mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-11-25 12:45:48 +01:00
Update for 1.4.4
* Fix /deletealladmin NPE * Fix claim greeting showing in parent when leaving subclaim * Fix claims being removed in current world when using world argument with abandonall and deleteall commands. * Fix abandonclaim with ignoreclaims giving claimblocks/money to source player and not claim owner. * Fix interact-item-secondary being triggered on left-click. * Fix /gdreload NoSuchMethodError on 1.14/1.15 servers. * Fix WECUI causing visual fillers to not show. * Update kotlin-stdlib, okio, and okhttp3 libs. * Add new visual config setting 'hide-fillers-when-using-wecui'. * Use unmodifiable map instead of immutable copy getChunksToClaimMap. * (Bukkit) Fix investigate claim loading chunks. * (Sponge) Fix NoClassDefFoundError when using gddebug command. * (Sponge) Add new admin command '/abandonworld [<world>]' which will abandon all user claims in world specified. * (Sponge) Add support for world argument in commands '/abandonall', '/deleteall', and '/deletealladmin'.
This commit is contained in:
parent
5c8354563c
commit
06939181a7
@ -129,8 +129,8 @@ dependencies {
|
||||
compileOnly "com.github.ben-manes.caffeine:caffeine:2.7.0"
|
||||
compileOnly "com.flowpowered:flow-math:1.0.3"
|
||||
compileOnly "com.google.inject:guice:4.1.0"
|
||||
compileOnly "com.squareup.okhttp3:okhttp:3.14.2"
|
||||
compileOnly "com.squareup.okio:okio:2.2.2"
|
||||
compileOnly "com.squareup.okhttp3:okhttp:4.7.2"
|
||||
compileOnly "com.squareup.okio:okio:2.6.0"
|
||||
compileOnly "com.typesafe:config:1.3.1"
|
||||
compileOnly "commons-io:commons-io:2.6"
|
||||
compileOnly "it.unimi.dsi:fastutil:8.2.3"
|
||||
@ -139,7 +139,7 @@ dependencies {
|
||||
compileOnly "org.apache.commons:commons-lang3:3.9"
|
||||
compileOnly "org.checkerframework:checker:2.8.2"
|
||||
compileOnly "org.jetbrains:annotations:17.0.0"
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:1.3.31"
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
|
||||
compileOnly "org.ow2.asm:asm-debug-all:5.2"
|
||||
compileOnly "org.spongepowered:configurate-core:3.7-SNAPSHOT"
|
||||
compileOnly "org.spongepowered:configurate-gson:3.7-SNAPSHOT"
|
||||
|
@ -167,7 +167,6 @@ public class GDPlayerData implements PlayerData {
|
||||
public boolean userOptionBypassPlayerGamemode = false;
|
||||
|
||||
public boolean dataInitialized = false;
|
||||
public boolean showVisualFillers = true;
|
||||
public boolean showNoClaimsFoundMessage = true;
|
||||
public boolean useRestoreSchematic = false;
|
||||
private boolean checkedDimensionHeight = false;
|
||||
|
@ -1063,7 +1063,7 @@ public void loadConfig() {
|
||||
// refresh default permissions
|
||||
this.dataStore.setDefaultGlobalPermissions();
|
||||
}
|
||||
if (this.tagProvider != null) {
|
||||
if (this.tagProvider != null && getMajorMinecraftVersion() > 15) {
|
||||
this.tagProvider.refresh();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
@ -25,7 +25,6 @@
|
||||
package com.griefdefender.claim;
|
||||
|
||||
import com.flowpowered.math.vector.Vector3i;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
@ -69,6 +68,7 @@
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -470,7 +470,7 @@ public Set<Claim> findOverlappingClaims(Claim claim) {
|
||||
|
||||
@Override
|
||||
public Map<Long, Set<Claim>> getChunksToClaimsMap() {
|
||||
return ImmutableMap.copyOf(this.chunksToClaimsMap);
|
||||
return Collections.unmodifiableMap(this.chunksToClaimsMap);
|
||||
}
|
||||
|
||||
public Map<Long, Set<Claim>> getInternalChunksToClaimsMap() {
|
||||
|
@ -81,7 +81,12 @@ public class CommandClaimAbandon extends BaseCommand {
|
||||
public void execute(Player player) {
|
||||
final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation());
|
||||
final UUID ownerId = claim.getOwnerUniqueId();
|
||||
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(player);
|
||||
GDPermissionUser user = null;
|
||||
if (ownerId != null) {
|
||||
user = PermissionHolderCache.getInstance().getOrCreateUser(ownerId);
|
||||
} else {
|
||||
user = PermissionHolderCache.getInstance().getOrCreateUser(player);
|
||||
}
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
|
||||
final boolean isAdmin = playerData.canIgnoreClaim(claim);
|
||||
@ -137,39 +142,40 @@ public void execute(Player player) {
|
||||
.append("\n[")
|
||||
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
|
||||
.append("]\n")
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player, playerData, claim, this.abandonTopClaim), true)))
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player, user, claim, this.abandonTopClaim), true)))
|
||||
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
|
||||
.build();
|
||||
TextAdapter.sendComponent(player, confirmationText);
|
||||
}
|
||||
|
||||
private static Consumer<CommandSender> createConfirmationConsumer(Player player, GDPlayerData playerData, GDClaim claim, boolean abandonTopClaim) {
|
||||
private static Consumer<CommandSender> createConfirmationConsumer(Player source, GDPermissionUser user, GDClaim claim, boolean abandonTopClaim) {
|
||||
return confirm -> {
|
||||
|
||||
GDCauseStackManager.getInstance().pushCause(player);
|
||||
GDCauseStackManager.getInstance().pushCause(source);
|
||||
GDRemoveClaimEvent.Abandon event = new GDRemoveClaimEvent.Abandon(claim);
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
if (event.cancelled()) {
|
||||
TextAdapter.sendComponent(player, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL));
|
||||
TextAdapter.sendComponent(source, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!claim.isSubdivision() && !claim.isAdminClaim()) {
|
||||
if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) {
|
||||
final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
|
||||
if (!economy.hasAccount(player)) {
|
||||
if (!economy.hasAccount(user.getOfflinePlayer())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(player.getWorld().getUID());
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(source.getWorld().getUID());
|
||||
playerData.useRestoreSchematic = event.isRestoring();
|
||||
final ClaimResult claimResult = claimManager.deleteClaimInternal(claim, abandonTopClaim);
|
||||
playerData.useRestoreSchematic = false;
|
||||
if (!claimResult.successful()) {
|
||||
TextAdapter.sendComponent(player, event.getMessage().orElse(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_FAILED,
|
||||
TextAdapter.sendComponent(source, event.getMessage().orElse(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_FAILED,
|
||||
ImmutableMap.of("result", claimResult.getMessage().orElse(TextComponent.of(claimResult.getResultType().toString()))))));
|
||||
return;
|
||||
}
|
||||
@ -183,16 +189,16 @@ private static Consumer<CommandSender> createConfirmationConsumer(Player player,
|
||||
}
|
||||
|
||||
if (!claim.isSubdivision() && !claim.isAdminClaim()) {
|
||||
final double abandonReturnRatio = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Double.class), player, Options.ABANDON_RETURN_RATIO, claim);
|
||||
final double abandonReturnRatio = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Double.class), user, Options.ABANDON_RETURN_RATIO, claim);
|
||||
if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) {
|
||||
final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
|
||||
final double requiredClaimBlocks = claim.getClaimBlocks() * abandonReturnRatio;
|
||||
final double refund = requiredClaimBlocks * claim.getOwnerEconomyBlockCost();
|
||||
final EconomyResponse result = economy.depositPlayer(player, refund);
|
||||
final EconomyResponse result = economy.depositPlayer(user.getOfflinePlayer(), refund);
|
||||
if (result.transactionSuccess()) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS, ImmutableMap.of(
|
||||
"amount", refund));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
GriefDefenderPlugin.sendMessage(source, message);
|
||||
}
|
||||
} else {
|
||||
int newAccruedClaimCount = playerData.getAccruedClaimBlocks() - ((int) Math.ceil(claim.getClaimBlocks() * (1 - abandonReturnRatio)));
|
||||
@ -200,7 +206,7 @@ private static Consumer<CommandSender> createConfirmationConsumer(Player player,
|
||||
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS, ImmutableMap.of(
|
||||
"amount", remainingBlocks));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
GriefDefenderPlugin.sendMessage(source, message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -145,6 +145,9 @@ private static Consumer<CommandSender> createConfirmationConsumer(GDPermissionUs
|
||||
claims = playerData.getInternalClaims();
|
||||
}
|
||||
for (Claim claim : claims) {
|
||||
if (world != null && !claim.getWorldUniqueId().equals(world.getUID())) {
|
||||
continue;
|
||||
}
|
||||
if (abandonDelay > 0) {
|
||||
final Instant localNow = Instant.now();
|
||||
final Instant dateCreated = ((GDClaim) claim).getInternalClaimData().getDateCreated();
|
||||
@ -160,6 +163,10 @@ private static Consumer<CommandSender> createConfirmationConsumer(GDPermissionUs
|
||||
}
|
||||
}
|
||||
|
||||
if (allowedClaims.isEmpty() && delayedClaims.isEmpty()) {
|
||||
TextAdapter.sendComponent(user.getOnlinePlayer(), MessageCache.getInstance().CLAIM_NO_CLAIMS);
|
||||
return;
|
||||
}
|
||||
if (!allowedClaims.isEmpty()) {
|
||||
GDCauseStackManager.getInstance().pushCause(user);
|
||||
GDRemoveClaimEvent.Abandon event = new GDRemoveClaimEvent.Abandon(ImmutableList.copyOf(allowedClaims));
|
||||
|
@ -123,6 +123,9 @@ private static Consumer<CommandSender> createConfirmationConsumer(Player source,
|
||||
Set<Claim> allowedClaims = new HashSet<>();
|
||||
final Player player = user.getOnlinePlayer();
|
||||
for (Claim claim : playerData.getInternalClaims()) {
|
||||
if (!claim.getWorldUniqueId().equals(world.getUID())) {
|
||||
continue;
|
||||
}
|
||||
allowedClaims.add(claim);
|
||||
}
|
||||
|
||||
@ -132,7 +135,7 @@ private static Consumer<CommandSender> createConfirmationConsumer(Player source,
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
if (event.cancelled()) {
|
||||
TextAdapter.sendComponent(user.getOnlinePlayer(), event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL).color(TextColor.RED));
|
||||
TextAdapter.sendComponent(source, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL).color(TextColor.RED));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@
|
||||
import net.kyori.text.format.TextColor;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
@ -134,13 +135,26 @@ public void execute(Player src, String otherPlayer, @Optional String worldName)
|
||||
private static Consumer<CommandSender> createConfirmationConsumer(Player src, GDPermissionUser otherPlayer, World world) {
|
||||
return confirm -> {
|
||||
GDCauseStackManager.getInstance().pushCause(src);
|
||||
Set<Claim> claims = new HashSet<>();
|
||||
Set<Claim> claims;
|
||||
if (world != null) {
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID());
|
||||
claims = claimManager.getPlayerClaims(otherPlayer.getUniqueId());
|
||||
claims = new HashSet<>(claimManager.getInternalPlayerClaims(otherPlayer.getUniqueId()));
|
||||
final Iterator<Claim> iterator = claims.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
final Claim claim = iterator.next();
|
||||
if (!claim.getWorldUniqueId().equals(world.getUID())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
claims = otherPlayer.getInternalPlayerData().getInternalClaims();
|
||||
}
|
||||
if (claims.isEmpty()) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLAYER_NO_CLAIMS_TO_DELETE, ImmutableMap.of(
|
||||
"player", otherPlayer.getFriendlyName()));
|
||||
TextAdapter.sendComponent(src, message);
|
||||
return;
|
||||
}
|
||||
GDRemoveClaimEvent.Delete event = new GDRemoveClaimEvent.Delete(ImmutableList.copyOf(claims));
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
|
@ -34,11 +34,9 @@
|
||||
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.ClaimResult;
|
||||
import com.griefdefender.api.claim.ClaimTypes;
|
||||
import com.griefdefender.cache.MessageCache;
|
||||
import com.griefdefender.claim.GDClaimManager;
|
||||
import com.griefdefender.configuration.MessageStorage;
|
||||
import com.griefdefender.permission.GDPermissions;
|
||||
import com.griefdefender.text.action.GDCallbackHolder;
|
||||
@ -50,7 +48,6 @@
|
||||
import net.kyori.text.event.HoverEvent;
|
||||
import net.kyori.text.format.TextColor;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@ -75,12 +72,6 @@ public void execute(Player player, @Optional String worldName) {
|
||||
ImmutableMap.of("world", worldName)));
|
||||
return;
|
||||
}
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID());
|
||||
final Set<Claim> claims = claimManager.getPlayerClaims(player.getUniqueId());
|
||||
if (claims == null || claims.isEmpty()) {
|
||||
TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIM_NO_CLAIMS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Component message = null;
|
||||
|
@ -34,6 +34,8 @@ public class VisualCategory extends ConfigCategory {
|
||||
|
||||
@Setting(value = "hide-borders-when-using-wecui", comment = "Whether to hide the glowstone/gold block borders when using WECUI.")
|
||||
public boolean hideBorders = false;
|
||||
@Setting(value = "hide-fillers-when-using-wecui", comment = "Whether to hide the block fillers when using WECUI.")
|
||||
public boolean hideFillers = false;
|
||||
@Setting(value = "hide-wecui-drag-visuals-2d", comment = "Whether drag visuals should be shown while creating a claim in 2D mode.")
|
||||
public boolean hideDrag2d = true;
|
||||
@Setting(value = "client-visuals-per-tick", comment = "The amount of block visuals a client can receive per tick when showing/hiding claims. Default: 12")
|
||||
|
@ -187,7 +187,7 @@ public boolean onEntityMove(Event event, Location fromLocation, Location toLocat
|
||||
} else {
|
||||
final boolean showGpPrefix = GriefDefenderPlugin.getGlobalConfig().getConfig().message.enterExitShowGdPrefix;
|
||||
TextComponent welcomeMessage = (TextComponent) gpEvent.getEnterMessage().orElse(null);
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty())) {
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty()) && !fromClaim.isParent(toClaim)) {
|
||||
ChatType chatType = gpEvent.getEnterMessageChatType();
|
||||
if (chatType == ChatTypes.ACTION_BAR) {
|
||||
TextAdapter.sendActionBar(player, TextComponent.builder("")
|
||||
@ -290,7 +290,7 @@ public boolean onEntityMove(Event event, Location fromLocation, Location toLocat
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
final boolean showGpPrefix = GriefDefenderPlugin.getGlobalConfig().getConfig().message.enterExitShowGdPrefix;
|
||||
Component welcomeMessage = gpEvent.getEnterMessage().orElse(null);
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty())) {
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty()) && !fromClaim.isParent(toClaim)) {
|
||||
ChatType chatType = gpEvent.getEnterMessageChatType();
|
||||
if (chatType == ChatTypes.ACTION_BAR) {
|
||||
TextAdapter.sendActionBar(player, TextComponent.builder("")
|
||||
|
@ -526,7 +526,7 @@ public void onPlayerInteractItem(PlayerInteractEvent event) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean primaryEvent = event.getAction() == Action.LEFT_CLICK_AIR ? true : false;
|
||||
final boolean primaryEvent = event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK ? true : false;
|
||||
final Flag flag = primaryEvent ? Flags.INTERACT_ITEM_PRIMARY : Flags.INTERACT_ITEM_SECONDARY;
|
||||
|
||||
if ((playerData.claimMode && (NMSUtil.getInstance().isMainHand(event) && event.getAction() == Action.LEFT_CLICK_AIR|| event.getAction() == Action.LEFT_CLICK_BLOCK)) || (!playerData.claimMode && GriefDefenderPlugin.getInstance().investigationTool != null && NMSUtil.getInstance().itemsEqual(itemInHand, GriefDefenderPlugin.getInstance().investigationTool))) {
|
||||
|
@ -71,6 +71,7 @@
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
@ -156,7 +157,10 @@ public ClaimResult createClaim(World world, Vector3i point1, Vector3i point2, Cl
|
||||
return claimResult;
|
||||
}
|
||||
|
||||
public ClaimResult deleteAllAdminClaims(CommandSender src, UUID worldUniqueId) {
|
||||
public ClaimResult deleteAllAdminClaims(Player source, UUID worldUniqueId) {
|
||||
if (worldUniqueId == null) {
|
||||
worldUniqueId = source.getWorld().getUID();
|
||||
}
|
||||
GDClaimManager claimWorldManager = this.claimWorldManagers.get(worldUniqueId);
|
||||
if (claimWorldManager == null) {
|
||||
return new GDClaimResult(ClaimResultType.CLAIMS_DISABLED);
|
||||
@ -165,6 +169,9 @@ public ClaimResult deleteAllAdminClaims(CommandSender src, UUID worldUniqueId) {
|
||||
List<Claim> claimsToDelete = new ArrayList<Claim>();
|
||||
boolean adminClaimFound = false;
|
||||
for (Claim claim : claimWorldManager.getWorldClaims()) {
|
||||
if (worldUniqueId != null && !claim.getWorldUniqueId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
if (claim.isAdminClaim()) {
|
||||
claimsToDelete.add(claim);
|
||||
adminClaimFound = true;
|
||||
@ -175,7 +182,7 @@ public ClaimResult deleteAllAdminClaims(CommandSender src, UUID worldUniqueId) {
|
||||
return new GDClaimResult(ClaimResultType.CLAIM_NOT_FOUND);
|
||||
}
|
||||
|
||||
GDCauseStackManager.getInstance().pushCause(src);
|
||||
GDCauseStackManager.getInstance().pushCause(source);
|
||||
GDRemoveClaimEvent.Delete event = new GDRemoveClaimEvent.Delete(ImmutableList.copyOf(claimsToDelete));
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
@ -223,11 +230,14 @@ public void deleteClaimsForPlayer(UUID playerID, UUID worldUniqueId) {
|
||||
}
|
||||
List<Claim> claimsToDelete = new ArrayList<>(claims);
|
||||
for (Claim claim : claimsToDelete) {
|
||||
if (worldUniqueId != null && !claim.getWorldUniqueId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
GDClaimManager claimWorldManager = this.claimWorldManagers.get(claim.getWorldUniqueId());
|
||||
claimWorldManager.deleteClaimInternal(claim, true);
|
||||
claims.remove(claim);
|
||||
}
|
||||
|
||||
claims.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -242,6 +252,9 @@ public void deleteClaimsForPlayer(UUID playerID, UUID worldUniqueId) {
|
||||
|
||||
List<Claim> claimsToDelete = new ArrayList<Claim>();
|
||||
for (Claim claim : claims) {
|
||||
if (worldUniqueId != null && !claim.getWorldUniqueId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
if (!claim.isAdminClaim()) {
|
||||
claimsToDelete.add(claim);
|
||||
}
|
||||
|
@ -265,12 +265,16 @@ public Set<Claim> getNearbyClaims(Location location, int blockDistance, boolean
|
||||
return claims;
|
||||
}
|
||||
|
||||
final World world = location.getWorld();
|
||||
org.bukkit.Chunk lesserChunk = location.getWorld().getChunkAt((location.getBlockX() - blockDistance) >> 4, (location.getBlockZ() - blockDistance) >> 4);
|
||||
org.bukkit.Chunk greaterChunk = location.getWorld().getChunkAt((location.getBlockX() + blockDistance) >> 4, (location.getBlockZ() + blockDistance) >> 4);
|
||||
|
||||
if (lesserChunk != null && greaterChunk != null) {
|
||||
for (int chunkX = lesserChunk.getX(); chunkX <= greaterChunk.getX(); chunkX++) {
|
||||
for (int chunkZ = lesserChunk.getZ(); chunkZ <= greaterChunk.getZ(); chunkZ++) {
|
||||
if (!world.isChunkLoaded(chunkX, chunkZ)) {
|
||||
continue;
|
||||
}
|
||||
org.bukkit.Chunk chunk = location.getWorld().getChunkAt(chunkX, chunkZ);
|
||||
if (chunk != null) {
|
||||
Set<Claim> claimsInChunk = claimWorldManager.getInternalChunksToClaimsMap().get(NMSUtil.getInstance().getChunkCoordIntPair(chunkX, chunkZ));
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.12.2",
|
||||
"sha1": "4c663c4feba6cbc25b1d18f2cbabdf017312f239",
|
||||
"path": "com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20200619.233101-42.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20200619.233101-42.jar"
|
||||
"sha1": "8603b6e638d0d4f0b60b56c03d6673c6d9fd04ad",
|
||||
"path": "com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20200627.035906-43.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20200627.035906-43.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -111,18 +111,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -188,11 +188,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.13.2",
|
||||
"sha1": "7dbe1036f6e10d56ac5f4f988ceaa6da3ab8c1de",
|
||||
"path": "com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20200619.232848-40.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20200619.232848-40.jar"
|
||||
"sha1": "f999f5c89b991be69026305680578a66c07a4e9a",
|
||||
"path": "com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20200627.035749-41.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20200627.035749-41.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.14.2",
|
||||
"sha1": "18149469c5748c9b636de5eba2da7fa6ff4c9f16",
|
||||
"path": "com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20200619.232544-40.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20200619.232544-40.jar"
|
||||
"sha1": "1258cd7e767c081c22f103bf08825a942f7fa7e2",
|
||||
"path": "com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20200627.035642-41.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20200627.035642-41.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.14.3",
|
||||
"sha1": "e3ce75457c3034ded36f70b4791b2ba8c830fae1",
|
||||
"path": "com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20200619.232410-41.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20200619.232410-41.jar"
|
||||
"sha1": "30491bb998cb8c3c92eb5e03642d021a46bedca2",
|
||||
"path": "com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20200627.035551-42.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20200627.035551-42.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.14.4",
|
||||
"sha1": "aa72d5656a68388bbd740369e3805f2ab8c254b4",
|
||||
"path": "com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20200619.232236-39.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20200619.232236-39.jar"
|
||||
"sha1": "635483ad5f21a1934a91ebdd1cc2ae6a82e3eff8",
|
||||
"path": "com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20200627.035444-40.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20200627.035444-40.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.15.2",
|
||||
"sha1": "5436d78fb482301af975af47877a3af4dc2dacf1",
|
||||
"path": "com/griefdefender/adapter/1.15.2-SNAPSHOT/adapter-1.15.2-20200619.231911-21.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.15.2-SNAPSHOT/adapter-1.15.2-20200619.231911-21.jar"
|
||||
"sha1": "331aa3c5a0fd7025b4f3bca8d9d62ab466cc7622",
|
||||
"path": "com/griefdefender/adapter/1.15.2-SNAPSHOT/adapter-1.15.2-20200627.035125-23.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.15.2-SNAPSHOT/adapter-1.15.2-20200627.035125-23.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.15",
|
||||
"sha1": "bf70b21a669593d596781372f2563caa02f3267b",
|
||||
"path": "com/griefdefender/adapter/1.15-SNAPSHOT/adapter-1.15-20200619.232051-22.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.15-SNAPSHOT/adapter-1.15-20200619.232051-22.jar"
|
||||
"sha1": "4cf98d03f25fad39de3bb268e6f7026d80e4ee71",
|
||||
"path": "com/griefdefender/adapter/1.15-SNAPSHOT/adapter-1.15-20200627.035345-23.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.15-SNAPSHOT/adapter-1.15-20200627.035345-23.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.16.1",
|
||||
"sha1": "15eec491a9e4d40d0deae04fff009983d960cac0",
|
||||
"path": "com/griefdefender/adapter/1.16.1-SNAPSHOT/adapter-1.16.1-20200625.044010-2.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.16.1-SNAPSHOT/adapter-1.16.1-20200625.044010-2.jar"
|
||||
"sha1": "5615f7855680579ad778d2a953293b929493d553",
|
||||
"path": "com/griefdefender/adapter/1.16.1-SNAPSHOT/adapter-1.16.1-20200627.034742-3.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.16.1-SNAPSHOT/adapter-1.16.1-20200627.034742-3.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -117,18 +117,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -194,11 +194,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.8.8",
|
||||
"sha1": "b8264ddf0ed12b92c4a6f82f8543b8369b2200e3",
|
||||
"path": "com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20200619.233541-40.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20200619.233541-40.jar"
|
||||
"sha1": "77db47f03e027b795447f280d6b762e0f82246bb",
|
||||
"path": "com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20200627.040005-41.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20200627.040005-41.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -111,18 +111,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -188,11 +188,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
@ -3,5 +3,5 @@ main: com.griefdefender.GDBootstrap
|
||||
softdepend: [dynmap, PlaceholderAPI, WorldEdit, WorldGuard, Vault]
|
||||
depend: [LuckPerms]
|
||||
load: STARTUP
|
||||
version: '1.4.3'
|
||||
version: '1.4.4'
|
||||
api-version: 1.13
|
||||
|
@ -2,13 +2,13 @@
|
||||
name=GriefDefender
|
||||
group=com.griefdefender
|
||||
url=https://github.com/bloodmc/GriefDefender
|
||||
version=1.4.3
|
||||
version=1.4.4
|
||||
apiVersion=1.0.0-20200528.202302-24
|
||||
# Bukkit
|
||||
adapterVersion=1.16.1-20200625.044010-2
|
||||
adapterVersion=1.16.1-20200627.034742-3
|
||||
spigotVersion=1.16.1-R0.1-SNAPSHOT
|
||||
# Sponge
|
||||
adapterSpongeVersion=1.12.2-20200620.004815-11
|
||||
adapterSpongeVersion=1.12.2-20200627.042712-12
|
||||
commonVersion=1.12.2-7.1.7-SNAPSHOT
|
||||
minecraftVersion=1.12.2
|
||||
mcpMappings=snapshot_20180808
|
||||
|
@ -143,8 +143,8 @@ dependencies {
|
||||
compileOnly "co.aikar:Table:1.0.0-SNAPSHOT"
|
||||
compileOnly "com.flowpowered:flow-math:1.0.3"
|
||||
compileOnly "com.github.ben-manes.caffeine:caffeine:2.7.0"
|
||||
compileOnly "com.squareup.okhttp3:okhttp:3.14.2"
|
||||
compileOnly "com.squareup.okio:okio:2.2.2"
|
||||
compileOnly "com.squareup.okhttp3:okhttp:4.7.2"
|
||||
compileOnly "com.squareup.okio:okio:2.6.0"
|
||||
compileOnly "commons-io:commons-io:2.6"
|
||||
compileOnly "it.unimi.dsi:fastutil:8.2.3"
|
||||
compileOnly "javax.inject:javax.inject:1"
|
||||
@ -153,7 +153,7 @@ dependencies {
|
||||
compileOnly "org.apache.commons:commons-lang3:3.9"
|
||||
compileOnly "org.checkerframework:checker:2.8.2"
|
||||
compileOnly "org.jetbrains:annotations:17.0.0"
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:1.3.31"
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
|
||||
compileOnly "org.ow2.asm:asm-debug-all:5.2"
|
||||
compileOnly "org.spongepowered:configurate-core:3.7-SNAPSHOT"
|
||||
compileOnly "org.spongepowered:configurate-gson:3.7-SNAPSHOT"
|
||||
@ -203,8 +203,9 @@ shadowJar {
|
||||
|
||||
dependencies {
|
||||
include dependency(':common')
|
||||
include dependency("com.squareup.okhttp3:okhttp:3.9.1")
|
||||
include dependency("com.squareup.okio:okio:1.13.0")
|
||||
//include dependency("com.squareup.okhttp3:okhttp:3.9.1")
|
||||
//include dependency("com.squareup.okio:okio:1.13.0")
|
||||
//include dependency("org.jetbrains.kotlin:kotlin-stdlib:1.3.31")
|
||||
include dependency("com.googlecode.json-simple:json-simple:1.1.1")
|
||||
}
|
||||
|
||||
@ -214,10 +215,10 @@ shadowJar {
|
||||
relocate("net.jodah", "com.griefdefender.lib.jodah")
|
||||
relocate("okhttp3", "com.griefdefender.lib.okhttp3")
|
||||
relocate("okio", "com.griefdefender.lib.okio")
|
||||
relocate("kotlin", "com.griefdefender.lib.kotlin")
|
||||
relocate("org.apache.commons.io", "com.griefdefender.lib.commonsio")
|
||||
relocate("org.apache.commons.lang3", "com.griefdefender.lib.commonslang3")
|
||||
relocate("org.checkerframework", "com.griefdefender.lib.checkerframework")
|
||||
relocate("org.jetbrains", "com.griefdefender.lib.jetbrains")
|
||||
|
||||
|
||||
exclude "dummyThing"
|
||||
|
@ -171,7 +171,6 @@ public class GDPlayerData implements PlayerData {
|
||||
public boolean userOptionBypassPlayerGamemode = false;
|
||||
|
||||
public boolean dataInitialized = false;
|
||||
public boolean showVisualFillers = true;
|
||||
public boolean showNoClaimsFoundMessage = true;
|
||||
public boolean useRestoreSchematic = false;
|
||||
private boolean checkedDimensionHeight = false;
|
||||
|
@ -59,6 +59,7 @@
|
||||
import com.griefdefender.command.CommandClaimAbandon;
|
||||
import com.griefdefender.command.CommandClaimAbandonAll;
|
||||
import com.griefdefender.command.CommandClaimAbandonTop;
|
||||
import com.griefdefender.command.CommandClaimAbandonWorld;
|
||||
import com.griefdefender.command.CommandClaimAdmin;
|
||||
import com.griefdefender.command.CommandClaimBan;
|
||||
import com.griefdefender.command.CommandClaimBank;
|
||||
@ -780,6 +781,7 @@ public void registerBaseCommands() {
|
||||
manager.registerCommand(new CommandClaimAbandon());
|
||||
manager.registerCommand(new CommandClaimAbandonAll());
|
||||
manager.registerCommand(new CommandClaimAbandonTop());
|
||||
manager.registerCommand(new CommandClaimAbandonWorld());
|
||||
manager.registerCommand(new CommandClaimAdmin());
|
||||
manager.registerCommand(new CommandClaimBan());
|
||||
manager.registerCommand(new CommandClaimBank());
|
||||
|
@ -25,7 +25,6 @@
|
||||
package com.griefdefender.claim;
|
||||
|
||||
import com.flowpowered.math.vector.Vector3i;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
@ -69,6 +68,7 @@
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -470,7 +470,7 @@ public Set<Claim> findOverlappingClaims(Claim claim) {
|
||||
|
||||
@Override
|
||||
public Map<Long, Set<Claim>> getChunksToClaimsMap() {
|
||||
return ImmutableMap.copyOf(this.chunksToClaimsMap);
|
||||
return Collections.unmodifiableMap(this.chunksToClaimsMap);
|
||||
}
|
||||
|
||||
public Map<Long, Set<Claim>> getInternalChunksToClaimsMap() {
|
||||
|
@ -84,7 +84,12 @@ public class CommandClaimAbandon extends BaseCommand {
|
||||
public void execute(Player player) {
|
||||
final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation());
|
||||
final UUID ownerId = claim.getOwnerUniqueId();
|
||||
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(player);
|
||||
GDPermissionUser user = null;
|
||||
if (ownerId != null) {
|
||||
user = PermissionHolderCache.getInstance().getOrCreateUser(ownerId);
|
||||
} else {
|
||||
user = PermissionHolderCache.getInstance().getOrCreateUser(player);
|
||||
}
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
|
||||
final boolean isAdmin = playerData.canIgnoreClaim(claim);
|
||||
@ -140,39 +145,40 @@ public void execute(Player player) {
|
||||
.append("\n[")
|
||||
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
|
||||
.append("]\n")
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player, playerData, claim, this.abandonTopClaim), true)))
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player, user, claim, this.abandonTopClaim), true)))
|
||||
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
|
||||
.build();
|
||||
TextAdapter.sendComponent(player, confirmationText);
|
||||
}
|
||||
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player player, GDPlayerData playerData, GDClaim claim, boolean abandonTopClaim) {
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player source, GDPermissionUser user, GDClaim claim, boolean abandonTopClaim) {
|
||||
return confirm -> {
|
||||
|
||||
GDCauseStackManager.getInstance().pushCause(player);
|
||||
GDCauseStackManager.getInstance().pushCause(source);
|
||||
GDRemoveClaimEvent.Abandon event = new GDRemoveClaimEvent.Abandon(claim);
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
if (event.cancelled()) {
|
||||
TextAdapter.sendComponent(player, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL));
|
||||
TextAdapter.sendComponent(source, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!claim.isSubdivision() && !claim.isAdminClaim()) {
|
||||
if (GriefDefenderPlugin.getGlobalConfig().getConfig().economy.economyMode) {
|
||||
final Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(playerData.playerID).orElse(null);
|
||||
final Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(user.getUniqueId()).orElse(null);
|
||||
if (playerAccount == null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(player.getWorld().getUniqueId());
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(source.getWorld().getUniqueId());
|
||||
playerData.useRestoreSchematic = event.isRestoring();
|
||||
final ClaimResult claimResult = claimManager.deleteClaimInternal(claim, abandonTopClaim);
|
||||
playerData.useRestoreSchematic = false;
|
||||
if (!claimResult.successful()) {
|
||||
TextAdapter.sendComponent(player, event.getMessage().orElse(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_FAILED,
|
||||
TextAdapter.sendComponent(source, event.getMessage().orElse(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_FAILED,
|
||||
ImmutableMap.of("result", claimResult.getMessage().orElse(TextComponent.of(claimResult.getResultType().toString()))))));
|
||||
return;
|
||||
}
|
||||
@ -186,9 +192,9 @@ private static Consumer<CommandSource> createConfirmationConsumer(Player player,
|
||||
}
|
||||
|
||||
if (!claim.isSubdivision() && !claim.isAdminClaim()) {
|
||||
final double abandonReturnRatio = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Double.class), player, Options.ABANDON_RETURN_RATIO, claim);
|
||||
final double abandonReturnRatio = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Double.class), user, Options.ABANDON_RETURN_RATIO, claim);
|
||||
if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) {
|
||||
final Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(playerData.playerID).orElse(null);
|
||||
final Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(user.getUniqueId()).orElse(null);
|
||||
if (playerAccount == null) {
|
||||
return;
|
||||
}
|
||||
@ -200,7 +206,7 @@ private static Consumer<CommandSource> createConfirmationConsumer(Player player,
|
||||
if (result.getResult() == ResultType.SUCCESS) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS, ImmutableMap.of(
|
||||
"amount", refund));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
GriefDefenderPlugin.sendMessage(source, message);
|
||||
}
|
||||
} else {
|
||||
int newAccruedClaimCount = playerData.getAccruedClaimBlocks() - ((int) Math.ceil(claim.getClaimBlocks() * (1 - abandonReturnRatio)));
|
||||
@ -208,7 +214,7 @@ private static Consumer<CommandSource> createConfirmationConsumer(Player player,
|
||||
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS, ImmutableMap.of(
|
||||
"amount", remainingBlocks));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
GriefDefenderPlugin.sendMessage(source, message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -26,12 +26,13 @@
|
||||
|
||||
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 com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.griefdefender.GDPlayerData;
|
||||
import com.griefdefender.GriefDefenderPlugin;
|
||||
@ -41,6 +42,7 @@
|
||||
import com.griefdefender.cache.MessageCache;
|
||||
import com.griefdefender.cache.PermissionHolderCache;
|
||||
import com.griefdefender.claim.GDClaim;
|
||||
import com.griefdefender.claim.GDClaimManager;
|
||||
import com.griefdefender.configuration.MessageStorage;
|
||||
import com.griefdefender.event.GDCauseStackManager;
|
||||
import com.griefdefender.event.GDRemoveClaimEvent;
|
||||
@ -61,6 +63,7 @@
|
||||
import org.spongepowered.api.service.economy.account.Account;
|
||||
import org.spongepowered.api.service.economy.transaction.ResultType;
|
||||
import org.spongepowered.api.service.economy.transaction.TransactionResult;
|
||||
import org.spongepowered.api.world.storage.WorldProperties;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Duration;
|
||||
@ -73,12 +76,27 @@
|
||||
@CommandPermission(GDPermissions.COMMAND_ABANDON_ALL_CLAIMS)
|
||||
public class CommandClaimAbandonAll extends BaseCommand {
|
||||
|
||||
@CommandCompletion("@gdworlds @gddummy")
|
||||
@CommandAlias("abandonall|abandonallclaims")
|
||||
@Description("Abandons ALL your claims")
|
||||
@Subcommand("abandon all")
|
||||
public void execute(Player player) {
|
||||
public void execute(Player player, @Optional String worldName) {
|
||||
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(player);
|
||||
int originalClaimCount = user.getInternalPlayerData().getInternalClaims().size();
|
||||
WorldProperties worldProperties = null;
|
||||
if (worldName != null) {
|
||||
worldProperties = Sponge.getServer().getWorldProperties(worldName).orElse(null);
|
||||
if (worldProperties == null) {
|
||||
TextAdapter.sendComponent(player, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND,
|
||||
ImmutableMap.of("world", worldName)));
|
||||
return;
|
||||
}
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(worldProperties.getUniqueId());
|
||||
final Set<Claim> claims = claimManager.getPlayerClaims(player.getUniqueId());
|
||||
if (claims == null || claims.isEmpty()) {
|
||||
originalClaimCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (originalClaimCount == 0) {
|
||||
try {
|
||||
@ -90,26 +108,48 @@ public void execute(Player player) {
|
||||
}
|
||||
|
||||
final boolean autoSchematicRestore = GriefDefenderPlugin.getActiveConfig(player.getWorld().getUniqueId()).getConfig().claim.claimAutoSchematicRestore;
|
||||
Component message = null;
|
||||
if (worldProperties != null) {
|
||||
if (autoSchematicRestore) {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_ABANDON_ALL_RESTORE_WARNING_WORLD, ImmutableMap.of(
|
||||
"world", worldProperties.getWorldName()));
|
||||
} else {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_ALL_WARNING_WORLD, ImmutableMap.of(
|
||||
"world", worldProperties.getWorldName()));
|
||||
}
|
||||
} else {
|
||||
message = autoSchematicRestore ? MessageCache.getInstance().SCHEMATIC_ABANDON_ALL_RESTORE_WARNING : MessageCache.getInstance().ABANDON_ALL_WARNING;
|
||||
}
|
||||
final Component confirmationText = TextComponent.builder()
|
||||
.append(autoSchematicRestore ? MessageCache.getInstance().SCHEMATIC_ABANDON_ALL_RESTORE_WARNING : MessageCache.getInstance().ABANDON_ALL_WARNING)
|
||||
.append(message)
|
||||
.append(TextComponent.builder()
|
||||
.append("\n[")
|
||||
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
|
||||
.append("]\n")
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(user), true)))
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(user, worldProperties), true)))
|
||||
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
|
||||
.build();
|
||||
TextAdapter.sendComponent(player, confirmationText);
|
||||
}
|
||||
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(GDPermissionUser user) {
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(GDPermissionUser user, WorldProperties worldProperties) {
|
||||
return confirm -> {
|
||||
Set<Claim> allowedClaims = new HashSet<>();
|
||||
Set<Claim> delayedClaims = new HashSet<>();
|
||||
final int abandonDelay = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Integer.class), user, Options.ABANDON_DELAY);
|
||||
final Player player = user.getOnlinePlayer();
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
for (Claim claim : playerData.getInternalClaims()) {
|
||||
Set<Claim> claims = new HashSet<>();
|
||||
if (worldProperties != null) {
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(worldProperties.getUniqueId());
|
||||
claims = claimManager.getPlayerClaims(player.getUniqueId());
|
||||
} else {
|
||||
claims = playerData.getInternalClaims();
|
||||
}
|
||||
for (Claim claim : claims) {
|
||||
if (worldProperties != null && !claim.getWorldUniqueId().equals(worldProperties.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
if (abandonDelay > 0) {
|
||||
final Instant localNow = Instant.now();
|
||||
final Instant dateCreated = ((GDClaim) claim).getInternalClaimData().getDateCreated();
|
||||
@ -125,6 +165,10 @@ private static Consumer<CommandSource> createConfirmationConsumer(GDPermissionUs
|
||||
}
|
||||
}
|
||||
|
||||
if (allowedClaims.isEmpty() && delayedClaims.isEmpty()) {
|
||||
TextAdapter.sendComponent(user.getOnlinePlayer(), MessageCache.getInstance().CLAIM_NO_CLAIMS);
|
||||
return;
|
||||
}
|
||||
if (!allowedClaims.isEmpty()) {
|
||||
GDCauseStackManager.getInstance().pushCause(user);
|
||||
GDRemoveClaimEvent.Abandon event = new GDRemoveClaimEvent.Abandon(ImmutableList.copyOf(allowedClaims));
|
||||
@ -167,12 +211,19 @@ private static Consumer<CommandSource> createConfirmationConsumer(GDPermissionUs
|
||||
"amount", TextComponent.of(String.valueOf(refund))));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS, ImmutableMap.of(
|
||||
Component message = null;
|
||||
if (worldProperties != null) {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS_WORLD, ImmutableMap.of(
|
||||
"world", worldProperties.getWorldName(),
|
||||
"amount", remainingBlocks));
|
||||
} else {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS, ImmutableMap.of(
|
||||
"amount", remainingBlocks));
|
||||
}
|
||||
TextAdapter.sendComponent(player, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!delayedClaims.isEmpty()) {
|
||||
|
@ -0,0 +1,190 @@
|
||||
/*
|
||||
* 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 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 com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.reflect.TypeToken;
|
||||
import com.griefdefender.GDPlayerData;
|
||||
import com.griefdefender.GriefDefenderPlugin;
|
||||
import com.griefdefender.api.GriefDefender;
|
||||
import com.griefdefender.api.claim.Claim;
|
||||
import com.griefdefender.api.permission.option.Options;
|
||||
import com.griefdefender.cache.MessageCache;
|
||||
import com.griefdefender.claim.GDClaimManager;
|
||||
import com.griefdefender.configuration.MessageStorage;
|
||||
import com.griefdefender.event.GDCauseStackManager;
|
||||
import com.griefdefender.event.GDRemoveClaimEvent;
|
||||
import com.griefdefender.permission.GDPermissionManager;
|
||||
import com.griefdefender.permission.GDPermissionUser;
|
||||
import com.griefdefender.permission.GDPermissions;
|
||||
import com.griefdefender.text.action.GDCallbackHolder;
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import net.kyori.text.event.ClickEvent;
|
||||
import net.kyori.text.event.HoverEvent;
|
||||
import net.kyori.text.format.TextColor;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.service.economy.Currency;
|
||||
import org.spongepowered.api.service.economy.account.Account;
|
||||
import org.spongepowered.api.service.economy.transaction.ResultType;
|
||||
import org.spongepowered.api.service.economy.transaction.TransactionResult;
|
||||
import org.spongepowered.api.world.storage.WorldProperties;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@CommandAlias("%griefdefender")
|
||||
@CommandPermission(GDPermissions.COMMAND_ABANDON_WORLD_CLAIMS)
|
||||
public class CommandClaimAbandonWorld extends BaseCommand {
|
||||
|
||||
@CommandCompletion("@gdworlds @gddummy")
|
||||
@CommandAlias("abandonworld")
|
||||
@Description("Special admin command used to abandon ALL user claims in world")
|
||||
@Subcommand("abandon world")
|
||||
@Syntax("[<world>]")
|
||||
public void execute(Player player, @Optional String worldName) {
|
||||
WorldProperties world = player.getWorld().getProperties();
|
||||
if (worldName != null) {
|
||||
world = Sponge.getServer().getWorldProperties(worldName).orElse(null);
|
||||
if (world == null) {
|
||||
TextAdapter.sendComponent(player, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND,
|
||||
ImmutableMap.of("world", worldName)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(player.getWorld().getUniqueId());
|
||||
if (claimWorldManager.getWorldClaims().size() == 0) {
|
||||
try {
|
||||
throw new CommandException(MessageCache.getInstance().CLAIM_NO_CLAIMS);
|
||||
} catch (CommandException e) {
|
||||
TextAdapter.sendComponent(player, e.getText());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_WORLD_WARNING, ImmutableMap.of(
|
||||
"world", TextComponent.of(world.getWorldName())));
|
||||
final Component confirmationText = TextComponent.builder()
|
||||
.append(message)
|
||||
.append(TextComponent.builder()
|
||||
.append("\n[")
|
||||
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
|
||||
.append("]\n")
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player, world), true)))
|
||||
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
|
||||
.build();
|
||||
TextAdapter.sendComponent(player, confirmationText);
|
||||
}
|
||||
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player source, WorldProperties world) {
|
||||
return confirm -> {
|
||||
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUniqueId());
|
||||
for (GDPlayerData playerData : claimWorldManager.getPlayerDataMap().values()) {
|
||||
final GDPermissionUser user = playerData.getSubject();
|
||||
if (user == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Set<Claim> allowedClaims = new HashSet<>();
|
||||
final Player player = user.getOnlinePlayer();
|
||||
for (Claim claim : playerData.getInternalClaims()) {
|
||||
if (!claim.getWorldUniqueId().equals(world.getUniqueId())) {
|
||||
continue;
|
||||
}
|
||||
allowedClaims.add(claim);
|
||||
}
|
||||
|
||||
if (!allowedClaims.isEmpty()) {
|
||||
GDCauseStackManager.getInstance().pushCause(user);
|
||||
GDRemoveClaimEvent.Abandon event = new GDRemoveClaimEvent.Abandon(ImmutableList.copyOf(allowedClaims));
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
if (event.cancelled()) {
|
||||
TextAdapter.sendComponent(source, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL).color(TextColor.RED));
|
||||
return;
|
||||
}
|
||||
|
||||
double refund = 0;
|
||||
// adjust claim blocks
|
||||
for (Claim claim : allowedClaims) {
|
||||
if (claim.isSubdivision() || claim.isAdminClaim() || claim.isWilderness()) {
|
||||
continue;
|
||||
}
|
||||
final double abandonReturnRatio = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Double.class), user, Options.ABANDON_RETURN_RATIO, claim);
|
||||
if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) {
|
||||
refund += claim.getClaimBlocks() * abandonReturnRatio;
|
||||
} else {
|
||||
playerData.setAccruedClaimBlocks(playerData.getAccruedClaimBlocks() - ((int) Math.ceil(claim.getClaimBlocks() * (1 - abandonReturnRatio))));
|
||||
}
|
||||
}
|
||||
|
||||
//playerData.useRestoreSchematic = event.isRestoring();
|
||||
GriefDefenderPlugin.getInstance().dataStore.abandonClaimsForPlayer(user, allowedClaims);
|
||||
//playerData.useRestoreSchematic = false;
|
||||
playerData.onClaimDelete();
|
||||
|
||||
if (GriefDefenderPlugin.getInstance().isEconomyModeEnabled()) {
|
||||
final Account playerAccount = GriefDefenderPlugin.getInstance().economyService.get().getOrCreateAccount(playerData.playerID).orElse(null);
|
||||
if (playerAccount == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Currency defaultCurrency = GriefDefenderPlugin.getInstance().economyService.get().getDefaultCurrency();
|
||||
final TransactionResult result = playerAccount.deposit(defaultCurrency, BigDecimal.valueOf(refund), Sponge.getCauseStackManager().getCurrentCause());
|
||||
if (result.getResult() == ResultType.SUCCESS) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS, ImmutableMap.of(
|
||||
"amount", TextComponent.of(String.valueOf(refund))));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
}
|
||||
} else {
|
||||
int remainingBlocks = playerData.getRemainingClaimBlocks();
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS_WORLD, ImmutableMap.of(
|
||||
"world", world.getWorldName(),
|
||||
"amount", remainingBlocks));
|
||||
TextAdapter.sendComponent(player, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_WORLD_SUCCESS, ImmutableMap.of(
|
||||
"world", world.getWorldName()));
|
||||
TextAdapter.sendComponent(source, message);
|
||||
};
|
||||
}
|
||||
}
|
@ -29,6 +29,7 @@
|
||||
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;
|
||||
|
||||
@ -37,73 +38,142 @@
|
||||
import com.griefdefender.GDPlayerData;
|
||||
import com.griefdefender.GriefDefenderPlugin;
|
||||
import com.griefdefender.api.GriefDefender;
|
||||
import com.griefdefender.api.claim.Claim;
|
||||
import com.griefdefender.cache.MessageCache;
|
||||
import com.griefdefender.cache.PermissionHolderCache;
|
||||
import com.griefdefender.claim.GDClaimManager;
|
||||
import com.griefdefender.configuration.MessageStorage;
|
||||
import com.griefdefender.event.GDCauseStackManager;
|
||||
import com.griefdefender.event.GDRemoveClaimEvent;
|
||||
import com.griefdefender.permission.GDPermissionUser;
|
||||
import com.griefdefender.permission.GDPermissions;
|
||||
import com.griefdefender.text.action.GDCallbackHolder;
|
||||
import com.griefdefender.util.PermissionUtil;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import net.kyori.text.event.ClickEvent;
|
||||
import net.kyori.text.event.HoverEvent;
|
||||
import net.kyori.text.format.TextColor;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.entity.living.player.User;
|
||||
import org.spongepowered.api.world.storage.WorldProperties;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@CommandAlias("%griefdefender")
|
||||
@CommandPermission(GDPermissions.COMMAND_DELETE_CLAIMS)
|
||||
public class CommandClaimDeleteAll extends BaseCommand {
|
||||
|
||||
@CommandCompletion("@gdplayers @gddummy")
|
||||
@CommandCompletion("@gdplayers @gdworlds @gddummy")
|
||||
@CommandAlias("deleteall")
|
||||
@Description("Delete all of another player's claims.")
|
||||
@Syntax("<player>")
|
||||
@Syntax("<player> [<world>]")
|
||||
@Subcommand("delete all")
|
||||
public void execute(Player src, User otherPlayer) {
|
||||
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(src.getWorld(), otherPlayer.getUniqueId());
|
||||
public void execute(Player src, String otherPlayer, @Optional String worldName) {
|
||||
final UUID playerUniqueId = PermissionUtil.getInstance().lookupUserUniqueId(otherPlayer);
|
||||
if (playerUniqueId == null) {
|
||||
GriefDefenderPlugin.sendMessage(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER,
|
||||
ImmutableMap.of(
|
||||
"player", otherPlayer)));
|
||||
return;
|
||||
}
|
||||
|
||||
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(playerUniqueId);
|
||||
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(src.getWorld(), user.getUniqueId());
|
||||
int originalClaimCount = playerData.getInternalClaims().size();
|
||||
WorldProperties worldProperties = null;
|
||||
if (worldName != null) {
|
||||
worldProperties = Sponge.getServer().getWorldProperties(worldName).orElse(null);
|
||||
if (worldProperties == null) {
|
||||
TextAdapter.sendComponent(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND,
|
||||
ImmutableMap.of("world", worldName)));
|
||||
return;
|
||||
}
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(worldProperties.getUniqueId());
|
||||
final Set<Claim> claims = claimManager.getPlayerClaims(user.getUniqueId());
|
||||
if (claims == null || claims.isEmpty()) {
|
||||
originalClaimCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (originalClaimCount == 0) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLAYER_NO_CLAIMS_TO_DELETE, ImmutableMap.of(
|
||||
"player", otherPlayer.getName()));
|
||||
"player", user.getFriendlyName()));
|
||||
TextAdapter.sendComponent(src, message);
|
||||
return;
|
||||
}
|
||||
|
||||
Component message = null;
|
||||
if (worldProperties != null) {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_WARNING_WORLD, ImmutableMap.of(
|
||||
"player", TextComponent.of(user.getFriendlyName()).color(TextColor.AQUA),
|
||||
"world", worldProperties.getWorldName()));
|
||||
} else {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_WARNING, ImmutableMap.of(
|
||||
"player", TextComponent.of(user.getFriendlyName()).color(TextColor.AQUA)));
|
||||
}
|
||||
final Component confirmationText = TextComponent.builder("")
|
||||
.append(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_WARNING,
|
||||
ImmutableMap.of("player", TextComponent.of(otherPlayer.getName()).color(TextColor.AQUA))))
|
||||
.append(message)
|
||||
.append(TextComponent.builder()
|
||||
.append("\n[")
|
||||
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
|
||||
.append("]\n")
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(src, createConfirmationConsumer(src, otherPlayer, playerData), true)))
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(src, createConfirmationConsumer(src, user, worldProperties), true)))
|
||||
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
|
||||
.build();
|
||||
TextAdapter.sendComponent(src, confirmationText);
|
||||
}
|
||||
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player src, User otherPlayer, GDPlayerData playerData) {
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player src, GDPermissionUser otherPlayer, WorldProperties worldProperties) {
|
||||
return confirm -> {
|
||||
GDCauseStackManager.getInstance().pushCause(src);
|
||||
GDRemoveClaimEvent.Delete event = new GDRemoveClaimEvent.Delete(ImmutableList.copyOf(playerData.getInternalClaims()));
|
||||
Set<Claim> claims;
|
||||
if (worldProperties != null) {
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(worldProperties.getUniqueId());
|
||||
claims = new HashSet<>(claimManager.getInternalPlayerClaims(otherPlayer.getUniqueId()));
|
||||
final Iterator<Claim> iterator = claims.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
final Claim claim = iterator.next();
|
||||
if (!claim.getWorldUniqueId().equals(worldProperties.getUniqueId())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
claims = otherPlayer.getInternalPlayerData().getInternalClaims();
|
||||
}
|
||||
if (claims.isEmpty()) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLAYER_NO_CLAIMS_TO_DELETE, ImmutableMap.of(
|
||||
"player", otherPlayer.getFriendlyName()));
|
||||
TextAdapter.sendComponent(src, message);
|
||||
return;
|
||||
}
|
||||
GDRemoveClaimEvent.Delete event = new GDRemoveClaimEvent.Delete(ImmutableList.copyOf(claims));
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
if (event.cancelled()) {
|
||||
GriefDefenderPlugin.sendMessage(src, event.getMessage().orElse(MessageCache.getInstance().PLUGIN_EVENT_CANCEL));
|
||||
return;
|
||||
}
|
||||
|
||||
GriefDefenderPlugin.getInstance().dataStore.deleteClaimsForPlayer(otherPlayer.getUniqueId());
|
||||
playerData.onClaimDelete();
|
||||
final UUID worldUniqueId = worldProperties != null ? worldProperties.getUniqueId() : null;
|
||||
GriefDefenderPlugin.getInstance().dataStore.deleteClaimsForPlayer(otherPlayer.getUniqueId(), worldUniqueId);
|
||||
otherPlayer.getInternalPlayerData().onClaimDelete();
|
||||
if (src != null) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_SUCCESS, ImmutableMap.of(
|
||||
"player", TextComponent.of(otherPlayer.getName()).color(TextColor.AQUA)));
|
||||
Component message = null;
|
||||
if (worldProperties != null) {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_SUCCESS_WORLD, ImmutableMap.of(
|
||||
"player", TextComponent.of(otherPlayer.getName()).color(TextColor.AQUA),
|
||||
"world", worldProperties.getWorldName()));
|
||||
} else {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_SUCCESS, ImmutableMap.of(
|
||||
"player", TextComponent.of(otherPlayer.getName()).color(TextColor.AQUA)));
|
||||
}
|
||||
GriefDefenderPlugin.sendMessage(src, message);
|
||||
}
|
||||
};
|
||||
|
@ -28,7 +28,9 @@
|
||||
import co.aikar.commands.annotation.CommandAlias;
|
||||
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 com.google.common.collect.ImmutableMap;
|
||||
import com.griefdefender.GDPlayerData;
|
||||
import com.griefdefender.GriefDefenderPlugin;
|
||||
@ -38,15 +40,19 @@
|
||||
import com.griefdefender.configuration.MessageStorage;
|
||||
import com.griefdefender.permission.GDPermissions;
|
||||
import com.griefdefender.text.action.GDCallbackHolder;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import net.kyori.text.event.ClickEvent;
|
||||
import net.kyori.text.event.HoverEvent;
|
||||
import net.kyori.text.format.TextColor;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.world.storage.WorldProperties;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@CommandAlias("%griefdefender")
|
||||
@ -56,23 +62,42 @@ public class CommandClaimDeleteAllAdmin extends BaseCommand {
|
||||
@CommandAlias("deletealladmin")
|
||||
@Description("Deletes all administrative claims.")
|
||||
@Subcommand("delete alladmin")
|
||||
public void execute(Player player) {
|
||||
public void execute(Player player, @Optional String worldName) {
|
||||
WorldProperties worldProperties = null;
|
||||
if (worldName != null) {
|
||||
worldProperties = Sponge.getServer().getWorldProperties(worldName).orElse(null);
|
||||
if (worldProperties == null) {
|
||||
TextAdapter.sendComponent(player, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_WORLD_NOT_FOUND,
|
||||
ImmutableMap.of("world", worldName)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Component message = null;
|
||||
if (worldProperties != null) {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_WARNING_WORLD, ImmutableMap.of(
|
||||
"type", TextComponent.of("ADMIN").color(TextColor.RED),
|
||||
"world", worldProperties.getWorldName()));
|
||||
} else {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_WARNING, ImmutableMap.of(
|
||||
"type", TextComponent.of("ADMIN").color(TextColor.RED)));
|
||||
}
|
||||
final Component confirmationText = TextComponent.builder("")
|
||||
.append(GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_WARNING,
|
||||
ImmutableMap.of("type", TextComponent.of("ADMIN").color(TextColor.RED))))
|
||||
.append(message)
|
||||
.append(TextComponent.builder()
|
||||
.append("\n[")
|
||||
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
|
||||
.append("]\n")
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player), true)))
|
||||
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(player, createConfirmationConsumer(player, worldProperties), true)))
|
||||
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
|
||||
.build();
|
||||
TextAdapter.sendComponent(player, confirmationText);
|
||||
}
|
||||
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player player) {
|
||||
private static Consumer<CommandSource> createConfirmationConsumer(Player player, WorldProperties worldProperties) {
|
||||
return confirm -> {
|
||||
ClaimResult claimResult = GriefDefenderPlugin.getInstance().dataStore.deleteAllAdminClaims(player, player.getWorld());
|
||||
final UUID worldUniqueId = worldProperties != null ? worldProperties.getUniqueId() : null;
|
||||
ClaimResult claimResult = GriefDefenderPlugin.getInstance().dataStore.deleteAllAdminClaims(player, worldUniqueId);
|
||||
if (!claimResult.successful()) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_TYPE_NOT_FOUND,
|
||||
ImmutableMap.of(
|
||||
@ -81,8 +106,17 @@ private static Consumer<CommandSource> createConfirmationConsumer(Player player)
|
||||
return;
|
||||
}
|
||||
|
||||
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_SUCCESS,
|
||||
ImmutableMap.of("type", TextComponent.of("ADMIN").color(TextColor.RED))));
|
||||
Component message = null;
|
||||
if (worldProperties != null) {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_SUCCESS_WORLD, ImmutableMap.of(
|
||||
"type", TextComponent.of("ADMIN").color(TextColor.RED),
|
||||
"world", worldProperties.getWorldName()));
|
||||
} else {
|
||||
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_SUCCESS, ImmutableMap.of(
|
||||
"type", TextComponent.of("ADMIN").color(TextColor.RED)));
|
||||
}
|
||||
|
||||
TextAdapter.sendComponent(player, message);
|
||||
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
|
||||
playerData.onClaimDelete();
|
||||
};
|
||||
|
@ -88,10 +88,14 @@ public class MessageStorage {
|
||||
public static String DESCRIPTION_PLAYER_INFO = "player-info";
|
||||
|
||||
// messages with parameters
|
||||
public static final String ABANDON_ALL_WARNING_WORLD = "abandon-all-warning-world";
|
||||
public static final String ABANDON_CLAIM_DELAY_WARNING = "abandon-claim-delay-warning";
|
||||
public static final String ABANDON_FAILED = "abandon-failed";
|
||||
public static final String ABANDON_OTHER_SUCCESS = "abandon-other-success";
|
||||
public static final String ABANDON_SUCCESS = "abandon-success";
|
||||
public static final String ABANDON_SUCCESS_WORLD = "abandon-success";
|
||||
public static final String ABANDON_WORLD_SUCCESS = "abandon-world-success";
|
||||
public static final String ABANDON_WORLD_WARNING = "abandon-world-warning";
|
||||
public static final String ADJUST_ACCRUED_BLOCKS_SUCCESS = "adjust-accrued-blocks-success";
|
||||
public static final String ADJUST_BONUS_BLOCKS_SUCCESS = "adjust-bonus-blocks-success";
|
||||
public static final String BANK_DEPOSIT = "bank-deposit";
|
||||
@ -165,9 +169,13 @@ public class MessageStorage {
|
||||
public static final String DEBUG_ERROR_UPLOAD = "debug-error-upload";
|
||||
public static final String DELETE_ALL_TYPE_DENY = "delete-all-type-deny";
|
||||
public static final String DELETE_ALL_TYPE_SUCCESS = "delete-all-type-success";
|
||||
public static final String DELETE_ALL_TYPE_SUCCESS_WORLD = "delete-all-type-success-world";
|
||||
public static final String DELETE_ALL_TYPE_WARNING = "delete-all-type-warning";
|
||||
public static final String DELETE_ALL_TYPE_WARNING_WORLD = "delete-all-type-warning-world";
|
||||
public static final String DELETE_ALL_PLAYER_SUCCESS = "delete-all-player-success";
|
||||
public static final String DELETE_ALL_PLAYER_SUCCESS_WORLD = "delete-all-player-success-world";
|
||||
public static final String DELETE_ALL_PLAYER_WARNING = "delete-all-player-warning";
|
||||
public static final String DELETE_ALL_PLAYER_WARNING_WORLD = "delete-all-player-warning-world";
|
||||
public static final String DELETE_CLAIM_SUCCESS = "delete-claim-success";
|
||||
public static final String DELETE_CLAIM_WARNING = "delete-claim-warning";
|
||||
public static final String ECONOMY_BLOCK_AVAILABLE_PURCHASE_2D = "economy-block-available-purchase-2d";
|
||||
@ -178,6 +186,7 @@ public class MessageStorage {
|
||||
public static final String ECONOMY_BLOCK_SALE_CONFIRMATION = "economy-block-sale-confirmation";
|
||||
public static final String ECONOMY_BLOCK_SELL_ERROR = "economy-block-sell-error";
|
||||
public static final String ECONOMY_CLAIM_ABANDON_SUCCESS = "economy-claim-abandon-success";
|
||||
public static final String ECONOMY_CLAIM_ABANDON_SUCCESS_WORLD = "economy-claim-abandon-success-world";
|
||||
public static final String ECONOMY_CLAIM_BUY_CANCELLED = "economy-claim-buy-cancelled";
|
||||
public static final String ECONOMY_CLAIM_BUY_CONFIRMATION = "economy-claim-buy-confirmation";
|
||||
public static final String ECONOMY_CLAIM_BUY_CONFIRMED = "economy-claim-buy-confirmed";
|
||||
@ -310,6 +319,7 @@ public class MessageStorage {
|
||||
public static final String RESULT_TYPE_NO_CHILDREN = "result-type-no-children";
|
||||
public static final String RESULT_TYPE_ONLY_SUBDIVISION = "result-type-only-subdivision";
|
||||
public static final String RESULT_TYPE_REQUIRES_OWNER = "result-type-requires-owner";
|
||||
public static final String SCHEMATIC_ABANDON_ALL_RESTORE_WARNING_WORLD = "schematic-abandon-all-restore-warning-world";
|
||||
public static final String SCHEMATIC_DELETED = "schematic-deleted";
|
||||
public static final String SCHEMATIC_NONE = "schematic-none";
|
||||
public static final String SCHEMATIC_RESTORE_CLICK = "schematic-restore-click";
|
||||
|
@ -34,6 +34,8 @@ public class VisualCategory extends ConfigCategory {
|
||||
|
||||
@Setting(value = "hide-borders-when-using-wecui", comment = "Whether to hide the glowstone/gold block borders when using WECUI.")
|
||||
public boolean hideBorders = false;
|
||||
@Setting(value = "hide-fillers-when-using-wecui", comment = "Whether to hide the block fillers when using WECUI.")
|
||||
public boolean hideFillers = false;
|
||||
@Setting(value = "hide-wecui-drag-visuals-2d", comment = "Whether drag visuals should be shown while creating a claim in 2D mode.")
|
||||
public boolean hideDrag2d = true;
|
||||
@Setting(value = "client-visuals-per-tick", comment = "The amount of block visuals a client can receive per tick when showing/hiding claims. Default: 12")
|
||||
|
@ -247,7 +247,7 @@ public boolean onEntityMove(MoveEntityEvent event, Location<World> fromLocation,
|
||||
final boolean showGpPrefix = GriefDefenderPlugin.getGlobalConfig().getConfig().message.enterExitShowGdPrefix;
|
||||
if (player != null) {
|
||||
TextComponent welcomeMessage = (TextComponent) gpEvent.getEnterMessage().orElse(null);
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty()) && !welcomeMessage.content().equals("")) {
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty()) && !fromClaim.isParent(toClaim)) {
|
||||
ChatType chatType = gpEvent.getEnterMessageChatType();
|
||||
if (showGpPrefix) {
|
||||
TextAdapter.sendComponent(player, TextComponent.builder("")
|
||||
@ -352,7 +352,7 @@ public boolean onEntityMove(MoveEntityEvent event, Location<World> fromLocation,
|
||||
final GDPlayerData playerData = user.getInternalPlayerData();
|
||||
final boolean showGpPrefix = GriefDefenderPlugin.getGlobalConfig().getConfig().message.enterExitShowGdPrefix;
|
||||
Component welcomeMessage = gpEvent.getEnterMessage().orElse(null);
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty())) {
|
||||
if (welcomeMessage != null && !welcomeMessage.equals(TextComponent.empty()) && !fromClaim.isParent(toClaim)) {
|
||||
ChatType chatType = gpEvent.getEnterMessageChatType();
|
||||
if (showGpPrefix) {
|
||||
TextAdapter.sendComponent(player, TextComponent.builder("")
|
||||
@ -365,7 +365,7 @@ public boolean onEntityMove(MoveEntityEvent event, Location<World> fromLocation,
|
||||
}
|
||||
|
||||
Component farewellMessage = gpEvent.getExitMessage().orElse(null);
|
||||
if (farewellMessage != null && farewellMessage != TextComponent.empty() && !toClaim.isParent(fromClaim)) {
|
||||
if (farewellMessage != null && !farewellMessage.equals(TextComponent.empty()) && !toClaim.isParent(fromClaim)) {
|
||||
ChatType chatType = gpEvent.getExitMessageChatType();
|
||||
if (showGpPrefix) {
|
||||
TextAdapter.sendComponent(player, TextComponent.builder("")
|
||||
|
@ -140,6 +140,7 @@ public class GDPermissions {
|
||||
public static final String CLAIM_RESIZE_BASIC = "griefdefender.admin.claim.resize.basic";
|
||||
public static final String CLAIM_RESIZE_BASIC_SUBDIVISION = "griefdefender.admin.claim.resize.basic.subdivision";
|
||||
public static final String CLAIM_RESIZE_TOWN = "griefdefender.admin.claim.resize.town";
|
||||
public static final String COMMAND_ABANDON_WORLD_CLAIMS = "griefdefender.admin.claim.command.abandon-world";
|
||||
public static final String COMMAND_ADJUST_CLAIM_BLOCKS = "griefdefender.admin.claim.command.adjust-claim-blocks";
|
||||
public static final String COMMAND_ADMIN_CLAIMS = "griefdefender.admin.claim.command.admin-mode";
|
||||
public static final String COMMAND_ADMIN_DEBUG = "griefdefender.admin.claim.command.debug";
|
||||
|
@ -65,6 +65,7 @@
|
||||
import net.kyori.text.format.TextColor;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.world.Location;
|
||||
import org.spongepowered.api.world.World;
|
||||
import org.spongepowered.api.world.storage.WorldProperties;
|
||||
@ -153,8 +154,11 @@ public ClaimResult createClaim(World world, Vector3i point1, Vector3i point2, Cl
|
||||
return claimResult;
|
||||
}
|
||||
|
||||
public ClaimResult deleteAllAdminClaims(CommandSource src, World world) {
|
||||
GDClaimManager claimWorldManager = this.claimWorldManagers.get(world.getProperties().getUniqueId());
|
||||
public ClaimResult deleteAllAdminClaims(Player source, UUID worldUniqueId) {
|
||||
if (worldUniqueId == null) {
|
||||
worldUniqueId = source.getWorld().getUniqueId();
|
||||
}
|
||||
GDClaimManager claimWorldManager = this.claimWorldManagers.get(worldUniqueId);
|
||||
if (claimWorldManager == null) {
|
||||
return new GDClaimResult(ClaimResultType.CLAIMS_DISABLED);
|
||||
}
|
||||
@ -162,6 +166,9 @@ public ClaimResult deleteAllAdminClaims(CommandSource src, World world) {
|
||||
List<Claim> claimsToDelete = new ArrayList<Claim>();
|
||||
boolean adminClaimFound = false;
|
||||
for (Claim claim : claimWorldManager.getWorldClaims()) {
|
||||
if (worldUniqueId != null && !claim.getWorldUniqueId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
if (claim.isAdminClaim()) {
|
||||
claimsToDelete.add(claim);
|
||||
adminClaimFound = true;
|
||||
@ -172,7 +179,7 @@ public ClaimResult deleteAllAdminClaims(CommandSource src, World world) {
|
||||
return new GDClaimResult(ClaimResultType.CLAIM_NOT_FOUND);
|
||||
}
|
||||
|
||||
GDCauseStackManager.getInstance().pushCause(src);
|
||||
GDCauseStackManager.getInstance().pushCause(source);
|
||||
GDRemoveClaimEvent.Delete event = new GDRemoveClaimEvent.Delete(ImmutableList.copyOf(claimsToDelete));
|
||||
GriefDefender.getEventManager().post(event);
|
||||
GDCauseStackManager.getInstance().popCause();
|
||||
@ -205,19 +212,36 @@ public void abandonClaimsForPlayer(GDPermissionUser user, Set<Claim> claimsToDel
|
||||
}
|
||||
|
||||
public void deleteClaimsForPlayer(UUID playerID) {
|
||||
this.deleteClaimsForPlayer(playerID, null);
|
||||
}
|
||||
|
||||
public void deleteClaimsForPlayer(UUID playerID, UUID worldUniqueId) {
|
||||
if (BaseStorage.USE_GLOBAL_PLAYER_STORAGE && playerID != null) {
|
||||
final GDPlayerData playerData = BaseStorage.GLOBAL_PLAYER_DATA.get(playerID);
|
||||
List<Claim> claimsToDelete = new ArrayList<>(playerData.getInternalClaims());
|
||||
Set<Claim> claims = new HashSet<>();
|
||||
if (worldUniqueId != null) {
|
||||
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(worldUniqueId);
|
||||
claims = claimManager.getInternalPlayerClaims(playerID);
|
||||
} else {
|
||||
final GDPlayerData playerData = BaseStorage.GLOBAL_PLAYER_DATA.get(playerID);
|
||||
claims = playerData.getInternalClaims();
|
||||
}
|
||||
List<Claim> claimsToDelete = new ArrayList<>(claims);
|
||||
for (Claim claim : claimsToDelete) {
|
||||
if (worldUniqueId != null && !claim.getWorldUniqueId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
GDClaimManager claimWorldManager = this.claimWorldManagers.get(claim.getWorldUniqueId());
|
||||
claimWorldManager.deleteClaimInternal(claim, true);
|
||||
claims.remove(claim);
|
||||
}
|
||||
|
||||
playerData.getInternalClaims().clear();
|
||||
return;
|
||||
}
|
||||
|
||||
for (GDClaimManager claimWorldManager : this.claimWorldManagers.values()) {
|
||||
if (worldUniqueId != null && !claimWorldManager.getWorldId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
Set<Claim> claims = claimWorldManager.getInternalPlayerClaims(playerID);
|
||||
if (playerID == null) {
|
||||
claims = claimWorldManager.getWorldClaims();
|
||||
@ -228,6 +252,9 @@ public void deleteClaimsForPlayer(UUID playerID) {
|
||||
|
||||
List<Claim> claimsToDelete = new ArrayList<Claim>();
|
||||
for (Claim claim : claims) {
|
||||
if (worldUniqueId != null && !claim.getWorldUniqueId().equals(worldUniqueId)) {
|
||||
continue;
|
||||
}
|
||||
if (!claim.isAdminClaim()) {
|
||||
claimsToDelete.add(claim);
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter-sponge:1.12.2",
|
||||
"sha1": "adc9ccc6363cd932728803bd7a47195d81ca22df",
|
||||
"path": "com/griefdefender/adapter-sponge/1.12.2-SNAPSHOT/adapter-sponge-1.12.2-20200620.004815-11.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter-sponge/1.12.2-SNAPSHOT/adapter-sponge-1.12.2-20200620.004815-11.jar"
|
||||
"sha1": "7ae27ff6509c58ed1eacc552fc98f517e92d9fed",
|
||||
"path": "com/griefdefender/adapter-sponge/1.12.2-SNAPSHOT/adapter-sponge-1.12.2-20200627.042712-12.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter-sponge/1.12.2-SNAPSHOT/adapter-sponge-1.12.2-20200627.042712-12.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
@ -102,18 +102,18 @@
|
||||
"url": "https://repo1.maven.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okhttp3:okhttp:3.14.2",
|
||||
"sha1": "eaed79ed6bc1e14fad462172b6a09524545b165c",
|
||||
"path": "com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar",
|
||||
"name": "com.squareup.okhttp3:okhttp:4.7.2",
|
||||
"sha1": "c9acfd63537db1d7d21d98a7405e22449bb881d6",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar",
|
||||
"relocate": "okhttp3:okhttp3",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.7.2/okhttp-4.7.2.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.squareup.okio:okio:2.2.2",
|
||||
"sha1": "36f483536153f15339a8b48d508e22be7c9c531a",
|
||||
"path": "com/squareup/okio/okio/2.2.2/okio-2.2.2.jar",
|
||||
"name": "com.squareup.okio:okio:2.6.0",
|
||||
"sha1": "0f06923d428f3c8e6f571043ec29a45d0cd9d2bf",
|
||||
"path": "com/squareup/okio/okio/2.6.0/okio-2.6.0.jar",
|
||||
"relocate": "okio:okio",
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
|
||||
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.6.0/okio-2.6.0.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
|
||||
@ -179,11 +179,11 @@
|
||||
"url": "https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar"
|
||||
},
|
||||
{
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.31",
|
||||
"sha1": "11289d20fd95ae219333f3456072be9f081c30cc",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar",
|
||||
"relocate": "org.jetbrains:jetbrains",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.jar"
|
||||
"name": "org.jetbrains.kotlin:kotlin-stdlib:1.3.72",
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar",
|
||||
"relocate": "kotlin:kotlin",
|
||||
"url": "https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.jar"
|
||||
},
|
||||
{
|
||||
"name": "net.kyori:event-api:3.0.0",
|
||||
|
Loading…
Reference in New Issue
Block a user