mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-31 21:06:31 +00:00
修复副手放置方块
This commit is contained in:
@@ -219,7 +219,7 @@ public class ItemEventListener implements Listener {
|
||||
int currentTicks = player.gameTicks();
|
||||
// The client will send multiple packets to the server if the client thinks it should
|
||||
// However, if the main hand item interaction is successful, the off-hand item should be blocked.
|
||||
if (!player.updateLastSuccessfulInteractionTick(currentTicks)) {
|
||||
if (player.lastSuccessfulInteractionTick() == currentTicks) {
|
||||
event.setCancelled(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -156,6 +156,11 @@ public class BukkitServerPlayer extends Player {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int lastSuccessfulInteractionTick() {
|
||||
return lastSuccessfulInteraction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int gameTicks() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user