Infusion pedestal (WIP), fix for #11
This commit is contained in:
parent
70f5e3e024
commit
36fa1ade9d
20 changed files with 220 additions and 21 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue