forked from xjboss/KCauldronX
Transparent unloading {,tile}entities from world
This commit is contained in:
@ -80,7 +80,7 @@
|
||||
private static final String __OBFID = "CL_00001533";
|
||||
/** Forge: Used to store custom data for each entity. */
|
||||
private NBTTagCompound customEntityData;
|
||||
@@ -135,7 +175,16 @@
|
||||
@@ -135,7 +175,17 @@
|
||||
public ArrayList<EntityItem> capturedDrops = new ArrayList<EntityItem>();
|
||||
private UUID persistentID;
|
||||
|
||||
@ -94,10 +94,11 @@
|
||||
+ // Spigot end
|
||||
protected HashMap<String, IExtendedEntityProperties> extendedProperties;
|
||||
+ public String spawnReason; // Cauldron - used to handle CraftBukkit's SpawnReason with CustomSpawners
|
||||
+ public boolean markedForRemoval = false;
|
||||
|
||||
public int getEntityId()
|
||||
{
|
||||
@@ -159,7 +208,7 @@
|
||||
@@ -159,7 +209,7 @@
|
||||
this.rand = new Random();
|
||||
this.fireResistance = 1;
|
||||
this.firstUpdate = true;
|
||||
@ -106,7 +107,7 @@
|
||||
this.myEntitySize = Entity.EnumEntitySize.SIZE_2;
|
||||
this.worldObj = p_i1582_1_;
|
||||
this.setPosition(0.0D, 0.0D, 0.0D);
|
||||
@@ -167,8 +216,15 @@
|
||||
@@ -167,8 +217,15 @@
|
||||
if (p_i1582_1_ != null)
|
||||
{
|
||||
this.dimension = p_i1582_1_.provider.dimensionId;
|
||||
@ -122,7 +123,7 @@
|
||||
this.dataWatcher = new DataWatcher(this);
|
||||
this.dataWatcher.addObject(0, Byte.valueOf((byte)0));
|
||||
this.dataWatcher.addObject(1, Short.valueOf((short)300));
|
||||
@@ -277,6 +333,41 @@
|
||||
@@ -277,6 +334,41 @@
|
||||
|
||||
protected void setRotation(float p_70101_1_, float p_70101_2_)
|
||||
{
|
||||
@ -164,7 +165,7 @@
|
||||
this.rotationYaw = p_70101_1_ % 360.0F;
|
||||
this.rotationPitch = p_70101_2_ % 360.0F;
|
||||
}
|
||||
@@ -343,7 +434,7 @@
|
||||
@@ -343,7 +435,7 @@
|
||||
|
||||
if (this.inPortal)
|
||||
{
|
||||
@ -173,7 +174,7 @@
|
||||
{
|
||||
if (this.ridingEntity == null && this.portalCounter++ >= i)
|
||||
{
|
||||
@@ -457,7 +548,35 @@
|
||||
@@ -457,7 +549,35 @@
|
||||
{
|
||||
if (!this.isImmuneToFire)
|
||||
{
|
||||
@ -210,7 +211,7 @@
|
||||
this.setFire(15);
|
||||
}
|
||||
}
|
||||
@@ -492,6 +611,30 @@
|
||||
@@ -492,6 +612,30 @@
|
||||
|
||||
public void moveEntity(double p_70091_1_, double p_70091_3_, double p_70091_5_)
|
||||
{
|
||||
@ -241,7 +242,7 @@
|
||||
if (this.noClip)
|
||||
{
|
||||
this.boundingBox.offset(p_70091_1_, p_70091_3_, p_70091_5_);
|
||||
@@ -756,6 +899,34 @@
|
||||
@@ -756,6 +900,34 @@
|
||||
d10 = this.posY - d4;
|
||||
d11 = this.posZ - d5;
|
||||
|
||||
@ -276,7 +277,7 @@
|
||||
if (this.canTriggerWalking() && !flag && this.ridingEntity == null)
|
||||
{
|
||||
int j1 = MathHelper.floor_double(this.posX);
|
||||
@@ -798,6 +969,8 @@
|
||||
@@ -798,6 +970,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +286,7 @@
|
||||
try
|
||||
{
|
||||
this.func_145775_I();
|
||||
@@ -809,7 +982,8 @@
|
||||
@@ -809,7 +983,8 @@
|
||||
this.addEntityCrashInfo(crashreportcategory);
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
@ -295,7 +296,7 @@
|
||||
boolean flag2 = this.isWet();
|
||||
|
||||
if (this.worldObj.func_147470_e(this.boundingBox.contract(0.001D, 0.001D, 0.001D)))
|
||||
@@ -820,8 +994,20 @@
|
||||
@@ -820,8 +995,20 @@
|
||||
{
|
||||
++this.fire;
|
||||
|
||||
@ -317,7 +318,7 @@
|
||||
this.setFire(8);
|
||||
}
|
||||
}
|
||||
@@ -839,6 +1025,8 @@
|
||||
@@ -839,6 +1026,8 @@
|
||||
|
||||
this.worldObj.theProfiler.endSection();
|
||||
}
|
||||
@ -326,7 +327,7 @@
|
||||
}
|
||||
|
||||
protected String getSwimSound()
|
||||
@@ -867,7 +1055,18 @@
|
||||
@@ -867,7 +1056,18 @@
|
||||
|
||||
try
|
||||
{
|
||||
@ -346,7 +347,7 @@
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -928,6 +1127,7 @@
|
||||
@@ -928,6 +1128,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -354,7 +355,7 @@
|
||||
protected void dealFireDamage(int p_70081_1_)
|
||||
{
|
||||
if (!this.isImmuneToFire)
|
||||
@@ -935,7 +1135,16 @@
|
||||
@@ -935,7 +1136,16 @@
|
||||
this.attackEntityFrom(DamageSource.inFire, (float)p_70081_1_);
|
||||
}
|
||||
}
|
||||
@ -371,7 +372,7 @@
|
||||
public final boolean isImmuneToFire()
|
||||
{
|
||||
return this.isImmuneToFire;
|
||||
@@ -1184,6 +1393,8 @@
|
||||
@@ -1184,6 +1394,8 @@
|
||||
|
||||
public void onCollideWithPlayer(EntityPlayer p_70100_1_) {}
|
||||
|
||||
@ -380,7 +381,7 @@
|
||||
public void applyEntityCollision(Entity p_70108_1_)
|
||||
{
|
||||
if (p_70108_1_.riddenByEntity != this && p_70108_1_.ridingEntity != this)
|
||||
@@ -1310,6 +1521,20 @@
|
||||
@@ -1310,6 +1522,20 @@
|
||||
{
|
||||
p_70109_1_.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ}));
|
||||
p_70109_1_.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ}));
|
||||
@ -401,7 +402,7 @@
|
||||
p_70109_1_.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch}));
|
||||
p_70109_1_.setFloat("FallDistance", this.fallDistance);
|
||||
p_70109_1_.setShort("Fire", (short)this.fire);
|
||||
@@ -1320,6 +1545,12 @@
|
||||
@@ -1320,6 +1546,12 @@
|
||||
p_70109_1_.setInteger("PortalCooldown", this.timeUntilPortal);
|
||||
p_70109_1_.setLong("UUIDMost", this.getUniqueID().getMostSignificantBits());
|
||||
p_70109_1_.setLong("UUIDLeast", this.getUniqueID().getLeastSignificantBits());
|
||||
@ -414,7 +415,7 @@
|
||||
if (customEntityData != null)
|
||||
{
|
||||
p_70109_1_.setTag("ForgeData", customEntityData);
|
||||
@@ -1370,7 +1601,7 @@
|
||||
@@ -1370,7 +1602,7 @@
|
||||
this.motionX = nbttaglist1.func_150309_d(0);
|
||||
this.motionY = nbttaglist1.func_150309_d(1);
|
||||
this.motionZ = nbttaglist1.func_150309_d(2);
|
||||
@ -423,7 +424,7 @@
|
||||
if (Math.abs(this.motionX) > 10.0D)
|
||||
{
|
||||
this.motionX = 0.0D;
|
||||
@@ -1385,7 +1616,7 @@
|
||||
@@ -1385,7 +1617,7 @@
|
||||
{
|
||||
this.motionZ = 0.0D;
|
||||
}
|
||||
@ -432,7 +433,7 @@
|
||||
this.prevPosX = this.lastTickPosX = this.posX = nbttaglist.func_150309_d(0);
|
||||
this.prevPosY = this.lastTickPosY = this.posY = nbttaglist.func_150309_d(1);
|
||||
this.prevPosZ = this.lastTickPosZ = this.posZ = nbttaglist.func_150309_d(2);
|
||||
@@ -1436,6 +1667,76 @@
|
||||
@@ -1436,6 +1668,76 @@
|
||||
{
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
}
|
||||
@ -509,7 +510,7 @@
|
||||
}
|
||||
catch (Throwable throwable)
|
||||
{
|
||||
@@ -1653,6 +1954,31 @@
|
||||
@@ -1653,6 +1955,31 @@
|
||||
|
||||
public void mountEntity(Entity p_70078_1_)
|
||||
{
|
||||
@ -541,7 +542,7 @@
|
||||
this.entityRiderPitchDelta = 0.0D;
|
||||
this.entityRiderYawDelta = 0.0D;
|
||||
|
||||
@@ -1660,6 +1986,20 @@
|
||||
@@ -1660,6 +1987,20 @@
|
||||
{
|
||||
if (this.ridingEntity != null)
|
||||
{
|
||||
@ -562,7 +563,7 @@
|
||||
this.setLocationAndAngles(this.ridingEntity.posX, this.ridingEntity.boundingBox.minY + (double)this.ridingEntity.height, this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch);
|
||||
this.ridingEntity.riddenByEntity = null;
|
||||
}
|
||||
@@ -1668,22 +2008,61 @@
|
||||
@@ -1668,22 +2009,61 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -631,7 +632,7 @@
|
||||
this.ridingEntity = p_70078_1_;
|
||||
p_70078_1_.riddenByEntity = this;
|
||||
}
|
||||
@@ -1860,12 +2239,59 @@
|
||||
@@ -1860,12 +2240,59 @@
|
||||
|
||||
public void onStruckByLightning(EntityLightningBolt p_70077_1_)
|
||||
{
|
||||
@ -693,7 +694,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2038,36 +2464,62 @@
|
||||
@@ -2038,36 +2465,62 @@
|
||||
{
|
||||
this.worldObj.theProfiler.startSection("changeDimension");
|
||||
MinecraftServer minecraftserver = MinecraftServer.getServer();
|
||||
@ -772,7 +773,7 @@
|
||||
}
|
||||
|
||||
this.isDead = true;
|
||||
@@ -2077,7 +2529,6 @@
|
||||
@@ -2077,7 +2530,6 @@
|
||||
this.worldObj.theProfiler.endSection();
|
||||
}
|
||||
}
|
||||
@ -780,7 +781,7 @@
|
||||
public float func_145772_a(Explosion p_145772_1_, World p_145772_2_, int p_145772_3_, int p_145772_4_, int p_145772_5_, Block p_145772_6_)
|
||||
{
|
||||
return p_145772_6_.getExplosionResistance(this, p_145772_2_, p_145772_3_, p_145772_4_, p_145772_5_, posX, posY + getEyeHeight(), posZ);
|
||||
@@ -2474,4 +2925,14 @@
|
||||
@@ -2474,4 +2926,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user