Accept null from IAltarComponent
This commit is contained in:
parent
aa8d41385f
commit
2c70e6ebc1
|
@ -122,7 +122,7 @@ public class BloodAltar implements IFluidHandler
|
|||
if (worldBlock.getBlock() instanceof IAltarComponent)
|
||||
{
|
||||
EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(world, worldBlock.getState(), componentPos);
|
||||
if (component != altarComponent.getComponent())
|
||||
if (component == null || component != altarComponent.getComponent())
|
||||
return false;
|
||||
} else if (worldBlock.getBlock() != Utils.getBlockForComponent(altarComponent.getComponent()))
|
||||
{
|
||||
|
@ -155,9 +155,9 @@ public class BloodAltar implements IFluidHandler
|
|||
if (worldBlock.getBlock() instanceof IAltarComponent)
|
||||
{
|
||||
EnumAltarComponent component = ((IAltarComponent) worldBlock.getBlock()).getType(world, worldBlock.getState(), componentPos);
|
||||
if (component != altarComponent.getComponent())
|
||||
if (component == null || component != altarComponent.getComponent())
|
||||
{
|
||||
return new ImmutablePair<BlockPos, EnumAltarComponent>(componentPos, altarComponent.getComponent());
|
||||
return Pair.of(componentPos, altarComponent.getComponent());
|
||||
}
|
||||
} else if (worldBlock.getBlock() != Utils.getBlockForComponent(altarComponent.getComponent()))
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ public class BloodAltar implements IFluidHandler
|
|||
{
|
||||
if (world.isAirBlock(componentPos))
|
||||
{
|
||||
return new ImmutablePair<BlockPos, EnumAltarComponent>(componentPos, altarComponent.getComponent());
|
||||
return Pair.of(componentPos, altarComponent.getComponent());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,10 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface IAltarComponent
|
||||
{
|
||||
@Nullable
|
||||
EnumAltarComponent getType(World world, IBlockState state, BlockPos pos);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue