diff --git a/gradle.properties b/gradle.properties index c7043f4..a5649d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,7 +34,7 @@ mod_name=Power Tool # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPL-3.0 # The mod version. See https://semver.org/ -mod_version=1.4.17 +mod_version=1.4.18 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html diff --git a/src/main/java/org/teacon/powertool/block/ItemDisplayBlock.java b/src/main/java/org/teacon/powertool/block/ItemDisplayBlock.java index cc1e557..85ad5d3 100644 --- a/src/main/java/org/teacon/powertool/block/ItemDisplayBlock.java +++ b/src/main/java/org/teacon/powertool/block/ItemDisplayBlock.java @@ -111,24 +111,16 @@ public void attack(BlockState state, Level level, BlockPos pos, Player player) { } } - @Override - protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hitResult) { - if (level.getBlockEntity(pos) instanceof ItemDisplayBlockEntity theBE) { - if (player.getAbilities().instabuild || state.getValue(SURVIVAL_AVAILABLE)) { - theBE.rotation = (theBE.rotation + 45) % 360; - theBE.setChanged(); - level.sendBlockUpdated(pos, state, state, Block.UPDATE_CLIENTS); - return InteractionResult.SUCCESS; - } - } - return InteractionResult.PASS; - } - @Override protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hitResult) { if (level.getBlockEntity(pos) instanceof ItemDisplayBlockEntity theBE) { if (player.getAbilities().instabuild || state.getValue(SURVIVAL_AVAILABLE)){ - theBE.itemToDisplay = stack.copy(); + if(stack.isEmpty()){ + theBE.rotation = (theBE.rotation + 45) % 360; + } + else{ + theBE.itemToDisplay = stack.copy(); + } if (!level.isClientSide) { theBE.setChanged(); level.sendBlockUpdated(pos, state, state, Block.UPDATE_CLIENTS);