mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 21:17:32 +00:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
3bf93a128c
5 files changed
+12
-10
No files matched your search
@@ -201,7 +201,7 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
double x, double y, double z) {
|
||||
this(world);
|
||||
this.zoneType = type;
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
// Snap to ground with tiny offset to prevent z-clipping
|
||||
double groundY = Ability.findGroundLevel(world, x, y, z) + GROUND_OFFSET;
|
||||
this.setPosition(x, groundY, z);
|
||||
@@ -213,7 +213,7 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
*/
|
||||
public void initAsHazard(Entity owner, double x, double y, double z) {
|
||||
this.zoneType = ZoneType.HAZARD;
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
double groundY = Ability.findGroundLevel(worldObj, x, y, z) + GROUND_OFFSET;
|
||||
this.setPosition(x, groundY, z);
|
||||
this.ticksSinceDamage = damageInterval;
|
||||
@@ -225,7 +225,7 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD
|
||||
*/
|
||||
public void initAsTrap(Entity owner, double x, double y, double z) {
|
||||
this.zoneType = ZoneType.TRAP;
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
double groundY = Ability.findGroundLevel(worldObj, x, y, z) + GROUND_OFFSET;
|
||||
this.setPosition(x, groundY, z);
|
||||
this.ticksSinceLastTrigger = triggerCooldown;
|
||||
|
||||
@@ -51,7 +51,7 @@ public class EntityEnergyDome extends EntityEnergyBarrier {
|
||||
this(world);
|
||||
this.noClip = true;
|
||||
this.stepHeight = 0.0F;
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
this.setDomeRadius(domeRadius);
|
||||
// Defensive copy: entities must never share data objects with the source ability.
|
||||
this.displayData = display != null ? display.copy() : new EnergyDisplayData();
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
EnergyBarrierData barrier, EnergyPanelData panel) {
|
||||
this(world);
|
||||
this.setPosition(x, y + panel.heightOffset, z);
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
this.panelYaw = yaw;
|
||||
this.prevPanelYaw = yaw;
|
||||
this.mode = mode;
|
||||
|
||||
@@ -184,7 +184,7 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
|
||||
this.startY = y;
|
||||
this.startZ = z;
|
||||
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
this.targetEntityId = target != null ? target.getEntityId() : -1;
|
||||
|
||||
// Visual
|
||||
|
||||
@@ -78,7 +78,7 @@ public class EntityEnergySweeper extends EntityEnergyAbility {
|
||||
boolean lockOnTarget) {
|
||||
this(world);
|
||||
|
||||
this.ownerEntityId = owner.getEntityId();
|
||||
this.ownerEntityId = owner != null ? owner.getEntityId() : -1;
|
||||
this.targetEntityId = target != null ? target.getEntityId() : -1;
|
||||
this.beamLength = beamLength;
|
||||
this.beamWidth = beamWidth;
|
||||
@@ -95,16 +95,18 @@ public class EntityEnergySweeper extends EntityEnergyAbility {
|
||||
this.maxTicks = (int) ((360.0f * numberOfRotations) / sweepSpeed) + 10;
|
||||
|
||||
// Calculate base yaw
|
||||
if (lockOnTarget && target != null) {
|
||||
if (lockOnTarget && target != null && owner != null) {
|
||||
double dx = target.posX - owner.posX;
|
||||
double dz = target.posZ - owner.posZ;
|
||||
this.baseYaw = (float) Math.toDegrees(Math.atan2(-dx, dz));
|
||||
} else {
|
||||
} else if (owner != null) {
|
||||
this.baseYaw = owner.rotationYaw;
|
||||
}
|
||||
|
||||
// Position at beam center (bottom at feet, top at feet + beamHeight)
|
||||
this.setPosition(owner.posX, owner.posY + beamHeight / 2.0, owner.posZ);
|
||||
if (owner != null) {
|
||||
this.setPosition(owner.posX, owner.posY + beamHeight / 2.0, owner.posZ);
|
||||
}
|
||||
|
||||
// Ready to deal damage immediately
|
||||
this.ticksSinceDamage = damageInterval;
|
||||
|
||||
Reference in new issue
Block a user