Fix overeager TE refreshing. Closes #152 and potentially fixes #71

This commit is contained in:
Vincent Lee committed 2016-03-02 10:30:46 -06:00
1 parent 70942d7089
commit a929156626
3 files changed
+17 -3

No files matched your search

@@ -18,6 +18,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.core.handler.MethodHandles;
import vazkii.botania.common.lib.LibBlockNames;
@@ -25,7 +27,11 @@ public class TileOpenCrate extends TileSimpleInventory {
@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
return true;
if(oldState.getBlock() != newState.getBlock())
return true;
if(oldState.getBlock() != ModBlocks.pool || newState.getBlock() != ModBlocks.pool)
return true;
return oldState.getValue(BotaniaStateProps.CRATE_VARIANT) != newState.getValue(BotaniaStateProps.CRATE_VARIANT);
}
@Override
@@ -106,7 +106,11 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
return true;
if(oldState.getBlock() != newState.getBlock())
return true;
if(oldState.getBlock() != ModBlocks.pool || newState.getBlock() != ModBlocks.pool)
return true;
return oldState.getValue(BotaniaStateProps.POOL_VARIANT) != newState.getValue(BotaniaStateProps.POOL_VARIANT);
}
@Override
@@ -143,7 +143,11 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newState) {
return true;
if(oldState.getBlock() != newState.getBlock())
return true;
if(oldState.getBlock() != ModBlocks.pool || newState.getBlock() != ModBlocks.pool)
return true;
return oldState.getValue(BotaniaStateProps.SPREADER_VARIANT) != newState.getValue(BotaniaStateProps.SPREADER_VARIANT);
}
@Override