diff --git a/patches/net/minecraft/world/World.java.patch b/patches/net/minecraft/world/World.java.patch index 49bee561..3fdba797 100644 --- a/patches/net/minecraft/world/World.java.patch +++ b/patches/net/minecraft/world/World.java.patch @@ -1290,21 +1290,27 @@ { if (this.field_147481_N) { -@@ -2606,12 +3277,26 @@ +@@ -2606,12 +3277,32 @@ public void removeTileEntity(int p_147475_1_, int p_147475_2_, int p_147475_3_) { Chunk chunk = getChunkFromChunkCoords(p_147475_1_ >> 4, p_147475_3_ >> 4); + TileEntity te = chunk.getTileEntityUnsafe(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); + if(te != null) + { -+ if(te instanceof IInventory) ++ /* TODO: This was done incorrectly by me originally. The idea is to forcefully close the inventories of broken tiles ++ * However, at the moment this does not seem possible. I was looking through the code and found that containers ++ * have all the information about who is using them. However, there is no easy way to tell that a container is ++ * linked to a tile. Maybe this can be something for the future but it is unlikely. ++ * ++ */ ++ /*if(te instanceof IInventory) + { + IInventory ii = (IInventory)te; + for(HumanEntity e : ii.getViewers()) + { + e.closeInventory(); + } -+ } ++ }*/ + } + if (chunk != null) chunk.removeTileEntity(p_147475_1_ & 15, p_147475_2_, p_147475_3_ & 15); @@ -1317,7 +1323,7 @@ this.field_147483_b.add(p_147457_1_); } -@@ -2718,7 +3403,15 @@ +@@ -2718,7 +3409,15 @@ if (i <= 0) { @@ -1334,7 +1340,7 @@ } } -@@ -2754,7 +3447,15 @@ +@@ -2754,7 +3453,15 @@ if (j <= 0) { @@ -1351,7 +1357,7 @@ } } -@@ -2777,8 +3478,41 @@ +@@ -2777,8 +3484,41 @@ protected void setActivePlayerChunksAndCheckLight() { this.activeChunkSet.clear(); @@ -1394,7 +1400,7 @@ int i; EntityPlayer entityplayer; int j; -@@ -2788,17 +3522,28 @@ +@@ -2788,17 +3528,28 @@ for (i = 0; i < this.playerEntities.size(); ++i) { entityplayer = (EntityPlayer)this.playerEntities.get(i); @@ -1429,7 +1435,7 @@ } this.theProfiler.endSection(); -@@ -2810,7 +3555,7 @@ +@@ -2810,7 +3561,7 @@ this.theProfiler.startSection("playerCheckLight"); @@ -1438,7 +1444,7 @@ { i = this.rand.nextInt(this.playerEntities.size()); entityplayer = (EntityPlayer)this.playerEntities.get(i); -@@ -3034,9 +3779,9 @@ +@@ -3034,9 +3785,9 @@ } } @@ -1450,7 +1456,7 @@ { return false; } -@@ -3166,6 +3911,28 @@ +@@ -3166,6 +3917,28 @@ } } @@ -1479,7 +1485,7 @@ this.theProfiler.endSection(); return true; } -@@ -3188,7 +3955,7 @@ +@@ -3188,7 +3961,7 @@ public List getEntitiesWithinAABBExcludingEntity(Entity p_94576_1_, AxisAlignedBB p_94576_2_, IEntitySelector p_94576_3_) { @@ -1488,7 +1494,7 @@ int i = MathHelper.floor_double((p_94576_2_.minX - MAX_ENTITY_RADIUS) / 16.0D); int j = MathHelper.floor_double((p_94576_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D); int k = MathHelper.floor_double((p_94576_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D); -@@ -3219,7 +3986,7 @@ +@@ -3219,7 +3992,7 @@ int j = MathHelper.floor_double((p_82733_2_.maxX + MAX_ENTITY_RADIUS) / 16.0D); int k = MathHelper.floor_double((p_82733_2_.minZ - MAX_ENTITY_RADIUS) / 16.0D); int l = MathHelper.floor_double((p_82733_2_.maxZ + MAX_ENTITY_RADIUS) / 16.0D); @@ -1497,7 +1503,7 @@ for (int i1 = i; i1 <= j; ++i1) { -@@ -3284,8 +4051,21 @@ +@@ -3284,8 +4057,21 @@ { Entity entity = (Entity)this.loadedEntityList.get(j); @@ -1520,7 +1526,7 @@ ++i; } } -@@ -3298,6 +4078,7 @@ +@@ -3298,6 +4084,7 @@ for (int i = 0; i < p_72868_1_.size(); ++i) { Entity entity = (Entity)p_72868_1_.get(i); @@ -1528,7 +1534,7 @@ if (!MinecraftForge.EVENT_BUS.post(new EntityJoinWorldEvent(entity, this))) { loadedEntityList.add(entity); -@@ -3314,8 +4095,17 @@ +@@ -3314,8 +4101,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_) { Block block1 = this.getBlock(p_147472_2_, p_147472_3_, p_147472_4_); @@ -1547,7 +1553,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 +4254,12 @@ +@@ -3464,6 +4260,12 @@ for (int i = 0; i < this.playerEntities.size(); ++i) { EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); @@ -1560,7 +1566,7 @@ 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)) -@@ -3489,7 +4285,12 @@ +@@ -3489,7 +4291,12 @@ for (int i = 0; i < this.playerEntities.size(); ++i) { EntityPlayer entityplayer1 = (EntityPlayer)this.playerEntities.get(i); @@ -1574,7 +1580,7 @@ if (!entityplayer1.capabilities.disableDamage && entityplayer1.isEntityAlive()) { double d5 = entityplayer1.getDistanceSq(p_72846_1_, p_72846_3_, p_72846_5_); -@@ -3660,6 +4461,18 @@ +@@ -3660,6 +4467,18 @@ public void updateAllPlayersSleepingFlag() {} @@ -1593,7 +1599,7 @@ public float getWeightedThunderStrength(float p_72819_1_) { return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * p_72819_1_) * this.getRainStrength(p_72819_1_); -@@ -3932,8 +4745,8 @@ +@@ -3932,8 +4751,8 @@ */ public void addTileEntity(TileEntity entity) { @@ -1604,7 +1610,7 @@ { dest.add(entity); } -@@ -4029,4 +4842,132 @@ +@@ -4029,4 +4848,132 @@ } return count; }