sponge: Fix NPE during claim create.

This commit is contained in:
bloodshot 2020-02-11 12:57:45 -05:00
parent 71d45beaec
commit 4bf2a66b4a
2 changed files with 2 additions and 1 deletions

View File

@ -1526,6 +1526,7 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect
final Component message = MessageCache.getInstance().CREATE_SUBDIVISION_ONLY; final Component message = MessageCache.getInstance().CREATE_SUBDIVISION_ONLY;
GriefDefenderPlugin.sendMessage(player, message); GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = null; playerData.lastShovelLocation = null;
playerData.claimResizing = null;
// TODO: Add new result type for this // TODO: Add new result type for this
return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message); return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message);
} }

View File

@ -1262,7 +1262,7 @@ private void onPlayerHandleClaimCreateAction(InteractEvent event, BlockSnapshot
return; return;
} }
if (playerData.claimResizing != null) { if (playerData.claimResizing != null && playerData.lastShovelLocation != null) {
handleResizeFinish(event, player, location, playerData); handleResizeFinish(event, player, location, playerData);
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming(); GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
return; return;