IAltarComponent should use state, not meta

This commit is contained in:
Nicholas Ignoffo 2016-06-19 22:24:47 -07:00
parent 4fd69186fb
commit aa8d41385f
2 changed files with 7 additions and 3 deletions
src/main/java/WayofTime/bloodmagic

View file

@ -121,7 +121,7 @@ public class BloodAltar implements IFluidHandler
{ {
if (worldBlock.getBlock() instanceof IAltarComponent) if (worldBlock.getBlock() instanceof IAltarComponent)
{ {
EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(worldBlock.getMeta()); EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(world, worldBlock.getState(), componentPos);
if (component != altarComponent.getComponent()) if (component != altarComponent.getComponent())
return false; return false;
} else if (worldBlock.getBlock() != Utils.getBlockForComponent(altarComponent.getComponent())) } else if (worldBlock.getBlock() != Utils.getBlockForComponent(altarComponent.getComponent()))
@ -154,7 +154,7 @@ public class BloodAltar implements IFluidHandler
{ {
if (worldBlock.getBlock() instanceof IAltarComponent) if (worldBlock.getBlock() instanceof IAltarComponent)
{ {
EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(worldBlock.getMeta()); EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(world, worldBlock.getState(), componentPos);
if (component != altarComponent.getComponent()) if (component != altarComponent.getComponent())
{ {
return new ImmutablePair<BlockPos, EnumAltarComponent>(componentPos, altarComponent.getComponent()); return new ImmutablePair<BlockPos, EnumAltarComponent>(componentPos, altarComponent.getComponent());

View file

@ -1,6 +1,10 @@
package WayofTime.bloodmagic.api.altar; package WayofTime.bloodmagic.api.altar;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface IAltarComponent public interface IAltarComponent
{ {
EnumAltarComponent getType(int meta); EnumAltarComponent getType(World world, IBlockState state, BlockPos pos);
} }