Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Pas possible maintenant
Browse files Browse the repository at this point in the history
  • Loading branch information
robotia committed May 29, 2016
1 parent b985f79 commit 7b2b279
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions patches/net/minecraft/world/World.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -1317,7 +1323,7 @@
this.field_147483_b.add(p_147457_1_);
}

@@ -2718,7 +3403,15 @@
@@ -2718,7 +3409,15 @@

if (i <= 0)
{
Expand All @@ -1334,7 +1340,7 @@
}
}

@@ -2754,7 +3447,15 @@
@@ -2754,7 +3453,15 @@

if (j <= 0)
{
Expand All @@ -1351,7 +1357,7 @@
}
}

@@ -2777,8 +3478,41 @@
@@ -2777,8 +3484,41 @@
protected void setActivePlayerChunksAndCheckLight()
{
this.activeChunkSet.clear();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1429,7 +1435,7 @@
}

this.theProfiler.endSection();
@@ -2810,7 +3555,7 @@
@@ -2810,7 +3561,7 @@

this.theProfiler.startSection("playerCheckLight");

Expand All @@ -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 @@
}
}

Expand All @@ -1450,7 +1456,7 @@
{
return false;
}
@@ -3166,6 +3911,28 @@
@@ -3166,6 +3917,28 @@
}
}

Expand Down Expand Up @@ -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_)
{
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -1520,15 +1526,15 @@
++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);
+ if (!entity.entityAllowedToSpawn()) continue;
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_);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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() {}

Expand All @@ -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)
{
Expand All @@ -1604,7 +1610,7 @@
{
dest.add(entity);
}
@@ -4029,4 +4842,132 @@
@@ -4029,4 +4848,132 @@
}
return count;
}
Expand Down

0 comments on commit 7b2b279

Please sign in to comment.