mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-11-28 13:15:23 +01:00
sponge: Fix claim create triggering twice in claim mode.
* Fix some issues with visuals while claiming.
This commit is contained in:
parent
8e6d2671f3
commit
ff82031cdd
@ -752,6 +752,18 @@ public void onPlayerChangeHeldItem(ChangeInventoryEvent.Held event, @First Playe
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
}
|
||||
|
||||
} else if (!playerData.claimMode) {
|
||||
if (playerData.lastShovelLocation != null) {
|
||||
playerData.revertActiveVisual(player);
|
||||
// check for any active WECUI visuals
|
||||
if (this.worldEditProvider != null) {
|
||||
this.worldEditProvider.revertVisuals(player, playerData, null);
|
||||
}
|
||||
}
|
||||
playerData.lastShovelLocation = null;
|
||||
playerData.endShovelLocation = null;
|
||||
playerData.claimResizing = null;
|
||||
playerData.shovelMode = ShovelTypes.BASIC;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
@ -797,7 +809,7 @@ public void onPlayerInteractBlockPrimary(InteractBlockEvent.Primary.MainHand eve
|
||||
if (handleItemInteract(event, player, player.getWorld(), itemInHand).isCancelled()) {
|
||||
return;
|
||||
}
|
||||
} else if (playerData.claimMode) {
|
||||
} else {
|
||||
if (investigateClaim(event, player, event.getTargetBlock(), itemInHand)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -955,8 +967,15 @@ public InteractEvent handleItemInteract(InteractEvent event, Player player, Worl
|
||||
return event;
|
||||
}
|
||||
if (!primaryEvent) {
|
||||
if (playerData.claimMode && event instanceof HandInteractEvent) {
|
||||
final HandInteractEvent handInteractEvent = (HandInteractEvent) event;
|
||||
if (handInteractEvent.getHandType() == HandTypes.MAIN_HAND) {
|
||||
onPlayerHandleClaimCreateAction(event, blockSnapshot, player, itemInHand, playerData);
|
||||
}
|
||||
} else {
|
||||
onPlayerHandleClaimCreateAction(event, blockSnapshot, player, itemInHand, playerData);
|
||||
}
|
||||
}
|
||||
return event;
|
||||
}
|
||||
|
||||
@ -1539,9 +1558,6 @@ private boolean investigateClaim(InteractEvent event, Player player, BlockSnapsh
|
||||
// claim mode inspects with left-click
|
||||
return false;
|
||||
}
|
||||
if (!playerData.claimMode && (itemInHand.isEmpty() || itemInHand.getType() != GriefDefenderPlugin.getInstance().investigationTool.getType())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event instanceof InteractItemEvent.Primary || event instanceof InteractBlockEvent.Primary) {
|
||||
if (!playerData.claimMode || !playerData.visualBlocks.isEmpty()) {
|
||||
@ -1554,6 +1570,10 @@ private boolean investigateClaim(InteractEvent event, Player player, BlockSnapsh
|
||||
}
|
||||
}
|
||||
|
||||
if (!playerData.claimMode && (itemInHand.isEmpty() || itemInHand.getType() != GriefDefenderPlugin.getInstance().investigationTool.getType())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
GDTimings.PLAYER_INVESTIGATE_CLAIM.startTimingIfSync();
|
||||
// if holding shift (sneaking), show all claims in area
|
||||
GDClaim claim = null;
|
||||
|
Loading…
Reference in New Issue
Block a user