char origins
This commit is contained in:
parent
3316c42ed8
commit
e9ede99d84
14 changed files with 516 additions and 373 deletions
|
@ -24,6 +24,7 @@ import game.ai.EntityAIWatchClosest2;
|
|||
import game.audio.MovingSoundMinecartRiding;
|
||||
import game.block.Block;
|
||||
import game.block.BlockBed;
|
||||
import game.dimension.Space;
|
||||
import game.enchantment.Enchantment;
|
||||
import game.enchantment.EnchantmentHelper;
|
||||
import game.entity.DamageSource;
|
||||
|
@ -218,6 +219,7 @@ public abstract class EntityNPC extends EntityLiving
|
|||
public double chasingPosX;
|
||||
public double chasingPosY;
|
||||
public double chasingPosZ;
|
||||
private WorldPos originPos = new WorldPos(0, 64, 0, Space.INSTANCE.getDimensionId());
|
||||
private WorldPos spawnPos;
|
||||
// private BlockPos startMinecartRidingCoordinate;
|
||||
public int experienceLevel;
|
||||
|
@ -3541,6 +3543,12 @@ public abstract class EntityNPC extends EntityLiving
|
|||
tagCompund.getInteger("SpawnZ"), tagCompund.getInteger("SpawnDim"));
|
||||
// this.spawnForced = tagCompund.getBoolean("SpawnForced");
|
||||
}
|
||||
|
||||
if (tagCompund.hasKey("OriginX", 99) && tagCompund.hasKey("OriginY", 99) && tagCompund.hasKey("OriginZ", 99))
|
||||
{
|
||||
this.originPos = new WorldPos(tagCompund.getInteger("OriginX"), tagCompund.getInteger("OriginY"),
|
||||
tagCompund.getInteger("OriginZ"), tagCompund.getInteger("OriginDim"));
|
||||
}
|
||||
|
||||
// this.foodStats.readNBT(tagCompund);
|
||||
// this.readCapabilitiesFromNBT(tagCompund);
|
||||
|
@ -3664,6 +3672,14 @@ public abstract class EntityNPC extends EntityLiving
|
|||
// tagCompound.setBoolean("SpawnForced", this.spawnForced);
|
||||
}
|
||||
|
||||
if (this.originPos != null)
|
||||
{
|
||||
tagCompound.setInteger("OriginX", this.originPos.getX());
|
||||
tagCompound.setInteger("OriginY", this.originPos.getY());
|
||||
tagCompound.setInteger("OriginZ", this.originPos.getZ());
|
||||
tagCompound.setInteger("OriginDim", this.originPos.getDimension());
|
||||
}
|
||||
|
||||
// this.foodStats.writeNBT(tagCompound);
|
||||
// this.writeCapabilitiesToNBT(tagCompound);
|
||||
tagCompound.setBoolean("flying", this.flying);
|
||||
|
@ -3964,6 +3980,16 @@ public abstract class EntityNPC extends EntityLiving
|
|||
this.spawnPos = pos;
|
||||
}
|
||||
|
||||
public WorldPos getOrigin()
|
||||
{
|
||||
return this.originPos;
|
||||
}
|
||||
|
||||
public void setOrigin(WorldPos pos)
|
||||
{
|
||||
this.originPos = pos;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Will trigger the specified trigger.
|
||||
// */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue