mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-12 18:42:07 +01:00
Fix wrong useItemInHand setting
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
b0cbecff2b
commit
c51e8f2f54
@ -30,7 +30,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
|||||||
this.blockClicked = clickedBlock;
|
this.blockClicked = clickedBlock;
|
||||||
this.blockFace = clickedFace;
|
this.blockFace = clickedFace;
|
||||||
|
|
||||||
useItemInHand = item == null ? Result.DENY : Result.DEFAULT;
|
useItemInHand = Result.DEFAULT;
|
||||||
useClickedBlock = clickedBlock == null ? Result.DENY : Result.ALLOW;
|
useClickedBlock = clickedBlock == null ? Result.DENY : Result.ALLOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +65,7 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
|
|||||||
*/
|
*/
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancel) {
|
||||||
setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock());
|
setUseInteractedBlock(cancel ? Result.DENY : useInteractedBlock() == Result.DENY ? Result.DEFAULT : useInteractedBlock());
|
||||||
|
setUseItemInHand(cancel ? Result.DENY : useItemInHand() == Result.DENY ? Result.DEFAULT : useItemInHand());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user