Allow breaking robots by attacking when in creative mode.

This commit is contained in:
Florian Nücke
2022-02-08 13:34:21 +01:00
parent df62a63d60
commit d235669ff6

View File

@@ -311,6 +311,14 @@ public final class Robot extends Entity implements li.cil.oc2.api.capabilities.R
}
}
@Override
public boolean skipAttackInteraction(final Entity entity) {
if (entity instanceof Player player && player.isCreative()) {
dropSelf();
}
return true;
}
@Override
public InteractionResult interact(final Player player, final InteractionHand hand) {
final ItemStack stack = player.getItemInHand(hand);