Fix issue with Double Chests not properly re-initializing their adapter when they change to a double chest.
This commit is contained in:
+22
-8
@@ -1255,22 +1255,36 @@ public class Platform
|
|||||||
|
|
||||||
int hash = target.hashCode();
|
int hash = target.hashCode();
|
||||||
|
|
||||||
if ( target instanceof IInventory )
|
if ( target instanceof TileEntityChest )
|
||||||
|
{
|
||||||
|
TileEntityChest targ = (TileEntityChest) target;
|
||||||
|
targ.checkForAdjacentChests();
|
||||||
|
if ( targ.adjacentChestZNeg != null )
|
||||||
|
hash ^= targ.adjacentChestZNeg.hashCode();
|
||||||
|
else if ( targ.adjacentChestZPosition != null )
|
||||||
|
hash ^= targ.adjacentChestZPosition.hashCode();
|
||||||
|
else if ( targ.adjacentChestXPos != null )
|
||||||
|
hash ^= targ.adjacentChestXPos.hashCode();
|
||||||
|
else if ( targ.adjacentChestXNeg != null )
|
||||||
|
hash ^= targ.adjacentChestXNeg.hashCode();
|
||||||
|
}
|
||||||
|
else if ( target instanceof IInventory )
|
||||||
|
{
|
||||||
hash ^= ((IInventory) target).getSizeInventory();
|
hash ^= ((IInventory) target).getSizeInventory();
|
||||||
|
|
||||||
if ( target instanceof ISidedInventory )
|
if ( target instanceof ISidedInventory )
|
||||||
{
|
|
||||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
|
||||||
{
|
{
|
||||||
int offset = 0;
|
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||||
for (Integer Side : ((ISidedInventory) target).getAccessibleSlotsFromSide( dir.ordinal() ))
|
|
||||||
{
|
{
|
||||||
hash ^= Side << (offset++ % 20);
|
int offset = 0;
|
||||||
|
for (Integer Side : ((ISidedInventory) target).getAccessibleSlotsFromSide( dir.ordinal() ))
|
||||||
|
{
|
||||||
|
hash ^= Side << (offset++ % 20);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user