Browse Source

Some mods have custom TE classes? 0.o

master
Robotia 9 years ago
parent
commit
a39d223791
  1. 12
      patches/net/minecraft/tileentity/TileEntity.java.patch
  2. 59
      patches/net/minecraft/world/World.java.patch

12
patches/net/minecraft/tileentity/TileEntity.java.patch

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java --- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java +++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java
@@ -22,18 +22,22 @@ @@ -22,18 +22,23 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -26,7 +26,7 @@
private static final String __OBFID = "CL_00000340"; private static final String __OBFID = "CL_00000340";
public static void addMapping(Class p_145826_0_, String p_145826_1_) public static void addMapping(Class p_145826_0_, String p_145826_1_)
@@ -106,7 +110,11 @@ @@ -106,7 +111,11 @@
} }
catch (Exception exception) catch (Exception exception)
{ {
@ -39,7 +39,7 @@
} }
if (tileentity != null) if (tileentity != null)
@@ -282,6 +290,20 @@ @@ -282,6 +291,31 @@
addMapping(TileEntityFlowerPot.class, "FlowerPot"); addMapping(TileEntityFlowerPot.class, "FlowerPot");
} }
@ -71,3 +71,9 @@
// -- BEGIN FORGE PATCHES -- // -- BEGIN FORGE PATCHES --
/** /**
* Determines if this TileEntity requires update calls. * Determines if this TileEntity requires update calls.
@@ -370,4 +404,4 @@
}
return bb;
}
-}
+}

59
patches/net/minecraft/world/World.java.patch

@ -896,7 +896,7 @@
} }
catch (Throwable throwable1) catch (Throwable throwable1)
{ {
@@ -1916,30 +2454,80 @@ @@ -1916,30 +2454,83 @@
{ {
this.getChunkFromChunkCoords(j, l).removeEntity(entity); this.getChunkFromChunkCoords(j, l).removeEntity(entity);
} }
@ -925,18 +925,21 @@
+ for (Object tile : field_147483_b) + for (Object tile : field_147483_b)
+ { + {
+ TileEntity te = (TileEntity)tile; + TileEntity te = (TileEntity)tile;
+ te.setGC(true); + try { te.setGC(true); } catch (Exception e) {}
+ te.onChunkUnload(); + te.onChunkUnload();
+ } + }
+ List temporary_tile_entity_list = new ArrayList(this.loadedTileEntityList.size()); + List temporary_tile_entity_list = new ArrayList(this.loadedTileEntityList.size());
+ for(Object tile : loadedTileEntityList) + for(Object tile : loadedTileEntityList)
+ if(!((TileEntity)tile).isGC()) + {
+ temporary_tile_entity_list.add(tile); + boolean marker = false;
+ try { marker = !((TileEntity)tile).isGC(); } catch (Exception e) { try { marker = this.field_14783_b.contains(tile) } catch (Exception ex) { marker = false; } }
+ if (marker) { temporary_tile_entity_list.add(tile); }
+ }
+ this.loadedTileEntityList = temporary_tile_entity_list; + this.loadedTileEntityList = temporary_tile_entity_list;
+ for (Object tile : field_147483_b) + for (Object tile : field_147483_b)
+ { + {
+ TileEntity te = (TileEntity)tile; + TileEntity te = (TileEntity)tile;
+ te.setGC(false); + try { te.setGC(false); } catch (Exception e) {}
+ } + }
+ this.field_147483_b.clear(); + this.field_147483_b.clear();
+ } + }
@ -984,7 +987,7 @@
crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity"); crashreport = CrashReport.makeCrashReport(throwable, "Ticking block entity");
crashreportcategory = crashreport.makeCategory("Block entity being ticked"); crashreportcategory = crashreport.makeCategory("Block entity being ticked");
tileentity.func_145828_a(crashreportcategory); tileentity.func_145828_a(crashreportcategory);
@@ -1955,23 +2543,13 @@ @@ -1955,23 +2546,13 @@
} }
} }
} }
@ -1013,7 +1016,7 @@
if (!this.field_147483_b.isEmpty()) if (!this.field_147483_b.isEmpty())
{ {
for (Object tile : field_147483_b) for (Object tile : field_147483_b)
@@ -1981,6 +2559,7 @@ @@ -1981,6 +2562,7 @@
this.loadedTileEntityList.removeAll(this.field_147483_b); this.loadedTileEntityList.removeAll(this.field_147483_b);
this.field_147483_b.clear(); this.field_147483_b.clear();
} }
@ -1021,7 +1024,7 @@
this.field_147481_N = false; this.field_147481_N = false;
@@ -2016,17 +2595,23 @@ @@ -2016,17 +2598,23 @@
this.addedTileEntityList.clear(); this.addedTileEntityList.clear();
} }
@ -1048,7 +1051,7 @@
} }
public void updateEntity(Entity p_72870_1_) public void updateEntity(Entity p_72870_1_)
@@ -2036,21 +2621,36 @@ @@ -2036,21 +2624,36 @@
public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_) public void updateEntityWithOptionalForce(Entity p_72866_1_, boolean p_72866_2_)
{ {
@ -1087,7 +1090,7 @@
p_72866_1_.lastTickPosX = p_72866_1_.posX; p_72866_1_.lastTickPosX = p_72866_1_.posX;
p_72866_1_.lastTickPosY = p_72866_1_.posY; p_72866_1_.lastTickPosY = p_72866_1_.posY;
p_72866_1_.lastTickPosZ = p_72866_1_.posZ; p_72866_1_.lastTickPosZ = p_72866_1_.posZ;
@@ -2134,6 +2734,7 @@ @@ -2134,6 +2737,7 @@
p_72866_1_.riddenByEntity = null; p_72866_1_.riddenByEntity = null;
} }
} }
@ -1095,7 +1098,7 @@
} }
} }
@@ -2570,7 +3171,7 @@ @@ -2570,7 +3174,7 @@
return; return;
} }
@ -1104,7 +1107,7 @@
{ {
if (this.field_147481_N) if (this.field_147481_N)
{ {
@@ -2718,7 +3319,15 @@ @@ -2718,7 +3322,15 @@
if (i <= 0) if (i <= 0)
{ {
@ -1121,7 +1124,7 @@
} }
} }
@@ -2754,7 +3363,15 @@ @@ -2754,7 +3366,15 @@
if (j <= 0) if (j <= 0)
{ {
@ -1138,7 +1141,7 @@
} }
} }
@@ -2777,8 +3394,41 @@ @@ -2777,8 +3397,41 @@
protected void setActivePlayerChunksAndCheckLight() protected void setActivePlayerChunksAndCheckLight()
{ {
this.activeChunkSet.clear(); this.activeChunkSet.clear();
@ -1181,7 +1184,7 @@
int i; int i;
EntityPlayer entityplayer; EntityPlayer entityplayer;
int j; int j;
@@ -2788,17 +3438,28 @@ @@ -2788,17 +3441,28 @@
for (i = 0; i < this.playerEntities.size(); ++i) for (i = 0; i < this.playerEntities.size(); ++i)
{ {
entityplayer = (EntityPlayer)this.playerEntities.get(i); entityplayer = (EntityPlayer)this.playerEntities.get(i);
@ -1217,7 +1220,7 @@
} }
this.theProfiler.endSection(); this.theProfiler.endSection();
@@ -2810,7 +3471,7 @@ @@ -2810,7 +3474,7 @@
this.theProfiler.startSection("playerCheckLight"); this.theProfiler.startSection("playerCheckLight");
@ -1226,7 +1229,7 @@
{ {
i = this.rand.nextInt(this.playerEntities.size()); i = this.rand.nextInt(this.playerEntities.size());
entityplayer = (EntityPlayer)this.playerEntities.get(i); entityplayer = (EntityPlayer)this.playerEntities.get(i);
@@ -3034,9 +3695,9 @@ @@ -3034,9 +3698,9 @@
} }
} }
@ -1238,7 +1241,7 @@
{ {
return false; return false;
} }
@@ -3166,6 +3827,16 @@ @@ -3166,6 +3830,16 @@
} }
} }
@ -1255,14 +1258,14 @@
this.theProfiler.endSection(); this.theProfiler.endSection();
return true; return true;
} }
@@ -3284,8 +3955,21 @@ @@ -3284,8 +3958,21 @@
{ {
Entity entity = (Entity)this.loadedEntityList.get(j); Entity entity = (Entity)this.loadedEntityList.get(j);
- if ((!(entity instanceof EntityLiving) || !((EntityLiving)entity).isNoDespawnRequired()) && p_72907_1_.isAssignableFrom(entity.getClass())) - if ((!(entity instanceof EntityLiving) || !((EntityLiving)entity).isNoDespawnRequired()) && p_72907_1_.isAssignableFrom(entity.getClass()))
+ // CraftBukkit start - Split out persistent check, don't apply it to special persistent mobs + // CraftBukkit start - Split out persistent check, don't apply it to special persistent mobs
+ if (entity instanceof EntityLiving) + if (entity instanceof EntityLiving)
+ { {
+ EntityLiving entityliving = (EntityLiving) entity; + EntityLiving entityliving = (EntityLiving) entity;
+ +
+ if (entityliving.canDespawn_CB() && entityliving.isNoDespawnRequired()) + if (entityliving.canDespawn_CB() && entityliving.isNoDespawnRequired())
@ -1272,13 +1275,13 @@
+ } + }
+ +
+ if (p_72907_1_.isAssignableFrom(entity.getClass())) + if (p_72907_1_.isAssignableFrom(entity.getClass()))
{ + {
+ // if ((!(entity instanceof EntityLiving) || !((EntityLiving)entity).isNoDespawnRequired()) && p_72907_1_.isAssignableFrom(entity.getClass())) + // if ((!(entity instanceof EntityLiving) || !((EntityLiving)entity).isNoDespawnRequired()) && p_72907_1_.isAssignableFrom(entity.getClass()))
+ // CraftBukkit end + // CraftBukkit end
++i; ++i;
} }
} }
@@ -3298,6 +3982,7 @@ @@ -3298,6 +3985,7 @@
for (int i = 0; i < p_72868_1_.size(); ++i) for (int i = 0; i < p_72868_1_.size(); ++i)
{ {
Entity entity = (Entity)p_72868_1_.get(i); Entity entity = (Entity)p_72868_1_.get(i);
@ -1286,7 +1289,7 @@
if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this)))
{ {
loadedEntityList.add(entity); loadedEntityList.add(entity);
@@ -3314,8 +3999,17 @@ @@ -3314,8 +4002,17 @@
public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_) public boolean canPlaceEntityOnSide(Block p_147472_1_, int p_147472_2_, int p_147472_3_, int p_147472_4_, boolean p_147472_5_, int p_147472_6_, Entity p_147472_7_, ItemStack p_147472_8_)
{ {
Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_);
@ -1305,7 +1308,7 @@
} }
public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_) public PathEntity getPathEntityToEntity(Entity p_72865_1_, Entity p_72865_2_, float p_72865_3_, boolean p_72865_4_, boolean p_72865_5_, boolean p_72865_6_, boolean p_72865_7_)
@@ -3464,6 +4158,12 @@ @@ -3464,6 +4161,12 @@
for (int i = 0; i < this.playerEntities.size(); ++i) for (int i = 0; i < this.playerEntities.size(); ++i)
{ {
EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i);
@ -1318,7 +1321,7 @@
double d5 = entityplayer1.getDistanceSq(p_72977_1_, p_72977_3_, p_72977_5_); double d5 = entityplayer1.getDistanceSq(p_72977_1_, p_72977_3_, p_72977_5_);
if ((p_72977_7_ < 0.0D || d5 < p_72977_7_ * p_72977_7_) && (d4 == -1.0D || d5 < d4)) if ((p_72977_7_ < 0.0D || d5 < p_72977_7_ * p_72977_7_) && (d4 == -1.0D || d5 < d4))
@@ -3489,7 +4189,12 @@ @@ -3489,7 +4192,12 @@
for (int i = 0; i < this.playerEntities.size(); ++i) for (int i = 0; i < this.playerEntities.size(); ++i)
{ {
EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i);
@ -1332,7 +1335,7 @@
if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive()) if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive())
{ {
double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_); double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_);
@@ -3660,6 +4365,18 @@ @@ -3660,6 +4368,18 @@
public void updateAllPlayersSleepingFlag() {} public void updateAllPlayersSleepingFlag() {}
@ -1351,7 +1354,7 @@
public float getWeightedThunderStrength(float p_72819_1_) public float getWeightedThunderStrength(float p_72819_1_)
{ {
return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_); return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_);
@@ -3932,8 +4649,8 @@ @@ -3932,8 +4652,8 @@
*/ */
public void addTileEntity(TileEntity entity) public void addTileEntity(TileEntity entity)
{ {
@ -1362,7 +1365,7 @@
{ {
dest.add(entity); dest.add(entity);
} }
@@ -4029,4 +4746,122 @@ @@ -4029,4 +4749,122 @@
} }
return count; return count;
} }

Loading…
Cancel
Save