Fix NPE during claim create.

This commit is contained in:
bloodshot 2020-02-11 12:54:51 -05:00
parent db4e50ca9c
commit 71d45beaec
2 changed files with 2 additions and 1 deletions

View File

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

View File

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