Replace Forge's BlockPos#getImmutable method with the included BlockPos#toImmutable (func_185334_h), while keeping the override in PooledMutableBlockPos to prevent mutable leaks.

Also prevent a mutable blockpos leak in World#setTileEntity
This commit is contained in:
kashike committed 2016-03-27 09:43:56 -07:00
1 parent efa7fd4dfe
commit 45881d1c90
4 files changed
+39 -61

No files matched your search

@@ -58,7 +58,7 @@ public class BlockSnapshot implements Serializable
{
this.setWorld(world);
this.dimId = world.provider.getDimension();
this.pos = pos.getImmutable();
this.pos = pos.toImmutable();
this.setReplacedBlock(state);
this.registryName = new ResourceLocation(state.getBlock().getRegistryName());
this.meta = state.getBlock().getMetaFromState(state);
@@ -82,7 +82,7 @@ public class BlockSnapshot implements Serializable
public BlockSnapshot(int dimension, BlockPos pos, String modId, String blockName, int meta, int flag, NBTTagCompound nbt)
{
this.dimId = dimension;
this.pos = pos.getImmutable();
this.pos = pos.toImmutable();
this.setFlag(flag);
this.registryName = new ResourceLocation(modId, blockName);
this.meta = meta;