Protect BlockSnapshot and Chunk.getTileEntity from mutible BlockPos instances. Closes #2438

This commit is contained in:
LexManos committed 2016-02-11 16:48:32 -08:00
1 parent 70fe18c163
commit 06130912c5
3 files changed
+40 -4

No files matched your search

@@ -58,7 +58,7 @@ public class BlockSnapshot implements Serializable
{
this.world = world;
this.dimId = world.provider.getDimensionId();
this.pos = pos;
this.pos = pos.getImmutable();
this.replacedBlock = state;
this.blockIdentifier = GameRegistry.findUniqueIdentifierFor(state.getBlock());
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;
this.pos = pos.getImmutable();
this.flag = flag;
this.blockIdentifier = new UniqueIdentifier(modid + ":" + blockName);
this.meta = meta;