Shift right click to use exp for mending

This commit is contained in:
William Blake Galbreath
2025-01-12 12:43:19 -08:00
committed by granny
parent 8ce5cc6607
commit eab7420f71
4 changed files with 37 additions and 69 deletions

View File

@@ -181,6 +181,14 @@
// Paper start - optimise out extra getCubes
private boolean hasNewCollision(final ServerLevel level, final Entity entity, final AABB oldBox, final AABB newBox) {
final List<AABB> collisionsBB = new java.util.ArrayList<>();
@@ -1994,6 +_,7 @@
boolean cancelled;
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
+ if (this.player.gameMode.shiftClickMended(itemInHand)) return; // Purpur - Shift right click to use exp for mending
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemInHand, hand);
cancelled = event.useItemInHand() == Event.Result.DENY;
} else {
@@ -2734,6 +_,7 @@
AABB boundingBox = target.getBoundingBox();