mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 09:59:42 +00:00
Allow Null Owners in Energy
This commit is contained in:
1 parent
c423ab43f1
commit
d8b18d7058
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;
|
||||
|
||||
Reference in new issue
Block a user