Infusion pedestal (WIP), fix for #11

This commit is contained in:
Aleksey 2020-11-05 22:51:36 +03:00
parent 70f5e3e024
commit 36fa1ade9d
20 changed files with 220 additions and 21 deletions

View file

@ -78,6 +78,7 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
}
protected final Block parent;
protected float height = 1.0F;
public BlockPedestal(Block parent) {
super(FabricBlockSettings.copyOf(parent));
@ -85,6 +86,13 @@ public class BlockPedestal extends BlockBaseNotFull implements BlockEntityProvid
this.parent = parent;
}
public float getHeight(BlockState state) {
if (state.getBlock() instanceof BlockPedestal && state.get(STATE) == PedestalState.PEDESTAL_TOP) {
return this.height - 0.2F;
}
return this.height;
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (world.isClient || !state.isOf(this)) return ActionResult.CONSUME;