Fixed items being consumed in creative mode

This commit is contained in:
Sollace 2024-01-19 16:13:54 +00:00
parent 08e1702a1a
commit 5d2478604c
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -155,7 +155,9 @@ public class EdibleBlock extends HayBlock {
BooleanProperty segment = getHitCorner(hit, 1);
if (!state.get(segment)) {
stack.decrement(1);
if (!player.isCreative()) {
stack.decrement(1);
}
if (!world.isClient) {
state = state.with(segment, true);
if (SHAPE_CACHE.apply(state) == VoxelShapes.fullCube()) {
@ -195,6 +197,7 @@ public class EdibleBlock extends HayBlock {
}
if (usingHoe) {
stack.damage(1, player, p -> p.sendToolBreakStatus(hand));
dropStack(world, pos, Registries.ITEM.get(material).getDefaultStack());
player.playSound(USounds.Vanilla.ITEM_HOE_TILL, 1, 1);
} else {