2019-09-03 19:59:12 +02:00
|
|
|
/*
|
|
|
|
* This file is part of GriefDefender, licensed under the MIT License (MIT).
|
|
|
|
*
|
|
|
|
* Copyright (c) bloodmc
|
|
|
|
* Copyright (c) contributors
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
* THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
package com.griefdefender.command;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.block.BlockFace;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
import com.flowpowered.math.vector.Vector3i;
|
|
|
|
import com.google.common.collect.ImmutableMap;
|
|
|
|
import com.griefdefender.GDPlayerData;
|
|
|
|
import com.griefdefender.GriefDefenderPlugin;
|
|
|
|
import com.griefdefender.api.claim.Claim;
|
|
|
|
import com.griefdefender.api.claim.ClaimBlockSystem;
|
|
|
|
import com.griefdefender.api.claim.ClaimResult;
|
|
|
|
import com.griefdefender.api.claim.ClaimResultType;
|
|
|
|
import com.griefdefender.cache.MessageCache;
|
|
|
|
import com.griefdefender.cache.PermissionHolderCache;
|
|
|
|
import com.griefdefender.claim.GDClaim;
|
|
|
|
import com.griefdefender.configuration.MessageStorage;
|
Update for 1.5.5 release.
* Add potion effects support.
* Add item enchantment support.
* Add pvp lookup methods for claim and playerdata.
* Add 'block-tileentity-id-list' used to override mod block id's that are used for many TE's.
- Ex. IC2 uses a base block id 'ic2:te' for all TE's. When the id is detected during block/item usage, it will be converted to the actual id.
* Add TileEntity registry to better support hybrid servers.
* Add '/claiminfo' UUID click support to copy text to chat.
* Add support for overriding option 'player-command-exit/enter' on player.
* Add command description translation support.
* Add zh_HK language support.
* Fix event cause not clearing on push.
* Fix abandon claim within town returning funds to owner in economy mode.
* Fix player afk detection during claim block task.
* Fix async chunk load during visual revert.
* Fix '/gd claim we' command.
* Fix advanced flag GUI toggle with definitions.
* Fix rent sign update not checking all children claims.
* Fix rent sign not being updated when cancelled via '/claimrent cancel'.
* Fix '/claimsell' on admin claim.
* Fix NPE when attempting to purchase an admin claim for sale.
* Fix command description translations.
* Fix isInvulnerable NPE on 1.8.8 servers.
* Fix '/abandonworld' exiting when no economy data found for player.
* Fix '/deletealladmin' only deleting admin claims in current world when passing no world argument.
* Fix '/claimcontract' and '/claimexpand' NPE in economy mode.
* Fix GD claim enter/exit prefix. The prefix will now use '[<playername>]'.
Note: This can be configured in lang file under 'claim-prefix-enter' and 'claim-prefix-exit'
* Clean up advanced flag GUI code.
* Disable /buyblocks command when economy-block-cost is <= 0
* Deny town claim abandon if basic claims exist owned by owner.
* Allow to input string as option value.
* Improve pvp source contexts.
* Clean up '/acb' command code.
* (Bukkit) Add potion splash protection support.
* (Bukkit) Fix tamed entities being hit by projectiles.
* (Bukkit) Fix enderman block place protection.
* (Hybrid) Fix wrong EnumCreatureType being registered for entities.
* (Hybrid) Add TileEntity registry.
* (Hybrid) Add mod command support for 'command-execute' flag.
* (Sponge) Add PlaceHolderAPI support.
* (Sponge) Add Nucleus v2 support.
* (Sponge) Add IgniteEntityEvent support.
* (Sponge) Fix '/cpp' and '/cpg' command.
* (Sponge) Fix player block placement deny not sending message.
Fixes #4
Fixes #200, Fixes #206, Fixes #222
Fixes #232, Fixes #237, Fixes #267
Fixes #269, Fixes #276, Fixes #296
Fixes #310, Fixes #311, Fixes #317
Fixes #324, Fixes #333, Fixes #334
Fixes #335, Fixes #336, Fixes #347
2020-12-28 23:28:12 +01:00
|
|
|
import com.griefdefender.event.GDCauseStackManager;
|
2020-06-06 01:26:14 +02:00
|
|
|
import com.griefdefender.internal.visual.GDClaimVisual;
|
2019-09-03 19:59:12 +02:00
|
|
|
import com.griefdefender.permission.GDPermissionUser;
|
|
|
|
import com.griefdefender.permission.GDPermissions;
|
|
|
|
import com.griefdefender.provider.VaultProvider;
|
|
|
|
import com.griefdefender.util.PlayerUtil;
|
|
|
|
|
|
|
|
import co.aikar.commands.BaseCommand;
|
|
|
|
import co.aikar.commands.annotation.CommandAlias;
|
|
|
|
import co.aikar.commands.annotation.CommandCompletion;
|
|
|
|
import co.aikar.commands.annotation.CommandPermission;
|
|
|
|
import co.aikar.commands.annotation.Description;
|
|
|
|
import co.aikar.commands.annotation.Optional;
|
|
|
|
import co.aikar.commands.annotation.Subcommand;
|
|
|
|
import co.aikar.commands.annotation.Syntax;
|
|
|
|
import net.kyori.text.TextComponent;
|
|
|
|
import net.kyori.text.format.TextColor;
|
|
|
|
|
|
|
|
@CommandAlias("%griefdefender")
|
|
|
|
@CommandPermission(GDPermissions.COMMAND_CLAIM_EXPAND)
|
|
|
|
public class CommandClaimExpand extends BaseCommand {
|
|
|
|
|
2019-09-18 17:28:49 +02:00
|
|
|
@CommandCompletion("@gddummy @gdblockfaces @gddummy")
|
2019-09-03 19:59:12 +02:00
|
|
|
@CommandAlias("claimexpand|expandclaim")
|
Update for 1.5.5 release.
* Add potion effects support.
* Add item enchantment support.
* Add pvp lookup methods for claim and playerdata.
* Add 'block-tileentity-id-list' used to override mod block id's that are used for many TE's.
- Ex. IC2 uses a base block id 'ic2:te' for all TE's. When the id is detected during block/item usage, it will be converted to the actual id.
* Add TileEntity registry to better support hybrid servers.
* Add '/claiminfo' UUID click support to copy text to chat.
* Add support for overriding option 'player-command-exit/enter' on player.
* Add command description translation support.
* Add zh_HK language support.
* Fix event cause not clearing on push.
* Fix abandon claim within town returning funds to owner in economy mode.
* Fix player afk detection during claim block task.
* Fix async chunk load during visual revert.
* Fix '/gd claim we' command.
* Fix advanced flag GUI toggle with definitions.
* Fix rent sign update not checking all children claims.
* Fix rent sign not being updated when cancelled via '/claimrent cancel'.
* Fix '/claimsell' on admin claim.
* Fix NPE when attempting to purchase an admin claim for sale.
* Fix command description translations.
* Fix isInvulnerable NPE on 1.8.8 servers.
* Fix '/abandonworld' exiting when no economy data found for player.
* Fix '/deletealladmin' only deleting admin claims in current world when passing no world argument.
* Fix '/claimcontract' and '/claimexpand' NPE in economy mode.
* Fix GD claim enter/exit prefix. The prefix will now use '[<playername>]'.
Note: This can be configured in lang file under 'claim-prefix-enter' and 'claim-prefix-exit'
* Clean up advanced flag GUI code.
* Disable /buyblocks command when economy-block-cost is <= 0
* Deny town claim abandon if basic claims exist owned by owner.
* Allow to input string as option value.
* Improve pvp source contexts.
* Clean up '/acb' command code.
* (Bukkit) Add potion splash protection support.
* (Bukkit) Fix tamed entities being hit by projectiles.
* (Bukkit) Fix enderman block place protection.
* (Hybrid) Fix wrong EnumCreatureType being registered for entities.
* (Hybrid) Add TileEntity registry.
* (Hybrid) Add mod command support for 'command-execute' flag.
* (Sponge) Add PlaceHolderAPI support.
* (Sponge) Add Nucleus v2 support.
* (Sponge) Add IgniteEntityEvent support.
* (Sponge) Fix '/cpp' and '/cpg' command.
* (Sponge) Fix player block placement deny not sending message.
Fixes #4
Fixes #200, Fixes #206, Fixes #222
Fixes #232, Fixes #237, Fixes #267
Fixes #269, Fixes #276, Fixes #296
Fixes #310, Fixes #311, Fixes #317
Fixes #324, Fixes #333, Fixes #334
Fixes #335, Fixes #336, Fixes #347
2020-12-28 23:28:12 +01:00
|
|
|
@Description("%claim-expand")
|
2019-09-03 19:59:12 +02:00
|
|
|
@Syntax("<amount> [direction]")
|
|
|
|
@Subcommand("claim expand")
|
|
|
|
public void execute(Player player, int amount, @Optional String direction) {
|
|
|
|
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(player);
|
|
|
|
final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(user.getInternalPlayerData(), player.getLocation());
|
|
|
|
final GDPlayerData playerData = user.getInternalPlayerData();
|
|
|
|
|
|
|
|
if (claim.isWilderness()) {
|
|
|
|
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_YOURS);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!claim.getInternalClaimData().isResizable() || (!claim.getOwnerUniqueId().equals(player.getUniqueId()) && !playerData.canIgnoreClaim(claim) && claim.allowEdit(player) != null)) {
|
|
|
|
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().PERMISSION_CLAIM_RESIZE);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
final Vector3i lesser = claim.lesserBoundaryCorner;
|
|
|
|
final Vector3i greater = claim.greaterBoundaryCorner;
|
|
|
|
Vector3i point1 = null;
|
|
|
|
Vector3i point2 = null;
|
2019-10-30 15:37:44 +01:00
|
|
|
if (direction == null || !direction.equalsIgnoreCase("all")) {
|
|
|
|
final BlockFace face = direction == null ? PlayerUtil.getInstance().getBlockFace(player) : PlayerUtil.getInstance().getBlockFace(direction);
|
|
|
|
if (face == null || amount <= 0) {
|
|
|
|
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_INVALID);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((face == BlockFace.UP || face == BlockFace.DOWN) && !claim.cuboid) {
|
|
|
|
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().COMMAND_INVALID);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (face == BlockFace.EAST) {
|
|
|
|
point1 = new Vector3i(lesser.getX(), lesser.getY(), lesser.getZ());
|
|
|
|
point2 = new Vector3i(greater.getX() + amount, greater.getY(), greater.getZ());
|
|
|
|
} else if (face == BlockFace.WEST) {
|
|
|
|
point1 = new Vector3i(lesser.getX() - amount, lesser.getY(), lesser.getZ());
|
|
|
|
point2 = new Vector3i(greater.getX(), greater.getY(), greater.getZ());
|
|
|
|
} else if (face == BlockFace.NORTH) {
|
|
|
|
point1 = new Vector3i(lesser.getX(), lesser.getY(), lesser.getZ() - amount);
|
|
|
|
point2 = new Vector3i(greater.getX(), greater.getY(), greater.getZ());
|
|
|
|
} else if (face == BlockFace.SOUTH) {
|
|
|
|
point1 = new Vector3i(lesser.getX(), lesser.getY(), lesser.getZ());
|
|
|
|
point2 = new Vector3i(greater.getX(), greater.getY(), greater.getZ() + amount);
|
2019-12-07 22:50:56 +01:00
|
|
|
} else if (face == BlockFace.UP) {
|
|
|
|
point1 = new Vector3i(lesser.getX(), lesser.getY(), lesser.getZ());
|
2020-01-31 17:31:03 +01:00
|
|
|
point2 = new Vector3i(greater.getX(), greater.getY() + amount, greater.getZ());
|
2019-12-07 22:50:56 +01:00
|
|
|
} else if (face == BlockFace.DOWN) {
|
|
|
|
point1 = new Vector3i(lesser.getX(), lesser.getY() - amount, lesser.getZ());
|
2020-01-31 17:31:03 +01:00
|
|
|
point2 = new Vector3i(greater.getX(), greater.getY(), greater.getZ());
|
2019-10-30 15:37:44 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
point1 = new Vector3i(
|
|
|
|
lesser.getX() - amount,
|
|
|
|
lesser.getY(),
|
|
|
|
lesser.getZ() - amount);
|
|
|
|
point2 = new Vector3i(
|
|
|
|
greater.getX() + amount,
|
|
|
|
greater.getY(),
|
|
|
|
greater.getZ() + amount);
|
2019-09-03 19:59:12 +02:00
|
|
|
}
|
|
|
|
|
Update for 1.5.5 release.
* Add potion effects support.
* Add item enchantment support.
* Add pvp lookup methods for claim and playerdata.
* Add 'block-tileentity-id-list' used to override mod block id's that are used for many TE's.
- Ex. IC2 uses a base block id 'ic2:te' for all TE's. When the id is detected during block/item usage, it will be converted to the actual id.
* Add TileEntity registry to better support hybrid servers.
* Add '/claiminfo' UUID click support to copy text to chat.
* Add support for overriding option 'player-command-exit/enter' on player.
* Add command description translation support.
* Add zh_HK language support.
* Fix event cause not clearing on push.
* Fix abandon claim within town returning funds to owner in economy mode.
* Fix player afk detection during claim block task.
* Fix async chunk load during visual revert.
* Fix '/gd claim we' command.
* Fix advanced flag GUI toggle with definitions.
* Fix rent sign update not checking all children claims.
* Fix rent sign not being updated when cancelled via '/claimrent cancel'.
* Fix '/claimsell' on admin claim.
* Fix NPE when attempting to purchase an admin claim for sale.
* Fix command description translations.
* Fix isInvulnerable NPE on 1.8.8 servers.
* Fix '/abandonworld' exiting when no economy data found for player.
* Fix '/deletealladmin' only deleting admin claims in current world when passing no world argument.
* Fix '/claimcontract' and '/claimexpand' NPE in economy mode.
* Fix GD claim enter/exit prefix. The prefix will now use '[<playername>]'.
Note: This can be configured in lang file under 'claim-prefix-enter' and 'claim-prefix-exit'
* Clean up advanced flag GUI code.
* Disable /buyblocks command when economy-block-cost is <= 0
* Deny town claim abandon if basic claims exist owned by owner.
* Allow to input string as option value.
* Improve pvp source contexts.
* Clean up '/acb' command code.
* (Bukkit) Add potion splash protection support.
* (Bukkit) Fix tamed entities being hit by projectiles.
* (Bukkit) Fix enderman block place protection.
* (Hybrid) Fix wrong EnumCreatureType being registered for entities.
* (Hybrid) Add TileEntity registry.
* (Hybrid) Add mod command support for 'command-execute' flag.
* (Sponge) Add PlaceHolderAPI support.
* (Sponge) Add Nucleus v2 support.
* (Sponge) Add IgniteEntityEvent support.
* (Sponge) Fix '/cpp' and '/cpg' command.
* (Sponge) Fix player block placement deny not sending message.
Fixes #4
Fixes #200, Fixes #206, Fixes #222
Fixes #232, Fixes #237, Fixes #267
Fixes #269, Fixes #276, Fixes #296
Fixes #310, Fixes #311, Fixes #317
Fixes #324, Fixes #333, Fixes #334
Fixes #335, Fixes #336, Fixes #347
2020-12-28 23:28:12 +01:00
|
|
|
GDCauseStackManager.getInstance().pushCause(player);
|
2019-09-03 19:59:12 +02:00
|
|
|
final ClaimResult result = claim.resize(point1, point2);
|
Update for 1.5.5 release.
* Add potion effects support.
* Add item enchantment support.
* Add pvp lookup methods for claim and playerdata.
* Add 'block-tileentity-id-list' used to override mod block id's that are used for many TE's.
- Ex. IC2 uses a base block id 'ic2:te' for all TE's. When the id is detected during block/item usage, it will be converted to the actual id.
* Add TileEntity registry to better support hybrid servers.
* Add '/claiminfo' UUID click support to copy text to chat.
* Add support for overriding option 'player-command-exit/enter' on player.
* Add command description translation support.
* Add zh_HK language support.
* Fix event cause not clearing on push.
* Fix abandon claim within town returning funds to owner in economy mode.
* Fix player afk detection during claim block task.
* Fix async chunk load during visual revert.
* Fix '/gd claim we' command.
* Fix advanced flag GUI toggle with definitions.
* Fix rent sign update not checking all children claims.
* Fix rent sign not being updated when cancelled via '/claimrent cancel'.
* Fix '/claimsell' on admin claim.
* Fix NPE when attempting to purchase an admin claim for sale.
* Fix command description translations.
* Fix isInvulnerable NPE on 1.8.8 servers.
* Fix '/abandonworld' exiting when no economy data found for player.
* Fix '/deletealladmin' only deleting admin claims in current world when passing no world argument.
* Fix '/claimcontract' and '/claimexpand' NPE in economy mode.
* Fix GD claim enter/exit prefix. The prefix will now use '[<playername>]'.
Note: This can be configured in lang file under 'claim-prefix-enter' and 'claim-prefix-exit'
* Clean up advanced flag GUI code.
* Disable /buyblocks command when economy-block-cost is <= 0
* Deny town claim abandon if basic claims exist owned by owner.
* Allow to input string as option value.
* Improve pvp source contexts.
* Clean up '/acb' command code.
* (Bukkit) Add potion splash protection support.
* (Bukkit) Fix tamed entities being hit by projectiles.
* (Bukkit) Fix enderman block place protection.
* (Hybrid) Fix wrong EnumCreatureType being registered for entities.
* (Hybrid) Add TileEntity registry.
* (Hybrid) Add mod command support for 'command-execute' flag.
* (Sponge) Add PlaceHolderAPI support.
* (Sponge) Add Nucleus v2 support.
* (Sponge) Add IgniteEntityEvent support.
* (Sponge) Fix '/cpp' and '/cpg' command.
* (Sponge) Fix player block placement deny not sending message.
Fixes #4
Fixes #200, Fixes #206, Fixes #222
Fixes #232, Fixes #237, Fixes #267
Fixes #269, Fixes #276, Fixes #296
Fixes #310, Fixes #311, Fixes #317
Fixes #324, Fixes #333, Fixes #334
Fixes #335, Fixes #336, Fixes #347
2020-12-28 23:28:12 +01:00
|
|
|
GDCauseStackManager.getInstance().popCause();
|
2019-09-03 19:59:12 +02:00
|
|
|
if (!result.successful()) {
|
|
|
|
if (result.getResultType() == ClaimResultType.OVERLAPPING_CLAIM) {
|
|
|
|
GDClaim overlapClaim = (GDClaim) result.getClaim().get();
|
|
|
|
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_OVERLAP);
|
|
|
|
Set<Claim> claims = new HashSet<>();
|
|
|
|
claims.add(overlapClaim);
|
|
|
|
CommandHelper.showOverlapClaims(player, claims, player.getEyeLocation().getBlockY());
|
|
|
|
} else {
|
|
|
|
// TODO add to lang
|
|
|
|
GriefDefenderPlugin.sendMessage(player, TextComponent.of("Could not resize claim. Reason : " + result.getResultType()).color(TextColor.RED));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
int claimBlocksRemaining = playerData.getRemainingClaimBlocks();;
|
|
|
|
if (!claim.isAdminClaim()) {
|
|
|
|
UUID ownerID = claim.getOwnerUniqueId();
|
|
|
|
if (claim.parent != null) {
|
|
|
|
ownerID = claim.parent.getOwnerUniqueId();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ownerID.equals(player.getUniqueId())) {
|
|
|
|
claimBlocksRemaining = playerData.getRemainingClaimBlocks();
|
|
|
|
} else {
|
|
|
|
GDPlayerData ownerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), ownerID);
|
|
|
|
claimBlocksRemaining = ownerData.getRemainingClaimBlocks();
|
|
|
|
final Player owner = Bukkit.getPlayer(ownerID);
|
|
|
|
if (owner == null || !owner.isOnline()) {
|
|
|
|
GriefDefenderPlugin.getInstance().dataStore.clearCachedPlayerData(player.getWorld().getUID(), ownerID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) {
|
|
|
|
final VaultProvider vaultProvider = GriefDefenderPlugin.getInstance().getVaultProvider();
|
|
|
|
if (vaultProvider.hasAccount(player)) {
|
|
|
|
if (GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) {
|
|
|
|
final double claimableChunks = claimBlocksRemaining / 65536.0;
|
|
|
|
final Map<String, Object> params = ImmutableMap.of(
|
|
|
|
"balance", String.valueOf("$" + vaultProvider.getBalance(player)),
|
|
|
|
"chunk-amount", Math.round(claimableChunks * 100.0)/100.0,
|
|
|
|
"block-amount", claimBlocksRemaining);
|
|
|
|
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_MODE_RESIZE_SUCCESS_3D, params));
|
|
|
|
} else {
|
|
|
|
final Map<String, Object> params = ImmutableMap.of(
|
|
|
|
"balance", String.valueOf("$" + vaultProvider.getBalance(player)),
|
|
|
|
"block-amount", claimBlocksRemaining);
|
|
|
|
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_MODE_RESIZE_SUCCESS_2D, params));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) {
|
|
|
|
final double claimableChunks = claimBlocksRemaining / 65536.0;
|
|
|
|
final Map<String, Object> params = ImmutableMap.of(
|
|
|
|
"chunk-amount", Math.round(claimableChunks * 100.0)/100.0,
|
|
|
|
"block-amount", claimBlocksRemaining);
|
|
|
|
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_SUCCESS_3D, params));
|
|
|
|
} else {
|
|
|
|
final Map<String, Object> params = ImmutableMap.of(
|
|
|
|
"block-amount", claimBlocksRemaining);
|
|
|
|
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_SUCCESS_2D, params));
|
|
|
|
}
|
|
|
|
}
|
2020-06-06 01:26:14 +02:00
|
|
|
playerData.revertClaimVisual(claim);
|
2019-09-03 19:59:12 +02:00
|
|
|
claim.getVisualizer().resetVisuals();
|
2020-06-06 01:26:14 +02:00
|
|
|
final GDClaimVisual visual = claim.getVisualizer();
|
|
|
|
if (visual.getVisualTransactions().isEmpty()) {
|
|
|
|
visual.createClaimBlockVisuals(player.getEyeLocation().getBlockY(), player.getLocation(), playerData);
|
|
|
|
}
|
|
|
|
visual.apply(player);
|
2019-09-03 19:59:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|