seat polish
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx4G
|
|||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
|
|
||||||
mod_version=4.0.12
|
mod_version=4.0.13
|
||||||
maven_group=earth.terrarium.handcrafted
|
maven_group=earth.terrarium.handcrafted
|
||||||
archives_base_name=handcrafted
|
archives_base_name=handcrafted
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,21 @@ public class BenchBlock extends ModularSeatBlock {
|
|||||||
return SEAT;
|
return SEAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getSeatHeight(BlockState state) {
|
||||||
|
// As with chairs, only compensate for the optional cushion.
|
||||||
|
return super.getSeatHeight(state)
|
||||||
|
+ (state.getValue(COLOR) == OptionalColorProperty.NONE ? 0.0D : 0.10D);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) {
|
||||||
|
// A backless bench has no canonical facing for the rider. Passing null
|
||||||
|
// makes Seat free-rotating, just like the standalone cushion/dining bench.
|
||||||
|
this.sitOn(level, pos, player, null);
|
||||||
|
return InteractionResult.SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
|
||||||
super.createBlockStateDefinition(builder);
|
super.createBlockStateDefinition(builder);
|
||||||
|
|||||||
@@ -88,6 +88,15 @@ public class ChairBlock extends HorizontalDirectionalBlock implements SittableBl
|
|||||||
return SEAT;
|
return SEAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getSeatHeight(BlockState state) {
|
||||||
|
// Keep the original chair height untouched unless an optional cushion
|
||||||
|
// is actually installed. The cushion adds visible thickness, so lift
|
||||||
|
// the rider just enough to sit on top of it instead of inside it.
|
||||||
|
return SittableBlock.super.getSeatHeight(state)
|
||||||
|
+ (state.getValue(COLOR) == OptionalColorProperty.NONE ? 0.0D : 0.10D);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
|
protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) {
|
||||||
InteractionResult result = InteractionUtils.interactOptionalCushion(state, level, pos, player, stack, COLOR);
|
InteractionResult result = InteractionUtils.interactOptionalCushion(state, level, pos, player, stack, COLOR);
|
||||||
|
|||||||
Reference in New Issue
Block a user