Update for 1.4.2 release.

* Fix entity damage not passing source in all cases.
* Fix vehicle destroy source.
* Fix collision interactions being ignored.
* Fix #vehicle context not being added on vehicle item use.
* Fix 'any' context showing up as 'all'.
* Fix context entity type format using '#' in front of name instead of modid.
* Fix parent exit claim messages showing on subclaims.
* Fix block-place using wrong target in some cases.
* Fix NPE during chunk load on new world creation.
* Fix claim resize/subdivide resetting on error.
* Fix offline players not being found with some commands.
* Fix NPE in migrator during claim migration of subclaims.
* Fix accrued blocks not being set for players if value exceeded max during migration.
* Fix playerdata migrate file not being created if parent folder did not exist.
* Fix hover contexts for partial results in flag GUI.
* Fix #pet tag not being formatted properly with contexts.
* Fix entity-damage used_item context not being added.
* Add new group context #hanging which represents hanging entities such as item frames.
* Add lava source to fire-spread flag definition.
* Add user context support for advanced flag GUI.
* Add endercrystal-use and armorstand-use definitions.
* Add entity-damage-source-blacklist.
* Add active claim visual time to config.
* Add tag support for used_item.
* Add visual tracking for create block visuals.
* (Bukkit) Add extra permission check when using item on a block.
* Add gd_claim_override=claim context to water-flow flag definition.
* Add new admin command '/abandonworld [<world>]' which will abandon all user claims in world specified.
* Add support for world argument in commands '/abandonall', '/deleteall', and '/deletealladmin'.
* Add MC 1.16.1 support.
* Update kyori libraries to latest.
* Don't process stair blocks on right-click.
* Refactor ADMIN group handling in PRESET GUI.
   - All ADMIN flags will now be forced to claim only.
   - If you want to change flags globally then simply provide a default context in the definition which will be applied at startup.
* Cleanup USER PRESET hover for normal users.
* Improve persistent check done if a user is trusted.
   - Only non-claim owners that are trusted will have an additional permission check to see if an admin denied/allowed something via a flag not given by trust system.
* (Hybrid) Add mod registry support for hybrid servers.
* (Hybrid) Add mod category to 'global.conf' to identify fakeplayers and mod id's.
* (Hybrid) Add initial fakeplayer support.
* (Hybrid) Added pixelmon animal support.
* (Hybrid) Added #pixelmon:animal tag for natural spawns.
* Check user/group permission excluding default group before trust is checked.
  Note: This allows admins to allow/deny permissions while using trust.
  Note: Only '/cfp' and '/cfg' is supported.
* Only check persistent permissions with overrides.
* Change user context to support all claim types except wilderness.
* Change global context to support all claim types including wilderness.
* Rename /cfd command to /cfdebug to avoid accidental use.
* Disable /cfdebug on logout.
This commit is contained in:
bloodshot 2020-06-25 03:15:24 -04:00
parent 1639945a1d
commit 343dfe9566
117 changed files with 3206 additions and 1723 deletions

View File

@ -116,7 +116,7 @@ dependencies {
compileOnly "net.ess3:EssentialsX:2.17.1"
compileOnly "net.milkbowl.vault:VaultAPI:1.7"
compileOnly "us.dynmap:dynmap-api:3.0-SNAPSHOT"
compileOnly "net.luckperms:api:5.0"
compileOnly "com.github.lucko:luckperms:master-SNAPSHOT"
// Libs
compileOnly "aopalliance:aopalliance:1.0"
compileOnly "co.aikar:acf-core:0.5.0-SNAPSHOT"

View File

@ -66,6 +66,13 @@ public static GDBootstrap getInstance() {
@Override
public void onEnable() {
// check if reload
if (instance != null) {
instance = this;
GriefDefenderPlugin.getInstance().onEnable(true);
return;
}
instance = this;
final JSONParser parser = new JSONParser();
String bukkitJsonVersion = null;
@ -86,8 +93,10 @@ public void onEnable() {
bukkitJsonVersion = "1.15.2";
} else if (Bukkit.getVersion().contains("1.15")) {
bukkitJsonVersion = "1.15";
} else if (Bukkit.getVersion().contains("1.16.1")) {
bukkitJsonVersion = "1.16.1";
} else {
this.getLogger().severe("Detected unsupported version '" + Bukkit.getVersion() + "'. GriefDefender only supports 1.8.8, 1.12.2, 1.13.2, 1.14.x, 1.15.0-1.15.2. GriefDefender will NOT load.");
this.getLogger().severe("Detected unsupported version '" + Bukkit.getVersion() + "'. GriefDefender only supports 1.8.8, 1.12.2, 1.13.2, 1.14.x, 1.15.0-1.15.2, 1.16.1. GriefDefender will NOT load.");
return;
}
try {

View File

@ -114,7 +114,7 @@ public GDDebugData(CommandSender source, String filter, boolean verbose) {
this.header.add("### Metadata");
this.header.add("| Key | Value |");
this.header.add("|-----|-------|");
this.header.add("| GD Version | " + GriefDefenderPlugin.IMPLEMENTATION_VERSION + "|");
this.header.add("| GD Version | " + GDBootstrap.getInstance().getDescription().getVersion() + "|");
this.header.add("| Bukkit Version | " + Bukkit.getVersion() + "|");
final Plugin lpContainer = Bukkit.getPluginManager().getPlugin("luckperms");
if (lpContainer != null) {
@ -142,12 +142,8 @@ public void addRecord(String flag, String trust, String source, String target, S
.append("Pasting output...", TextColor.GREEN).build());
this.pasteRecords();
this.records.clear();
if (this.user != null) {
GriefDefenderPlugin.getInstance().getDebugUserMap().remove(this.user.getName());
}
if (GriefDefenderPlugin.getInstance().getDebugUserMap().isEmpty()) {
GriefDefenderPlugin.debugActive = false;
}
GriefDefenderPlugin.getInstance().getDebugUserMap().clear();
GriefDefenderPlugin.debugActive = false;
TextAdapter.sendComponent(this.source, TextComponent.builder("").append(GD_TEXT).append("Debug ", TextColor.GRAY).append("OFF", TextColor.RED).build());
}
}

View File

@ -34,8 +34,6 @@
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Consumer;
import org.bukkit.Bukkit;
@ -73,6 +71,7 @@
import com.griefdefender.permission.option.GDOptions;
import com.griefdefender.provider.VaultProvider;
import com.griefdefender.storage.BaseStorage;
import com.griefdefender.task.ClaimVisualRevertTask;
import com.griefdefender.util.PermissionUtil;
import net.kyori.text.Component;
@ -95,6 +94,8 @@ public class GDPlayerData implements PlayerData {
public GDClaim claimResizing;
public GDClaim claimSubdividing;
public Map<UUID, Runnable> createBlockVisualRevertRunnables = new HashMap<>();
public Map<UUID, List<BlockTransaction>> createBlockVisualTransactions = new HashMap<>();
public Map<UUID, BukkitTask> claimVisualRevertTasks = new HashMap<>();
public Map<UUID, List<BlockTransaction>> visualClaimBlocks = new HashMap<>();
public List<BlockSnapshot> queuedVisuals = new ArrayList<>();
@ -256,6 +257,9 @@ public String getName() {
@Override
public void revertAllVisuals() {
this.lastShovelLocation = null;
this.claimResizing = null;
this.claimSubdividing = null;
final Player player = this.getSubject().getOnlinePlayer();
if (player == null) {
return;
@ -277,6 +281,10 @@ public void revertAllVisuals() {
GriefDefenderPlugin.getInstance().getWorldEditProvider().revertAllVisuals(this.playerID);
}
// Revert any temp visuals
this.revertTempVisuals();
}
public void revertTempVisuals() {
if (this.tempVisualUniqueId != null) {
this.revertClaimVisual(null, this.tempVisualUniqueId);
this.tempVisualUniqueId = null;
@ -318,12 +326,24 @@ public void revertClaimVisual(GDClaim claim, UUID visualUniqueId) {
}
private void revertVisualBlocks(Player player, GDClaim claim, UUID visualUniqueId) {
this.lastShovelLocation = null;
final List<BlockTransaction> visualTransactions = this.visualClaimBlocks.get(visualUniqueId);
if (visualTransactions == null || visualTransactions.isEmpty()) {
return;
}
// Gather create block visuals
final List<BlockTransaction> createBlockVisualTransactions = new ArrayList<>();
for (Runnable runnable : this.createBlockVisualRevertRunnables.values()) {
final ClaimVisualRevertTask revertTask = (ClaimVisualRevertTask) runnable;
if (revertTask.getVisualUniqueId().equals(visualUniqueId)) {
continue;
}
final List<BlockTransaction> blockTransactions = this.createBlockVisualTransactions.get(revertTask.getVisualUniqueId());
if (blockTransactions != null) {
createBlockVisualTransactions.addAll(blockTransactions);
}
}
for (int i = 0; i < visualTransactions.size(); i++) {
BlockSnapshot snapshot = visualTransactions.get(i).getOriginal();
// If original block does not exist, do not send to player
@ -333,6 +353,16 @@ private void revertVisualBlocks(Player player, GDClaim claim, UUID visualUniqueI
}
continue;
}
boolean ignoreVisual = false;
for (BlockTransaction createVisualTransaction : createBlockVisualTransactions) {
if (createVisualTransaction.getOriginal().getLocation().equals(snapshot.getLocation())) {
ignoreVisual = true;
break;
}
}
if (ignoreVisual) {
continue;
}
NMSUtil.getInstance().sendBlockChange(player, snapshot);
}
if (claim != null) {
@ -341,11 +371,8 @@ private void revertVisualBlocks(Player player, GDClaim claim, UUID visualUniqueI
this.claimVisualRevertTasks.remove(visualUniqueId);
this.visualClaimBlocks.remove(visualUniqueId);
// Revert any temp visuals
if (this.tempVisualUniqueId != null) {
this.revertClaimVisual(null, this.tempVisualUniqueId);
this.tempVisualUniqueId = null;
}
this.createBlockVisualRevertRunnables.remove(visualUniqueId);
this.createBlockVisualTransactions.remove(visualUniqueId);
}
@Override
@ -491,7 +518,11 @@ public boolean addAccruedClaimBlocks(int newAccruedClaimBlocks) {
}
public boolean setAccruedClaimBlocks(int newAccruedClaimBlocks) {
if (newAccruedClaimBlocks > this.getMaxAccruedClaimBlocks()) {
return this.setAccruedClaimBlocks(newAccruedClaimBlocks, true);
}
public boolean setAccruedClaimBlocks(int newAccruedClaimBlocks, boolean checkMax) {
if (checkMax && newAccruedClaimBlocks > this.getMaxAccruedClaimBlocks()) {
return false;
}
@ -699,7 +730,6 @@ public UUID getUniqueId() {
}
public GDPermissionUser getSubject() {
this.playerSubject = null;
if (this.playerSubject == null || this.playerSubject.get() == null) {
GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(this.playerID);
this.playerSubject = new WeakReference<>(user);
@ -825,8 +855,11 @@ public void onClaimDelete() {
public void onDisconnect() {
this.claimVisualRevertTasks.clear();
this.visualClaimBlocks.clear();
this.createBlockVisualTransactions.clear();
this.createBlockVisualRevertRunnables.clear();
this.queuedVisuals.clear();
this.claimMode = false;
this.debugClaimPermissions = false;
this.ignoreClaims = false;
this.lastShovelLocation = null;
this.eventResultCache = null;

View File

@ -50,9 +50,11 @@
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.collect.ImmutableList;
import com.google.common.reflect.TypeToken;
@ -83,6 +85,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;
@ -280,6 +283,8 @@ public class GriefDefenderPlugin {
private VaultProvider vaultProvider;
private PermissionProvider permissionProvider;
private List<BukkitRunnable> runningTasks = new ArrayList<>();
public Executor executor;
public GDBlockType createVisualBlock;
@ -474,6 +479,13 @@ public static void addEventLogEntry(Event event, Claim claim, Location location,
}
public void onEnable() {
this.onEnable(false);
}
public void onEnable(boolean reload) {
if (reload) {
this.cleanup();
}
this.getLogger().info("GriefDefender boot start.");
Plugin permissionPlugin = Bukkit.getPluginManager().getPlugin("LuckPerms");
if (permissionPlugin != null) {
@ -504,10 +516,12 @@ public void onEnable() {
GameModeTypeRegistryModule.getInstance().registerDefaults();
WeatherTypeRegistryModule.getInstance().registerDefaults();
OptionRegistryModule.getInstance().registerDefaults();
GriefDefender.getRegistry().registerBuilderSupplier(PaymentTransaction.Builder.class, GDPaymentTransaction.PaymentTransactionBuilder::new);
GriefDefender.getRegistry().registerBuilderSupplier(Claim.Builder.class, GDClaim.ClaimBuilder::new);
GriefDefender.getRegistry().registerBuilderSupplier(FlagData.Builder.class, GDFlagData.FlagDataBuilder::new);
GriefDefender.getRegistry().registerBuilderSupplier(FlagDefinition.Builder.class, GDFlagDefinition.FlagDefinitionBuilder::new);
if (!reload) {
GriefDefender.getRegistry().registerBuilderSupplier(PaymentTransaction.Builder.class, GDPaymentTransaction.PaymentTransactionBuilder::new);
GriefDefender.getRegistry().registerBuilderSupplier(Claim.Builder.class, GDClaim.ClaimBuilder::new);
GriefDefender.getRegistry().registerBuilderSupplier(FlagData.Builder.class, GDFlagData.FlagDataBuilder::new);
GriefDefender.getRegistry().registerBuilderSupplier(FlagDefinition.Builder.class, GDFlagDefinition.FlagDefinitionBuilder::new);
}
this.loadConfig();
@ -531,7 +545,9 @@ public void onEnable() {
if (Bukkit.getPluginManager().getPlugin("WorldEdit") != null || Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit") != null || Bukkit.getPluginManager().getPlugin("AsyncWorldEdit") != null) {
this.worldEditProvider = new GDWorldEditProvider();
GriefDefender.getRegistry().registerBuilderSupplier(ClaimSchematic.Builder.class, GDClaimSchematic.ClaimSchematicBuilder::new);
if (!reload) {
GriefDefender.getRegistry().registerBuilderSupplier(ClaimSchematic.Builder.class, GDClaimSchematic.ClaimSchematicBuilder::new);
}
}
if (Bukkit.getPluginManager().getPlugin("WorldGuard") != null) {
@ -623,21 +639,21 @@ public void onEnable() {
}
if (!isEconomyModeEnabled() || GriefDefenderPlugin.getGlobalConfig().getConfig().economy.useClaimBlockTask) {
new ClaimBlockTask();
this.runningTasks.add(new ClaimBlockTask());
}
new PlayerTickTask();
if (GriefDefenderPlugin.getGlobalConfig().getConfig().economy.rentSystem && GriefDefenderPlugin.getGlobalConfig().getConfig().economy.isRentSignEnabled()) {
new SignUpdateTask(100);
this.runningTasks.add(new SignUpdateTask(100));
}
if (GriefDefenderPlugin.getInstance().getVaultProvider() != null && GriefDefenderPlugin.getGlobalConfig().getConfig().economy.rentSystem) {
new RentDelinquentApplyTask();
new RentApplyTask();
this.runningTasks.add(new RentDelinquentApplyTask());
this.runningTasks.add(new RentApplyTask());
}
if (GriefDefenderPlugin.getInstance().getVaultProvider() != null) {
if (GriefDefenderPlugin.getGlobalConfig().getConfig().economy.taxSystem) {
// run tax task
new TaxApplyTask();
this.runningTasks.add(new TaxApplyTask());
}
}
registerBaseCommands();
@ -662,6 +678,21 @@ public void onDisable() {
this.getLogger().info("Save complete.");
}
private void cleanup() {
for (BukkitRunnable task : this.runningTasks) {
task.cancel();
}
for (World world : Bukkit.getServer().getWorlds()) {
for (Player player : world.getPlayers()) {
if (player.isDead()) {
continue;
}
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
playerData.onDisconnect();
}
}
}
public void registerBaseCommands() {
PaperCommandManager manager = new PaperCommandManager(GDBootstrap.getInstance());
this.commandManager = manager;
@ -672,6 +703,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());
@ -1031,6 +1063,9 @@ public void loadConfig() {
// refresh default permissions
this.dataStore.setDefaultGlobalPermissions();
}
if (this.tagProvider != null) {
this.tagProvider.refresh();
}
} catch (Exception e) {
e.printStackTrace();
}
@ -1249,6 +1284,8 @@ public static int getMajorMinecraftVersion() {
return 14;
} else if (version.contains("1.15")) {
return 15;
} else if (version.contains("1.16")) {
return 16;
}
return -1;

View File

@ -167,6 +167,7 @@ public static MessageCache getInstance() {
public Component ECONOMY_SIGN_SOLD_LINE4;
public Component ECONOMY_VIRTUAL_NOT_SUPPORTED;
public Component FEATURE_NOT_AVAILABLE;
public Component FLAG_DESCRIPTION_CUSTOM_ARMOR_STAND_USE;
public Component FLAG_DESCRIPTION_CUSTOM_BLOCK_TRAMPLING;
public Component FLAG_DESCRIPTION_CUSTOM_CHEST_ACCESS;
public Component FLAG_DESCRIPTION_CUSTOM_CHORUS_FRUIT_TELEPORT;
@ -174,6 +175,7 @@ public static MessageCache getInstance() {
public Component FLAG_DESCRIPTION_CUSTOM_CREEPER_ENTITY_EXPLOSION;
public Component FLAG_DESCRIPTION_CUSTOM_CROP_GROWTH;
public Component FLAG_DESCRIPTION_CUSTOM_DAMAGE_ANIMALS;
public Component FLAG_DESCRIPTION_CUSTOM_END_CRYSTAL_USE;
public Component FLAG_DESCRIPTION_CUSTOM_ENDERMAN_GRIEF;
public Component FLAG_DESCRIPTION_CUSTOM_EXP_DROP;
public Component FLAG_DESCRIPTION_CUSTOM_FALL_ENTITY_DAMAGE;
@ -204,6 +206,7 @@ public static MessageCache getInstance() {
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_EXIT;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_INVENTORY_INTERACT;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMFRAME_INTERACT;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMHANGING_PLACE;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_DROP;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_PICKUP;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_TELEPORT_FROM;
@ -614,6 +617,7 @@ public void loadCache() {
ECONOMY_SIGN_SOLD_LINE4 = MessageStorage.MESSAGE_DATA.getMessage("economy-sign-sold-line4");
ECONOMY_VIRTUAL_NOT_SUPPORTED = MessageStorage.MESSAGE_DATA.getMessage("economy-virtual-not-supported");
FEATURE_NOT_AVAILABLE = MessageStorage.MESSAGE_DATA.getMessage("feature-not-available");
FLAG_DESCRIPTION_CUSTOM_ARMOR_STAND_USE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-armorstand-use");
FLAG_DESCRIPTION_CUSTOM_BLOCK_TRAMPLING = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-block-trampling");
FLAG_DESCRIPTION_CUSTOM_CHEST_ACCESS = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-chest-access");
FLAG_DESCRIPTION_CUSTOM_CHORUS_FRUIT_TELEPORT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-chorus-fruit-teleport");
@ -621,6 +625,7 @@ public void loadCache() {
FLAG_DESCRIPTION_CUSTOM_CREEPER_ENTITY_EXPLOSION = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-creeper-entity-explosion");
FLAG_DESCRIPTION_CUSTOM_CROP_GROWTH = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-crop-growth");
FLAG_DESCRIPTION_CUSTOM_DAMAGE_ANIMALS = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-damage-animals");
FLAG_DESCRIPTION_CUSTOM_END_CRYSTAL_USE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-endcrystal-use");
FLAG_DESCRIPTION_CUSTOM_ENDERMAN_GRIEF = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-enderman-grief");
FLAG_DESCRIPTION_CUSTOM_EXP_DROP = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-exp-drop");
FLAG_DESCRIPTION_CUSTOM_FALL_ENTITY_DAMAGE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-fall-entity-damage");
@ -653,6 +658,7 @@ public void loadCache() {
FLAG_DESCRIPTION_CUSTOM_PLAYER_EXIT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-exit");
FLAG_DESCRIPTION_CUSTOM_PLAYER_INVENTORY_INTERACT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-inventory-interact");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMFRAME_INTERACT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-itemframe-interact");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMHANGING_PLACE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-itemhanging-place");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_DROP = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-item-drop");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_PICKUP = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-item-pickup");
FLAG_DESCRIPTION_CUSTOM_PLAYER_PORTAL_USE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-portal-use");

View File

@ -864,6 +864,7 @@ public Set<Long> getChunkHashes(boolean refresh) {
final GDChunk gdChunk = this.worldClaimManager.getChunkIfLoaded(x, z);
if (gdChunk != null) {
this.loadedChunkHashes.add(gdChunk.getChunkKey());
((GDClaim) this.wildernessClaim).loadedChunkHashes.remove(gdChunk.getChunkKey());
}
}
}
@ -997,7 +998,7 @@ public ClaimResult transferOwner(UUID newOwnerID, boolean checkEconomy, boolean
}
this.claimData.setOwnerUniqueId(newOwnerID);
if (this.isBasicClaim()) {
if (!this.isAdminClaim()) {
ownerData.getInternalClaims().remove(this);
newOwnerData.getInternalClaims().add(this);
}
@ -1358,6 +1359,9 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) {
}
}
// The current values must be used in order for getClaimBlocks to return current cost
this.lesserBoundaryCorner = currentLesserCorner;
this.greaterBoundaryCorner = currentGreaterCorner;
if (!this.cuboid || GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) {
// check player has enough claim blocks
if ((this.isBasicClaim() || this.isTown()) && this.claimData.requiresClaimBlocks()) {
@ -1381,8 +1385,8 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) {
GriefDefenderPlugin.sendMessage(player, message);
}
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
this.lesserBoundaryCorner = currentLesserCorner;
this.greaterBoundaryCorner = currentGreaterCorner;
return new GDClaimResult(ClaimResultType.ECONOMY_NOT_ENOUGH_FUNDS, message);
}
} else {
@ -1402,8 +1406,7 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) {
"block-amount", Math.abs(remainingClaimBlocks))));
}
}
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
this.lesserBoundaryCorner = currentLesserCorner;
this.greaterBoundaryCorner = currentGreaterCorner;
return new GDClaimResult(ClaimResultType.INSUFFICIENT_CLAIM_BLOCKS);
@ -1468,16 +1471,12 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect
if (playerData.claimResizing != null) {
final Component message = MessageCache.getInstance().RESIZE_SAME_LOCATION;
GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
// TODO: Add new result type for this
return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message);
}
if (playerData.claimSubdividing == null) {
final Component message = MessageCache.getInstance().CREATE_SUBDIVISION_ONLY;
GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
// TODO: Add new result type for this
return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message);
}

View File

@ -210,9 +210,11 @@ public void addClaim(Claim claimToAdd, boolean writeToStorage) {
this.deleteChunkHashes((GDClaim) claim);
if (!claim.isAdminClaim() && (!claim.isInTown() || !claim.getTownClaim().getOwnerUniqueId().equals(claim.getOwnerUniqueId()))) {
final GDPlayerData playerData = this.getPlayerDataMap().get(claim.getOwnerUniqueId());
Set<Claim> playerClaims = playerData.getInternalClaims();
if (!playerClaims.contains(claim)) {
playerClaims.add(claim);
if (playerData != null) {
Set<Claim> playerClaims = playerData.getInternalClaims();
if (!playerClaims.contains(claim)) {
playerClaims.add(claim);
}
}
}
return;
@ -378,7 +380,7 @@ private void resetPlayerClaimVisuals(Claim claim) {
}
private void deleteChunkHashes(GDClaim claim) {
Set<Long> chunkHashes = claim.getChunkHashes(false);
Set<Long> chunkHashes = claim.getChunkHashes(true);
if (chunkHashes == null) {
return;
}
@ -657,7 +659,7 @@ public GDChunk getChunk(Chunk chunk) {
gdChunk = new GDChunk(chunk);
this.chunksToGDChunks.put(chunkKey, gdChunk);
if (this.chunksToClaimsMap.get(chunkKey) == null) {
this.theWildernessClaim.loadedChunkHashes.add(chunkKey);
this.getWildernessClaim().loadedChunkHashes.add(chunkKey);
}
}
return gdChunk;
@ -685,7 +687,7 @@ public boolean isChunkLoaded(long key) {
public void removeChunk(long key) {
this.chunksToGDChunks.remove(key);
this.theWildernessClaim.loadedChunkHashes.remove(key);
this.getWildernessClaim().loadedChunkHashes.remove(key);
}
private long getChunkKey(int cx, int cz) {

View File

@ -61,6 +61,7 @@
import com.griefdefender.permission.ui.MenuType;
import com.griefdefender.permission.ui.UIHelper;
import com.griefdefender.permission.ui.UIFlagData.FlagContextHolder;
import com.griefdefender.provider.PermissionProvider.PermissionDataType;
import com.griefdefender.registry.FlagRegistryModule;
import com.griefdefender.text.action.GDCallbackHolder;
import com.griefdefender.util.CauseContextHelper;
@ -252,21 +253,7 @@ protected void showCustomFlags(GDPermissionUser src, GDClaim claim, String flagG
}
final Map<String, GDFlagDefinition> definitions = new HashMap<>(flagGroupCat.getFlagDefinitions());
boolean isAdminUser = false;
if (flagGroup.equalsIgnoreCase("user") && src.getOnlinePlayer().hasPermission(GDPermissions.COMMAND_DELETE_ADMIN_CLAIMS)) {
for (String group : groups) {
if (group.equalsIgnoreCase("user")) {
continue;
}
final CustomFlagGroupCategory adminGroup = flagGroups.get(group);
if (adminGroup.isAdminGroup()) {
isAdminUser = true;
if (adminGroup != null) {
definitions.putAll(new HashMap<>(adminGroup.getFlagDefinitions()));
}
}
}
}
final boolean isAdminUser = src.getInternalPlayerData().canManageAdminClaims;
List<Component> textComponents = new ArrayList<>();
for (GDFlagDefinition customFlag : definitions.values()) {
if (customFlag.isEnabled()) {
@ -424,7 +411,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
defaultContexts.add(ClaimContexts.WILDERNESS_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT);
}
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
defaultContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
@ -439,7 +426,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(claim.getDefaultTypeContext())) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT))) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
}
@ -449,7 +436,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(claim.getDefaultTypeContext())) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT))) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
if (displayType != MenuType.DEFAULT) {
@ -463,7 +450,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.INHERIT, mapEntry.getValue());
}
}
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT)) {
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_OVERRIDE_CONTEXT))) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.OVERRIDE, mapEntry.getValue());
}
if (contextSet.contains(claim.getOverrideClaimContext())) {
@ -653,39 +640,20 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
}
final List<GDActiveFlagData> definitionResults = new ArrayList<>();
boolean hasClaimContext = false;
Set<Context> definitionContexts = new HashSet<>(customFlag.getContexts());
for (Context context : definitionContexts) {
if (context.getKey().contains("gd_claim")) {
// Admins can set 'gd_claim' context value to 'claim' to represent it should be replaced with each claim UUID
if (context.getValue().equalsIgnoreCase("claim")) {
definitionContexts.remove(context);
hasClaimContext = true;
break;
}
}
}
if (hasClaimContext) {
definitionContexts.add(claim.getContext());
}
boolean hasOverride = false;
UUID parentInheritUniqueId = null;
Component parentInheritFriendlyType = null;
for (FlagData flagData : customFlag.getFlagData()) {
if (customFlag.isAdmin() && !flagGroup.equalsIgnoreCase("user")) {
definitionResults.add(this.getSpecificDefinitionResult(claim, customFlag, flagData));
} else {
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
definitionResults.add(activeData);
if (activeData.getType() == GDActiveFlagData.Type.OVERRIDE) {
hasOverride = true;
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
definitionResults.add(activeData);
if (activeData.getType() == GDActiveFlagData.Type.OVERRIDE) {
hasOverride = true;
hasEditPermission = false;
} else if (activeData.getType() == GDActiveFlagData.Type.OWNER_OVERRIDE_PARENT_INHERIT || activeData.getType() == GDActiveFlagData.Type.CLAIM_PARENT_INHERIT) {
if (claim.allowEdit(src) != null) {
hasEditPermission = false;
} else if (activeData.getType() == GDActiveFlagData.Type.OWNER_OVERRIDE_PARENT_INHERIT || activeData.getType() == GDActiveFlagData.Type.CLAIM_PARENT_INHERIT) {
if (claim.allowEdit(src) != null) {
hasEditPermission = false;
parentInheritUniqueId = activeData.getInheritParentUniqueId();
parentInheritFriendlyType = activeData.getInheritParentFriendlyType();
}
parentInheritUniqueId = activeData.getInheritParentUniqueId();
parentInheritFriendlyType = activeData.getInheritParentFriendlyType();
}
}
}
@ -729,6 +697,7 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
} else {
hoverBuilder.append(MessageCache.getInstance().FLAG_UI_CLICK_ALLOW);
}
hasHover = true;
if (properResult) {
hoverBuilder.append("\nDefault Value: ", TextColor.AQUA);
@ -740,67 +709,70 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
} else {
hoverBuilder.append(customFlag.getDefaultValue().toString().toLowerCase(), TextColor.RED);
}
if (src.getInternalPlayerData().canManageAdminClaims) {
if (!customFlag.getContexts().isEmpty()) {
hoverBuilder.append("\nDefinition Contexts: ");
hoverBuilder.append("\ngd_claim", TextColor.AQUA)
.append("=", TextColor.WHITE)
.append(claim.getUniqueId().toString(), TextColor.GRAY);
for (Context context : customFlag.getContexts()) {
if (!customFlag.isAdmin()) {
continue;
}
final String key = context.getKey();
if (key.contains("default") || key.contains("override")) {
// Only used in config for startup
continue;
}
hoverBuilder.append("\n");
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
if (key.contains("default")) {
keyColor = TextColor.LIGHT_PURPLE;
} else if (key.contains("override")) {
keyColor = TextColor.RED;
} else if (key.contains("server")) {
keyColor = TextColor.GRAY;
}
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
}
}
} else {
hoverBuilder.append("\nClaim ID: ", TextColor.AQUA).append(claim.getUniqueId().toString(), TextColor.GRAY);
}
if (src.getInternalPlayerData().canManageAdminClaims) {
for (FlagData flagData : customFlag.getFlagData()) {
hoverBuilder.append("\nFlag: ")
.append(flagData.getFlag().getName(), TextColor.GREEN);
if (!customFlag.getContexts().isEmpty()) {
hoverBuilder.append("\nDefinition Contexts: ");
if (!customFlag.isAdmin() || flagGroup.equalsIgnoreCase("user")) {
hoverBuilder.append("gd_claim", TextColor.AQUA)
.append("=", TextColor.WHITE)
.append(claim.getUniqueId().toString(), TextColor.GRAY);
}
for (Context context : customFlag.getContexts()) {
if ((!customFlag.isAdmin() || flagGroup.equalsIgnoreCase("user")) && context.getKey().contains("gd_claim")) {
continue;
if (!flagData.getContexts().isEmpty()) {
hoverBuilder.append("\nContexts: ");
}
hoverBuilder.append("\n");
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
if (key.contains("default")) {
keyColor = TextColor.LIGHT_PURPLE;
} else if (key.contains("override")) {
keyColor = TextColor.RED;
} else if (key.contains("server")) {
keyColor = TextColor.GRAY;
for (Context context : flagData.getContexts()) {
hoverBuilder.append("\n");
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
}
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
// show active value
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
hoverBuilder.append("\nActive Result: ")
.append("\nvalue", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getValue().name().toLowerCase(), TextColor.GOLD)
.append("\ntype", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getType().name() + "\n", activeData.getColor());
}
}
for (FlagData flagData : customFlag.getFlagData()) {
hoverBuilder.append("\nFlag: ")
.append(flagData.getFlag().getName(), TextColor.GREEN);
if (!flagData.getContexts().isEmpty()) {
hoverBuilder.append("\nContexts: ");
}
for (Context context : flagData.getContexts()) {
if ((!customFlag.isAdmin() || flagGroup.equalsIgnoreCase("user")) && context.getKey().contains("gd_claim")) {
continue;
}
hoverBuilder.append("\n");
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
}
// show active value
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
hoverBuilder.append("\nActive Result: ")
.append("\nvalue", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getValue().name().toLowerCase(), TextColor.GOLD)
.append("\ntype", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getType().name() + "\n", activeData.getColor());
}
hasHover = true;
}
} else {
if (hasOverride) {
@ -834,49 +806,6 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
return textBuilder.build();
}
public GDActiveFlagData getSpecificDefinitionResult(GDClaim claim, GDFlagDefinition flagDefinition, FlagData flagData) {
Set<Context> contexts = new HashSet<>(flagData.getContexts());
contexts.addAll(flagDefinition.getContexts());
boolean hasClaimContext = false;
boolean hasOverrideClaimContext = false;
boolean hasDefaultClaimContext = false;
boolean replaceClaimContext = false;
final Iterator<Context> iterator = contexts.iterator();
while (iterator.hasNext()) {
final Context context = iterator.next();
if (context.getKey().equalsIgnoreCase("gd_claim")) {
hasClaimContext = true;
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
}
} else if (context.getKey().equalsIgnoreCase("gd_claim_default")) {
hasDefaultClaimContext = true;
} else if (context.getKey().equalsIgnoreCase("gd_claim_override")) {
hasOverrideClaimContext = true;
}
}
GDActiveFlagData.Type type = GDActiveFlagData.Type.DEFAULT;
if (hasClaimContext) {
type = GDActiveFlagData.Type.CLAIM;
} else if (hasOverrideClaimContext) {
type = GDActiveFlagData.Type.OVERRIDE;
}
if (replaceClaimContext || !flagDefinition.isAdmin()) {
contexts.add(claim.getContext());
}
Tristate result = PermissionUtil.getInstance().getPermissionValue(claim, GriefDefenderPlugin.DEFAULT_HOLDER, flagData.getFlag().getPermission(), contexts);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, contexts, type);
}
return new GDActiveFlagData(flagDefinition, flagData, result, contexts, GDActiveFlagData.Type.UNDEFINED);
}
public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinition flagDefinition, FlagData flagData) {
Set<Context> contexts = new HashSet<>(flagData.getContexts());
contexts.addAll(flagDefinition.getContexts());
@ -888,32 +817,14 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
Context claimContext = claim.getContext();
while (iterator.hasNext()) {
final Context context = iterator.next();
if (!flagDefinition.isAdmin()) {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE)) {
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
hasOverrideOwnerContext = true;
}
} else {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE)) {
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
hasOverrideOwnerContext = true;
}
} else {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM)) {
claimContext = context;
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
}
} else if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_DEFAULT)) {
iterator.remove();
} else if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE)) {
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
hasOverrideOwnerContext = true;
}
}
iterator.remove();
}
}
final Set<Context> filteredContexts = new HashSet<>(contexts);
@ -922,10 +833,13 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
// Check override
Set<Context> permissionContexts = new HashSet<>(filteredContexts);
permissionContexts.add(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT);
if (!claim.isWilderness()) {
contexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
permissionContexts.add(claim.getWorldContext());
permissionContexts.add(claim.getOverrideTypeContext());
permissionContexts.addAll(flagData.getContexts());
Tristate result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
Tristate result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.OVERRIDE);
}
@ -938,7 +852,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
for (Claim parentClaim : inheritParents) {
GDClaim parent = (GDClaim) parentClaim;
permissionContexts.add(parent.getOverrideClaimContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, parent.getUniqueId(), parent.getFriendlyNameType(), GDActiveFlagData.Type.OWNER_OVERRIDE_PARENT_INHERIT);
}
@ -947,7 +861,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
}
permissionContexts.add(claim.getOverrideClaimContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.OWNER_OVERRIDE);
}
@ -960,7 +874,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
GDClaim parent = (GDClaim) parentClaim;
// check parent context
permissionContexts.add(parent.getContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, parent.getUniqueId(), parent.getFriendlyNameType(), GDActiveFlagData.Type.CLAIM_PARENT_INHERIT);
}
@ -974,8 +888,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
} else {
permissionContexts.add(claimContext);
}
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, hasOverrideOwnerContext ? GDActiveFlagData.Type.OWNER_OVERRIDE : GDActiveFlagData.Type.CLAIM);
}
@ -987,18 +900,31 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
// Check default type first
permissionContexts.add(claim.getDefaultTypeContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
permissionContexts.remove(claim.getDefaultTypeContext());
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
permissionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
permissionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.ALL);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
permissionContexts.remove(ClaimContexts.USER_DEFAULT_CONTEXT);
} else {
permissionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.ALL);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
}
permissionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
permissionContexts.add(claim.getWorldContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
permissionContexts.remove(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
permissionContexts.add(claim.getDefaultTypeContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.TRANSIENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
@ -1164,23 +1090,13 @@ private Consumer<CommandSender> createCustomFlagConsumer(GDPermissionUser src, G
final Iterator<Context> iterator = definitionContexts.iterator();
while (iterator.hasNext()) {
final Context context = iterator.next();
if (!customFlag.isAdmin() || (customFlag.isAdmin() && flagGroup.equalsIgnoreCase("user"))) {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimOverrideContext = true;
} else if (context.getKey().contains(ContextKeys.CLAIM)) {
iterator.remove();
}
addClaimContext = true;
} else {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimContext = true;
} else if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimOverrideContext = true;
}
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimOverrideContext = true;
} else if (context.getKey().contains(ContextKeys.CLAIM)) {
iterator.remove();
}
addClaimContext = true;
}
if (addClaimOverrideContext) {
definitionContexts.add(claim.getOverrideClaimContext());

View File

@ -372,7 +372,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
defaultContexts.add(ClaimContexts.WILDERNESS_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT);
}
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
defaultContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
@ -383,7 +383,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
Map<String, OptionData> filteredContextMap = new HashMap<>();
for (Map.Entry<Set<Context>, Map<String, String>> mapEntry : PermissionUtil.getInstance().getTransientOptions(this.subject).entrySet()) {
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(claim.getDefaultTypeContext()) || contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
if (contextSet.contains(claim.getDefaultTypeContext()) || (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT)))) {
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
}
@ -391,6 +391,9 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
if (displayType == MenuType.DEFAULT || displayType == MenuType.CLAIM) {
final Set<Context> contexts = new HashSet<>();
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
if (!claim.isWilderness()) {
contexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
}
for (Option option : OptionRegistryModule.getInstance().getAll()) {
if (option.isGlobal() && displayType == MenuType.CLAIM) {
continue;
@ -417,7 +420,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
for (Map.Entry<Set<Context>, Map<String, String>> mapEntry : PermissionUtil.getInstance().getPermanentOptions(this.subject).entrySet()) {
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT))) {
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
if (contextSet.contains(claim.getDefaultTypeContext())) {
@ -429,7 +432,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.CLAIM, mapEntry.getValue());
}
}
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT)) {
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_OVERRIDE_CONTEXT))) {
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.OVERRIDE, mapEntry.getValue());
}
if (contextSet.contains(claim.getOverrideClaimContext())) {

View File

@ -26,8 +26,10 @@
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;
@ -40,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;
@ -62,6 +65,8 @@
import java.util.Set;
import java.util.function.Consumer;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -69,12 +74,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();
World world = null;
if (worldName != null) {
world = Bukkit.getWorld(worldName);
if (world == 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(world.getUID());
final Set<Claim> claims = claimManager.getPlayerClaims(player.getUniqueId());
if (claims == null || claims.isEmpty()) {
originalClaimCount = 0;
}
}
if (originalClaimCount == 0) {
try {
@ -86,26 +106,45 @@ public void execute(Player player) {
}
final boolean autoSchematicRestore = GriefDefenderPlugin.getActiveConfig(player.getWorld().getUID()).getConfig().claim.claimAutoSchematicRestore;
Component message = null;
if (world != null) {
if (autoSchematicRestore) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.SCHEMATIC_ABANDON_ALL_RESTORE_WARNING_WORLD, ImmutableMap.of(
"world", world.getName()));
} else {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_ALL_WARNING_WORLD, ImmutableMap.of(
"world", world.getName()));
}
} 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, world), true)))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
.build();
TextAdapter.sendComponent(player, confirmationText);
}
private static Consumer<CommandSender> createConfirmationConsumer(GDPermissionUser user) {
private static Consumer<CommandSender> createConfirmationConsumer(GDPermissionUser user, World world) {
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 (world != null) {
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID());
claims = claimManager.getPlayerClaims(player.getUniqueId());
} else {
claims = playerData.getInternalClaims();
}
for (Claim claim : claims) {
if (abandonDelay > 0) {
final Instant localNow = Instant.now();
final Instant dateCreated = ((GDClaim) claim).getInternalClaimData().getDateCreated();
@ -158,14 +197,28 @@ private static Consumer<CommandSender> createConfirmationConsumer(GDPermissionUs
final EconomyResponse result = economy.depositPlayer(user.getOnlinePlayer(), refund);
if (result.transactionSuccess()) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS, ImmutableMap.of(
"amount", TextComponent.of(String.valueOf(refund))));
Component message = null;
if (world != null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS_WORLD, ImmutableMap.of(
"world", world.getName(),
"amount", TextComponent.of(String.valueOf(refund))));
} else {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS, ImmutableMap.of(
"amount", TextComponent.of(String.valueOf(refund))));
}
TextAdapter.sendComponent(player, message);
}
} else {
int remainingBlocks = playerData.getRemainingClaimBlocks();
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS, ImmutableMap.of(
Component message = null;
if (world != null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS_WORLD, ImmutableMap.of(
"world", world.getName(),
"amount", remainingBlocks));
} else {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS, ImmutableMap.of(
"amount", remainingBlocks));
}
TextAdapter.sendComponent(player, message);
}
}

View File

@ -0,0 +1,185 @@
/*
* 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.bukkit.TextAdapter;
import net.kyori.text.event.ClickEvent;
import net.kyori.text.event.HoverEvent;
import net.kyori.text.format.TextColor;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Consumer;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@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) {
World world = player.getWorld();
if (worldName != null) {
world = Bukkit.getWorld(worldName);
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().getUID());
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.getName())));
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<CommandSender> createConfirmationConsumer(Player source, World world) {
return confirm -> {
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID());
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()) {
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(user.getOnlinePlayer(), 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 Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
if (!economy.hasAccount(player)) {
return;
}
final EconomyResponse result = economy.depositPlayer(user.getOfflinePlayer(), refund);
if (result.transactionSuccess()) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_ABANDON_SUCCESS_WORLD, ImmutableMap.of(
"world", world.getName(),
"amount", TextComponent.of(String.valueOf(refund))));
TextAdapter.sendComponent(player, message);
}
} else {
int remainingBlocks = playerData.getRemainingClaimBlocks();
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_SUCCESS_WORLD, ImmutableMap.of(
"world", world.getName(),
"amount", remainingBlocks));
TextAdapter.sendComponent(player, message);
}
}
}
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ABANDON_WORLD_SUCCESS, ImmutableMap.of(
"world", world.getName()));
TextAdapter.sendComponent(source, message);
};
}
}

View File

@ -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;
@ -39,11 +40,15 @@
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;
@ -52,10 +57,13 @@
import net.kyori.text.event.HoverEvent;
import net.kyori.text.format.TextColor;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
import org.bukkit.OfflinePlayer;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -63,51 +71,96 @@
@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, OfflinePlayer 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();
World world = null;
if (worldName != null) {
world = Bukkit.getWorld(worldName);
if (world == 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(world.getUID());
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 (world != null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_WARNING_WORLD, ImmutableMap.of(
"player", TextComponent.of(user.getFriendlyName()).color(TextColor.AQUA),
"world", world.getName()));
} 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, world), true)))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
.build();
TextAdapter.sendComponent(src, confirmationText);
}
private static Consumer<CommandSender> createConfirmationConsumer(Player src, OfflinePlayer otherPlayer, GDPlayerData playerData) {
private static Consumer<CommandSender> createConfirmationConsumer(Player src, GDPermissionUser otherPlayer, World world) {
return confirm -> {
GDCauseStackManager.getInstance().pushCause(src);
GDRemoveClaimEvent.Delete event = new GDRemoveClaimEvent.Delete(ImmutableList.copyOf(playerData.getInternalClaims()));
Set<Claim> claims = new HashSet<>();
if (world != null) {
final GDClaimManager claimManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(world.getUID());
claims = claimManager.getPlayerClaims(otherPlayer.getUniqueId());
} else {
claims = otherPlayer.getInternalPlayerData().getInternalClaims();
}
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 = world != null ? world.getUID() : 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 (world != null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_PLAYER_SUCCESS_WORLD, ImmutableMap.of(
"player", TextComponent.of(otherPlayer.getName()).color(TextColor.AQUA),
"world", world.getName()));
} 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);
}
};

View File

@ -28,14 +28,17 @@
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;
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;
@ -47,8 +50,12 @@
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;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@ -59,23 +66,48 @@ 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) {
World world = null;
if (worldName != null) {
world = Bukkit.getWorld(worldName);
if (world == 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(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;
if (world != null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_WARNING_WORLD, ImmutableMap.of(
"type", TextComponent.of("ADMIN").color(TextColor.RED),
"world", world.getName()));
} 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, world), true)))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_CONFIRM)).build())
.build();
TextAdapter.sendComponent(player, confirmationText);
}
private static Consumer<CommandSender> createConfirmationConsumer(Player player) {
private static Consumer<CommandSender> createConfirmationConsumer(Player player, World world) {
return confirm -> {
ClaimResult claimResult = GriefDefenderPlugin.getInstance().dataStore.deleteAllAdminClaims(player, player.getWorld());
final UUID worldUniqueId = world != null ? world.getUID() : 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(
@ -84,8 +116,17 @@ private static Consumer<CommandSender> 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 (world != null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.DELETE_ALL_TYPE_SUCCESS_WORLD, ImmutableMap.of(
"type", TextComponent.of("ADMIN").color(TextColor.RED),
"world", world.getName()));
} 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();
};

View File

@ -43,7 +43,7 @@
@CommandPermission(GDPermissions.COMMAND_FLAGS_DEBUG)
public class CommandClaimFlagDebug extends BaseCommand {
@CommandAlias("cfd")
@CommandAlias("cfdebug")
@Description("Toggles claim flag debug mode.")
@Subcommand("claim debug")
public void execute(Player player) {

View File

@ -183,7 +183,7 @@ public void execute(CommandSender src, String[] args) {
final GDClaim gdClaim = (GDClaim) claim;
final GDPermissionUser owner = PermissionHolderCache.getInstance().getOrCreateUser(claim.getOwnerUniqueId());
final UUID ownerUniqueId = claim.getOwnerUniqueId();
final boolean isAdmin = gdClaim.allowEdit(player) == null;
final boolean isAdmin = playerData.canManageAdminClaims;
// if not owner of claim, validate perms
if (!isAdmin && !player.getUniqueId().equals(claim.getOwnerUniqueId())) {
if (!gdClaim.getInternalClaimData().getContainers().contains(player.getUniqueId())

View File

@ -173,6 +173,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(user.getUniqueId());
}
for (String group : claim.getInternalClaimData().getManagerGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getManagerGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
for (UUID uuid : claim.getInternalClaimData().getBuilders()) {
if (!userIdList.contains(uuid)) {
@ -194,6 +208,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
for (String group : claim.getInternalClaimData().getBuilderGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getBuilderGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
for (UUID uuid : claim.getInternalClaimData().getContainers()) {
if (!userIdList.contains(uuid)) {
@ -215,6 +243,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
for (String group : claim.getInternalClaimData().getContainerGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getContainerGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
for (UUID uuid : claim.getInternalClaimData().getAccessors()) {
if (!userIdList.contains(uuid)) {
@ -236,6 +278,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
for (String group : claim.getInternalClaimData().getAccessorGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getAccessorGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
} else {
final List<UUID> trusts = claim.getUserTrustList(type);
trustList.add(TextComponent.builder("")
@ -269,6 +325,21 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
final List<String> groupList = claim.getGroupTrustList(type);
for (String group : groupList) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), groupList, group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
}
Component footer = null;
@ -354,6 +425,7 @@ private static Consumer<CommandSender> createAddConsumer(Player src, GDClaim cla
return consumer -> {
String name = playerData.commandInput;
List<Component> messages = new ArrayList<>();
boolean isGroup = false;
if (playerData.commandInput.contains("player ")) {
name = name.replace("player ", "");
if (!name.equalsIgnoreCase("public") && PermissionUtil.getInstance().lookupUserUniqueId(name) == null) {
@ -365,6 +437,7 @@ private static Consumer<CommandSender> createAddConsumer(Player src, GDClaim cla
return;
}
} else if (playerData.commandInput.contains("group ")) {
isGroup = true;
name = name.replace("group ", "");
if (!name.equalsIgnoreCase("public") && !PermissionUtil.getInstance().hasGroupSubject(name)) {
messages.add(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER,
@ -382,7 +455,11 @@ private static Consumer<CommandSender> createAddConsumer(Player src, GDClaim cla
createInputConsumer(src, claim, playerData, type, messages, returnCommand).accept(src);
return;
}
CommandHelper.executeCommand(src, "trust", name + " " + type.getName().toLowerCase());
if (isGroup) {
CommandHelper.executeCommand(src, "trustgroup", name + " " + type.getName().toLowerCase());
} else {
CommandHelper.executeCommand(src, "trust", name + " " + type.getName().toLowerCase());
}
playerData.commandInputTimestamp = null;
playerData.commandConsumer = null;
showTrustList(src, claim, playerData, type, messages, returnCommand);
@ -405,4 +482,13 @@ private static Consumer<CommandSender> createRemoveConsumer(Player src, GDClaim
showTrustList(src, claim, playerData, type, new ArrayList<>(), returnCommand);
};
}
private static Consumer<CommandSender> createRemoveGroupConsumer(Player src, GDClaim claim, GDPlayerData playerData, TrustType type, Component returnCommand, IClaimData data, List<String> trustList, String group) {
return consumer -> {
trustList.remove(group);
data.setRequiresSave(true);
data.save();
showTrustList(src, claim, playerData, type, new ArrayList<>(), returnCommand);
};
}
}

View File

@ -90,10 +90,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";
@ -167,9 +171,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";
@ -180,6 +188,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";
@ -312,6 +321,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";

View File

@ -34,6 +34,7 @@
import java.util.List;
import java.util.Map;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.checkerframework.checker.nullness.qual.Nullable;
@ConfigSerializable
@ -48,6 +49,26 @@ public class BlacklistCategory extends ConfigCategory {
@Setting(value = "global-target", comment = "A global list of target id's that are ignored by events. \nNote: This only affects events where the id specified is the target.")
public List<String> globalTargetBlacklist = new ArrayList<>();
@Setting(value = "entity-damage-source-blacklist", comment = "A global list of entity damage sources that are ignored in events by default.")
public List<String> entityDamageSourceBlacklist = new ArrayList<>();
public BlacklistCategory() {
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
this.flagIdBlacklist.put(flag.getName().toLowerCase(), new ArrayList<>());
}
this.flagIdBlacklist.put("block-pre", new ArrayList<>());
this.entityDamageSourceBlacklist.add(DamageCause.CONTACT.name().toLowerCase());
this.entityDamageSourceBlacklist.add("cramming");
this.entityDamageSourceBlacklist.add(DamageCause.DROWNING.name().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageCause.FALLING_BLOCK.name().toLowerCase());
this.entityDamageSourceBlacklist.add("flyintowall");
this.entityDamageSourceBlacklist.add(DamageCause.POISON.name().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageCause.STARVATION.name().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageCause.SUFFOCATION.name().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageCause.SUICIDE.name().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageCause.VOID.name().toLowerCase());
}
public List<String> getGlobalSourceBlacklist() {
return this.globalSourceBlacklist;
}
@ -56,11 +77,8 @@ public List<String> getGlobalTargetBlacklist() {
return this.globalTargetBlacklist;
}
public BlacklistCategory() {
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
this.flagIdBlacklist.put(flag.getName().toLowerCase(), new ArrayList<>());
}
this.flagIdBlacklist.put("block-pre", new ArrayList<>());
public List<String> getEntityDamageSourceBlacklist() {
return this.entityDamageSourceBlacklist;
}
// Used by API

View File

@ -41,9 +41,9 @@ public class DefaultFlagCategory extends ConfigCategory {
@Setting(value = "default-claim-flags", comment = "The default flag settings used by claims. The group name represents the claim type."
+ "\nEx: The group admin will ONLY affect admin claims."
+ "\nSupported groups are : global, admin, basic, subdivision, town, and wilderness."
+ "\nNote: Global represents all claim types."
+ "\nNote: Specific types, such as wilderness, have higher priority than global."
+ "\nSupported groups are : user, admin, basic, subdivision, town, and wilderness."
+ "\nNote: User represents all claim types EXCEPT wilderness."
+ "\nNote: Specific types, such as wilderness, have higher priority than user."
+ "\nNote: Defaults do not force flags onto user claims. A newly created claim will have no flags set and use these default settings until a claim owner sets flags.")
private Map<String, Map<String, Boolean>> defaultClaimFlags = Maps.newHashMap();
@ -52,7 +52,7 @@ public DefaultFlagCategory() {
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
globalFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(null));
}
this.defaultClaimFlags.put("global", globalFlagMap);
this.defaultClaimFlags.put("user", globalFlagMap);
Map<String, Boolean> wildernessFlagMap = new HashMap<>();
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
wildernessFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(ClaimTypes.WILDERNESS));
@ -71,7 +71,14 @@ public void refreshFlags() {
}
}
}
final Map<String, Boolean> globalFlagMap = this.defaultClaimFlags.get("global");
Map<String, Boolean> globalFlagMap = this.defaultClaimFlags.get("user");
if (globalFlagMap == null) {
globalFlagMap = new HashMap<>();
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
globalFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(null));
}
this.defaultClaimFlags.put("user", globalFlagMap);
}
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
if (!globalFlagMap.containsKey(flag.getName())) {
globalFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(null));

View File

@ -0,0 +1,90 @@
/*
* 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.configuration.category;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.io.FilenameUtils;
import org.bukkit.entity.Player;
import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
@ConfigSerializable
public class ModCategory {
@Setting(value = "fakeplayer-identifiers", comment = "Contains a list of strings used to identify a fakeplayer by UUID or name. To use, add the fakeplayer UUID or name."
+ "\nNote: Strings support wildcards '?' and '*' by using Apache's wildcard matcher."
+ "\nThe wildcard '?' represents a single character."
+ "\nThe wildcard '*' represents zero or more characters."
+ "\nFor more information on usage, see https://commons.apache.org/proper/commons-io/javadocs/api-2.5/org/apache/commons/io/FilenameUtils.html#wildcardMatch(java.lang.String,%20java.lang.String)")
public List<String> fakePlayerIdentifiers = new ArrayList<>();
@Setting(value = "mod-id-map", comment = "Used to map an unknown mod item/block/entity to a mod id. To use, add the mod package with a mapping to a mod id."
+ "\nEx. 'com.pixelmonmod.*', 'pixelmon' would map an entity containing class name 'com.pixelmonmod.*' to 'pixelmon'."
+ "\nNote: Strings support wildcards '?' and '*' by using Apache's wildcard matcher."
+ "\nThe wildcard '?' represents a single character."
+ "\nThe wildcard '*' represents zero or more characters."
+ "\nFor more information on usage, see https://commons.apache.org/proper/commons-io/javadocs/api-2.5/org/apache/commons/io/FilenameUtils.html#wildcardMatch(java.lang.String,%20java.lang.String)")
public Map<String, String> modIdMap = new HashMap<>();
public ModCategory() {
this.fakePlayerIdentifiers.add("41C82C87-7AfB-4024-BA57-13D2C99CAE77"); // Forge FakePlayer
this.fakePlayerIdentifiers.add("BFC3377F-C3C9-3382-9DA6-79B50A9AFE57"); // OpenMods
this.fakePlayerIdentifiers.add("0D0C4CA0-4FF1-11E4-916C-0800200C9A66"); // ComputerCraft
this.fakePlayerIdentifiers.add("[Minecraft]"); // Forge FakePlayer name
this.fakePlayerIdentifiers.add("OpenModsFakethis*");
this.modIdMap.put("com.pixelmonmod.*", "pixelmon");
this.modIdMap.put("net.minecraftforge.*", "forge");
this.modIdMap.put("openblocks.*", "openblocks");
this.modIdMap.put("openmods.*", "openmods");
}
public boolean isFakePlayer(Player player) {
for (String str : this.fakePlayerIdentifiers) {
if (FilenameUtils.wildcardMatch(player.getUniqueId().toString().toLowerCase(), str.toLowerCase())) {
return true;
}
if (FilenameUtils.wildcardMatch(player.getName().toLowerCase(), str.toLowerCase())) {
return true;
}
}
return false;
}
public String getModId(String clazz) {
for (Entry<String, String> entry : this.modIdMap.entrySet()) {
final String modPackage = entry.getKey();
final String modId = entry.getValue();
if (FilenameUtils.wildcardMatch(clazz, modPackage)) {
return modId.toLowerCase();
}
}
return null;
}
}

View File

@ -42,6 +42,13 @@ public class VisualCategory extends ConfigCategory {
public String claimCreateStartBlock = "minecraft:diamond_block";
@Setting(value = "filler-spacing", comment = "The space between each filler visual block.")
public int fillerSpacing = 10;
@Setting(value = "active-claim-visual-time", comment = "The active time, in seconds, to keep a claim's visuals shown to a player. (Default: 60)"
+ "\nNote: If value is <= 0, GD will use the default value.")
public int claimVisualTime = 60;
@Setting(value = "active-create-block-visual-time", comment = "The active time, in seconds, to keep a claim's create block visual shown to a player. (Default: 180)"
+ "\nNote: This only applies during claim creation."
+ "\nNote: If value is <= 0, GD will use the default value.")
public int createBlockVisualTime = 180;
@Setting(value = "admin-accent-block", comment = "The visual accent block used for admin claims. (Default: minecraft:pumpkin)")
public String visualAdminAccentBlock = "minecraft:pumpkin";

View File

@ -144,7 +144,7 @@ public FlagDefinition deserialize(TypeToken<?> type, ConfigurationNode node) thr
final String value = parts[1];
if (key.equalsIgnoreCase("default") || key.equalsIgnoreCase("gd_claim_default")) {
if (!value.equalsIgnoreCase("global") && !value.equalsIgnoreCase("basic") && !value.equalsIgnoreCase("admin")
&& !value.equalsIgnoreCase("subdivision") && !value.equalsIgnoreCase("town") && !value.equalsIgnoreCase("wilderness")) {
&& !value.equalsIgnoreCase("subdivision") && !value.equalsIgnoreCase("town") && !value.equalsIgnoreCase("user")) {
throw new ObjectMappingException("Invalid context '" + key + "' with value '" + value + "'.");
}
contexts.add(new Context("gd_claim_default", value));

View File

@ -28,6 +28,7 @@
import com.griefdefender.configuration.category.DynmapCategory;
import com.griefdefender.configuration.category.MessageCategory;
import com.griefdefender.configuration.category.MigratorCategory;
import com.griefdefender.configuration.category.ModCategory;
import com.griefdefender.configuration.category.PlayerDataCategory;
import com.griefdefender.configuration.category.ThreadCategory;
import com.griefdefender.configuration.category.TownCategory;
@ -43,6 +44,8 @@ public class GlobalConfig extends ConfigBase {
public PlayerDataCategory playerdata = new PlayerDataCategory();
@Setting
public MessageCategory message = new MessageCategory();
@Setting
public ModCategory mod = new ModCategory();
@Setting(comment =
"List of migrators that convert old or other protection data into the current GD claim data format." +
"\nNote: It is recommended to backup data before using.")

View File

@ -33,14 +33,14 @@ public GDCreateClaimEvent(Claim claim) {
super(claim);
}
public static class Pre extends GDCreateClaimEvent {
public static class Pre extends GDCreateClaimEvent implements CreateClaimEvent.Pre {
public Pre(Claim claim) {
super(claim);
}
}
public static class Post extends GDCreateClaimEvent {
public static class Post extends GDCreateClaimEvent implements CreateClaimEvent.Post {
public Post(Claim claim) {
super(claim);

View File

@ -42,11 +42,13 @@
import com.griefdefender.api.permission.option.Options;
import com.griefdefender.cache.EventResultCache;
import com.griefdefender.cache.MessageCache;
import com.griefdefender.cache.PermissionHolderCache;
import com.griefdefender.claim.GDClaim;
import com.griefdefender.claim.GDClaimManager;
import com.griefdefender.configuration.GriefDefenderConfig;
import com.griefdefender.configuration.MessageStorage;
import com.griefdefender.event.GDCauseStackManager;
import com.griefdefender.internal.tracking.PlayerTracker;
import com.griefdefender.internal.tracking.chunk.GDChunk;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.internal.util.VecHelper;
@ -59,6 +61,7 @@
import com.griefdefender.util.BlockUtil;
import com.griefdefender.util.CauseContextHelper;
import com.griefdefender.util.Direction;
import com.griefdefender.util.PlayerUtil;
import com.griefdefender.util.SignUtil;
import net.kyori.text.Component;
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
@ -291,7 +294,7 @@ public void onBlockFromTo(BlockFromToEvent event) {
return;
}
final GDPermissionUser user = CauseContextHelper.getEventUser(fromBlock.getLocation());
final GDPermissionUser user = CauseContextHelper.getEventUser(fromBlock.getLocation(), PlayerTracker.Type.NOTIFIER);
if (user == null) {
return;
}
@ -377,17 +380,17 @@ public void onBlockDecay(LeavesDecayEvent event) {
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockNotify(BlockPhysicsEvent event) {
final Block source = NMSUtil.getInstance().getSourceBlock(event);
if (source != null && GriefDefenderPlugin.isSourceIdBlacklisted("block-notify", source, event.getBlock().getWorld().getUID())) {
if (source == null) {
return;
}
final Location sourceLocation = source != null ? source.getLocation() : null;
final Location sourceLocation = source.getLocation();
if (sourceLocation != null && sourceLocation.equals(event.getBlock().getLocation())) {
return;
}
final GDPermissionUser user = CauseContextHelper.getEventUser(sourceLocation);
Location location = event.getBlock().getLocation();
final Location location = event.getBlock().getLocation();
if (user == null) {
return;
}
@ -397,36 +400,31 @@ public void onBlockNotify(BlockPhysicsEvent event) {
return;
}
GDTimings.BLOCK_NOTIFY_EVENT.startTiming();
GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(world, user.getUniqueId());
GDClaim sourceClaim = null;
if (source != null) {
sourceClaim = this.storage.getClaimAt(sourceLocation);
}
Vector3i pos = VecHelper.toVector3i(location);
GDClaim targetClaim = this.storage.getClaimAt(location);
if (sourceClaim != null && sourceClaim.isWilderness() && targetClaim.isWilderness()) {
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(world, user.getUniqueId());
final GDClaim sourceClaim = this.storage.getClaimAt(sourceLocation);
final Vector3i pos = VecHelper.toVector3i(location);
final GDClaim targetClaim = this.storage.getClaimAt(location);
if (sourceClaim.isWilderness() && targetClaim.isWilderness()) {
if (playerData != null) {
playerData.eventResultCache = new EventResultCache(targetClaim, "block-notify", Tristate.TRUE);
}
GDTimings.BLOCK_NOTIFY_EVENT.stopTiming();
return;
} else if (sourceClaim != null && !sourceClaim.isWilderness() && targetClaim.isWilderness()) {
} else if (!sourceClaim.isWilderness() && targetClaim.isWilderness()) {
if (playerData != null) {
playerData.eventResultCache = new EventResultCache(targetClaim, "block-notify", Tristate.TRUE);
}
GDTimings.BLOCK_NOTIFY_EVENT.stopTiming();
return;
} // Redstone sources can end up in target
else if (sourceClaim != null && sourceClaim.getUniqueId().equals(targetClaim.getUniqueId())) {
else if (sourceClaim.getUniqueId().equals(targetClaim.getUniqueId())) {
if (playerData != null) {
playerData.eventResultCache = new EventResultCache(targetClaim, "block-notify", Tristate.TRUE);
}
GDTimings.BLOCK_NOTIFY_EVENT.stopTiming();
return;
} else {
if (playerData.eventResultCache != null && playerData.eventResultCache.checkEventResultCache(targetClaim) == Tristate.TRUE) {
GDTimings.BLOCK_NOTIFY_EVENT.stopTiming();
return;
}
// Needed to handle levers notifying doors to open etc.
@ -434,12 +432,11 @@ else if (sourceClaim != null && sourceClaim.getUniqueId().equals(targetClaim.get
if (playerData != null) {
playerData.eventResultCache = new EventResultCache(targetClaim, "block-notify", Tristate.TRUE);
}
GDTimings.BLOCK_NOTIFY_EVENT.stopTiming();
return;
}
}
event.setCancelled(true);
GDTimings.BLOCK_NOTIFY_EVENT.stopTiming();
}
@EventHandler(priority = EventPriority.LOWEST)
@ -455,7 +452,7 @@ public void onExplosionEvent(BlockExplodeEvent event) {
return;
}
final GDPermissionUser user = CauseContextHelper.getEventUser(event.getBlock().getLocation());
final GDPermissionUser user = CauseContextHelper.getEventUser(event.getBlock().getLocation(), PlayerTracker.Type.OWNER);
GDTimings.EXPLOSION_EVENT.startTiming();
GDClaim targetClaim = null;
final List<Block> filteredLocations = new ArrayList<>();
@ -499,6 +496,7 @@ public void onBlockBreak(BlockBreakEvent event) {
}
final Player player = event.getPlayer();
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(player);
GDCauseStackManager.getInstance().pushCause(player);
final World world = event.getPlayer().getWorld();
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(world.getUID())) {
@ -522,7 +520,7 @@ public void onBlockBreak(BlockBreakEvent event) {
// check overrides
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_BREAK, player, event.getBlock(), player, TrustTypes.BUILDER, true);
if (result == Tristate.FALSE) {
if (player != null) {
if (!PlayerUtil.getInstance().isFakePlayer(player)) {
Component message = GDPermissionManager.getInstance().getEventMessage();
if (message == null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_BUILD,
@ -585,6 +583,16 @@ public void onBlockPlace(BlockPlaceEvent event) {
// check overrides
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_PLACE, player, block, player, TrustTypes.BUILDER, true);
if (result == Tristate.FALSE) {
if (!PlayerUtil.getInstance().isFakePlayer(player)) {
Component message = GDPermissionManager.getInstance().getEventMessage();
if (message == null) {
message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_BUILD,
ImmutableMap.of(
"player", targetClaim.getOwnerDisplayName()
));
}
GriefDefenderPlugin.sendClaimDenyMessage(targetClaim, player, message);
}
event.setCancelled(true);
GDTimings.BLOCK_PLACE_EVENT.stopTiming();
return;

View File

@ -270,4 +270,22 @@ public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
}
GDTimings.PLAYER_COMMAND_EVENT.stopTiming();
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerCommandMonitor(PlayerCommandPreprocessEvent event) {
String message = event.getMessage();
String arguments = "";
String command = "";
if (!message.contains(" ")) {
command = message.replace("/", "");
} else {
command = message.substring(0, message.indexOf(" ")).replace("/", "");
arguments = message.substring(message.indexOf(" ") + 1, message.length());
}
if (command.equalsIgnoreCase("datapack") && (arguments.contains("enable") || arguments.contains("disable"))) {
if (GriefDefenderPlugin.getInstance().getTagProvider() != null) {
GriefDefenderPlugin.getInstance().getTagProvider().refresh();
}
}
}
}

View File

@ -34,7 +34,6 @@
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockFormEvent;
import com.griefdefender.GriefDefenderPlugin;
import com.griefdefender.api.Tristate;
import com.griefdefender.api.claim.TrustTypes;
@ -42,6 +41,7 @@
import com.griefdefender.cache.PermissionHolderCache;
import com.griefdefender.claim.GDClaim;
import com.griefdefender.event.GDCauseStackManager;
import com.griefdefender.internal.tracking.PlayerTracker;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.permission.GDPermissionManager;
import com.griefdefender.permission.GDPermissionUser;
@ -78,12 +78,12 @@ public void handleBlockSpread(Event event, Block fromBlock, BlockState newState)
}
final Location sourceLocation = fromBlock != null ? fromBlock.getLocation() : null;
final GDPermissionUser user = CauseContextHelper.getEventUser(sourceLocation);
final GDPermissionUser user = CauseContextHelper.getEventUser(sourceLocation, PlayerTracker.Type.NOTIFIER);
Location location = newState.getLocation();
GDClaim targetClaim = this.storage.getClaimAt(location);
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_SPREAD, fromBlock, newState, user, TrustTypes.BUILDER, true);
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_SPREAD, fromBlock, newState.getBlock().isEmpty() ? newState.getType() : newState, user, TrustTypes.BUILDER, true);
if (result == Tristate.FALSE) {
((Cancellable) event).setCancelled(true);
}
@ -114,6 +114,9 @@ public void handleBlockModify(Event event, Object source, BlockState newState) {
if (newState.getType() == Material.AIR) {
// Block -> Air should always be recorded as break
// pass original state for target since AIR is the end result
// In some cases both source and newState will be the same
// ex. turtle egg hatching
handleBlockBreak(event, source, newState);
return;
}
@ -153,7 +156,7 @@ public void handleBlockModify(Event event, Object source, BlockState newState) {
}
}
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_MODIFY, source, newState, user, TrustTypes.BUILDER, true);
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_MODIFY, source, newState.getBlock().isEmpty() ? newState.getType() : newState, user, TrustTypes.BUILDER, true);
if (result == Tristate.FALSE) {
((Cancellable) event).setCancelled(true);
}
@ -186,12 +189,11 @@ public void handleBlockPlace(Event event, Object source, BlockState newState) {
GDPermissionUser user = player != null ? PermissionHolderCache.getInstance().getOrCreateUser(player.getUniqueId()) : GDCauseStackManager.getInstance().getCurrentCause().first(GDPermissionUser.class).orElse(null);
if (user == null && source != null && source instanceof Block) {
final Block sourceBlock = (Block) source;
user = CauseContextHelper.getEventUser(sourceBlock.getLocation());
user = CauseContextHelper.getEventUser(sourceBlock.getLocation(), PlayerTracker.Type.OWNER);
}
GDClaim targetClaim = this.storage.getClaimAt(location);
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_PLACE, source, newState, user, TrustTypes.BUILDER, true);
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, targetClaim, Flags.BLOCK_PLACE, source, newState.getBlock().isEmpty() ? newState.getType() : newState, user, TrustTypes.BUILDER, true);
if (result == Tristate.FALSE) {
((Cancellable) event).setCancelled(true);
}

View File

@ -203,7 +203,7 @@ public boolean onEntityMove(Event event, Location fromLocation, Location toLocat
}
Component farewellMessage = gpEvent.getExitMessage().orElse(null);
if (farewellMessage != null && !farewellMessage.equals(TextComponent.empty())) {
if (farewellMessage != null && !farewellMessage.equals(TextComponent.empty()) && !toClaim.isParent(fromClaim)) {
ChatType chatType = gpEvent.getExitMessageChatType();
if (chatType == ChatTypes.ACTION_BAR) {
TextAdapter.sendActionBar(player, TextComponent.builder("")
@ -306,7 +306,7 @@ public boolean onEntityMove(Event event, Location fromLocation, Location toLocat
}
Component farewellMessage = gpEvent.getExitMessage().orElse(null);
if (farewellMessage != null && !farewellMessage.equals(TextComponent.empty())) {
if (farewellMessage != null && !farewellMessage.equals(TextComponent.empty()) && !toClaim.isParent(fromClaim)) {
ChatType chatType = gpEvent.getExitMessageChatType();
if (chatType == ChatTypes.ACTION_BAR) {
TextAdapter.sendActionBar(player, TextComponent.builder("")

View File

@ -47,6 +47,7 @@
import com.griefdefender.internal.registry.EntityTypeRegistryModule;
import com.griefdefender.internal.registry.GDEntityType;
import com.griefdefender.internal.tracking.EntityTracker;
import com.griefdefender.internal.tracking.PlayerTracker;
import com.griefdefender.internal.tracking.entity.GDEntity;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.permission.GDPermissionManager;
@ -67,6 +68,7 @@
import org.bukkit.block.Block;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.EnderCrystal;
import org.bukkit.entity.Entity;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.FallingBlock;
@ -95,6 +97,8 @@
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.entity.SlimeSplitEvent;
import org.bukkit.event.entity.SpawnerSpawnEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
@ -176,19 +180,20 @@ public void onEntityChangeBlockEvent(EntityChangeBlockEvent event) {
@EventHandler(priority = EventPriority.LOWEST)
public void onExplosionPrimeEvent(ExplosionPrimeEvent event) {
final World world = event.getEntity().getLocation().getWorld();
final Entity source = event.getEntity();
if (!GDFlags.EXPLOSION_BLOCK && !GDFlags.EXPLOSION_ENTITY) {
return;
}
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(world.getUID())) {
return;
}
if (event.getEntity() instanceof Creeper) {
if (source instanceof Creeper || source instanceof EnderCrystal) {
return;
}
GDCauseStackManager.getInstance().pushCause(event.getEntity());
GDCauseStackManager.getInstance().pushCause(source);
GDTimings.ENTITY_EXPLOSION_PRE_EVENT.startTiming();
final GDEntity gdEntity = EntityTracker.getCachedEntity(event.getEntity().getEntityId());
final GDEntity gdEntity = EntityTracker.getCachedEntity(source.getEntityId());
GDPermissionUser user = null;
if (gdEntity != null) {
user = PermissionHolderCache.getInstance().getOrCreateUser(gdEntity.getOwnerUUID());
@ -206,10 +211,10 @@ public void onExplosionPrimeEvent(ExplosionPrimeEvent event) {
// Use any location for permission check
final Vector3i pos = claim.getLesserBoundaryCorner();
Location targetLocation = new Location(location.getWorld(), pos.getX(), pos.getY(), pos.getZ());
Tristate blockResult = GDPermissionManager.getInstance().getFinalPermission(event, location, claim, Flags.EXPLOSION_BLOCK, event.getEntity(), targetLocation, user, true);
Tristate blockResult = GDPermissionManager.getInstance().getFinalPermission(event, location, claim, Flags.EXPLOSION_BLOCK, source, targetLocation, user, true);
if (blockResult == Tristate.FALSE) {
// Check explosion entity
if (GDPermissionManager.getInstance().getFinalPermission(event, location, claim, Flags.EXPLOSION_ENTITY, event.getEntity(), targetLocation, user, true) == Tristate.FALSE) {
if (GDPermissionManager.getInstance().getFinalPermission(event, location, claim, Flags.EXPLOSION_ENTITY, source, targetLocation, user, true) == Tristate.FALSE) {
event.setCancelled(true);
break;
}
@ -292,7 +297,8 @@ public void onVehicleDamage(VehicleDamageEvent event) {
@EventHandler(priority = EventPriority.LOWEST)
public void onVehicleDestroy(VehicleDestroyEvent event) {
GDTimings.ENTITY_DAMAGE_EVENT.startTiming();
if (protectEntity(event, event.getAttacker(), (Entity) event.getVehicle())) {
final Object source = event.getAttacker() != null ? event.getAttacker() : NMSUtil.getInstance().getBlockDamager();
if (protectEntity(event, source, (Entity) event.getVehicle())) {
event.setCancelled(true);
}
GDTimings.ENTITY_DAMAGE_EVENT.stopTiming();
@ -301,7 +307,11 @@ public void onVehicleDestroy(VehicleDestroyEvent event) {
@EventHandler(priority = EventPriority.LOWEST)
public void onEntityDamage(EntityCombustByBlockEvent event) {
GDTimings.ENTITY_DAMAGE_EVENT.startTiming();
if (protectEntity(event, event.getCombuster(), event.getEntity())) {
Object source = event.getCombuster();
if (source == null) {
source = NMSUtil.getInstance().getFlameableBlock(event.getEntity());
}
if (protectEntity(event, source, event.getEntity())) {
event.setCancelled(true);
}
GDTimings.ENTITY_DAMAGE_EVENT.stopTiming();
@ -310,7 +320,11 @@ public void onEntityDamage(EntityCombustByBlockEvent event) {
@EventHandler(priority = EventPriority.LOWEST)
public void onEntityDamage(EntityCombustByEntityEvent event) {
GDTimings.ENTITY_DAMAGE_EVENT.startTiming();
if (protectEntity(event, event.getCombuster(), event.getEntity())) {
Object source = event.getCombuster();
if (source == null) {
source = NMSUtil.getInstance().getFlameableBlock(event.getEntity());
}
if (protectEntity(event, source, event.getEntity())) {
event.setCancelled(true);
}
GDTimings.ENTITY_DAMAGE_EVENT.stopTiming();
@ -322,7 +336,7 @@ public void onEntityDamage(EntityDamageByBlockEvent event) {
return;
}
GDTimings.ENTITY_DAMAGE_EVENT.startTiming();
if (protectEntity(event, event.getDamager(), event.getEntity())) {
if (protectEntity(event, event.getDamager() == null ? event.getCause() : event.getDamager(), event.getEntity())) {
event.setCancelled(true);
}
GDTimings.ENTITY_DAMAGE_EVENT.stopTiming();
@ -403,7 +417,7 @@ public void onEntityDamage(EntityDamageEvent event) {
// Ignore as this is handled above
return;
}
if (event.getCause() == DamageCause.SUFFOCATION || event.getCause() == DamageCause.DROWNING || event.getCause() == DamageCause.SUICIDE) {
if (GriefDefenderPlugin.getGlobalConfig().getConfig().blacklist.entityDamageSourceBlacklist.contains(event.getCause().name().toLowerCase())) {
return;
}
GDTimings.ENTITY_DAMAGE_EVENT.startTiming();
@ -435,11 +449,6 @@ public boolean protectEntity(Event event, Object source, Entity targetEntity) {
}
}
// Get proper source block
if (source == null && event instanceof EntityCombustByBlockEvent) {
source = NMSUtil.getInstance().getFlameableBlock(targetEntity);
}
final GDClaim claim = this.baseStorage.getClaimAt(targetEntity.getLocation());
final GDPermissionUser targetUser = targetEntity instanceof Player ? PermissionHolderCache.getInstance().getOrCreateUser((Player) targetEntity) : null;
GDPermissionUser user = null;
@ -474,7 +483,7 @@ public boolean protectEntity(Event event, Object source, Entity targetEntity) {
}
if (user == null) {
user = owner != null ? PermissionHolderCache.getInstance().getOrCreateUser(owner) : CauseContextHelper.getEventUser(null);
user = PermissionHolderCache.getInstance().getOrCreateUser(owner);
if (user != null) {
GDCauseStackManager.getInstance().pushCause(user);
}
@ -645,6 +654,16 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
handleEntitySpawn(event, event.getSpawnReason(), event.getEntity());
}
@EventHandler(priority = EventPriority.LOWEST)
public void onItemSpawn(ItemSpawnEvent event) {
handleEntitySpawn(event, null, event.getEntity());
}
@EventHandler(priority = EventPriority.LOWEST)
public void onProjectileSpawn(ProjectileLaunchEvent event) {
handleEntitySpawn(event, null, event.getEntity());
}
@EventHandler(priority = EventPriority.LOWEST)
public void onSpawnerSpawn(SpawnerSpawnEvent event) {
handleEntitySpawn(event, event.getSpawner(), event.getEntity());
@ -655,23 +674,6 @@ public void onSlimeSplitEvent(SlimeSplitEvent event) {
handleEntitySpawn(event, event.getEntity(), event.getEntity());
}
@EventHandler(priority = EventPriority.LOWEST)
public void onEntitySpawn(EntitySpawnEvent event) {
final Object source = GDCauseStackManager.getInstance().getCurrentCause().root();
if (source != null && source instanceof GDPermissionUser) {
final GDPermissionUser user = (GDPermissionUser) source;
final GDEntity gdEntity = new GDEntity(event.getEntity().getEntityId());
gdEntity.setOwnerUUID(user.getUniqueId());
gdEntity.setNotifierUUID(user.getUniqueId());
EntityTracker.addTempEntity(gdEntity);
}
handleEntitySpawn(event, null, event.getEntity());
}
//@EventHandler(priority = EventPriority.LOWEST)
//public void onEntitySpawn(EntitySpawnEvent event) {
//}
public void handleEntitySpawn(Event event, Object source, Entity entity) {
if (!GDFlags.ENTITY_SPAWN) {
return;
@ -684,6 +686,16 @@ public void handleEntitySpawn(Event event, Object source, Entity entity) {
if (GriefDefenderPlugin.isSourceIdBlacklisted(Flags.ENTITY_SPAWN.getName(), source, world.getUID())) {
return;
}
final Object root = GDCauseStackManager.getInstance().getCurrentCause().root();
if (root != null && root instanceof GDPermissionUser) {
final GDPermissionUser user = (GDPermissionUser) root;
final GDEntity gdEntity = new GDEntity(entity.getEntityId());
gdEntity.setOwnerUUID(user.getUniqueId());
gdEntity.setNotifierUUID(user.getUniqueId());
EntityTracker.addTempEntity(gdEntity);
}
if (entity instanceof FallingBlock) {
return;
}
@ -691,7 +703,6 @@ public void handleEntitySpawn(Event event, Object source, Entity entity) {
final boolean isEntityProtected = this.isEntityProtected(entity);
GDTimings.ENTITY_SPAWN_EVENT.startTiming();
GDPermissionUser user = null;
final Object root = GDCauseStackManager.getInstance().getCurrentCause().root();
// Make sure not to pass trusted user for non-protected entities such as monsters
if (isEntityProtected) {
user = root instanceof GDPermissionUser && isEntityProtected ? (GDPermissionUser) root : null;
@ -711,7 +722,7 @@ public void handleEntitySpawn(Event event, Object source, Entity entity) {
if (source instanceof CreatureSpawner) {
sourceLocation = ((CreatureSpawner) source).getLocation();
if (isEntityProtected) {
user = CauseContextHelper.getEventUser(sourceLocation);
user = CauseContextHelper.getEventUser(sourceLocation, PlayerTracker.Type.OWNER);
}
} else if (source instanceof Player) {
if (isEntityProtected) {
@ -720,7 +731,7 @@ public void handleEntitySpawn(Event event, Object source, Entity entity) {
} else if (source instanceof Block) {
sourceLocation = ((Block) source).getLocation();
if (isEntityProtected) {
user = CauseContextHelper.getEventUser(sourceLocation);
user = CauseContextHelper.getEventUser(sourceLocation, PlayerTracker.Type.OWNER);
}
// check if claim is rented
if (user != null && GriefDefenderPlugin.getGlobalConfig().getConfig().economy.rentSystem) {

View File

@ -57,6 +57,7 @@
import com.griefdefender.internal.provider.GDWorldEditProvider;
import com.griefdefender.internal.provider.WorldGuardProvider;
import com.griefdefender.internal.registry.BlockTypeRegistryModule;
import com.griefdefender.internal.registry.GDBlockType;
import com.griefdefender.internal.registry.ItemTypeRegistryModule;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.internal.util.VecHelper;
@ -68,6 +69,7 @@
import com.griefdefender.permission.option.GDOptions;
import com.griefdefender.provider.VaultProvider;
import com.griefdefender.storage.BaseStorage;
import com.griefdefender.task.ClaimVisualRevertTask;
import com.griefdefender.text.action.GDCallbackHolder;
import com.griefdefender.util.BlockRay;
import com.griefdefender.util.BlockRayHit;
@ -126,12 +128,15 @@
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitTask;
import java.time.Duration;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@ -313,6 +318,7 @@ public void onPlayerChangeHeldItem(PlayerItemHeldEvent event) {
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
playerData.claimResizing = null;
playerData.claimSubdividing = null;
// always reset to basic claims mode
if (playerData.shovelMode != ShovelTypes.BASIC) {
playerData.shovelMode = ShovelTypes.BASIC;
@ -331,6 +337,23 @@ public void onPlayerChangeHeldItem(PlayerItemHeldEvent event) {
"block-amount", playerData.getRemainingClaimBlocks()));
GriefDefenderPlugin.sendMessage(player, message);
}
} else {
// check for shovel start visuals
if (!playerData.createBlockVisualRevertRunnables.isEmpty()) {
final Iterator<Entry<UUID, Runnable>> iterator = new HashMap<>(playerData.createBlockVisualRevertRunnables).entrySet().iterator();
while (iterator.hasNext()) {
final Entry<UUID, Runnable> revertEntry = iterator.next();
final ClaimVisualRevertTask revertTask = (ClaimVisualRevertTask) revertEntry.getValue();
if (revertTask.isShovelStartVisual()) {
revertTask.run();
final BukkitTask task = playerData.claimVisualRevertTasks.get(revertEntry.getKey());
if (task != null) {
task.cancel();
playerData.claimVisualRevertTasks.remove(revertEntry.getKey());
}
}
}
}
}
GDTimings.PLAYER_CHANGE_HELD_ITEM_EVENT.stopTiming();
}
@ -503,24 +526,30 @@ public void onPlayerInteractItem(PlayerInteractEvent event) {
return;
}
if (playerData.claimMode || (GriefDefenderPlugin.getInstance().modificationTool != null && NMSUtil.getInstance().itemsEqual(itemInHand, GriefDefenderPlugin.getInstance().modificationTool) ||
GriefDefenderPlugin.getInstance().investigationTool != null && NMSUtil.getInstance().itemsEqual(itemInHand, GriefDefenderPlugin.getInstance().investigationTool))) {
final boolean primaryEvent = event.getAction() == Action.LEFT_CLICK_AIR ? 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))) {
investigateClaim(event, player, clickedBlock, itemInHand);
event.setCancelled(true);
return;
}
if ((playerData.claimMode && (NMSUtil.getInstance().isMainHand(event) && (event.getAction() == Action.RIGHT_CLICK_AIR|| event.getAction() == Action.RIGHT_CLICK_BLOCK))) || (!playerData.claimMode && itemInHand != null && GriefDefenderPlugin.getInstance().modificationTool != null && NMSUtil.getInstance().itemsEqual(itemInHand, GriefDefenderPlugin.getInstance().modificationTool))) {
onPlayerHandleClaimCreateAction(event, clickedBlock, player, itemInHand, playerData);
// avoid changing blocks after using a shovel
event.setUseInteractedBlock(Result.DENY);
return;
}
final boolean itemPrimaryBlacklisted = GriefDefenderPlugin.isTargetIdBlacklisted(Flags.INTERACT_ITEM_PRIMARY.getName(), itemInHand, world.getUID());
final boolean itemSecondaryBlacklisted = GriefDefenderPlugin.isTargetIdBlacklisted(Flags.INTERACT_ITEM_SECONDARY.getName(), itemInHand, world.getUID());
if (itemPrimaryBlacklisted && itemSecondaryBlacklisted) {
return;
}
final boolean primaryEvent = event.getAction() == Action.LEFT_CLICK_AIR ? true : false;
final Location location = clickedBlock == null ? event.getPlayer().getLocation() : clickedBlock.getLocation();
final GDClaim claim = this.dataStore.getClaimAt(location);
final Flag flag = primaryEvent ? Flags.INTERACT_ITEM_PRIMARY : Flags.INTERACT_ITEM_SECONDARY;
if ((itemPrimaryBlacklisted && flag == Flags.INTERACT_ITEM_PRIMARY) || (itemSecondaryBlacklisted && flag == Flags.INTERACT_ITEM_SECONDARY)) {
return;
}
@ -535,6 +564,19 @@ public void onPlayerInteractItem(PlayerInteractEvent event) {
lastInteractItemCancelled = true;
return;
}
if (clickedBlock != null && !clickedBlock.isEmpty()) {
if (GDPermissionManager.getInstance().getFinalPermission(event, location, claim, flag, itemInHand, clickedBlock, player, TrustTypes.ACCESSOR, true) == Tristate.FALSE) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_INTERACT_ITEM_BLOCK,
ImmutableMap.of(
"item", ItemTypeRegistryModule.getInstance().getNMSKey(itemInHand),
"block", BlockTypeRegistryModule.getInstance().getNMSKey(clickedBlock)));
GriefDefenderPlugin.sendClaimDenyMessage(claim, player, message);
event.setCancelled(true);
lastInteractItemCancelled = true;
return;
}
}
}
@EventHandler(priority = EventPriority.LOWEST)
@ -762,6 +804,20 @@ public void onPlayerInteractBlockPrimary(PlayerInteractEvent event, Player playe
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerInteractBlockSecondary(PlayerInteractEvent event) {
final Block clickedBlock = event.getClickedBlock();
if (clickedBlock == null) {
return;
}
final String id = GDPermissionManager.getInstance().getPermissionIdentifier(clickedBlock);
final GDBlockType gdBlock = BlockTypeRegistryModule.getInstance().getById(id).orElse(null);
if (gdBlock == null || (!gdBlock.isInteractable() && event.getAction() != Action.PHYSICAL)) {
return;
}
if (NMSUtil.getInstance().isBlockStairs(clickedBlock) && event.getAction() != Action.PHYSICAL) {
return;
}
final Player player = event.getPlayer();
GDCauseStackManager.getInstance().pushCause(player);
final GDPlayerData playerData = this.dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
@ -770,29 +826,22 @@ public void onPlayerInteractBlockSecondary(PlayerInteractEvent event) {
return;
}
final Block clickedBlock = event.getClickedBlock();
final Location location = event.getClickedBlock() != null ? event.getClickedBlock().getLocation() : null;
GDClaim claim = null;
if (location != null) {
claim = this.dataStore.getClaimAt(location);
final Sign sign = SignUtil.getSign(location);
// check sign
if (SignUtil.isSellSign(sign)) {
EconomyUtil.getInstance().buyClaimConsumerConfirmation(player, claim, sign);
return;
}
if (SignUtil.isRentSign(claim, sign)) {
EconomyUtil.getInstance().rentClaimConsumerConfirmation(player, claim, sign);
return;
}
final Location location = clickedBlock.getLocation();
GDClaim claim = this.dataStore.getClaimAt(location);
final Sign sign = SignUtil.getSign(location);
// check sign
if (SignUtil.isSellSign(sign)) {
EconomyUtil.getInstance().buyClaimConsumerConfirmation(player, claim, sign);
return;
}
if (SignUtil.isRentSign(claim, sign)) {
EconomyUtil.getInstance().rentClaimConsumerConfirmation(player, claim, sign);
return;
}
BlockState state = null;
if (clickedBlock != null) {
state = clickedBlock.getState();
}
final BlockState state = clickedBlock.getState();
final ItemStack itemInHand = event.getItem();
final boolean hasInventory = clickedBlock == null ? false : NMSUtil.getInstance().isTileInventory(location) || clickedBlock.getType() == Material.ENDER_CHEST;
final boolean hasInventory = NMSUtil.getInstance().isTileInventory(location) || clickedBlock.getType() == Material.ENDER_CHEST;
if (hasInventory) {
onInventoryOpen(event, state.getLocation(), state, player);
return;
@ -808,20 +857,7 @@ public void onPlayerInteractBlockSecondary(PlayerInteractEvent event) {
GDTimings.PLAYER_INTERACT_BLOCK_SECONDARY_EVENT.startTiming();
final Object source = player;
if (NMSUtil.getInstance().isMainHandSlot(event.getHand()) && (playerData.claimMode || (itemInHand != null && GriefDefenderPlugin.getInstance().modificationTool != null && NMSUtil.getInstance().itemsEqual(itemInHand, GriefDefenderPlugin.getInstance().modificationTool)))) {
onPlayerHandleClaimCreateAction(event, clickedBlock, player, itemInHand, playerData);
// avoid changing blocks after using a shovel
event.setUseInteractedBlock(Result.DENY);
GDTimings.PLAYER_INTERACT_BLOCK_SECONDARY_EVENT.stopTiming();
return;
}
if (location == null) {
GDTimings.PLAYER_INTERACT_BLOCK_SECONDARY_EVENT.stopTiming();
return;
}
final TrustType trustType = NMSUtil.getInstance().isTileInventory(location) || clickedBlock != null && clickedBlock.getType() == Material.ENDER_CHEST ? TrustTypes.CONTAINER : TrustTypes.ACCESSOR;
final TrustType trustType = NMSUtil.getInstance().isTileInventory(location) || clickedBlock.getType() == Material.ENDER_CHEST ? TrustTypes.CONTAINER : TrustTypes.ACCESSOR;
if (GDFlags.INTERACT_BLOCK_SECONDARY && playerData != null) {
Flag flag = Flags.INTERACT_BLOCK_SECONDARY;
if (event.getAction() == Action.PHYSICAL) {
@ -848,12 +884,14 @@ public void onPlayerInteractBlockSecondary(PlayerInteractEvent event) {
this.sendInteractBlockDenyMessage(itemInHand, clickedBlock, claim, player, playerData);
}
} else {
this.sendInteractBlockDenyMessage(itemInHand, clickedBlock, claim, player, playerData);
if (gdBlock != null && gdBlock.isInteractable()) {
this.sendInteractBlockDenyMessage(itemInHand, clickedBlock, claim, player, playerData);
}
}
}
}
event.setCancelled(true);
event.setUseInteractedBlock(Result.DENY);
GDTimings.PLAYER_INTERACT_BLOCK_SECONDARY_EVENT.stopTiming();
return;
}
@ -1024,22 +1062,18 @@ private void onPlayerHandleClaimCreateAction(PlayerInteractEvent event, Block cl
}
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.startTiming();
Location location = clickedBlock != null ? clickedBlock.getLocation() : null;
boolean ignoreAir = false;
if (this.worldEditProvider != null) {
// Ignore air so players can use client-side WECUI block target which uses max reach distance
if (this.worldEditProvider.hasCUISupport(player) && playerData.getClaimCreateMode() == CreateModeTypes.VOLUME && playerData.lastShovelLocation != null) {
ignoreAir = true;
}
}
final int distance = !ignoreAir ? 100 : 5;
final Location location = BlockUtil.getInstance().getTargetBlock(player, playerData, distance, ignoreAir).orElse(null);
if (location == null) {
boolean ignoreAir = false;
if (this.worldEditProvider != null) {
// Ignore air so players can use client-side WECUI block target which uses max reach distance
if (this.worldEditProvider.hasCUISupport(player) && playerData.getClaimCreateMode() == CreateModeTypes.VOLUME && playerData.lastShovelLocation != null) {
ignoreAir = true;
}
}
final int distance = !ignoreAir ? 100 : 5;
location = BlockUtil.getInstance().getTargetBlock(player, playerData, distance, ignoreAir).orElse(null);
if (location == null) {
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
return;
}
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
return;
}
// Always cancel to avoid breaking blocks such as grass
@ -1121,7 +1155,6 @@ private void onPlayerHandleClaimCreateAction(PlayerInteractEvent event, Block cl
return;
} else if (playerData.shovelMode == ShovelTypes.SUBDIVISION && playerData.lastShovelLocation != null) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_SUBDIVISION_FAIL);
playerData.lastShovelLocation = null;
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
return;
}
@ -1215,6 +1248,7 @@ private void createClaimStart(PlayerInteractEvent event, Player player, Location
"item", ItemTypeRegistryModule.getInstance().getNMSKey(event.getItem())));
}
GriefDefenderPlugin.sendMessage(player, message);
playerData.revertTempVisuals();
GDClaimVisual visual = GDClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
visual.apply(player, false);
}
@ -1281,7 +1315,6 @@ private void createClaimFinish(PlayerInteractEvent event, Player player, Locatio
}
return;
} else {
playerData.lastShovelLocation = null;
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_SUCCESS,
ImmutableMap.of(
"type", gdClaim.getFriendlyNameType(true)));
@ -1290,11 +1323,16 @@ private void createClaimFinish(PlayerInteractEvent event, Player player, Locatio
this.worldEditProvider.stopDragVisual(player);
this.worldEditProvider.displayClaimCUIVisual(gdClaim, player, playerData, false);
}
playerData.revertTempVisuals();
final GDClaimVisual visual = gdClaim.getVisualizer();
if (visual.getVisualTransactions().isEmpty()) {
visual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
}
visual.apply(player, false);
playerData.claimSubdividing = null;
playerData.claimResizing = null;
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
}
}
@ -1333,6 +1371,7 @@ private void createSubdivisionStart(PlayerInteractEvent event, Player player, Lo
GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = location;
playerData.claimSubdividing = claim;
playerData.revertTempVisuals();
GDClaimVisual visualization = GDClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
visualization.apply(player, false);
}
@ -1374,11 +1413,10 @@ private void createSubdivisionFinish(PlayerInteractEvent event, Player player, L
event.setCancelled(true);
return;
} else {
playerData.lastShovelLocation = null;
playerData.claimSubdividing = null;
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_SUCCESS, ImmutableMap.of(
"type", gdClaim.getFriendlyNameType(true)));
GriefDefenderPlugin.sendMessage(player, message);
playerData.revertTempVisuals();
final GDClaimVisual visual = gdClaim.getVisualizer();
if (visual.getVisualTransactions().isEmpty()) {
visual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
@ -1388,6 +1426,10 @@ private void createSubdivisionFinish(PlayerInteractEvent event, Player player, L
this.worldEditProvider.stopDragVisual(player);
this.worldEditProvider.displayClaimCUIVisual(gdClaim, player, playerData, false);
}
playerData.claimSubdividing = null;
playerData.claimResizing = null;
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
}
}
@ -1441,6 +1483,7 @@ private void handleResizeStart(PlayerInteractEvent event, Player player, Locatio
this.worldEditProvider.displayClaimCUIVisual(claim, new Vector3i(x, y, z), VecHelper.toVector3i(playerData.lastShovelLocation), player, playerData, false);
}
// Show visual block for resize corner click
playerData.revertTempVisuals();
GDClaimVisual visual = GDClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
visual.apply(player, false);
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_START);
@ -1511,6 +1554,7 @@ private void handleResizeFinish(PlayerInteractEvent event, Player player, Locati
}
}
playerData.claimSubdividing = null;
playerData.claimResizing = null;
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
@ -1545,6 +1589,7 @@ private void handleResizeFinish(PlayerInteractEvent event, Player player, Locati
}
}
playerData.revertClaimVisual((GDClaim) claim);
playerData.revertTempVisuals();
final GDClaimVisual visual = ((GDClaim) claim).getVisualizer();
visual.resetVisuals();
visual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
@ -1559,13 +1604,8 @@ private void handleResizeFinish(PlayerInteractEvent event, Player player, Locati
Set<Claim> claims = new HashSet<>();
claims.add(overlapClaim);
CommandHelper.showOverlapClaims(player, claims, location.getBlockY());
} else {
if (!claimResult.getMessage().isPresent()) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_YOURS);
}
}
playerData.claimSubdividing = null;
event.setCancelled(true);
}
}

View File

@ -70,6 +70,10 @@ public void onWorldSave(WorldSaveEvent event) {
@EventHandler(priority = EventPriority.LOWEST)
public void onChunkLoad(ChunkLoadEvent event) {
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(event.getWorld().getUID())) {
return;
}
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(event.getWorld().getUID());
final GDChunk gdChunk = claimWorldManager.getChunk(event.getChunk());
if (gdChunk != null) {
@ -83,6 +87,10 @@ public void onChunkLoad(ChunkLoadEvent event) {
@EventHandler(priority = EventPriority.LOWEST)
public void onChunkUnload(ChunkUnloadEvent event) {
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(event.getWorld().getUID())) {
return;
}
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(event.getWorld().getUID());
final GDChunk gdChunk = claimWorldManager.getChunk(event.getChunk());
if (gdChunk != null) {

View File

@ -502,7 +502,7 @@ private static void migratePlayerData(World world) {
final int bonusBlocks = Integer.parseInt(lines.get(2));
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(world, uuid);
// Set directly in storage as subject data has not been initialized
playerData.setAccruedClaimBlocks(accruedBlocks);
playerData.setAccruedClaimBlocks(accruedBlocks, false);
playerData.setBonusClaimBlocks(bonusBlocks);
} catch (NumberFormatException e) {
e.printStackTrace();
@ -512,7 +512,13 @@ private static void migratePlayerData(World world) {
}
try {
Files.createFile(gpBukkitPlayerDataMigrated.toPath());
final Path gpPlayerDataPath = gpBukkitPlayerDataMigrated.toPath();
if (Files.notExists(gpPlayerDataPath.getParent())) {
Files.createDirectories(gpPlayerDataPath.getParent());
}
if (Files.notExists(gpPlayerDataPath)) {
Files.createFile(gpPlayerDataPath);
}
} catch (IOException e) {
e.printStackTrace();
}

View File

@ -135,7 +135,7 @@ private static void migratePlayerData(World world) {
} else {
final String contextType = GriefDefenderPlugin.getGlobalConfig().getConfig().playerdata.contextType;
if (contextType.equalsIgnoreCase("world")) {
contexts.add(new Context("world", world.getName().toLowerCase()));
// ignore
} else if (contextType.equalsIgnoreCase("global")) {
contexts.add(new Context("server", "global"));
} else {

View File

@ -26,12 +26,13 @@
public class ContextGroupKeys {
public static final String ALL = "#all";
public static final String ANY = "#any";
public static final String AMBIENT = "#ambient";
public static final String ANIMAL = "#animal";
public static final String AQUATIC = "#aquatic";
public static final String CROPS = "#crops";
public static final String FOOD = "#food";
public static final String HANGING = "#hanging";
public static final String MISC = "#misc";
public static final String MONSTER = "#monster";
public static final String PET = "#pet";

View File

@ -30,24 +30,32 @@
public class ContextGroups {
// Entity groups
public static final Context SOURCE_ALL = new Context(ContextKeys.SOURCE, ContextGroupKeys.ALL);
public static final Context SOURCE_ANY = new Context(ContextKeys.SOURCE, ContextGroupKeys.ANY);
public static final Context SOURCE_AMBIENT = new Context(ContextKeys.SOURCE, ContextGroupKeys.AMBIENT);
public static final Context SOURCE_ANIMAL = new Context(ContextKeys.SOURCE, ContextGroupKeys.ANIMAL);
public static final Context SOURCE_AQUATIC = new Context(ContextKeys.SOURCE, ContextGroupKeys.AQUATIC);
public static final Context SOURCE_CROPS = new Context(ContextKeys.SOURCE, ContextGroupKeys.CROPS);
public static final Context SOURCE_HANGING = new Context(ContextKeys.SOURCE, ContextGroupKeys.HANGING);
public static final Context SOURCE_MISC = new Context(ContextKeys.SOURCE, ContextGroupKeys.MISC);
public static final Context SOURCE_MONSTER = new Context(ContextKeys.SOURCE, ContextGroupKeys.MONSTER);
public static final Context SOURCE_PET = new Context(ContextKeys.SOURCE, ContextGroupKeys.PET);
public static final Context SOURCE_VEHICLE = new Context(ContextKeys.SOURCE, ContextGroupKeys.VEHICLE);
public static final Context TARGET_ALL = new Context(ContextKeys.TARGET, ContextGroupKeys.ALL);
public static final Context TARGET_ANY = new Context(ContextKeys.TARGET, ContextGroupKeys.ANY);
public static final Context TARGET_AMBIENT = new Context(ContextKeys.TARGET, ContextGroupKeys.AMBIENT);
public static final Context TARGET_ANIMAL = new Context(ContextKeys.TARGET, ContextGroupKeys.ANIMAL);
public static final Context TARGET_AQUATIC = new Context(ContextKeys.TARGET, ContextGroupKeys.AQUATIC);
public static final Context TARGET_CROPS = new Context(ContextKeys.TARGET, ContextGroupKeys.CROPS);
public static final Context TARGET_HANGING = new Context(ContextKeys.TARGET, ContextGroupKeys.HANGING);
public static final Context TARGET_MISC = new Context(ContextKeys.TARGET, ContextGroupKeys.MISC);
public static final Context TARGET_MONSTER = new Context(ContextKeys.TARGET, ContextGroupKeys.MONSTER);
public static final Context TARGET_PET = new Context(ContextKeys.TARGET, ContextGroupKeys.PET);
public static final Context TARGET_VEHICLE = new Context(ContextKeys.TARGET, ContextGroupKeys.VEHICLE);
// Item groups
public static final Context SOURCE_FOOD = new Context(ContextKeys.SOURCE, ContextGroupKeys.FOOD);
public static final Context TARGET_FOOD = new Context(ContextKeys.TARGET, ContextGroupKeys.FOOD);
// Custom mod groups
public static final Context SOURCE_PIXELMON = new Context(ContextKeys.SOURCE, "#pixelmon:animal");
public static final Context TARGET_PIXELMON = new Context(ContextKeys.TARGET, "#pixelmon:animal");
}

View File

@ -70,9 +70,11 @@
import com.griefdefender.internal.tracking.chunk.GDChunk;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.permission.option.GDOptions;
import com.griefdefender.provider.PermissionProvider.PermissionDataType;
import com.griefdefender.registry.FlagRegistryModule;
import com.griefdefender.util.EconomyUtil;
import com.griefdefender.util.PermissionUtil;
import com.griefdefender.util.PlayerUtil;
import net.kyori.text.Component;
import net.kyori.text.TextComponent;
@ -197,7 +199,7 @@ public Tristate getFinalPermission(Event event, Location location, Set<Context>
this.eventContexts = new HashSet<>();
if (source instanceof Player && flag != Flags.COLLIDE_BLOCK && flag != Flags.COLLIDE_ENTITY) {
this.addPlayerContexts((Player) source, contexts);
this.addPlayerContexts((Player) source, contexts, flag);
}
final Set<Context> sourceContexts = this.getPermissionContexts((GDClaim) claim, source, true);
@ -221,21 +223,19 @@ public Tristate getFinalPermission(Event event, Location location, Set<Context>
final GDClaim gdClaim = (GDClaim) claim;
final int spawnLimit = gdClaim.getSpawnLimit(contexts);
if (spawnLimit > -1) {
if (target instanceof Entity) {
final Entity entity = (Entity) target;
final int currentEntityCount = gdClaim.countEntities(entity);
if (currentEntityCount >= spawnLimit) {
if (user != null && user.getOnlinePlayer() != null && source == SpawnReason.ENDER_PEARL || source == SpawnReason.SPAWNER_EGG || source == SpawnReason.SPAWNER) {
final String name = entity.getType().getName() == null ? entity.getType().name().toLowerCase() : entity.getType().getName();
final GDEntityType entityType = EntityTypeRegistryModule.getInstance().getById(name).orElse(null);
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.OPTION_APPLY_SPAWN_LIMIT,
ImmutableMap.of(
"type", entityType.getId(),
"limit", spawnLimit));
GriefDefenderPlugin.sendMessage(user.getOnlinePlayer(), message);
}
return this.processResult(claim, flag.getPermission(), "spawn-limit", Tristate.FALSE, this.eventSubject);
final Entity entity = (Entity) target;
final int currentEntityCount = gdClaim.countEntities(entity);
if (currentEntityCount >= spawnLimit) {
if (user != null && user.getOnlinePlayer() != null && (source == SpawnReason.ENDER_PEARL || source == SpawnReason.SPAWNER_EGG || source == SpawnReason.SPAWNER)) {
final String name = entity.getType().getName() == null ? entity.getType().name().toLowerCase() : entity.getType().getName();
final GDEntityType entityType = EntityTypeRegistryModule.getInstance().getById(name).orElse(null);
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.OPTION_APPLY_SPAWN_LIMIT,
ImmutableMap.of(
"type", entityType.getId(),
"limit", spawnLimit));
GriefDefenderPlugin.sendMessage(user.getOnlinePlayer(), message);
}
return this.processResult(claim, flag.getPermission(), "spawn-limit", Tristate.FALSE, this.eventSubject);
}
}
}
@ -244,9 +244,8 @@ public Tristate getFinalPermission(Event event, Location location, Set<Context>
return processResult(claim, targetPermission, "ignore", Tristate.TRUE, user);
}
if (checkOverride) {
Tristate override = Tristate.UNDEFINED;
// First check for claim flag overrides
override = getFlagOverride(claim, permissionHolder == null ? GriefDefenderPlugin.DEFAULT_HOLDER : permissionHolder, playerData, targetPermission);
final Tristate override = getFlagOverride(claim, permissionHolder == null ? GriefDefenderPlugin.DEFAULT_HOLDER : permissionHolder, playerData, targetPermission);
if (override != Tristate.UNDEFINED) {
return processResult(claim, targetPermission, type == null ? "none" : type.getName().toLowerCase(), override, user);
}
@ -303,16 +302,25 @@ public Tristate getFinalPermission(Event event, Location location, Set<Context>
}
if (type != null) {
if (((GDClaim) claim).isUserTrusted(user, type)) {
// check persisted flags
if (!claim.isWilderness()) {
if ((claim.isAdminClaim() && !user.getInternalPlayerData().canManageAdminClaims) || !user.getUniqueId().equals(claim.getOwnerUniqueId())) {
final Tristate result = getUserPermission(user, claim, targetPermission, PermissionDataType.USER_PERSISTENT);
if (result != Tristate.UNDEFINED) {
return processResult(claim, targetPermission, result, user);
}
}
}
return processResult(claim, targetPermission, type.getName().toLowerCase(), Tristate.TRUE, permissionHolder);
}
}
return getUserPermission(user, claim, targetPermission);
return getUserPermission(user, claim, targetPermission, PermissionDataType.ALL);
}
return getClaimFlagPermission(claim, targetPermission);
}
private Tristate getUserPermission(GDPermissionHolder holder, Claim claim, String permission) {
private Tristate getUserPermission(GDPermissionHolder holder, Claim claim, String permission, PermissionDataType dataType) {
final List<Claim> inheritParents = claim.getInheritedParents();
final Set<Context> contexts = new HashSet<>();
contexts.addAll(this.eventContexts);
@ -321,7 +329,7 @@ private Tristate getUserPermission(GDPermissionHolder holder, Claim claim, Strin
GDClaim parent = (GDClaim) parentClaim;
// check parent context
contexts.add(parent.getContext());
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, holder, permission, contexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, holder, permission, contexts, dataType);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, holder);
}
@ -331,22 +339,17 @@ private Tristate getUserPermission(GDPermissionHolder holder, Claim claim, Strin
// Check claim context
contexts.add(claim.getContext());
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, holder, permission, contexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, holder, permission, contexts, dataType);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, holder);
}
// Check default type context
contexts.add(claim.getType().getContext());
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, holder, permission, contexts);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, holder);
if (dataType == PermissionDataType.USER_PERSISTENT) {
// don't log, just return result
return value;
}
if (holder == GriefDefenderPlugin.DEFAULT_HOLDER) {
return getFlagDefaultPermission(claim, permission, contexts);
}
return getClaimFlagPermission(claim, permission, contexts, inheritParents);
contexts.remove(claim.getContext());
return getFlagDefaultPermission(claim, permission, contexts);
}
private Tristate getClaimFlagPermission(Claim claim, String permission) {
@ -363,7 +366,7 @@ private Tristate getClaimFlagPermission(Claim claim, String permission, Set<Cont
GDClaim parent = (GDClaim) parentClaim;
// check parent context
contexts.add(parent.getContext());
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts, PermissionDataType.PERSISTENT);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, GriefDefenderPlugin.DEFAULT_HOLDER);
}
@ -373,7 +376,7 @@ private Tristate getClaimFlagPermission(Claim claim, String permission, Set<Cont
contexts.add(claim.getContext());
}
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts, PermissionDataType.PERSISTENT);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, GriefDefenderPlugin.DEFAULT_HOLDER);
}
@ -384,16 +387,30 @@ private Tristate getClaimFlagPermission(Claim claim, String permission, Set<Cont
// Only uses world and claim type contexts
private Tristate getFlagDefaultPermission(Claim claim, String permission, Set<Context> contexts) {
contexts.add(claim.getDefaultTypeContext());
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts, PermissionDataType.PERSISTENT);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, GriefDefenderPlugin.DEFAULT_HOLDER);
}
contexts.remove(claim.getDefaultTypeContext());
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
contexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts, PermissionDataType.ALL);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, GriefDefenderPlugin.DEFAULT_HOLDER);
}
contexts.remove(ClaimContexts.USER_DEFAULT_CONTEXT);
} else {
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts, PermissionDataType.ALL);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, GriefDefenderPlugin.DEFAULT_HOLDER);
}
}
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts);
contexts.remove(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
contexts.add(claim.getDefaultTypeContext());
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, GriefDefenderPlugin.DEFAULT_HOLDER, permission, contexts, PermissionDataType.TRANSIENT);
if (value != Tristate.UNDEFINED) {
return processResult(claim, permission, value, GriefDefenderPlugin.DEFAULT_HOLDER);
}
@ -418,7 +435,7 @@ private Tristate getFlagOverride(Claim claim, GDPermissionHolder permissionHolde
contexts.add(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT);
player = permissionHolder instanceof GDPermissionUser ? ((GDPermissionUser) permissionHolder).getOnlinePlayer() : null;
}
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
contexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
@ -426,7 +443,7 @@ private Tristate getFlagOverride(Claim claim, GDPermissionHolder permissionHolde
contexts.add(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT);
contexts.addAll(this.eventContexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, permissionHolder, flagPermission, contexts);
Tristate value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, permissionHolder, flagPermission, contexts, PermissionDataType.PERSISTENT);
if (value == Tristate.UNDEFINED) {
// check claim owner parent override
/*final List<Claim> inheritParents = claim.getInheritedParents();
@ -453,7 +470,7 @@ private Tristate getFlagOverride(Claim claim, GDPermissionHolder permissionHolde
contexts.add(((GDClaim) claim).getWorldContext());
contexts.addAll(this.eventContexts);
contexts.add(claim.getOverrideClaimContext());
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, permissionHolder, flagPermission, contexts);
value = PermissionUtil.getInstance().getPermissionValue((GDClaim) claim, permissionHolder, flagPermission, contexts, PermissionDataType.PERSISTENT);
}
if (value != Tristate.UNDEFINED) {
if (value == Tristate.FALSE) {
@ -462,10 +479,6 @@ private Tristate getFlagOverride(Claim claim, GDPermissionHolder permissionHolde
return processResult(claim, flagPermission, value, permissionHolder);
}
if (permissionHolder != GriefDefenderPlugin.DEFAULT_HOLDER) {
return getFlagOverride(claim, GriefDefenderPlugin.DEFAULT_HOLDER, playerData, flagPermission);
}
return Tristate.UNDEFINED;
}
@ -556,7 +569,7 @@ public String getPermissionIdentifier(Object obj, boolean isSource) {
}
final String name = targetEntity.getType().getName() == null ? targetEntity.getType().name().toLowerCase() : targetEntity.getType().getName();
final GDEntityType type = EntityTypeRegistryModule.getInstance().getById(name).orElse(null);
final GDEntityType type = EntityTypeRegistryModule.getInstance().getByBukkitType(targetEntity);
if (type == null) {
// Should never happen
return name;
@ -572,6 +585,9 @@ public String getPermissionIdentifier(Object obj, boolean isSource) {
final BlockState blockstate = (BlockState) obj;
final String id = BlockTypeRegistryModule.getInstance().getNMSKey(blockstate);
return populateEventSourceTarget(id, isSource);
} else if (obj instanceof Material) {
final String id = ((Material) obj).name().toLowerCase();
return populateEventSourceTarget(id, isSource);
} /*else if (obj instanceof TileEntity) {
TileEntity tileEntity = (TileEntity) obj;
final String id = tileEntity.getMinecraftKeyString();
@ -616,9 +632,9 @@ public Set<Context> getPermissionContexts(GDClaim claim, Object obj, boolean isS
final Set<Context> contexts = new HashSet<>();
if (obj == null) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_ALL);
contexts.add(ContextGroups.SOURCE_ANY);
} else {
contexts.add(ContextGroups.TARGET_ALL);
contexts.add(ContextGroups.TARGET_ANY);
}
return contexts;
}
@ -634,17 +650,17 @@ public Set<Context> getPermissionContexts(GDClaim claim, Object obj, boolean isS
return contexts;
}
final String name = targetEntity.getType().getName() == null ? targetEntity.getType().name().toLowerCase() : targetEntity.getType().getName();
final GDEntityType type = EntityTypeRegistryModule.getInstance().getById(name).orElse(null);
if (type == null) {
// Should never happen
return contexts;
}
final GDEntityType type = EntityTypeRegistryModule.getInstance().getByBukkitType(targetEntity);
String id = type.getId();
if (!(targetEntity instanceof Player)) {
addCustomEntityTypeContexts(targetEntity, id, contexts, type, isSource);
} else {
final Player player = (Player) targetEntity;
if (PlayerUtil.getInstance().isFakePlayer(player)) {
final String modId = EntityTypeRegistryModule.getInstance().findModIdFromBukkit(targetEntity);
id = modId + ":fakeplayer_" + EntityTypeRegistryModule.getInstance().getFriendlyName(targetEntity.getName());
}
}
if (this.isObjectIdBanned(claim, id, BanType.ENTITY)) {
@ -658,6 +674,7 @@ public Set<Context> getPermissionContexts(GDClaim claim, Object obj, boolean isS
if (this.isObjectIdBanned(claim, id, BanType.BLOCK)) {
return null;
}
return populateEventSourceTargetContext(contexts, id, isSource);
} else if (obj instanceof BlockState) {
final BlockState blockstate = (BlockState) obj;
@ -666,6 +683,10 @@ public Set<Context> getPermissionContexts(GDClaim claim, Object obj, boolean isS
if (this.isObjectIdBanned(claim, id, BanType.BLOCK)) {
return null;
}
return populateEventSourceTargetContext(contexts, id, isSource);
} else if (obj instanceof Material) {
final String id = ((Material) obj).name().toLowerCase();
return populateEventSourceTargetContext(contexts, id, isSource);
} else if (obj instanceof Inventory) {
final String id = ((Inventory) obj).getType().name().toLowerCase();
@ -682,10 +703,25 @@ public Set<Context> getPermissionContexts(GDClaim claim, Object obj, boolean isS
contexts.add(ContextGroups.TARGET_FOOD);
}
}
if (NMSUtil.getInstance().isItemHanging(itemstack)) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_HANGING);
} else {
contexts.add(ContextGroups.TARGET_HANGING);
}
}
if (NMSUtil.getInstance().isItemBoat(itemstack) || NMSUtil.getInstance().isItemMinecart(itemstack)) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_VEHICLE);
} else {
contexts.add(ContextGroups.TARGET_VEHICLE);
}
}
String id = ItemTypeRegistryModule.getInstance().getNMSKey(itemstack);
if (this.isObjectIdBanned(claim, id, BanType.ITEM)) {
return null;
}
return populateEventSourceTargetContext(contexts, id, isSource);
} else if (obj instanceof DamageCause) {
final DamageCause damageCause = (DamageCause) obj;
@ -775,9 +811,11 @@ public boolean isObjectIdBanned(GDClaim claim, String id, BanType type) {
public void addCustomEntityTypeContexts(Entity targetEntity, String id, Set<Context> contexts, GDEntityType type, boolean isSource) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_ALL);
contexts.add(ContextGroups.SOURCE_ANY);
contexts.add(new Context(ContextKeys.SOURCE, "#" + type.getModId().toLowerCase() + ":any"));
} else {
contexts.add(ContextGroups.TARGET_ALL);
contexts.add(ContextGroups.TARGET_ANY);
contexts.add(new Context(ContextKeys.TARGET, "#" + type.getModId().toLowerCase() + ":any"));
}
// check vehicle
if (targetEntity instanceof Vehicle) {
@ -787,67 +825,104 @@ public void addCustomEntityTypeContexts(Entity targetEntity, String id, Set<Cont
contexts.add(ContextGroups.TARGET_VEHICLE);
}
}
// pixelmon
if (targetEntity.getType() != null && targetEntity.getType().name().equalsIgnoreCase("pixelmon_pixelmon") || targetEntity.getType().name().equalsIgnoreCase("pixelmon")) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_PIXELMON);
} else {
contexts.add(ContextGroups.TARGET_PIXELMON);
}
}
final String creatureType = type.getEnumCreatureTypeId();
if (creatureType == null) {
return;
}
final String modId = type.getModId().toLowerCase();
if (creatureType.contains("animal")) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_ANIMAL);
contexts.add(new Context(ContextKeys.SOURCE, "#" + modId + ":animal"));
} else {
contexts.add(ContextGroups.TARGET_ANIMAL);
contexts.add(new Context(ContextKeys.TARGET, "#" + modId + ":animal"));
}
this.checkPetContext(targetEntity, id, contexts);
this.checkPetContext(targetEntity, modId, contexts, isSource);
} else if (creatureType.contains("aquatic")) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_AQUATIC);
contexts.add(new Context(ContextKeys.SOURCE, "#" + modId + ":aquatic"));
} else {
contexts.add(ContextGroups.TARGET_AQUATIC);
contexts.add(new Context(ContextKeys.TARGET, "#" + modId + ":aquatic"));
}
this.checkPetContext(targetEntity, id, contexts);
this.checkPetContext(targetEntity, modId, contexts, isSource);
} else if (creatureType.contains("monster")) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_MONSTER);
contexts.add(new Context(ContextKeys.SOURCE, "#" + modId + ":monster"));
} else {
contexts.add(ContextGroups.TARGET_MONSTER);
contexts.add(new Context(ContextKeys.TARGET, "#" + modId + ":monster"));
}
} else if (creatureType.contains("ambient")) {
if (isSource) {
contexts.add(ContextGroups.SOURCE_AMBIENT);
contexts.add(new Context(ContextKeys.SOURCE, "#" + modId + ":ambient"));
} else {
contexts.add(ContextGroups.TARGET_AMBIENT);
contexts.add(new Context(ContextKeys.TARGET, "#" + modId + ":ambient"));
}
this.checkPetContext(targetEntity, id, contexts);
this.checkPetContext(targetEntity, modId, contexts, isSource);
} else {
if (isSource) {
contexts.add(ContextGroups.SOURCE_MISC);
contexts.add(new Context(ContextKeys.SOURCE, "#" + modId + ":misc"));
} else {
contexts.add(ContextGroups.TARGET_MISC);
contexts.add(new Context(ContextKeys.TARGET, "#" + modId + ":misc"));
}
}
}
private void checkPetContext(Entity targetEntity, String id, Set<Context> contexts) {
private void checkPetContext(Entity targetEntity, String modId, Set<Context> contexts, boolean isSource) {
if (this.eventSubject != null && this.eventSubject instanceof GDPermissionUser) {
final GDPermissionUser user = (GDPermissionUser) this.eventSubject;
final UUID uuid = NMSUtil.getInstance().getTameableOwnerUUID(targetEntity);
if (uuid != null && uuid.equals(user.getUniqueId())) {
contexts.add(new Context(ContextGroupKeys.PET, id));
if (isSource) {
contexts.add(ContextGroups.SOURCE_PET);
if (modId != null && !modId.isEmpty()) {
contexts.add(new Context(ContextKeys.SOURCE, "#" + modId + ":pet"));
}
} else {
contexts.add(ContextGroups.TARGET_PET);
if (modId != null && !modId.isEmpty()) {
contexts.add(new Context(ContextKeys.TARGET, "#" + modId + ":pet"));
}
}
}
}
}
private void addPlayerContexts(Player player, Set<Context> contexts) {
if(!PermissionUtil.getInstance().containsKey(contexts, "used_item")) {
private void addPlayerContexts(Player player, Set<Context> contexts, Flag flag) {
Context usedItemContext = null;
for (Context context : contexts) {
if (context.getKey().equals(ContextKeys.USED_ITEM)) {
usedItemContext = context;
break;
}
}
if(usedItemContext == null) {
// special case
if (this.currentEvent instanceof PlayerBucketEvent) {
final PlayerBucketEvent bucketEvent = (PlayerBucketEvent) this.currentEvent;
contexts.add(new Context("used_item", "minecraft:" + bucketEvent.getBucket().name().toLowerCase()));
contexts.add(new Context(ContextKeys.USED_ITEM, "minecraft:" + bucketEvent.getBucket().name().toLowerCase()));
} else {
final ItemStack stack = NMSUtil.getInstance().getActiveItem(player, this.currentEvent);
if (stack != null && stack.getType() != Material.AIR) {
contexts.add(new Context("used_item", getPermissionIdentifier(stack)));
final String stackId = getPermissionIdentifier(stack);
contexts.add(new Context(ContextKeys.USED_ITEM, stackId));
if (stack.getItemMeta() != null && stack.getItemMeta().getDisplayName() != null) {
String itemName = stack.getItemMeta().getDisplayName().replaceAll("[^A-Za-z0-9]", "").toLowerCase();
if (itemName != null && !itemName.isEmpty()) {
@ -857,6 +932,31 @@ private void addPlayerContexts(Player player, Set<Context> contexts) {
contexts.add(new Context("item_name", itemName));
}
}
// populate item tag
if (GriefDefenderPlugin.getInstance().getTagProvider() != null) {
final Set<Context> tagContexts = GriefDefenderPlugin.getInstance().getTagProvider().getTagMap().get(stackId);
if (tagContexts != null) {
for (Context context : tagContexts) {
contexts.add(new Context(ContextKeys.USED_ITEM, "#" + context.getKey() + ":" + context.getValue()));
if (context.getKey().equalsIgnoreCase("minecraft")) {
contexts.add(new Context(ContextKeys.USED_ITEM, "#" + context.getValue()));
}
}
}
}
}
}
} else {
// populate item tag
if (GriefDefenderPlugin.getInstance().getTagProvider() != null) {
final Set<Context> tagContexts = GriefDefenderPlugin.getInstance().getTagProvider().getTagMap().get(usedItemContext.getValue());
if (tagContexts != null) {
for (Context context : tagContexts) {
contexts.add(new Context(ContextKeys.USED_ITEM, "#" + context.getKey() + ":" + context.getValue()));
if (context.getKey().equalsIgnoreCase("minecraft")) {
contexts.add(new Context(ContextKeys.USED_ITEM, "#" + context.getValue()));
}
}
}
}
}
@ -908,11 +1008,10 @@ public String getIdentifierWithoutMeta(String targetId) {
}
private Set<Context> populateEventSourceTargetContext(Set<Context> contexts, String id, boolean isSource) {
contexts = this.populateTagContextsForId(contexts, id, isSource);
if (!id.contains(":")) {
id = "minecraft:" + id;
}
contexts = this.populateTagContextsForId(contexts, id, isSource);
final String[] parts = id.split(":");
final String modId = parts[0];
if (isSource) {
@ -1186,7 +1285,7 @@ public <T> T getInternalOptionValue(TypeToken<T> type, GDPermissionHolder holder
} else if (claim.isWilderness()) {
optionContexts.add(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT);
}
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
optionContexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
@ -1244,10 +1343,8 @@ public <T> T getInternalOptionValue(TypeToken<T> type, GDPermissionHolder holder
}
optionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
if (claim != null) {
if (!claim.isWilderness() && !claim.isAdminClaim()) {
optionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
}
if (claim != null && !claim.isWilderness()) {
optionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
}
value = this.getOptionActualValue(type, holder, option, optionContexts);
if (value != null) {

View File

@ -56,7 +56,13 @@ public GDPermissionUser(Player player) {
public GDPermissionUser(OfflinePlayer player) {
super(player.getUniqueId().toString());
this.uniqueId = player.getUniqueId();
this.userName = player.getName();
if (player instanceof Player) {
// OfflinePlayer getName returns null sometimes
// Always use Player getName if available
this.userName = ((Player) player).getName();
} else {
this.userName = player.getName();
}
}
public GDPermissionUser(UUID uuid, String objectName, String friendlyName) {

View File

@ -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";

View File

@ -70,9 +70,14 @@ public class FlagContexts {
public static final Context TARGET_CHEST = new Context(ContextKeys.TARGET, "minecraft:chest");
public static final Context TARGET_CHORUS_FRUIT = new Context(ContextKeys.TARGET, "minecraft:chorus_fruit");
public static final Context TARGET_ENDERPEARL = new Context(ContextKeys.TARGET, "minecraft:enderpearl");
public static final Context TARGET_ENTITY_ARMOR_STAND = new Context(ContextKeys.TARGET, "minecraft:armorstand");
public static final Context TARGET_ENTITY_ENDER_CRYSTAL = new Context(ContextKeys.TARGET, "minecraft:endercrystal");
public static final Context TARGET_FARMLAND = new Context(ContextKeys.TARGET, "minecraft:farmland");
public static final Context TARGET_FLINTANDSTEEL = new Context(ContextKeys.TARGET, "minecraft:flint_and_steel");
public static final Context TARGET_GRASS= new Context(ContextKeys.TARGET, "minecraft:grass");
public static final Context TARGET_HANGING = new Context(ContextKeys.TARGET, "#hanging");
public static final Context TARGET_ITEM_ARMOR_STAND = new Context(ContextKeys.TARGET, "minecraft:armor_stand");
public static final Context TARGET_ITEM_END_CRYSTAL = new Context(ContextKeys.TARGET, "minecraft:end_crystal");
public static final Context TARGET_ITEM_FRAME = new Context(ContextKeys.TARGET, "minecraft:item_frame");
public static final Context TARGET_LAVA_BUCKET = new Context(ContextKeys.TARGET, "minecraft:lava_bucket");
public static final Context TARGET_MINECART = new Context(ContextKeys.TARGET, "minecraft:minecart");
@ -93,6 +98,7 @@ public class FlagContexts {
public static final Context TARGET_TYPE_CROP = new Context(ContextKeys.TARGET, "#crops");
public static final Context TARGET_TYPE_AMBIENT = new Context(ContextKeys.TARGET, "#ambient");
public static final Context TARGET_TYPE_AQUATIC = new Context(ContextKeys.TARGET, "#aquatic");
public static final Context TARGET_TYPE_FOOD = new Context(ContextKeys.TARGET, "#food");
public static final Context TARGET_TYPE_MONSTER = new Context(ContextKeys.TARGET, "#monster");
public static final Context TARGET_TYPE_MUSHROOM = new Context(ContextKeys.TARGET, "#mushroom");
public static final Context TARGET_TYPE_PORTAL = new Context(ContextKeys.TARGET, "#portal");

View File

@ -138,10 +138,10 @@ public Component getComponent(String flagGroup) {
final boolean contextNewLine = this.flagDefinition.getFlagData().size() <= 2;
for (Context context : this.contexts) {
if ((!this.flagDefinition.isAdmin() || flagGroup.equalsIgnoreCase("user")) && context.getKey().contains("gd_claim")) {
if (context.getKey().contains("default") || context.getKey().contains("override")) {
// Only used in config for startup
continue;
}
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;

View File

@ -56,8 +56,23 @@ public boolean addContexts(Flag flag, Boolean value, MenuType type, Set<Context>
// ignore
return false;
}
final boolean hasGlobalDefault = contexts.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
final boolean hasGlobalOverride = contexts.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT);
final boolean hasUserDefault = contexts.contains(ClaimContexts.USER_DEFAULT_CONTEXT);
final boolean hasUserOverride = contexts.contains(ClaimContexts.USER_OVERRIDE_CONTEXT);
// Context Default Types have higher priority than global
if (contexts.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
if (hasGlobalDefault && hasUserDefault) {
for (Context context : flagHolder.getAllContexts()) {
if (context.getKey().equalsIgnoreCase("gd_claim_default")) {
if (!context.getValue().equalsIgnoreCase("global") && !context.getValue().equalsIgnoreCase("user")) {
return false;
}
}
}
}
if (hasGlobalDefault && !hasUserDefault) {
for (Context context : flagHolder.getAllContexts()) {
if (context.getKey().equalsIgnoreCase("gd_claim_default")) {
if (!context.getValue().equalsIgnoreCase("global")) {
@ -66,8 +81,18 @@ public boolean addContexts(Flag flag, Boolean value, MenuType type, Set<Context>
}
}
}
// Context Override Types have higher priority than global
if (contexts.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT)) {
if (hasGlobalOverride && hasUserOverride) {
for (Context context : flagHolder.getAllContexts()) {
if (context.getKey().equalsIgnoreCase("gd_claim_override")) {
if (!context.getValue().equalsIgnoreCase("global") && !context.getValue().equalsIgnoreCase("user")) {
return false;
}
}
}
}
if (hasGlobalOverride && !hasUserOverride) {
for (Context context : flagHolder.getAllContexts()) {
if (context.getKey().equalsIgnoreCase("gd_claim_override")) {
if (!context.getValue().equalsIgnoreCase("global")) {

View File

@ -24,7 +24,6 @@
*/
package com.griefdefender.provider;
import com.github.benmanes.caffeine.cache.Cache;
import com.google.common.collect.ImmutableSet;
import com.griefdefender.GDPlayerData;
import com.griefdefender.GriefDefenderPlugin;
@ -62,6 +61,8 @@
import net.luckperms.api.query.QueryOptions;
import net.luckperms.api.query.dataorder.DataQueryOrder;
import net.luckperms.api.query.dataorder.DataQueryOrderFunction;
import net.luckperms.api.query.dataorder.DataTypeFilter;
import net.luckperms.api.query.dataorder.DataTypeFilterFunction;
import java.util.ArrayList;
import java.util.Collection;
@ -70,17 +71,17 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;
import java.util.UUID;
import java.util.Map.Entry;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.function.Predicate;
import org.apache.commons.io.FilenameUtils;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.checkerframework.checker.nullness.qual.NonNull;
public class LuckPermsProvider implements PermissionProvider {
@ -99,6 +100,9 @@ public int compare(Set<Context> s1, Set<Context> s2) {
private final LuckPerms luckPermsApi;
private final static DefaultDataQueryOrderFunction DEFAULT_DATA_QUERY_ORDER = new DefaultDataQueryOrderFunction();
private final static DefaultPersistentOnlyDataFilter DEFAULT_PERSISTENT_ONLY = new DefaultPersistentOnlyDataFilter();
private final static DefaultTransientOnlyDataFilter DEFAULT_TRANSIENT_ONLY = new DefaultTransientOnlyDataFilter();
private final static UserPersistentOnlyDataFilter USER_PERSISTENT_ONLY = new UserPersistentOnlyDataFilter();
public LuckPermsProvider() {
this.luckPermsApi = Bukkit.getServicesManager().getRegistration(LuckPerms.class).getProvider();
@ -139,15 +143,20 @@ public User getLuckPermsUser(String identifier) {
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
} else {
user = this.luckPermsApi.getUserManager().getUser(identifier);
if (user == null) {
try {
uuid = this.luckPermsApi.getUserManager().lookupUniqueId(identifier).get();
} catch (Throwable t) {
// ignore
}
}
}
if (uuid != null) {
user = this.getUserSubject(uuid);
}
if (user == null) {
user = this.luckPermsApi.getUserManager().getUser(identifier);
}
return user;
}
@ -562,6 +571,21 @@ public Set<Context> getGPContexts(ContextSet contextSet) {
return gpContexts;
}
@Override
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
return this.getPermissionValue(holder, permission, contexts, PermissionDataType.ALL);
}
@Override
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
return this.getPermissionValue(holder, permission, contexts);
}
@Override
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, PermissionDataType type) {
return this.getPermissionValue(holder, permission, contexts, type);
}
public Tristate getPermissionValue(GDPermissionHolder holder, String permission) {
final Set<Context> contexts = new HashSet<>();
this.checkServerContext(contexts);
@ -569,136 +593,36 @@ public Tristate getPermissionValue(GDPermissionHolder holder, String permission)
return this.getPermissionValue(holder, permission, set);
}
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, MutableContextSet contexts) {
return this.getPermissionValue(claim, holder, permission, this.getGDContexts(contexts));
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, MutableContextSet contexts) {
return this.getPermissionValue(holder, permission, this.getGDContexts(contexts));
}
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts, PermissionDataType type) {
this.checkServerContext(contexts);
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
return this.getPermissionValue(holder, permission, contextSet);
}
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, boolean checkTransient) {
final Set<Context> activeContexts = new HashSet<>();
this.addActiveContexts(activeContexts, holder, null, claim);
contexts.addAll(activeContexts);
this.checkServerContext(contexts);
final int contextHash = Objects.hash(claim, holder, permission, contexts);
final Cache<Integer, Tristate> cache = PermissionHolderCache.getInstance().getOrCreatePermissionCache(holder);
Tristate result = cache.getIfPresent(contextHash);
if (result != null) {
return result;
}
// check persistent permissions first
Map<Set<Context>, Map<String, Boolean>> permanentPermissions = getPermanentPermissions(holder);
for (Entry<Set<Context>, Map<String, Boolean>> entry : permanentPermissions.entrySet()) {
if (entry.getKey().isEmpty()) {
continue;
}
boolean match = true;
for (Context context : entry.getKey()) {
if (!contexts.contains(context)) {
match = false;
break;
}
}
if (match) {
for (Map.Entry<String, Boolean> permEntry : entry.getValue().entrySet()) {
if (FilenameUtils.wildcardMatch(permission, permEntry.getKey())) {
final Tristate value = Tristate.fromBoolean(permEntry.getValue());
cache.put(contextHash, value);
return value;
}
}
// If we get here, continue on normally
continue;
}
}
if (!checkTransient) {
return Tristate.UNDEFINED;
}
// check transient permissions last
Map<Set<Context>, Map<String, Boolean>> transientPermissions = getTransientPermissions(holder);
for (Entry<Set<Context>, Map<String, Boolean>> entry : transientPermissions.entrySet()) {
if (entry.getKey().isEmpty()) {
continue;
}
boolean match = true;
for (Context context : entry.getKey()) {
if (!contexts.contains(context)) {
match = false;
break;
}
}
if (match) {
for (Map.Entry<String, Boolean> permEntry : entry.getValue().entrySet()) {
if (FilenameUtils.wildcardMatch(permission, permEntry.getKey())) {
final Tristate value = Tristate.fromBoolean(permEntry.getValue());
cache.put(contextHash, value);
return value;
}
}
// If we get here, continue on normally
continue;
}
}
cache.put(contextHash, Tristate.UNDEFINED);
return Tristate.UNDEFINED;
}
public Tristate getPermissionValueWithRequiredContexts(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, String contextFilter) {
Map<Set<Context>, Map<String, Boolean>> permanentPermissions = getPermanentPermissions(holder);
for (Entry<Set<Context>, Map<String, Boolean>> entry : permanentPermissions.entrySet()) {
if (entry.getKey().isEmpty()) {
continue;
}
boolean match = true;
for (Context context : entry.getKey()) {
if (!contexts.contains(context)) {
match = false;
break;
}
}
// Check for required contexts
for (Context context : contexts) {
if (!context.getKey().contains(contextFilter) && !context.getKey().equalsIgnoreCase("world")) {
if (!entry.getKey().contains(context)) {
match = false;
break;
}
}
}
if (match) {
for (Map.Entry<String, Boolean> permEntry : entry.getValue().entrySet()) {
if (FilenameUtils.wildcardMatch(permission, permEntry.getKey())) {
final Tristate value = Tristate.fromBoolean(permEntry.getValue());
return value;
}
}
}
}
return Tristate.UNDEFINED;
}
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
this.checkServerContext(contexts);
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
return this.getPermissionValue(holder, permission, contextSet);
return this.getPermissionValue(holder, permission, contextSet, type);
}
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, ContextSet contexts) {
return this.getPermissionValue(holder, permission, contexts, PermissionDataType.ALL);
}
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, ContextSet contexts, PermissionDataType type) {
final PermissionHolder permissionHolder = this.getLuckPermsHolder(holder);
if (permissionHolder == null) {
return Tristate.UNDEFINED;
}
final QueryOptions query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).context(contexts).build();
QueryOptions query = null;
if (type == PermissionDataType.TRANSIENT) {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).option(DataTypeFilterFunction.KEY, DEFAULT_TRANSIENT_ONLY).context(contexts).build();
} else if (type == PermissionDataType.PERSISTENT) {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).option(DataTypeFilterFunction.KEY, DEFAULT_PERSISTENT_ONLY).context(contexts).build();
} else if (type == PermissionDataType.USER_PERSISTENT) {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).option(DataTypeFilterFunction.KEY, USER_PERSISTENT_ONLY).context(contexts).build();
} else {
query = QueryOptions.builder(QueryMode.CONTEXTUAL).option(DataQueryOrderFunction.KEY, DEFAULT_DATA_QUERY_ORDER).context(contexts).build();
}
CachedPermissionData cachedData = permissionHolder.getCachedData().getPermissionData(query);
return getGDTristate(cachedData.checkPermission(permission));
}
@ -957,4 +881,38 @@ public Comparator<DataType> getOrderComparator(Identifier identifier) {
return DataQueryOrder.TRANSIENT_FIRST;
}
}
private static class DefaultTransientOnlyDataFilter implements DataTypeFilterFunction {
@Override
public @NonNull Predicate<DataType> getTypeFilter(@NonNull Identifier identifier) {
if (identifier.getType() == Identifier.GROUP_TYPE && identifier.getName().equalsIgnoreCase("default")) {
return DataTypeFilter.TRANSIENT_ONLY;
}
return DataTypeFilter.ALL;
}
}
private static class DefaultPersistentOnlyDataFilter implements DataTypeFilterFunction {
@Override
public @NonNull Predicate<DataType> getTypeFilter(@NonNull Identifier identifier) {
if (identifier.getType() == Identifier.GROUP_TYPE && identifier.getName().equalsIgnoreCase("default")) {
return DataTypeFilter.NORMAL_ONLY;
}
return DataTypeFilter.ALL;
}
}
private static class UserPersistentOnlyDataFilter implements DataTypeFilterFunction {
@Override
public @NonNull Predicate<DataType> getTypeFilter(@NonNull Identifier identifier) {
if (identifier.getType() == Identifier.GROUP_TYPE && identifier.getName().equalsIgnoreCase("default")) {
return DataTypeFilter.NONE;
}
return DataTypeFilter.NORMAL_ONLY;
}
}
}

View File

@ -50,6 +50,13 @@
*/
public interface PermissionProvider {
public enum PermissionDataType {
ALL,
TRANSIENT,
PERSISTENT,
USER_PERSISTENT
}
/**
* Get server name.
*
@ -243,10 +250,10 @@ public interface PermissionProvider {
* @param holder The holder
* @param permission The permission to check
* @param contexts The contexts
* @param checkTransient Whether to check transient permissions
* @param type The data type
* @return The permission value
*/
Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, boolean checkTransient);
Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, PermissionDataType type);
/**
* Gets the current value of a permission assigned to a holder.
@ -258,19 +265,6 @@ public interface PermissionProvider {
*/
Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts);
/**
* Gets the current value of a permission that contains all passed contexts
* assigned to a holder.
*
* @param claim The current claim
* @param holder The holder
* @param permission The permission to check
* @param contexts The contexts required
* @param contextFilter The context key to ignore for required contexts
* @return The permission value
*/
Tristate getPermissionValueWithRequiredContexts(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, String contextFilter);
/**
* Gets the current value of an option assigned to a holder.
*

View File

@ -47,6 +47,8 @@
import com.griefdefender.util.PlayerUtil;
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import net.kyori.text.Component;
import net.kyori.text.serializer.plain.PlainComponentSerializer;
public class PlaceholderProvider {
@ -97,6 +99,19 @@ public String onRequest(OfflinePlayer offlinePlayer, String identifier) {
return this.getAllPlayerClaims(playerData, ClaimTypes.SUBDIVISION);
case "claims_town" :
return this.getAllPlayerClaims(playerData, ClaimTypes.TOWN);
case "claim_town_tag" :
if (claim == null || !playerData.inTown) {
return "";
}
final GDClaim town = (GDClaim) claim.getTown().orElse(null);
if (town == null) {
return "";
}
final Component tag = town.getTownData().getTownTag().orElse(null);
if (tag == null) {
return "";
}
return PlainComponentSerializer.INSTANCE.serialize(tag);
case "claims_town_basic" :
return this.getAllTownChildrenClaims(playerData, ClaimTypes.BASIC);
case "claims_town_subdivision" :
@ -113,12 +128,12 @@ public String onRequest(OfflinePlayer offlinePlayer, String identifier) {
return String.valueOf(claim.getEconomyData().isForSale());
case "claim_name" :
if (claim == null) {
return "none";
return "";
}
return ((GDClaim) claim).getFriendlyName();
case "claim_owner" :
if (claim == null) {
return "none";
return "";
}
if (claim.isWilderness()) {
return "wilderness";
@ -126,17 +141,17 @@ public String onRequest(OfflinePlayer offlinePlayer, String identifier) {
return ((GDClaim) claim).getOwnerName();
case "claim_trust" :
if (claim == null) {
return "[unknown]";
return "";
}
return String.valueOf(claim.isUserTrusted(player.getUniqueId(), TrustTypes.ACCESSOR));
case "claim_type" :
if (claim == null) {
return "none";
return "";
}
return claim.getType().getName();
case "pvp" :
if (claim == null) {
return "[unknown]";
return "";
}
return String.valueOf(PlayerUtil.getInstance().canPlayerPvP((GDClaim) claim, user));
case "blocks_total" :

View File

@ -370,15 +370,11 @@ public Tristate getPermissionValue(GDPermissionHolder holder, String permission)
@Override
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
return getPermissionValue(claim, holder, permission, contexts, true);
return tristateFromInt(holderToPEXSubject(holder).getPermission(contextsGDToPEX(contexts), permission));
}
/*
* The checkTransient value is ignored here -- we shouldn't need to use it since PEX already prioritizes
* transient permissions appropriately based on the subject type
*/
@Override
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, boolean checkTransient) {
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, PermissionDataType type) {
return tristateFromInt(holderToPEXSubject(holder).getPermission(contextsGDToPEX(contexts), permission));
}
@ -387,13 +383,6 @@ public Tristate getPermissionValue(GDPermissionHolder holder, String permission,
return tristateFromInt(holderToPEXSubject(holder).getPermission(contextsGDToPEX(contexts), permission));
}
@Override
public Tristate getPermissionValueWithRequiredContexts(GDClaim claim, GDPermissionHolder holder, String permission,
Set<Context> contexts, String contextFilter) {
// TODO
return tristateFromInt(holderToPEXSubject(holder).getPermission(contextsGDToPEX(contexts), permission));
}
@Override
public String getOptionValue(GDPermissionHolder holder, Option option, Set<Context> contexts) {
return holderToPEXSubject(holder).getOption(contextsGDToPEX(contexts), option.getPermission()).orElse(null);

View File

@ -92,7 +92,7 @@ public void registerDefaults() {
.reset()
.name("ambient-spawn")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_SPAWN_AMBIENT)
.group("admin")
@ -108,7 +108,7 @@ public void registerDefaults() {
.reset()
.name("animal-spawn")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_SPAWN_ANIMAL)
.group("admin")
@ -124,7 +124,7 @@ public void registerDefaults() {
.reset()
.name("aquatic-spawn")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_SPAWN_AQUATIC)
.group("admin")
@ -135,12 +135,46 @@ public void registerDefaults() {
.build())
.build());
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_ITEM_ARMOR_STAND);
flagData = new ArrayList<>();
flagData.add(flagDataBuilder
.reset()
.flag(Flags.INTERACT_ITEM_SECONDARY)
.contexts(flagContexts)
.build());
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_ENTITY_ARMOR_STAND);
flagData.add(flagDataBuilder
.reset()
.flag(Flags.ENTITY_DAMAGE)
.contexts(flagContexts)
.build());
flagData.add(flagDataBuilder
.reset()
.flag(Flags.INTERACT_ENTITY_SECONDARY)
.contexts(flagContexts)
.build());
this.registerCustomType(
definitionBuilder
.reset()
.name("armorstand-use")
.admin(true)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_ARMOR_STAND_USE)
.group("admin")
.flagData(flagData)
.build());
this.registerCustomType(
definitionBuilder
.reset()
.name("chorus-fruit-teleport")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_CHORUS_FRUIT_TELEPORT)
.group("admin")
@ -156,7 +190,7 @@ public void registerDefaults() {
.reset()
.name("creeper-block-explosion")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_CREEPER_BLOCK_EXPLOSION)
.group("admin")
@ -172,7 +206,7 @@ public void registerDefaults() {
.reset()
.name("creeper-entity-explosion")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_CREEPER_ENTITY_EXPLOSION)
.group("admin")
@ -183,12 +217,46 @@ public void registerDefaults() {
.build())
.build());
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_ITEM_END_CRYSTAL);
flagData = new ArrayList<>();
flagData.add(flagDataBuilder
.reset()
.flag(Flags.INTERACT_ITEM_SECONDARY)
.contexts(flagContexts)
.build());
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_ENTITY_ENDER_CRYSTAL);
flagData.add(flagDataBuilder
.reset()
.flag(Flags.ENTITY_DAMAGE)
.contexts(flagContexts)
.build());
flagData.add(flagDataBuilder
.reset()
.flag(Flags.INTERACT_ENTITY_SECONDARY)
.contexts(flagContexts)
.build());
this.registerCustomType(
definitionBuilder
.reset()
.name("endcrystal-use")
.admin(true)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_END_CRYSTAL_USE)
.group("admin")
.flagData(flagData)
.build());
this.registerCustomType(
definitionBuilder
.reset()
.name("exp-drop")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_EXP_DROP)
.group("admin")
@ -204,7 +272,7 @@ public void registerDefaults() {
.reset()
.name("fall-entity-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_FALL_ENTITY_DAMAGE)
.group("admin")
@ -223,7 +291,7 @@ public void registerDefaults() {
.reset()
.name("fall-player-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_FALL_PLAYER_DAMAGE)
.group("admin")
@ -239,7 +307,7 @@ public void registerDefaults() {
.reset()
.name("falling-block-break")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_FALLING_BLOCK_BREAK)
.group("admin")
@ -256,12 +324,12 @@ public void registerDefaults() {
.name("fire-block-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_FIRE_BLOCK_DAMAGE)
.group("admin")
.flagData(flagDataBuilder
.reset()
.flag(Flags.BLOCK_MODIFY)
.flag(Flags.BLOCK_BREAK)
.context(FlagContexts.SOURCE_FIRE)
.build())
.build());
@ -300,7 +368,7 @@ public void registerDefaults() {
.reset()
.name("fire-entity-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_FIRE_ENTITY_DAMAGE)
.group("admin")
@ -312,7 +380,7 @@ public void registerDefaults() {
.reset()
.name("lightning-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_LIGHTNING)
.group("admin")
@ -342,7 +410,7 @@ public void registerDefaults() {
.reset()
.name("monster-animal-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_MONSTER_ANIMAL_DAMAGE)
.group("admin")
@ -368,7 +436,7 @@ public void registerDefaults() {
.reset()
.name("monster-player-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_MONSTER_PLAYER_DAMAGE)
.group("admin")
@ -380,7 +448,7 @@ public void registerDefaults() {
.reset()
.name("monster-spawn")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_MONSTER_SPAWN)
.group("admin")
@ -407,7 +475,7 @@ public void registerDefaults() {
.reset()
.name("piston-item-spawn")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PISTON_ITEM_SPAWN)
.group("admin")
@ -452,7 +520,7 @@ public void registerDefaults() {
.reset()
.name("player-block-break")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_BLOCK_BREAK)
.group("admin")
@ -468,7 +536,7 @@ public void registerDefaults() {
.reset()
.name("player-block-interact")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_BLOCK_INTERACT)
.group("admin")
@ -484,7 +552,7 @@ public void registerDefaults() {
.reset()
.name("player-block-place")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_BLOCK_PLACE)
.group("admin")
@ -500,7 +568,7 @@ public void registerDefaults() {
.reset()
.name("player-damage")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_DAMAGE)
.group("admin")
@ -519,7 +587,7 @@ public void registerDefaults() {
.reset()
.name("player-enderpearl-interact")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_ENDERPEARL_INTERACT)
.group("admin")
@ -551,7 +619,7 @@ public void registerDefaults() {
.reset()
.name("player-entity-interact")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_ENTITY_INTERACT)
.group("admin")
@ -586,7 +654,7 @@ public void registerDefaults() {
.reset()
.name("player-itemframe-interact")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMFRAME_INTERACT)
.group("admin")
@ -597,12 +665,31 @@ public void registerDefaults() {
.build())
.build());
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_HANGING);
this.registerCustomType(
definitionBuilder
.reset()
.name("player-itemhanging-place")
.admin(true)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMHANGING_PLACE)
.group("admin")
.flagData(flagDataBuilder
.reset()
.flag(Flags.INTERACT_ITEM_SECONDARY)
.contexts(flagContexts)
.build())
.build());
this.registerCustomType(
definitionBuilder
.reset()
.name("player-item-drop")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_DROP)
.group("admin")
@ -618,7 +705,7 @@ public void registerDefaults() {
.reset()
.name("player-item-pickup")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_PICKUP)
.group("admin")
@ -637,7 +724,7 @@ public void registerDefaults() {
.reset()
.name("player-portal-use")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_PORTAL_USE)
.group("admin")
@ -653,7 +740,7 @@ public void registerDefaults() {
.reset()
.name("player-teleport-from")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_TELEPORT_FROM)
.group("admin")
@ -669,7 +756,7 @@ public void registerDefaults() {
.reset()
.name("player-teleport-to")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PLAYER_TELEPORT_TO)
.group("admin")
@ -688,7 +775,7 @@ public void registerDefaults() {
.reset()
.name("pvp")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_PVP)
.group("admin")
@ -704,7 +791,7 @@ public void registerDefaults() {
.reset()
.name("tnt-block-explosion")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_TNT_BLOCK_EXPLOSION)
.group("admin")
@ -720,7 +807,7 @@ public void registerDefaults() {
.reset()
.name("tnt-entity-explosion")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_TNT_ENTITY_EXPLOSION)
.group("admin")
@ -745,7 +832,7 @@ public void registerDefaults() {
.reset()
.name("turtle-egg-hatch")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_TURTLE_EGG_HATCH)
.group("admin")
@ -766,7 +853,7 @@ public void registerDefaults() {
.reset()
.name("villager-farm")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_VILLAGER_FARM)
.group("admin")
@ -778,7 +865,7 @@ public void registerDefaults() {
.reset()
.name("wither-block-break")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_WITHER_BLOCK_BREAK)
.group("admin")
@ -794,7 +881,7 @@ public void registerDefaults() {
.reset()
.name("wither-entity-break")
.admin(true)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_WITHER_ENTITY_DAMAGE)
.group("admin")
@ -806,7 +893,7 @@ public void registerDefaults() {
.build());
definitionContexts = new HashSet<>();
definitionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
definitionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
definitionContexts.add(OWNER_OVERRIDE_CONTEXT);
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_VILLAGER);
@ -838,7 +925,7 @@ public void registerDefaults() {
.reset()
.name("block-trampling")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_BLOCK_TRAMPLING)
.group("user")
@ -868,7 +955,7 @@ public void registerDefaults() {
.reset()
.name("chest-access")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_CHEST_ACCESS)
.group("user")
@ -880,7 +967,7 @@ public void registerDefaults() {
.reset()
.name("crop-growth")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_CROP_GROWTH)
.group("user")
@ -896,7 +983,7 @@ public void registerDefaults() {
.reset()
.name("damage-animals")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_DAMAGE_ANIMALS)
.group("user")
@ -912,7 +999,7 @@ public void registerDefaults() {
.reset()
.name("enderman-grief")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_ENDERMAN_GRIEF)
.group("user")
@ -932,6 +1019,11 @@ public void registerDefaults() {
.flag(Flags.BLOCK_SPREAD)
.context(FlagContexts.SOURCE_FIRE)
.build());
flagData.add(flagDataBuilder
.reset()
.flag(Flags.BLOCK_SPREAD)
.context(FlagContexts.SOURCE_LAVA)
.build());
this.registerCustomType(
definitionBuilder
.reset()
@ -949,7 +1041,7 @@ public void registerDefaults() {
.reset()
.name("grass-growth")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_GRASS_GROWTH)
.group("user")
@ -965,7 +1057,7 @@ public void registerDefaults() {
.reset()
.name("ice-form")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_ICE_FORM)
.group("user")
@ -984,7 +1076,7 @@ public void registerDefaults() {
.reset()
.name("ice-melt")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_ICE_MELT)
.group("user")
@ -1013,7 +1105,7 @@ public void registerDefaults() {
.reset()
.name("lava-flow")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_LAVA_FLOW)
.group("user")
@ -1025,7 +1117,7 @@ public void registerDefaults() {
.reset()
.name("leaf-decay")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_LEAF_DECAY)
.group("user")
@ -1040,7 +1132,7 @@ public void registerDefaults() {
.reset()
.name("lighter")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_LIGHTER)
.group("user")
@ -1056,7 +1148,7 @@ public void registerDefaults() {
.reset()
.name("mushroom-growth")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_MUSHROOM_GROWTH)
.group("user")
@ -1072,7 +1164,7 @@ public void registerDefaults() {
.reset()
.name("mycelium-spread")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_MYCELIUM_SPREAD)
.group("user")
@ -1102,7 +1194,7 @@ public void registerDefaults() {
.reset()
.name("ride")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_RIDE)
.group("user")
@ -1128,7 +1220,7 @@ public void registerDefaults() {
.reset()
.name("sleep")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_SLEEP)
.group("user")
@ -1136,7 +1228,7 @@ public void registerDefaults() {
.build());
definitionContexts = new HashSet<>();
definitionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
definitionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
definitionContexts.add(OWNER_OVERRIDE_CONTEXT);
flagContexts = new HashSet<>();
if (GriefDefenderPlugin.getMajorMinecraftVersion() > 12) {
@ -1163,7 +1255,7 @@ public void registerDefaults() {
.build());
definitionContexts = new HashSet<>();
definitionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
definitionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
definitionContexts.add(OWNER_OVERRIDE_CONTEXT);
flagContexts = new HashSet<>();
if (GriefDefenderPlugin.getMajorMinecraftVersion() > 12) {
@ -1202,7 +1294,7 @@ public void registerDefaults() {
.reset()
.name("snowman-trail")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_SNOWMAN_TRAIL)
.group("user")
@ -1218,7 +1310,7 @@ public void registerDefaults() {
.reset()
.name("soil-dry")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_SOIL_DRY)
.group("user")
@ -1231,16 +1323,8 @@ public void registerDefaults() {
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.USED_ITEM_VEHICLE);
flagData = new ArrayList<>();
flagData.add(flagDataBuilder
.reset()
.flag(Flags.INTERACT_BLOCK_SECONDARY)
.contexts(flagContexts)
.build());
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_TYPE_VEHICLE);
flagData = new ArrayList<>();
flagData.add(flagDataBuilder
.reset()
.flag(Flags.INTERACT_ITEM_SECONDARY)
@ -1266,7 +1350,7 @@ public void registerDefaults() {
.reset()
.name("vehicle-use")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_VEHICLE_USE)
.group("user")
@ -1274,7 +1358,7 @@ public void registerDefaults() {
.build());
definitionContexts = new HashSet<>();
definitionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
definitionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
flagContexts = new HashSet<>();
flagContexts.add(FlagContexts.SOURCE_PLAYER);
flagContexts.add(FlagContexts.TARGET_VILLAGER);
@ -1301,7 +1385,7 @@ public void registerDefaults() {
.reset()
.name("vine-growth")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.context(ClaimContexts.USER_DEFAULT_CONTEXT)
.defaultValue(Tristate.TRUE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_VINE_GROWTH)
.group("user")
@ -1312,6 +1396,9 @@ public void registerDefaults() {
.build())
.build());
definitionContexts = new HashSet<>();
definitionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
definitionContexts.add(OWNER_OVERRIDE_CONTEXT);
flagContexts = new HashSet<>();
if (GriefDefenderPlugin.getMajorMinecraftVersion() > 12) {
flagContexts.add(FlagContexts.SOURCE_WATER);
@ -1330,7 +1417,7 @@ public void registerDefaults() {
.reset()
.name("water-flow")
.admin(false)
.context(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)
.contexts(definitionContexts)
.defaultValue(Tristate.FALSE)
.description(MessageCache.getInstance().FLAG_DESCRIPTION_CUSTOM_WATER_FLOW)
.group("user")

View File

@ -166,5 +166,6 @@ private void createKey(String id, String name, boolean multiValued, Set<String>
@Override
public void registerCustomType(Option type) {
this.customMap.put(type.getId(), type);
this.registryMap.put(type.getId(), type);
}
}

View File

@ -156,8 +156,8 @@ public ClaimResult createClaim(World world, Vector3i point1, Vector3i point2, Cl
return claimResult;
}
public ClaimResult deleteAllAdminClaims(CommandSender src, World world) {
GDClaimManager claimWorldManager = this.claimWorldManagers.get(world.getUID());
public ClaimResult deleteAllAdminClaims(CommandSender src, UUID worldUniqueId) {
GDClaimManager claimWorldManager = this.claimWorldManagers.get(worldUniqueId);
if (claimWorldManager == null) {
return new GDClaimResult(ClaimResultType.CLAIMS_DISABLED);
}
@ -208,19 +208,33 @@ 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) {
GDClaimManager claimWorldManager = this.claimWorldManagers.get(claim.getWorldUniqueId());
claimWorldManager.deleteClaimInternal(claim, true);
}
playerData.getInternalClaims().clear();
claims.clear();
return;
}
for (GDClaimManager claimWorldManager : this.claimWorldManagers.values()) {
if (worldUniqueId != null && !claimWorldManager.getWorldId().equals(worldUniqueId)) {
continue;
}
Set<Claim> claims = claimWorldManager.getInternalPlayerClaims(playerID);
if (claims == null) {
continue;
@ -331,7 +345,7 @@ public void setDefaultGlobalPermissions() {
final Map<String, String> basicDefaultOptions = optionConfig.getConfig().defaultOptionCategory.getBasicOptionDefaults();
contexts = new HashSet<>();
contexts.add(ClaimTypes.BASIC.getDefaultContext());
this.setDefaultOptions(ClaimTypes.BASIC.toString(), contexts, new HashMap<>(basicDefaultOptions));
this.setDefaultOptions(contexts, new HashMap<>(basicDefaultOptions));
// Town defaults
contexts = new HashSet<>();
@ -343,13 +357,13 @@ public void setDefaultGlobalPermissions() {
}
contexts = new HashSet<>();
contexts.add(ClaimTypes.TOWN.getDefaultContext());
this.setDefaultOptions(ClaimTypes.TOWN.toString(), contexts, new HashMap<>(townDefaultOptions));
this.setDefaultOptions(contexts, new HashMap<>(townDefaultOptions));
// Subdivision defaults
contexts = new HashSet<>();
contexts.add(ClaimTypes.SUBDIVISION.getDefaultContext());
final Map<String, String> subdivisionDefaultOptions = optionConfig.getConfig().defaultOptionCategory.getSubdivisionOptionDefaults();
this.setDefaultOptions(ClaimTypes.SUBDIVISION.toString(), contexts, new HashMap<>(subdivisionDefaultOptions));
this.setDefaultOptions(contexts, new HashMap<>(subdivisionDefaultOptions));
// Wilderness defaults
contexts = new HashSet<>();
@ -359,11 +373,13 @@ public void setDefaultGlobalPermissions() {
// Global default options
contexts = new HashSet<>();
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
final Map<String, Boolean> globalDefaultFlags = flagConfig.getConfig().defaultFlagCategory.getFlagDefaults("global");
contexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
final Map<String, Boolean> globalDefaultFlags = flagConfig.getConfig().defaultFlagCategory.getFlagDefaults("user");
this.setDefaultFlags(contexts, globalDefaultFlags);
contexts = new HashSet<>();
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
final Map<String, String> globalDefaultOptions = optionConfig.getConfig().defaultOptionCategory.getUserOptionDefaults();
this.setDefaultOptions(ClaimContexts.GLOBAL_DEFAULT_CONTEXT.getName(), contexts, new HashMap<>(globalDefaultOptions));
this.setDefaultOptions(contexts, new HashMap<>(globalDefaultOptions));
GriefDefenderPlugin.getInstance().getPermissionProvider().setTransientPermission(GriefDefenderPlugin.DEFAULT_HOLDER, "griefdefender", Tristate.FALSE, new HashSet<>());
flagConfig.save();
optionConfig.save();
@ -386,7 +402,7 @@ private void setDefaultFlags(Set<Context> contexts, Map<String, Boolean> default
});
}
private void setDefaultOptions(String type, Set<Context> contexts, Map<String, String> defaultOptions) {
private void setDefaultOptions(Set<Context> contexts, Map<String, String> defaultOptions) {
final Map<Set<Context>, Map<String, String>> permanentOptions = PermissionUtil.getInstance().getPermanentOptions(GriefDefenderPlugin.DEFAULT_HOLDER);
final Map<String, String> options = permanentOptions.get(contexts);
GriefDefenderPlugin.getInstance().executor.execute(() -> {

View File

@ -136,7 +136,13 @@ public void registerWorld(World world) {
final Path path = Paths.get("plugins", "GriefPreventionData", "ClaimData");
if (path.toFile().exists()) {
GriefPreventionMigrator.migrate(world, path);
Files.createFile(dimPath.resolve(worldName).resolve("_bukkitMigrated"));
final Path bukkitMigratedFile = dimPath.resolve(worldName).resolve("_bukkitMigrated");
if (Files.notExists(bukkitMigratedFile.getParent())) {
Files.createDirectories(bukkitMigratedFile.getParent());
}
if (Files.notExists(bukkitMigratedFile)) {
Files.createFile(bukkitMigratedFile);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();

View File

@ -26,6 +26,7 @@
import com.griefdefender.GDBootstrap;
import com.griefdefender.GDPlayerData;
import com.griefdefender.GriefDefenderPlugin;
import com.griefdefender.internal.block.BlockSnapshot;
import com.griefdefender.internal.block.BlockTransaction;
import com.griefdefender.internal.visual.GDClaimVisual;
@ -99,8 +100,15 @@ public void run() {
}
}
if (playerData.lastShovelLocation == null) {
this.playerData.claimVisualRevertTasks.put(visualUniqueId, Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(GDBootstrap.getInstance(), new ClaimVisualRevertTask(visualUniqueId, this.player, this.playerData), 1200));
int tickTime = (this.playerData.lastShovelLocation != null && this.visualization.getClaim() == null ? GriefDefenderPlugin.getGlobalConfig().getConfig().visual.createBlockVisualTime : GriefDefenderPlugin.getGlobalConfig().getConfig().visual.claimVisualTime) * 20;
if (tickTime <= 0) {
tickTime = this.playerData.lastShovelLocation == null ? 1200 : 3600;
}
final ClaimVisualRevertTask runnable = new ClaimVisualRevertTask(visualUniqueId, this.player, this.playerData);
if (this.playerData.lastShovelLocation != null && this.visualization.getClaim() == null) {
this.playerData.createBlockVisualTransactions.put(visualUniqueId, new ArrayList<>(this.visualization.getVisualTransactions()));
this.playerData.createBlockVisualRevertRunnables.put(visualUniqueId, runnable);
}
this.playerData.claimVisualRevertTasks.put(visualUniqueId, Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(GDBootstrap.getInstance(), runnable, tickTime));
}
}

View File

@ -33,16 +33,26 @@
import org.bukkit.entity.Player;
class ClaimVisualRevertTask implements Runnable {
public class ClaimVisualRevertTask implements Runnable {
private Player player;
private GDPlayerData playerData;
private UUID visualUniqueId;
private boolean shovelStartVisual = false;
public ClaimVisualRevertTask(UUID visualUniqueId, Player player, GDPlayerData playerData) {
this.visualUniqueId = visualUniqueId;
this.playerData = playerData;
this.player = player;
this.shovelStartVisual = playerData.lastShovelLocation != null;
}
public boolean isShovelStartVisual() {
return this.shovelStartVisual;
}
public UUID getVisualUniqueId() {
return this.visualUniqueId;
}
@Override

View File

@ -148,10 +148,17 @@ public boolean clickedClaimCorner(GDClaim claim, Vector3i clickedPos) {
return false;
}
public int getClaimBlockCost(World world, Vector3i lesser, Vector3i greater, boolean cuboid) {
final int claimWidth = greater.getX() - lesser.getX() + 1;
final int claimHeight = greater.getY() - lesser.getY() + 1;
final int claimLength = greater.getZ() - lesser.getZ() + 1;
public int getClaimBlockCost(World world, Vector3i point1, Vector3i point2, boolean cuboid) {
int minx = Math.min(point1.getX(), point2.getX());
int miny = Math.min(point1.getY(), point2.getY());
int minz = Math.min(point1.getZ(), point2.getZ());
int maxx = Math.max(point1.getX(), point2.getX());
int maxy = Math.max(point1.getY(), point2.getY());
int maxz = Math.max(point1.getZ(), point2.getZ());
final int claimWidth = Math.abs(maxx - minx) + 1;
final int claimHeight = Math.abs(maxy - miny) + 1;
final int claimLength = Math.abs(maxz - minz) + 1;
if (GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.AREA) {
return claimWidth * claimLength;
}
@ -160,7 +167,7 @@ public int getClaimBlockCost(World world, Vector3i lesser, Vector3i greater, boo
}
public long asLong(int x, int z) {
return (long)x & 4294967295L | ((long)z & 4294967295L) << 32;
return (long) x & 0xffffffffL | ((long) z & 0xffffffffL) << 32;
}
public short blockPosToShort(Location location) {

View File

@ -35,8 +35,8 @@
import com.griefdefender.event.GDCauseStackManager;
import com.griefdefender.internal.registry.GDItemType;
import com.griefdefender.internal.registry.ItemTypeRegistryModule;
import com.griefdefender.internal.tracking.PlayerTracker;
import com.griefdefender.internal.tracking.chunk.GDChunk;
import com.griefdefender.permission.ContextGroups;
import com.griefdefender.permission.GDPermissionUser;
import com.griefdefender.permission.GDPermissions;
@ -59,6 +59,11 @@ public class CauseContextHelper {
@Nullable
public static GDPermissionUser getEventUser(Location location) {
return getEventUser(location, null);
}
@Nullable
public static GDPermissionUser getEventUser(Location location, PlayerTracker.Type trackerType) {
final GDPermissionUser user = GDCauseStackManager.getInstance().getCurrentCause().first(GDPermissionUser.class).orElse(null);
if (user != null) {
return user;
@ -66,9 +71,17 @@ public static GDPermissionUser getEventUser(Location location) {
if (location == null) {
return null;
}
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(location.getWorld().getUID());
final GDChunk gpChunk = claimWorldManager.getChunk(location.getChunk());
return gpChunk.getBlockUser(location);
final GDChunk gdChunk = claimWorldManager.getChunk(location.getChunk());
if (trackerType != null) {
if (trackerType == PlayerTracker.Type.OWNER) {
return gdChunk.getBlockOwner(location);
}
return gdChunk.getBlockNotifier(location);
}
return gdChunk.getBlockUser(location);
}
// Credit to digitok of freenode for the regex assistance
@ -231,14 +244,6 @@ public static Set<Context> generateContexts(String permission, CommandSender src
}
}
if (permission.equals(Options.SPAWN_LIMIT.getPermission())) {
if (!hasSourceContext) {
contextSet.add(ContextGroups.SOURCE_ALL);
}
if (!hasTargetContext) {
contextSet.add(ContextGroups.TARGET_ALL);
}
}
return contextSet;
}
}

View File

@ -26,6 +26,7 @@
import com.griefdefender.GDPlayerData;
import com.griefdefender.GriefDefenderPlugin;
import com.griefdefender.api.Group;
import com.griefdefender.api.Tristate;
import com.griefdefender.api.claim.Claim;
import com.griefdefender.api.claim.TrustTypes;
@ -33,15 +34,12 @@
import com.griefdefender.api.permission.PermissionResult;
import com.griefdefender.api.permission.flag.Flag;
import com.griefdefender.api.permission.option.Option;
import com.griefdefender.cache.MessageCache;
import com.griefdefender.cache.PermissionHolderCache;
import com.griefdefender.claim.GDClaim;
import com.griefdefender.permission.GDPermissionHolder;
import com.griefdefender.permission.GDPermissions;
import com.griefdefender.provider.PermissionProvider;
import net.kyori.text.adapter.bukkit.TextAdapter;
import net.kyori.text.format.TextColor;
import com.griefdefender.provider.PermissionProvider.PermissionDataType;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
@ -178,22 +176,18 @@ public Tristate getPermissionValue(GDPermissionHolder holder, String permission)
return PERMISSION_PROVIDER.getPermissionValue(holder, permission);
}
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, PermissionDataType type) {
return PERMISSION_PROVIDER.getPermissionValue(claim, holder, permission, contexts, type);
}
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
return PERMISSION_PROVIDER.getPermissionValue(claim, holder, permission, contexts);
}
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, boolean checkTransient) {
return PERMISSION_PROVIDER.getPermissionValue(claim, holder, permission, contexts, checkTransient);
}
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
return PERMISSION_PROVIDER.getPermissionValue(holder, permission, contexts);
}
public Tristate getPermissionValueWithRequiredContexts(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts, String contextFilter) {
return PERMISSION_PROVIDER.getPermissionValueWithRequiredContexts(claim, holder, permission, contexts, contextFilter);
}
public String getOptionValue(GDPermissionHolder holder, Option option, Set<Context> contexts) {
return PERMISSION_PROVIDER.getOptionValue(holder, option, contexts);
}

View File

@ -281,7 +281,7 @@ public boolean shouldRefreshVisual(GDPlayerData playerData, Location locality, S
Integer highestY = null;
if (!corners.isEmpty() && playerData != null && playerData.lastNonAirInspectLocation != null) {
for (BlockTransaction transaction : corners) {
final int cornerHeight = transaction.getFinal().getBlockPos().getY();
final int cornerHeight = transaction.getFinal().getPosition().getY();
if (lowestY == null || (lowestY != null && cornerHeight < lowestY)) {
lowestY = cornerHeight;
}
@ -292,7 +292,7 @@ public boolean shouldRefreshVisual(GDPlayerData playerData, Location locality, S
}
if (!accents.isEmpty() && playerData != null && playerData.lastNonAirInspectLocation != null) {
for (BlockTransaction transaction : accents) {
final int cornerHeight = transaction.getFinal().getBlockPos().getY();
final int cornerHeight = transaction.getFinal().getPosition().getY();
if (lowestY == null || (lowestY != null && cornerHeight < lowestY)) {
lowestY = cornerHeight;
}
@ -315,4 +315,12 @@ public boolean shouldRefreshVisual(GDPlayerData playerData, Location locality, S
}
return false;
}
public boolean isFakePlayer(Player player) {
if (player == null) {
return false;
}
return GriefDefenderPlugin.getGlobalConfig().getConfig().mod.isFakePlayer(player);
}
}

View File

@ -155,6 +155,11 @@ public static Sign getSign(Location location) {
}
public static void setClaimForSale(Claim claim, Player player, Sign sign, double price) {
if (claim.isWilderness()) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_CLAIM_NOT_FOR_SALE);
return;
}
// if not owner of claim, validate perms
if (((GDClaim) claim).allowEdit(player) != null || !player.hasPermission(GDPermissions.COMMAND_CLAIM_INFO_OTHERS)) {
TextAdapter.sendComponent(player, MessageCache.getInstance().CLAIM_NOT_YOURS);

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.12.2",
"sha1": "ac5ae7a5dab7bbf4efda26d66cb99a4cd1e91a23",
"path": "com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20200608.154737-35.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20200608.154737-35.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -213,46 +213,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.13.2",
"sha1": "a8b277590f2f2e4725c059f963109a232b5400e8",
"path": "com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20200608.154648-34.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20200608.154648-34.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -219,46 +219,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.14.2",
"sha1": "9b698ff86706e3e2378b01f500d48e7dde3753fb",
"path": "com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20200608.155146-34.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20200608.155146-34.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -219,46 +219,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.14.3",
"sha1": "cd56f66cfb67cc151496a19a0788b4d868950d47",
"path": "com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20200608.154518-35.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20200608.154518-35.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -219,46 +219,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.14.4",
"sha1": "83d35e56feb96ab9f88378ab97945be15a04ed3d",
"path": "com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20200608.154430-33.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20200608.154430-33.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -219,46 +219,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.15.2",
"sha1": "b9ba833d0305ea7e74074d664e1ecceee405aca8",
"path": "com/griefdefender/adapter/1.15.2-SNAPSHOT/adapter-1.15.2-20200608.154231-14.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.15.2-SNAPSHOT/adapter-1.15.2-20200608.154231-14.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -219,46 +219,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.15",
"sha1": "b5f4c81abce44d0f12b488b1ff0dba4ec9ff81ba",
"path": "com/griefdefender/adapter/1.15-SNAPSHOT/adapter-1.15-20200608.154335-15.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.15-SNAPSHOT/adapter-1.15-20200608.154335-15.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -219,46 +219,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -0,0 +1,264 @@
{
"version": "1.16.1",
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
"sha1": "2a3f820d12a3bd4c03932018567ab3732517aee5",
"path": "com/griefdefender/api/1.0.0-SNAPSHOT/api-1.0.0-20200528.202302-24.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/api/1.0.0-SNAPSHOT/api-1.0.0-20200528.202302-24.jar"
},
{
"name": "com.griefdefender:reflect-helper:1.0",
"sha1": "7a50bffa9f0062ac4ca376d95a0e6599aa5f3257",
"path": "com/griefdefender/reflect-helper/1.0/reflect-helper-1.0.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/reflect-helper/1.0/reflect-helper-1.0.jar"
},
{
"name": "com.griefdefender:reflect-helper:2.0",
"sha1": "ee45d077344ae67e155e37eb61025401944ffabc",
"path": "com/griefdefender/reflect-helper/2.0/reflect-helper-2.0.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/reflect-helper/2.0/reflect-helper-2.0.jar"
},
{
"name": "org.checkerframework:checker-qual:2.10.0",
"sha1": "5786699a0cb71f9dc32e6cca1d665eef07a0882f",
"path": "org/checkerframework/checker-qual/2.10.0/checker-qual-2.10.0.jar",
"relocate": "javax.inject:javaxinject",
"url": "https://repo1.maven.org/maven2/org/checkerframework/checker-qual/2.10.0/checker-qual-2.10.0.jar"
},
{
"name": "org.ow2.asm:asm-debug-all:5.2",
"sha1": "3354e11e2b34215f06dab629ab88e06aca477c19",
"path": "org/ow2/asm/asm-debug-all/5.2/asm-debug-all-5.2.jar",
"relocate": "org.ow2.asm:asm",
"url": "https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.2/asm-debug-all-5.2.jar"
},
{
"name": "me.lucko:jar-relocator:1.3",
"sha1": "90c6b66b8535f2f5eefc108e34e50f3e02e1f4cf",
"path": "me/lucko/jar-relocator/1.3/jar-relocator-1.3.jar",
"relocate": "me.lucko:lucko",
"url": "https://repo1.maven.org/maven2/me/lucko/jar-relocator/1.3/jar-relocator-1.3.jar"
},
{
"name": "co.aikar:acf-core:0.5.0-SNAPSHOT",
"sha1": "d640d058f08da1be6b4483ac7a665d0b4bb22044",
"path": "co/aikar/acf-core/0.5.0-SNAPSHOT/acf-core-0.5.0-20190617.211117-148.jar",
"url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-core/0.5.0-SNAPSHOT/acf-core-0.5.0-20190617.211117-148.jar"
},
{
"name": "co.aikar:acf-bukkit:0.5.0-SNAPSHOT",
"sha1": "0af5d53de31ebf4e19100cc0654b88cc9c9c07fb",
"path": "co/aikar/acf-bukkit/0.5.0-SNAPSHOT/acf-bukkit-0.5.0-20190607.112608-152.jar",
"url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-bukkit/0.5.0-SNAPSHOT/acf-bukkit-0.5.0-20190607.112608-152.jar"
},
{
"name": "co.aikar:acf-paper:0.5.0-SNAPSHOT",
"sha1": "5df2f2f0c7190f4b867af20ff57f9fde012a4e2c",
"path": "co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar",
"url": "https://repo.glaremasters.me/repository/public/co/aikar/acf-paper/0.5.0-SNAPSHOT/acf-paper-0.5.0-20190607.112622-147.jar"
},
{
"name": "co.aikar:locales:1.0-SNAPSHOT",
"sha1": "09c89ff1a611600186edf8482d1059544875582b",
"path": "co/aikar/locales/1.0-SNAPSHOT/locales-1.0-20181221.115311-17.jar",
"url": "https://repo.glaremasters.me/repository/public/co/aikar/locales/1.0-SNAPSHOT/locales-1.0-20181221.115311-17.jar"
},
{
"name": "co.aikar:minecraft-timings:1.0.4",
"sha1": "7ed9d44840cd2c0f77b7c5276d60ca901b146332",
"path": "co/aikar/minecraft-timings/1.0.4/minecraft-timings-1.0.4.jar",
"url": "https://repo.glaremasters.me/repository/public/co/aikar/minecraft-timings/1.0.4/minecraft-timings-1.0.4.jar"
},
{
"name": "co.aikar:Table:1.0.0-SNAPSHOT",
"sha1": "ccbfaea11c65e6d7173226d318c577c439673b3a",
"path": "co/aikar/Table/1.0.0-SNAPSHOT/Table-1.0.0-20180331.054128-7.jar",
"url": "https://repo.glaremasters.me/repository/public/co/aikar/Table/1.0.0-SNAPSHOT/Table-1.0.0-20180331.054128-7.jar"
},
{
"name": "net.jodah:expiringmap:0.5.9",
"sha1": "b93ac8a915e38beadc20c3cc284506e15478fd7b",
"path": "net/jodah/expiringmap/0.5.9/expiringmap-0.5.9.jar",
"relocate": "net.jodah:jodah",
"url": "https://repo1.maven.org/maven2/net/jodah/expiringmap/0.5.9/expiringmap-0.5.9.jar"
},
{
"name": "aopalliance:aopalliance:1.0",
"sha1": "0235ba8b489512805ac13a8f9ea77a1ca5ebe3e8",
"path": "aopalliance/aopalliance/1.0/aopalliance-1.0.jar",
"relocate": "org.aopalliance:aopalliance",
"url": "https://repo1.maven.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"
},
{
"name": "com.flowpowered:flow-math:1.0.3",
"sha1": "d98020239e5015091ad3be927cef9dea0d61a234",
"path": "com/flowpowered/flow-math/1.0.3/flow-math-1.0.3.jar",
"url": "https://repo1.maven.org/maven2/com/flowpowered/flow-math/1.0.3/flow-math-1.0.3.jar"
},
{
"name": "com.google.inject:guice:4.1.0",
"sha1": "eeb69005da379a10071aa4948c48d89250febb07",
"path": "com/google/inject/guice/4.1.0/guice-4.1.0.jar",
"relocate": "com.google.inject:googleinject",
"url": "https://repo1.maven.org/maven2/com/google/inject/guice/4.1.0/guice-4.1.0.jar"
},
{
"name": "javax.inject:javax.inject:1",
"sha1": "6975da39a7040257bd51d21a231b76c915872d38",
"path": "javax/inject/javax.inject/1/javax.inject-1.jar",
"relocate": "javax.inject:javaxinject",
"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",
"relocate": "okhttp3:okhttp3",
"url": "https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/3.14.2/okhttp-3.14.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",
"relocate": "okio:okio",
"url": "https://repo1.maven.org/maven2/com/squareup/okio/okio/2.2.2/okio-2.2.2.jar"
},
{
"name": "com.github.ben-manes.caffeine:caffeine:2.7.0",
"sha1": "c3af06be4a7d4e769fce2cef5e77d3becad9818a",
"path": "com/github/ben-manes/caffeine/caffeine/2.7.0/caffeine-2.7.0.jar",
"relocate": "com.github.benmanes.caffeine:caffeine",
"url": "https://repo1.maven.org/maven2/com/github/ben-manes/caffeine/caffeine/2.7.0/caffeine-2.7.0.jar"
},
{
"name": "commons-io:commons-io:2.6",
"sha1": "815893df5f31da2ece4040fe0a12fd44b577afaf",
"path": "org/apache/commons/commons-io/2.6/commons-io-2.6.jar",
"relocate": "org.apache.commons.io:commonsio",
"url": "https://repo1.maven.org/maven2/commons-io/commons-io/2.6/commons-io-2.6.jar"
},
{
"name": "org.apache.commons:commons-lang3:3.9",
"sha1": "0122c7cee69b53ed4a7681c03d4ee4c0e2765da5",
"path": "org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar",
"relocate": "org.apache.commons.lang3:commonslang3",
"url": "https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar"
},
{
"name": "org.spongepowered:configurate-core:3.7-SNAPSHOT",
"sha1": "e596c439ac71fa2ea5c48f8ba97a7dc6f4c77b16",
"path": "org/spongepowered/configurate-core/3.7-SNAPSHOT/configurate-core-3.7-20190531.182437-11.jar",
"relocate": "ninja.leaping.configurate:configurate",
"url": "https://repo.spongepowered.org/maven/org/spongepowered/configurate-core/3.7-SNAPSHOT/configurate-core-3.7-20190531.182437-11.jar"
},
{
"name": "org.spongepowered:configurate-gson:3.7-SNAPSHOT",
"sha1": "265a94f16583621f497eeecc356f35f983484dde",
"path": "org/spongepowered/configurate-gson/3.7-SNAPSHOT/configurate-gson-3.7-20190531.182438-11.jar",
"relocate": "ninja.leaping.configurate:configurate",
"url": "https://repo.spongepowered.org/maven/org/spongepowered/configurate-gson/3.7-SNAPSHOT/configurate-gson-3.7-20190531.182438-11.jar"
},
{
"name": "org.spongepowered:configurate-hocon:3.7-SNAPSHOT",
"sha1": "af48dcb9e7456f2f81a633f62ae5c55e5215c4af",
"path": "org/spongepowered/configurate-hocon/3.7-SNAPSHOT/configurate-hocon-3.7-20190531.182439-11.jar",
"relocate": "ninja.leaping.configurate:configurate",
"url": "https://repo.spongepowered.org/maven/org/spongepowered/configurate-hocon/3.7-SNAPSHOT/configurate-hocon-3.7-20190531.182439-11.jar"
},
{
"name": "org.spongepowered:configurate-yaml:3.7-SNAPSHOT",
"sha1": "c66110f5ae0098c450e048f78b322590d2e24d06",
"path": "org/spongepowered/configurate-yaml/3.7-SNAPSHOT/configurate-yaml-3.7-20190531.182442-11.jar",
"relocate": "ninja.leaping.configurate:configurate",
"url": "https://repo.spongepowered.org/maven/org/spongepowered/configurate-yaml/3.7-SNAPSHOT/configurate-yaml-3.7-20190531.182442-11.jar"
},
{
"name": "com.typesafe:config:1.3.1",
"sha1": "2cf7a6cc79732e3bdf1647d7404279900ca63eb0",
"path": "com/typesafe/config/1.3.1/config-1.3.1.jar",
"relocate": "com.typesafe:typesafe",
"url": "https://repo1.maven.org/maven2/com/typesafe/config/1.3.1/config-1.3.1.jar"
},
{
"name": "it.unimi.dsi:fastutil:8.2.3",
"sha1": "f3a26db2204f1779c9958a914422f84284e53a84",
"path": "it/unimi/dsi/fastutil/8.2.3/fastutil-8.2.3.jar",
"relocate": "it.unimi.dsi:fastutil",
"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": "net.kyori:event-api:3.0.0",
"sha1": "4e207f07d2adaa15e174a085f65bc6ae5a81029e",
"path": "net/kyori/event-api/3.0.0/event-api-3.0.0.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/event-api/3.0.0/event-api-3.0.0.jar"
},
{
"name": "net.kyori:event-method:3.0.0",
"sha1": "85fe9bbf8ebadde4c82602af29352ba5db06e8e5",
"path": "net/kyori/event-method/3.0.0/event-method-3.0.0.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/event-method/3.0.0/event-method-3.0.0.jar"
},
{
"name": "net.kyori:event-method-asm:3.0.0",
"sha1": "69113430c1ba05c9d9fa6e48028edd53e3e16723",
"path": "net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,9 +3,9 @@
"libraries": [
{
"name": "com.griefdefender:adapter:1.8.8",
"sha1": "9d183a6a2ec921d7907118e4e728c62554850c87",
"path": "com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20200608.154829-34.jar",
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20200608.154829-34.jar"
"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"
},
{
"name": "com.griefdefender:api:1.0.0",
@ -213,46 +213,46 @@
"url": "https://repo1.maven.org/maven2/net/kyori/event-method-asm/3.0.0/event-method-asm-3.0.0.jar"
},
{
"name": "net.kyori:text-adapter-bukkit:3.0.3",
"sha1": "37033ab1173d73a62a087cbd5c8d356774f4cee3",
"path": "net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.3/text-adapter-bukkit-3.0.3.jar"
"name": "net.kyori:text-adapter-bukkit:3.0.5",
"sha1": "00f1b0dcf5a92da9172ea911695c0021eed445cb",
"path": "net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bukkit/3.0.5/text-adapter-bukkit-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-bungeecord:3.0.2",
"sha1": "d57c245bdc182bdf37d1b7a32691859add018a2b",
"path": "net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.2/text-adapter-bungeecord-3.0.2.jar"
"name": "net.kyori:text-adapter-bungeecord:3.0.5",
"sha1": "3d4d18e691d8319cb3f2e42cedaaa18c7b1b324c",
"path": "net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-bungeecord/3.0.5/text-adapter-bungeecord-3.0.5.jar"
},
{
"name": "net.kyori:text-adapter-spongeapi:3.0.2",
"sha1": "8562afb1594a9d34b891f23add503741d0656873",
"path": "net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.2/text-adapter-spongeapi-3.0.2.jar"
"name": "net.kyori:text-adapter-spongeapi:3.0.5",
"sha1": "ce0217b7ac94d464074a916de58d86c1bac4f4b0",
"path": "net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-adapter-spongeapi/3.0.5/text-adapter-spongeapi-3.0.5.jar"
},
{
"name": "net.kyori:text-api:3.0.2",
"sha1": "608cdb44a74bbd68745941760df730ed55e4b47c",
"path": "net/kyori/text-api/3.0.2/text-api-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.2/text-api-3.0.2.jar"
"name": "net.kyori:text-api:3.0.4",
"sha1": "3f6844794af6769053337f21e6ac544d88181fd9",
"path": "net/kyori/text-api/3.0.4/text-api-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-api/3.0.4/text-api-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-gson:3.0.2",
"sha1": "9ac22f04f3504c52ff1618c5a8d9a6145d8d9c9e",
"path": "net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.2/text-serializer-gson-3.0.2.jar"
"name": "net.kyori:text-serializer-gson:3.0.4",
"sha1": "d9e3e97a60bf64690f633f16278117b1c0702c27",
"path": "net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-gson/3.0.4/text-serializer-gson-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-legacy:3.0.2",
"sha1": "8acbfb36356259273a8e3a15782e4f2980375bc5",
"path": "net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.2/text-serializer-legacy-3.0.2.jar"
"name": "net.kyori:text-serializer-legacy:3.0.4",
"sha1": "925bad50c7221713fe6ada7a42686df584969017",
"path": "net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-legacy/3.0.4/text-serializer-legacy-3.0.4.jar"
},
{
"name": "net.kyori:text-serializer-plain:3.0.2",
"sha1": "8d60703f579019f7c26959d2e46501c3d389b48d",
"path": "net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.2/text-serializer-plain-3.0.2.jar"
"name": "net.kyori:text-serializer-plain:3.0.4",
"sha1": "b5b9ca6a4be956542934ca699091a3b8ea169c19",
"path": "net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar",
"url": "https://repo1.maven.org/maven2/net/kyori/text-serializer-plain/3.0.4/text-serializer-plain-3.0.4.jar"
}
]
}

View File

@ -3,5 +3,5 @@ main: com.griefdefender.GDBootstrap
softdepend: [dynmap, PlaceholderAPI, WorldEdit, WorldGuard, Vault]
depend: [LuckPerms]
load: STARTUP
version: '1.3.4'
version: '1.4.2'
api-version: 1.13

View File

@ -59,7 +59,10 @@ GriefDefender {
}
messages {
abandon-all-delay-warning="&aDiese Grundstücke wurden erst kürzlich erstellt und können daher nicht entfernt werden."
abandon-all-success="&aAll your claims have been abandoned. You now have &6{amount}&a available claim blocks."
abandon-all-success-world="&aAll your claims have been abandoned in &6{world}&a. You now have &6{amount}&a available claim blocks."
abandon-all-warning="&6Bist du dir sicher, dass du &cALLE&6 deine Grundstücke löschen willst?"
abandon-all-warning-world="&6Bist du dir sicher, dass du &cALLE&6 deine Grundstücke löschen willst auf &a{world}&6?"
abandon-claim-delay-warning="&aDieses Grundstück ist noch neu und kann erst am &6{date}&a entfernt werden."
abandon-claim-failed="&aKonnte das Grundstück nicht löschen. Grund: &f{result}&a."
abandon-claim-missing="&cKein Grundstück gefunden. Stelle dich auf dein Grundstück, dass du löschen möchtest oder erwäge &f/abandonall &czu nutzen."
@ -68,6 +71,8 @@ GriefDefender {
abandon-top-level="&cDieses Grundstück kann nicht entfernt werden. Es existieren untergeordnete Grundstücke. Um es zu löschen, nutze &f/abandontop&c."
abandon-town-children="&cYDu hast keine Berechtigungen eine Stadt mit Teilgrundstücken zu entfernen, welche dir nicht gehören. Benutze &f/ignoreclaims&c oder lasse den Teilgrundstück Besitzer sein Grundstück entfernen. Wenn du die Stadt auflösen willst, ohne die Teilgrundstücke, benutze &f/abandon&c."
abandon-warning="&6Bist du dir sicher, dass du das Grundstück entfernen möchtest? Es wird dann nicht länger geschützt."
abandon-world-success="&aAbandoned all player claims in &6{world}&a."
abandon-world-warning="&6Are you sure you want to abandon &cALL&6 user claims in &a{world}&6?"
adjust-accrued-blocks-success="&6{player}&a's angesammelte Blöcke wurden auf &6{amount}&a angepasst. Neue Anzahl: &6{total}&a."
adjust-bonus-blocks-success="&6{player}&a's Bonusblöcke wurden auf &6{amount}&a angepasst. Neue Anzahl: &6{total}&a."
bank-click-view-transactions="Klicken, um Banktransaktionen anzuzeigen."
@ -228,10 +233,14 @@ GriefDefender {
debug-time-elapsed="Debug Zeit abgelaufen"
delete-all-player-failed="&aGrundstücke des Spielers &6{player}&a konnten nicht entfernt werden. Meldung: &f{result}&a."
delete-all-player-success="&aAlle Grundstücke des Spielers &6{player}&a entfernt."
delete-all-player-success-world="&aAlle Grundstücke des Spielers &6{player}&a entfernt auf &6{world}&a."
delete-all-player-warning="&6Bist du dir sicher, dass du alle Grundstücke von {player}&6 löschen möchtest?"
delete-all-player-warning-world="&6Bist du dir sicher, dass du alle Grundstücke von {player}&6 löschen möchtest auf &a{world}&6?"
delete-all-type-deny="&cLöschung von {type}&c Grundstücken fehlgeschlagen. Ein Plugin hat den Vorgang blockiert."
delete-all-type-success="&cAlle {type}&c Grundstücke entfernt."
delete-all-type-success-world="&cAlle {type}&c Grundstücke entfernt auf &6{world}&c."
delete-all-type-warning="&6Bist du dir sicher, dass du alle {type}&6 Grundstücke entfernen möchtest?"
delete-all-type-warning-world="&6Bist du dir sicher, dass du alle {type}&6 Grundstücke entfernen möchtest auf &a{world}&6?"
delete-claim-failed="&aGrundstück konnte nicht entfernt werden. Meldung: &f{result}&a."
delete-claim-success="&a{player}&as Grundstück entfernt."
delete-claim-warning="&6Bist du dir sicher, dass du {player}&6s Grundstück löschen möchtest?"
@ -250,6 +259,7 @@ GriefDefender {
economy-block-sale-confirmation="&6{deposit}&a verkauft. Du hast nun &6{amount}&a Baublöcke."
economy-block-sell-error="&cKonnte die Baublöcke nicht verkaufen. Meldung: &f{reason}&c."
economy-claim-abandon-success="&aGrundstück aufgegeben. Du hast '&6{amount}&a' Baublöcke zurückerhalten."
economy-claim-abandon-success-world="&aGrundstück aufgegeben auf &6{world}&a. Du hast '&6{amount}&a' Baublöcke zurückerhalten."
economy-claim-buy-cancelled="&cKauf abgebrochen! Konnte das Grundstück von &6{player}&c nicht kaufen. Meldung: &a{result}"
economy-claim-buy-confirmation="&6Bist du dir sicher, dass du das Grundstück für &a{amount}&6 kaufen möchtest? Klicke auf Confirm um den Kauf zu bestätigen."
economy-claim-buy-confirmed="&aDu hast das Grundstück für &6{amount}&a gekauft."
@ -319,6 +329,7 @@ GriefDefender {
flag-description-collide-entity="Kontrolliert, ob eine Entität mit einer anderen kollidieren kann.\n&dBeispiel&f : Um das Kollidieren mit Rahmen zu verhindern, nutze\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft steht für die ModID und item_frame für die BlockID.\nGibst du keine ModID an, wird standardmäßig minecraft benutzt."
flag-description-command-execute="Kontrolliert, ob ein Befehl ausgeführt werden kann.\n&dBeispiel&f : Um den Pixelmon Befehl '/shop select' zu blockieren, nutze\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f steht für die ModID &o&6shop&f für den Befehl und &o&6select&f für das Argument.\nGibst du keine ModID an, wird standardmäßig minecraft benutzt."
flag-description-command-execute-pvp="Kontrolliert, ob ein Befehl während PvP benutzt werden kann.\n&dBeispiel&f : Um den Pixelmon Befehl '/shop select' zu blockieren, nutze\n&a/cf command-execute pixelmon:shop[select] false\n&bBeispiel&f : &o&6pixelmon&f steht für die ModID &o&6shop&f für den Befehl und &o&6select&f für das Argument.\nGibst du keine ModID an, wird standardmäßig minecraft benutzt."
flag-description-custom-armorstand-use="Controls whether armorstands can be placed or broken."
flag-description-custom-block-trampling="Kontrolliert, ob Acker-/Farmland und Eier von Schildkröten zertrampelt werden können."
flag-description-custom-build="Kontrolliert, ob Aktionen mit Blöcken möglich sind, wie Abbauen, Platzieren und Interagieren."
flag-description-custom-chest-access="Kontrolliert, ob Spieler auf Kisten zugreifen können."
@ -327,6 +338,7 @@ GriefDefender {
flag-description-custom-creeper-entity-explosion="Kontrolliert, ob Creeper Schaden verursachen können."
flag-description-custom-crop-growth="Kontrolliert, ob Weizensamen wachsen können."
flag-description-custom-damage-animals="Kontrolliert, ob Tiere geschädigt werden können."
flag-description-custom-endcrystal-use="Controls whether endcrystals can be placed or broken."
flag-description-custom-enderman-grief="Kontrolliert, ob Enderman Blöcke stehlen können."
flag-description-custom-exp-drop="Kontrolliert, ob EXP droppt."
flag-description-custom-explosion-block="Kontrolliert, ob Explosionen Blöcke beeinflussen."
@ -683,6 +695,7 @@ GriefDefender {
result-type-requires-owner="&cKonnte {type} Grundstück nicht zu {target_type} konvertieren. Du musst Eigentümer sein."
result-type-success=SUCCESS
schematic-abandon-all-restore-warning="&6Bist du dir sicher, dass du &cALL&6 Grundstücke &nlöschen&6 willst? &cALLE DATEN GEHEN VERLOREN&f!!&6 Alle Grundstücke werden bei Bestätigung zurückgesetzt."
schematic-abandon-all-restore-warning-world="&6Bist du dir sicher, dass du &cALL&6 Grundstücke &nlöschen&6 willst auf &a{world}? &cALLE DATEN GEHEN VERLOREN&f!!&6 Alle Grundstücke werden bei Bestätigung zurückgesetzt."
schematic-abandon-restore-warning="&6Bist du dir sicher, dass du das Grundstück &nlöschen&6 willst? &cALLE DATEN GEHEN VERLOREN&f!!&6 Das Grundstück wird bei Bestätigung zurückgesetzt."
schematic-create="&aErstelle eine Sicherung mit Abbildern..."
schematic-create-complete="&aSicherung vollständig."

View File

@ -59,7 +59,10 @@ GriefDefender {
}
messages {
abandon-all-delay-warning="&aThese claims were recently created and cannot be abandoned."
abandon-all-success="&aAll your claims have been abandoned. You now have &6{amount}&a available claim blocks."
abandon-all-success-world="&aAll your claims have been abandoned in &6{world}&a. You now have &6{amount}&a available claim blocks."
abandon-all-warning="&6Are you sure you want to abandon &cALL&6 your claims?"
abandon-all-warning-world="&6Are you sure you want to abandon &cALL&6 your claims in &a{world}&6?"
abandon-claim-delay-warning="&aThis claim was recently created and cannot be abandoned until &6{date}&a."
abandon-claim-failed="&aCould not abandon claim. Claim result was &f{result}&a."
abandon-claim-missing="&cNo claim found. Stand in the claim you want to abandon, or consider &f/abandonall&c."
@ -68,6 +71,8 @@ GriefDefender {
abandon-top-level="&cThis claim cannot be abandoned as it contains one or more child claims. In order to abandon a claim with child claims, you must use &f/abandontop&c instead."
abandon-town-children="&cYou do not have permission to abandon a town with child claims you do not own. Use &f/ignoreclaims&c or have the child claim owner abandon their claim first. If you just want to abandon the town without affecting children then use &f/abandon&c instead."
abandon-warning="&6Are you sure you want to abandon this claim? It will no longer be protected from grief."
abandon-world-success="&aAbandoned all player claims in &6{world}&a."
abandon-world-warning="&6Are you sure you want to abandon &cALL&6 user claims in &a{world}&6?"
adjust-accrued-blocks-success="&aAdjusted &6{player}&a's accrued claim blocks by &6{amount}&a. New total accrued blocks: &6{total}&a."
adjust-bonus-blocks-success="&aAdjusted &6{player}&a's bonus claim blocks by &6{amount}&a. New total bonus blocks: &6{total}&a."
bank-click-view-transactions="Click here to view bank transactions"
@ -228,10 +233,14 @@ GriefDefender {
debug-time-elapsed="Time elapsed"
delete-all-player-failed="&aCould not delete all of &6{player}&a's claims. Claim result was &f{result}&a."
delete-all-player-success="&aDeleted all of &6{player}&a's claims."
delete-all-player-success-world="&aDeleted all of &6{player}&a's claims in &6{world}&a."
delete-all-player-warning="&6Are you sure you want to delete all of {player}&6's claims?"
delete-all-player-warning-world="&6Are you sure you want to delete all of {player}&6's claims in &a{world}&6?"
delete-all-type-deny="&cCould not delete all {type}&c claims. A plugin has denied it."
delete-all-type-success="&cDeleted all {type}&c claims."
delete-all-type-success-world="&cDeleted all {type}&c claims in &6{world}&c."
delete-all-type-warning="&6Are you sure you want to delete all {type}&6 claims?"
delete-all-type-warning-world="&6Are you sure you want to delete all {type}&6 claims in &a{world}&6?"
delete-claim-failed="&aCould not delete claim. Claim result was &f{result}&a."
delete-claim-success="&aDeleted {player}&a's claim."
delete-claim-warning="&6Are you sure you want to delete {player}&6's claim?"
@ -250,6 +259,7 @@ GriefDefender {
economy-block-sale-confirmation="&aDeposited &6{deposit}&a in your account. You now have &6{amount}&a available claim blocks."
economy-block-sell-error="&cCould not sell blocks. Reason: &f{reason}&c."
economy-claim-abandon-success="&aClaim(s) abandoned. You have been refunded a total of '&6{amount}&a'."
economy-claim-abandon-success-world="&aClaim(s) abandoned in &6{world}&a. You have been refunded a total of '&6{amount}&a'."
economy-claim-buy-cancelled="&cBuy cancelled! Could not buy claim from &6{player}&c. Result was &a{result}"
economy-claim-buy-confirmation="&6Are you sure you want to buy this claim for &a{amount}&6? Click confirm to proceed."
economy-claim-buy-confirmed="&aYou have successfully bought the claim for &6{amount}&a."
@ -319,6 +329,7 @@ GriefDefender {
flag-description-collide-entity="Controls whether an entity can collide with an entity.\n&dExample&f : To prevent entity collisions with item frames, enter\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft represents the modid and item_frame represents the entity id.\nSpecifying no modid will always default to minecraft."
flag-description-command-execute="Controls whether a command can be executed.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft."
flag-description-command-execute-pvp="Controls whether a command can be executed while engaged in PvP.\n&dExample&f : To prevent pixelmon's command '/shop select' from being run, enter\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f represents the modid and &o&6shop&f represents the base command, and &o&6select&f represents the argument.\nSpecifying no modid will always default to minecraft."
flag-description-custom-armorstand-use="Controls whether armorstands can be placed or broken."
flag-description-custom-block-trampling="Controls whether farmland and turtle eggs can be trampled."
flag-description-custom-build="Controls whether actions are allowed against blocks and entities such as mining, placement, and interactions."
flag-description-custom-chest-access="Controls whether a player can access chest inventories."
@ -327,6 +338,7 @@ GriefDefender {
flag-description-custom-creeper-entity-explosion="Controls whether a creeper can explode entities."
flag-description-custom-crop-growth="Controls whether crops can grow."
flag-description-custom-damage-animals="Controls whether animals can be damaged."
flag-description-custom-endcrystal-use="Controls whether endcrystals can be placed or broken."
flag-description-custom-enderman-grief="Controls whether enderman can grief."
flag-description-custom-exp-drop="Controls whether experience orbs can drop."
flag-description-custom-explosion-block="Controls whether explosions affect blocks."
@ -683,6 +695,7 @@ GriefDefender {
result-type-requires-owner="&cCould not convert {type} claim to {target_type}. Owner is required."
result-type-success=SUCCESS
schematic-abandon-all-restore-warning="&6Are you sure you want to &nabandon&6 &cALL&6 your claims? &cALL DATA WILL BE LOST&f!!&6 Your claims will be restored back to their original state of creation on confirmation."
schematic-abandon-all-restore-warning-world="&6Are you sure you want to &nabandon&6 &cALL&6 your claims in &a{world}? &cALL DATA WILL BE LOST&f!!&6 Your claims will be restored back to their original state of creation on confirmation."
schematic-abandon-restore-warning="&6Are you sure you want to &nabandon&6 this claim? &cALL DATA WILL BE LOST&f!!&6 This claim will be restored back to its original state of creation on confirmation."
schematic-create="&aCreating schematic backup..."
schematic-create-complete="&aSchematic backup complete."

View File

@ -59,7 +59,10 @@ GriefDefender {
}
messages {
abandon-all-delay-warning="&aEsos Claims fueron recientemente creados y no pueden abandonarse."
abandon-all-success="&aTodas tus claims han sido abandonadas. Ahora tienes &6{amount}&a claimblocks disponibles."
abandon-all-success-world="&aTodas tus claims han sido abandonadas en el mundo &6{world}&a. Ahora tienes &6{amount}&a claimblocks disponibles."
abandon-all-warning="&6¿Estás seguro de que quieres abandonar &c&lTODOS &6tus Claims?"
abandon-all-warning-world="&6¿Estás seguro que deseas abandonar &cTODAS&6 tus claims en el mundo &a{world}&6?"
abandon-claim-delay-warning="&6¿Estás seguro de que quieres abandonar &c&lTODOS &6tus Claims?"
abandon-claim-failed="&4&l[ERROR] &cNo puedes abandonar el Claim porque el resultado fue &f{result}&c."
abandon-claim-missing="&4&l[ERROR] &c&l&nClaim no encontrado&c. Mantente en el Claim que quieres abandonar o considera usar &6&o/abandonall&c."
@ -68,6 +71,8 @@ GriefDefender {
abandon-top-level="&4&l[ERROR] &c&lEste Claim no puede ser abandonado porque contiene uno o mas &l&nChild Claims&c. Usa &6&l&o/abandontop &c este tipo de Claims."
abandon-town-children="&4&l[ERROR] &c&lNo tienes permiso para abandonar una CIUDAD con Child Claims que no son de tu propiedad. &cUsa &6&l&o/ignoreclaims &co tienes que pedir al dueño que abandone ese &lC&child &lC&claim primero, sin embargo, lo único que quieres es abandonar la ciudad sin afectar al &lCC&c entonces usa &6&l&o/abandon&c."
abandon-warning="&4&l[ATENCION] &c&l¿Estás seguro de querer abandonar este Claim? &cCualquiera podrá grifearte la zona."
abandon-world-success="&aTodas las claims del mundo &6{world}&a han sido abandonadas."
abandon-world-warning="&4&l[ATENCION] &6¿Estás seguro que deseas abandonar &cTODAS&6 las claims de los usuarios en el mundo &a{world}&6?
adjust-accrued-blocks-success="&2&l[MODIFICADO] &ala cantidad de bloques acumulados a &6&o{amount} &aal jugador &6&o{player}&a. &aTOTAL BLOQUES ACUMULADOS: &6&o{total}&a."
adjust-bonus-blocks-success="&2&l[MODIFICADO] &ael bonus de ClaimBlocks a &6&o{amount} &aal jugador &6&o{player}&a. &aTOTAL DE BONOS ACUMULADOS: &6&o{total}&a."
bank-click-view-transactions="&aClick aqui para ver las transacciones del Banco."
@ -228,10 +233,14 @@ GriefDefender {
debug-time-elapsed="Tiempo Transcurrido"
delete-all-player-failed="&4&l[ERROR] &aNo puedes eliminar todos los Claims de &6{player}&c porque el resultado fue &f{result}&c."
delete-all-player-success="&aEliminados TODOS los Claims de &6{player}&a."
delete-all-player-success-world="&aEliminadas todas las claims de &6{player}&a en el mundo &6{world}&a."
delete-all-player-warning="&4&l[ATENCION] &a¿Estás seguro de eliminar todos los Claims de &6{player}&a?"
delete-all-player-warning-world="&4&l[ATENCION] &6¿Estás seguro que deseas eliminar todas las claims de {player}&6 en el mundo &a{world}&6?"
delete-all-type-deny="&4&l[ERROR] &cCNo puedes eliminar todos los Claims de tipo &6{type}&c. Un plugin lo ha denegado."
delete-all-type-success="&aEliminados todos los Claims de tipo {type}&a."
delete-all-type-success-world="&cEliminadas todas las claims de tipo {type}&c en el mundo &a{world}&c."
delete-all-type-warning="&4&l[ATENCION] &c¿Estás seguro de eliminar todos los Claims de tipo &6{type}&c?"
delete-all-type-warning-world="&4&l[ATENCION] &6¿Estás seguro que deseas eliminar todas las claims de tipo {type}&6 en el mundo &a{world}&6?"
delete-claim-failed="&4&l[ERROR] &cNo puedes eliminar el Claim porque el resultado fue &f{result}&c."
delete-claim-success="&2&l[TERRENO ELEMINADO] &aDel jugador {player}."
delete-claim-warning="&4&l[AVISO] &c¿Estás seguro de querer eliminar el Claim del jugador {player}&c?"
@ -250,6 +259,7 @@ GriefDefender {
economy-block-sale-confirmation="&2&l[VENTA CONFIRMADA] &aSe han depositado &6&o{deposit}CB's&a en tu cuenta.\n&a&lCB's Disponibles: &6&o{amount}&a."
economy-block-sell-error="&4&l[ERROR] &cNo puedes vender &6&oCB's&c. RAZON: &6&o{reason}&c."
economy-claim-abandon-success="&2&l[CLAIMS ABANDONADOS] &acon éxito.\n&a&lTOTAL DEVUELTO: &6&o'{amount}'&a."
economy-claim-abandon-success-world="&aClaim(s) abandonadas en el mundo &6{world}&a. Se te ha reembolsado un total de '&6{amount}&a' claimblocks."
economy-claim-buy-cancelled="&4&l[COMPRA CANCELADA] &cNo puedes comprar un terreno &6&o{player}&c.\n&c&lRESULTADO: &6&o{result}"
economy-claim-buy-confirmation="&2&l[CONFIRMAR COMPRA] &a¿Estás seguro de querer comprar este terreno por &6&o{amount}&a?\n&6&lClick en CONFIRMAR si estás de acuerdo."
economy-claim-buy-confirmed="&2&l[COMPRA CONFIRMADA] &a¡Has comprado el terreno por &6&o{amount}&a.\n&8Ya puedes ponerte a plantar potatoes =)"
@ -319,6 +329,7 @@ GriefDefender {
flag-description-collide-entity="Controla si una entidad puede COLISIONAR con otra entidad.\n&2&lEJEMPLO: &aPara prevenir colisionar con item frames, usa...\n&6&o'/cf collide-entity minecraft:item_frame &c&ofalse&6&o'\n&4&l[NOTA] &6&o'minecraft'&f&l=&d&lModID&f&l / &6&o'item_frame'&f&l=&d&lEntityID.\n&aSin especificar el &d&lModID &asiempre será por default &6&o'minecraft'&a."
flag-description-command-execute="Controlar si un comando puede ser EJECUTADO.\n&2&lEJEMPLO: &aPara prevenir que los jugadores usen el comando &6&o'/sethome'&a, usa...\n&6&o'/cf command-execute nucleus:sethome &c&ofalse&6&o'\n&4&l[NOTA] &6&o'nucleus'&f&l=&d&lPluginID&f&l / &6&o'sethome'&f&l=&d&lBaseCommand\n&aSin especificar el &d&lPluginID &asiempre será por default &6&o'minecraft'&a."
flag-description-command-execute-pvp="Controla si un comando puede ser EJECUTADO.\n&2&lEJEMPLO: &aPara prevenir que los jugadores usen el comando &6&o'/home'&a durante una pelea, usa...\n&6&o'/cf command-execute nucleus:home &c&ofalse&6&o'\n&4&l[NOTA] &6&o'nucleus'&f&l=&d&lPluginID&f&l / &6&o'home'&f&l=&d&lBaseCommand\n&aSin especificar el &d&lPluginID &asiempre será por default &6&o'minecraft'&a."
flag-description-custom-armorstand-use="Controla si los soportes de armaduras pueden ser colocados o destruidos."
flag-description-custom-block-trampling="Controla si los bloques, como la Tierra para Cultivo (Farmland) o los huevos de Tortuga pueden ser dañados al pisarse."
flag-description-custom-build="Controla si cualquier acción está permitida contra bloques y entidades como por ejemplo, minar, colocar, interactuar."
flag-description-custom-chest-access="Controla si cualquier jugador puede acceder a los cofres."
@ -327,6 +338,7 @@ GriefDefender {
flag-description-custom-creeper-entity-explosion="Controla si un Creeper puede dañar entidades al explotar."
flag-description-custom-crop-growth="Controla si cualquier cultivo puede crecer."
flag-description-custom-damage-animals="Controla si los animales puedes ser dañados."
flag-description-custom-endcrystal-use="Controla si los cristales de Ender pueden ser colocados o destruidos."
flag-description-custom-enderman-grief="Controla si cualquier Enderman puede grifear bloques."
flag-description-custom-exp-drop="Controla si los orbes de experiencia pueden ser dropeados."
flag-description-custom-explosion-block="Controla si las explosiones pueden dañar bloques."
@ -683,6 +695,7 @@ GriefDefender {
result-type-requires-owner="&4&l[ERROR] &cNo puedes convertir el Claim de tipo &6&o{type} a &6&o{target_type}. Requiere ser Dueño."
result-type-success=ÉXITO
schematic-abandon-all-restore-warning="&4&l[ATENCION] &2¿Estás seguro de querer &nabandonar&r&c &cTODOS&2 tus terrenos? &aTus terrenos serán restaurados de vuelta al estado por defecto si confirmas.\n&4&l[NOTA] &cPERDERAS TODA la &6&oinformación-opciones-flags-permisos, &cya configurada..."
schematic-abandon-all-restore-warning-world="&4&l[ATENCION] &6¿Estás seguro que deseas &nabandonar&6 &cTODAS&6 tus claims en el mundo &a{world}? &c¡¡TODA ESTA INFORMACIÓN SE PERDERÁ&f!!&6 Tus claims serán restauradas a su estado de creación original al confirmar esta acción."
schematic-abandon-restore-warning="&4&l[ATENCION] &2¿Estás seguro de querer &nabandonar&r&c &cESTE&2 terreno? &aEl terrenos será restaurado de vuelta al estado por defecto si confirmas.\n&4&l[NOTA] &cPERDERAS TODA la &6&oinformación-opciones-flags-permisos, &cya configurada..."
schematic-create="&2&l[COPIA DE SEGURIDAD] ➜ &a&lON\n&a&oSe está creando una copia de guardado de todas las &6&nPlanos&r&a."
schematic-create-complete="&2&l[COPIA DE SEGURIDAD] ➜ &6&oPlanos&2&l ➜ &a&lProceso Completado."

View File

@ -59,7 +59,10 @@ GriefDefender {
}
messages {
abandon-all-delay-warning="&aCes terrains ont été créés récemment et ne peuvent être abandonnés."
abandon-all-success="&aAll your claims have been abandoned. You now have &6{amount}&a available claim blocks."
abandon-all-success-world="&aAll your claims have been abandoned in &6{world}&a. You now have &6{amount}&a available claim blocks."
abandon-all-warning="&6Es-tu sûr de vouloir abandonner &cTOUS&6 tes terrains ?"
abandon-all-warning-world="&6Es-tu sûr de vouloir abandonner &cTOUS&6 tes terrains en &a{world}&6?"
abandon-claim-delay-warning="&aCe terrain a été créé récemment et ne peut pas être abandonnée avant le &6{date}&a."
abandon-claim-failed="&aN'a pas réussi à abandonner le terrain. Résultat du terrain était: &f{result}&a."
abandon-claim-missing="&cPas de terrain trouvé. Va dans le terrain que tu veux abandonner ou envisages &f/abandonall&c."
@ -68,6 +71,8 @@ GriefDefender {
abandon-top-level="&cCe terrain ne peut être abandonné car il contient un ou plusieurs terrain(s) enfant(s). Pour abandonner un terrain avec enfant, tu dois utiliser &f/abandontop&c à la place."
abandon-town-children="&cTu n'as pas la permission pour abandonner un village contenant des terrains enfants qui ne t'appartiennent pas. Utilises &f/ignoreclaims&c ou fais en sorte que le propriétaire des terrains enfants les abandonne d'abord. Si tu veux abandonner le village sans affecter les terrains enfants, utilises &f/abandon&c à la place."
abandon-warning="&6Es-tu sûr de vouloir abandonner ce terrain ? Il ne sera plus protégé contre les dégâts."
abandon-world-success="&aAbandoned all player claims in &6{world}&a."
abandon-world-warning="&6Are you sure you want to abandon &cALL&6 user claims in &a{world}&6?"
adjust-accrued-blocks-success="&aAjustement du nombre de blocs de terrain gagnés par &6{player}&a de &6{amount}&a. Nouveau total de blocs de terrain gagnés: &6{total}&a."
adjust-bonus-blocks-success="&aAjustement du nombre de blocs de terrain, bonus &6{player}&a de &6{amount}&a. Nouveau total de blocs de terrain bonus: &6{total}&a."
bank-click-view-transactions="Clique ici pour voir les transactions bancaires"
@ -228,10 +233,14 @@ GriefDefender {
debug-time-elapsed="Temps passé"
delete-all-player-failed="&aNe peut pas supprimer l'ENSEMBLE des terrains de &6{player}&a. Résultat de terrain était &f{result}&a."
delete-all-player-success="&aSuppression de l'ENSEMBLE des terrains de &6{player}&a avec succès."
delete-all-player-success-world="&aSuppression de l'ENSEMBLE des terrains de &6{player}&a avec succès en &6{world}&a."
delete-all-player-warning="&6Es-tu sûr de vouloir supprimer l'ENSEMBLE des terrains de &6{player}&6 ?"
delete-all-player-warning-world="&6Es-tu sûr de vouloir supprimer l'ENSEMBLE des terrains de &6{player}&6 en &a{world}&6 ?"
delete-all-type-deny="&cImpossible de supprimer l'ensemble des terrains de type {type}&c. Un plug-in l'a refusé."
delete-all-type-success="&&cSuppression de l'ensemble des terrains {type}&c."
delete-all-type-success-world="&&cSuppression de l'ensemble des terrains {type}&c en &6{world}&c."
delete-all-type-warning="&6Es-tu sûr de vouloir supprimer l'ENSEMBLE des terrains de type {type}&6 ?"
delete-all-type-warning-world="&6Es-tu sûr de vouloir supprimer l'ENSEMBLE des terrains de type {type}&6 en &a{world}&6 ?"
delete-claim-failed="&aNe peut pas supprimer le terrain. Le résultat du terrain était : &f{result}&a."
delete-claim-success="&aSuppression des terrains de {player}&a."
delete-claim-warning="&6Es-tu sûr de vouloir supprimer les terrains de {player}&6 ?"
@ -250,6 +259,7 @@ GriefDefender {
economy-block-sale-confirmation="&aDéposé &6{deposit}&a sur ton compte. Tu as maintenant &6{amount}&a blocs de terrain disponibles."
economy-block-sell-error="&cImpossible de vendre les blocs. Raison: &f{reason}&c."
economy-claim-abandon-success="&Terrain abandonné. Tu as été remboursé d'un total de '&6{amount}&a'."
economy-claim-abandon-success-world="&Terrain abandonné en &6{world}&a. Tu as été remboursé d'un total de '&6{amount}&a'."
economy-claim-buy-cancelled="&cAchat annulé ! Impossible d'acheter le terrain de &6{player}&c. Resultat est &a{result}"
economy-claim-buy-confirmation="&6Es-tu sûr de vouloir acheter ce terrain pour &a{amount}&6 ? Clique confirm pour procéder."
economy-claim-buy-confirmed="&aTu as acheté le terrain avec succès pour un montant de &6{amount}&a."
@ -319,6 +329,7 @@ GriefDefender {
flag-description-collide-entity="Contrôle si une entité peut entrer en collision avec une entité.\n&dExemple&f : Pour prévenir une entité d'entrer en collision avec un cadre, entre\n&a/cf collide-entity minecraft:item_frame false\n&bNote&f : minecraft représente le modID et item_frame représente le blockID.\nNe pas spécifier de modID prendra toujours minecraft par défaut."
flag-description-command-execute="Contrôle si une commande peut être exécutée.\n&dExemple&f : Pour prévenir la commandes pixelmon '/shop select' d'être exécutée, entre\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f représente le modID et &o&6shop&f représente la commande de base, et &o&6select&f représente l'argument.\nNe pas spécifier de modID prendra toujours minecraft par défaut."
flag-description-command-execute-pvp="Contrôle si une commande peut être exécutée en état PvP.\n&dExemple&f : Pour prévenir la commandes pixelmon '/shop select' d'être exécutée, entre\n&a/cf command-execute pixelmon:shop[select] false\n&bNote&f : &o&6pixelmon&f représente le modID et &o&6shop&f représente la commande de base, et &o&6select&f représente l'argument.\nNe pas spécifier de modID prendra toujours minecraft par défaut."
flag-description-custom-armorstand-use="Controls whether armorstands can be placed or broken."
flag-description-custom-block-trampling="Contrôle si les terres agricoles et les œufs de tortue peuvent être piétinés."
flag-description-custom-build="Contrôle les actions autorisées contre les blocs comme le minage, placement et intéraction."
flag-description-custom-chest-access="Contrôle si un joueur peut accéder à l'inventaire d'un coffre."
@ -327,6 +338,7 @@ GriefDefender {
flag-description-custom-creeper-entity-explosion="Contrôle si un creeper peut exploser des entités."
flag-description-custom-crop-growth="Contrôle si les pousses peuvent grandir."
flag-description-custom-damage-animals="Contrôle si les animaux peuvent prendre des dégâts."
flag-description-custom-endcrystal-use="Controls whether endcrystals can be placed or broken."
flag-description-custom-enderman-grief="Contrôle si les enderman peuvent prendre des blocs."
flag-description-custom-exp-drop="Contrôle si les orbes d'expériences peuvent apparaîtres."
flag-description-custom-explosion-block="Contrôle si les explosions affectent les blocs."
@ -683,6 +695,7 @@ GriefDefender {
result-type-requires-owner="&cImpossible de convertir la protection {type} en {target_type}. Le propriétaire est requis."
result-type-success=SUCCESS
schematic-abandon-all-restore-warning="&6Es-tu sûr de vouloir &nabandonner&6 &cTOUTES&6 tes protections ? &cL'ENSEMBLE DES DONNÉES SERONT PERDUES&f !&6 Tes protections seront restorées à leur état d'origine lors de la confirmation."
schematic-abandon-all-restore-warning-world="&6Es-tu sûr de vouloir &nabandonner&6 &cTOUTES&6 tes protections en &a{world} ? &cL'ENSEMBLE DES DONNÉES SERONT PERDUES&f !&6 Tes protections seront restorées à leur état d'origine lors de la confirmation."
schematic-abandon-restore-warning="&6Es-tu sûr de vouloir &nabandonner&6 cette protection ? &cL'ENSEMBLE DES DONNÉES SERONT PERDUES&f !&6 Cette protection sera restorée à son état d'origine lors de la confirmation."
schematic-create="&aCréation d'une sauvegarde du patron..."
schematic-create-complete="&aSauvegarde du patron complète."

View File

@ -59,7 +59,10 @@ GriefDefender {
}
messages {
abandon-all-delay-warning="&aTe działki są zbyt świeże, aby je opuścić."
abandon-all-success="&aAll your claims have been abandoned. You now have &6{amount}&a available claim blocks."
abandon-all-success-world="&aAll your claims have been abandoned in &6{world}&a. You now have &6{amount}&a available claim blocks."
abandon-all-warning="&6Na pewno chcesz opuścić &cWSZYSTKIE&6 swoje działki?"
abandon-all-warning-world="&6Na pewno chcesz opuścić &cWSZYSTKIE&6 swoje działki w &a{world}&6?"
abandon-claim-delay-warning="&aTa działka jest zbyt świeża. Spróbuj ponownie &6{date}&a."
abandon-claim-failed="&aNie udało się opuścić działki. Wynik: &f{result}&a."
abandon-claim-missing="&cNie znaleziono działki. Stań w działce do opuszczenia, lub użyj &f/abandonall&c."
@ -68,6 +71,8 @@ GriefDefender {
abandon-top-level="&cTa działka nie może zostać opuszczona, bo ma dzieci :( Aby opuścić działkę która była podzielona wpisz &f/abandontop&c."
abandon-town-children="&cNie masz możliwości opuszczenia miasta które ma zależne działki stworzone przez innych. Użyj &f/ignoreclaims&c lub poproś innych o opuszczenie działek. Jeżeli chcesz opuścić miasto bez zmiany w działkach zależnych wpisz &f/abandon&c."
abandon-warning="&6Jesteś pewien, że chcesz opuścić tę działkę? Przestanie być chroniona przed zniszczeniami."
abandon-world-success="&aAbandoned all player claims in &6{world}&a."
abandon-world-warning="&6Are you sure you want to abandon &cALL&6 user claims in &a{world}&6?"
adjust-accrued-blocks-success="&aZmieniono ilość bloków metrażu gracza &6{player} &ao &6{amount}&a. Nowy metraż: &6{total} &abloków."
adjust-bonus-blocks-success="&aZmieniono ilość bonusowych bloków metrażu gracza &6{player} &ao &6{amount}&a. Nowy bonus: &6{total} &abloków."
bank-click-view-transactions="Kliknij aby sprawdzić transakcje bankowe"
@ -228,10 +233,14 @@ GriefDefender {
debug-time-elapsed="Czas trwania"
delete-all-player-failed="&aNie można usunąć wszystkich claimów które ma &6{player}&a. Wynik: &f{result}&a."
delete-all-player-success="&aUsunięto wszystkie działki gracza &6{player}&a."
delete-all-player-success-world="&aUsunięto wszystkie działki gracza &6{player}&a w &6{world}&a."
delete-all-player-warning="&6Na pewno usunąć wszystkie działki które ma {player}&6?"
delete-all-player-warning-world="&6Na pewno usunąć wszystkie działki które ma {player}&6 w &a{world}&6?"
delete-all-type-deny="&cNie można było usunąć wszystkich działek o typie {type}&c. Plugin mówi Bo nie."
delete-all-type-success="&cUsunięto wszystkie działki typu {type}&c."
delete-all-type-success-world="&cUsunięto wszystkie działki typu {type}&c w &6{world}&c."
delete-all-type-warning="&6Na pewno usunąć wszystkie działki o typie {type}&6?"
delete-all-type-warning-world="&6Na pewno usunąć wszystkie działki o typie {type}&6 w &a{world}&6?"
delete-claim-failed="&aNie można usunąć działki. Wynik: &f{result}&a."
delete-claim-success="&aUsunięto działkę graczowi {player}&a."
delete-claim-warning="&6Na pewno usunąć działkę której właścicielem jest {player}&6?"
@ -250,6 +259,7 @@ GriefDefender {
economy-block-sale-confirmation="&aZdeponowano &6{deposit}&a na Twoim koncie. Masz teraz &6{amount}&a szt. bloków do dyspozycji."
economy-block-sell-error="&cNie można sprzedać bloków. Powód: &f{reason}&c."
economy-claim-abandon-success="&aTeren opuszczony. Przywrócono Ci '&6{amount}&a'."
economy-claim-abandon-success-world="&aTeren opuszczony w &6{world}&a. Przywrócono Ci '&6{amount}&a'."
economy-claim-buy-cancelled="&cKupno anulowane! Nie kupujesz od &6{player}&c. Powód was &a{result}"
economy-claim-buy-confirmation="&6Na pewno chcesz kupić tę działkę za &a{amount}&6? Kliknij aby potwierdzić."
economy-claim-buy-confirmed="&aKupujesz działkę za &6{amount}&a."
@ -319,6 +329,7 @@ GriefDefender {
flag-description-collide-entity="Ustala, czy obiekt może wchodzić w interakcje z innym obiektem.\n&dPrzykład&f : Aby obiekt nie wchodził w interakcje z obrazem, wpisz\n&a/cf collide-entity minecraft:item_frame false\n&bUwaga&f : minecraft oznacza ID moda a item_frame to id obiektu z którym ma nie być reakcji.\nBez wpisania nazwy moda użyte zostanie 'minecraft:'."
flag-description-command-execute="Ustala, czy można używać danej komendy.\n&dUwaga&f : Aby wyłączyć pixelmonową komendę '/shop select', wpisz\n&a/cf command-execute pixelmon:shop[select] false\n&bUwaga&f : &o&6pixelmon&f to ID moda, &o&6shop&f to komenda, a &o&6select&f to argument komendy.\nBez wpisania nazwy moda użyte zostanie 'minecraft:'."
flag-description-command-execute-pvp="Ustala, czy komendy można użyć w trakcie PvP.\n&dPrzykład&f : Aby wyłączyć pixelmonową komendę '/shop select' w trakcie PvP, wpisz\n&a/cf command-execute pixelmon:shop[select] false\n&bUwaga&f : &o&6pixelmon&f to ID moda, &o&6shop&f to podstawowa komenda, a &o&6select&f to jej argument.\nBez wpisania nazwy moda użyte zostanie 'minecraft:'."
flag-description-custom-armorstand-use="Controls whether armorstands can be placed or broken."
flag-description-custom-block-trampling="Ustala, czy farmy i żółwie jajka mogą być rozdeptywane."
flag-description-custom-build="Ustala czy możliwe są akcje takie jak wydobycie, stawianie, uruchamianie oraz interakcja."
flag-description-custom-chest-access="Ustala, czy można korzystać z pojemników."
@ -327,6 +338,7 @@ GriefDefender {
flag-description-custom-creeper-entity-explosion="Ustala, czy eksplozje creeperów mogą niszczyć obiekty i zadawać obrażenia."
flag-description-custom-crop-growth="Ustala, czy zbiory będą rosnąć."
flag-description-custom-damage-animals="Ustala, czy można bić zwierzątka."
flag-description-custom-endcrystal-use="Controls whether endcrystals can be placed or broken."
flag-description-custom-enderman-grief="Ustala, czy enderman może podnosić bloki."
flag-description-custom-exp-drop="Ustala wypadanie kul z doświadczeniem."
flag-description-custom-explosion-block="Ustala, czy eksplozje niszczą bloki."
@ -683,6 +695,7 @@ GriefDefender {
result-type-requires-owner="&cNie można zmienić typu {type} na typ {target_type}. Wymaga właściciela."
result-type-success=SUCCESS
schematic-abandon-all-restore-warning="&6Na pewno chcesz &nporzucić&6 &cWSZYSTKIE&6 swoje działki? &cWSZYSTKIE ZMIANY ZNIKNĄ BEZPOWROTNIE&f!!&6 Działka zostanie przywrócona do stanu w jakim była przed jej zajęciem po potwierdzeniu."
schematic-abandon-all-restore-warning-world="&6Na pewno chcesz &nporzucić&6 &cWSZYSTKIE&6 swoje działki w &a{world}? &cWSZYSTKIE ZMIANY ZNIKNĄ BEZPOWROTNIE&f!!&6 Działka zostanie przywrócona do stanu w jakim była przed jej zajęciem po potwierdzeniu."
schematic-abandon-restore-warning="&6Na pewno chcesz &nporzucić&6 tę działkę? &cWSZYSTKIE ZMIANY ZNIKNĄ BEZPOWROTNIE&f!!&6 Działka zostanie przywrócona do stanu w jakim była przed jej zajęciem po potwierdzeniu."
schematic-create="&aTworzenie kopii zapasowej schematu..."
schematic-create-complete="&aKopia zapasowa schematu gotowa."

View File

@ -59,7 +59,10 @@ GriefDefender {
}
messages {
abandon-all-delay-warning="&aThese claims were recently created and cannot be abandoned."
abandon-all-success="&aAll your claims have been abandoned. You now have &6{amount}&a available claim blocks."
abandon-all-success-world="&aAll your claims have been abandoned in &6{world}&a. You now have &6{amount}&a available claim blocks."
abandon-all-warning="&6Вы уверены, что хотите удалить &cВСЕ&6 ваши регионы?"
abandon-all-warning-world="&6Вы уверены, что хотите удалить &cВСЕ&6 ваши регионы в &a{world}&6?"
abandon-claim-delay-warning="&aЭтот регион был создан недавно и не может быть удалён до &6{date}&a."
abandon-claim-failed="&aНе удалось удалить регион. Результат действия: &f{result}&a."
abandon-claim-missing="&cНе найдено ни одного региона. Войдите в регион, который вы хотите удалить, или воспользуйтесь &f/abandonall&c."
@ -68,6 +71,8 @@ GriefDefender {
abandon-top-level="&cРегион не может быть удалён, поскольку в нём есть один или несколько суб-регионов. Чтобы удалить регион вместе с суб-регионами, воспользуйтесь &f/abandontop&c."
abandon-town-children="&cУ вас нет разрешения на удаление города, в котором есть суб-регионы, не принадлежащие вам. Воспользуйтесь &f/ignoreclaims&c или попросите владельцев суб-регионов удалить их. Если вы хотите удалить город, но не суб-регионы, воспользуйтесь &f/abandon&c."
abandon-warning="&6Вы уверены, что хотите удалить этот регион? Он больше не будет защищён."
abandon-world-success="&aAbandoned all player claims in &6{world}&a."
abandon-world-warning="&6Are you sure you want to abandon &cALL&6 user claims in &a{world}&6?"
adjust-accrued-blocks-success="&aКоличество накопленных блоков региона для &6{player}&a изменено на &6{amount}&a. Новое количество накопленных блоков: &6{total}&a."
adjust-bonus-blocks-success="&aКоличество бонусных блоков региона для &6{player}&a изменено на &6{amount}&a. Новое количество бонусных блоков: &6{total}&a."
bank-click-view-transactions="Нажмите здесь, чтобы просмотреть историю банковских переводов"
@ -228,10 +233,14 @@ GriefDefender {
debug-time-elapsed="Затраченное время"
delete-all-player-failed="&aНе удалось удалить все регионы, принадлежащие игроку &6{player}&a. Результат действия: &f{result}&a."
delete-all-player-success="&aУдалены все регионы, принадлежавшие игроку &6{player}&a."
delete-all-player-success-world="&aУдалены все регионы, принадлежавшие игроку &6{player}&a в &6{world}&a."
delete-all-player-warning="&6Вы уверенны, что хотите удалить все регионы, принадлежащие игроку &a{player}&6?"
delete-all-player-warning-world="&6Вы уверенны, что хотите удалить все регионы, принадлежащие игроку &a{player}&6?"
delete-all-type-deny="&cНе удалось удалить все регионы вида &6{type}&c. Плагин не разрешил."
delete-all-type-success="&cВсе регионы вида &6{type}&c удалены."
delete-all-type-success-world="&cВсе регионы вида &6{type}&c удалены в &6{world}&c."
delete-all-type-warning="&6Вы уверены, что хотите удалить все регионы вида &c{type}&6?"
delete-all-type-warning-world="&6Вы уверены, что хотите удалить все регионы вида &c{type}&6 в &a{world}&6?"
delete-claim-failed="&aНе удалось удалить регион. Результат действия: &f{result}&a."
delete-claim-success="&aУспешно удалён регион, принадлежавший игроку &f{player}&a."
delete-claim-warning="&6Вы уверены, что хотите удалить регион, принадлежащий игроку &f{player}&6?"
@ -250,6 +259,7 @@ GriefDefender {
economy-block-sale-confirmation="&aНа ваш счёт начислено &6{deposit}&a. Теперь у вас доступно &6{amount}&a блоков региона."
economy-block-sell-error="&cНе удалось продать блоки. Причина: &f{reason}&c."
economy-claim-abandon-success="&aРегион(ы) удалены. Вам возмещены средства в размере '&6{amount}&a'."
economy-claim-abandon-success-world="&aРегион(ы) удалены в &6{world}&a. Вам возмещены средства в размере '&6{amount}&a'."
economy-claim-buy-cancelled="&cПокупка отменена! Не удалось купить регион, принадлежащий &6{player}&c. Результат действия: &a{result}"
economy-claim-buy-confirmation="&6Вы уверены, что хотите купить этот регион за &a{amount}&6? Нажмите &aПодтвердить&6 для продолжения."
economy-claim-buy-confirmed="&aВы успешно приобрели регион за &6{amount}&a."
@ -319,6 +329,7 @@ GriefDefender {
flag-description-collide-entity="Управляет возможностью столкновения сущности с другой сущностью.\n&dПример&f : чтобы отключить столкновение сущностей с рамками, введите\n&a/cf collide-entity minecraft:item_frame false\n&bПримечание&f : minecraft - это id мода, а item_frame - id сущности.\nЕсли id мода не указан - будет использоваться minecraft."
flag-description-command-execute="Управляет возможностью выполнять команды.\n&dПример&f : чтобы запретить команду '/shop select' из Pixelmon, введите\n&a/cf command-execute pixelmon:shop[select] false\n&bПримечание&f : &o&6pixelmon&f - это id мода, &o&6shop&f - базовая команда, а &o&6select&f - аргумент.\nЕсли id мода не указан - будет использоваться minecraft."
flag-description-command-execute-pvp="Управляет возможностью выполнять команды во время сражения с другим игроком.\n&dПример&f : чтобы запретить команду '/shop select' из Pixelmon, введите \n&a/cf command-execute-pvp pixelmon:shop[select] false\n&bПримечание&f : &o&6pixelmon&f - это id модв, &o&6shop&f - базовая команда, а &o&6select&f - аргумент.\nЕсли id мода не указан - будет использоваться minecraft."
flag-description-custom-armorstand-use="Controls whether armorstands can be placed or broken."
flag-description-custom-block-trampling="Управляет, можно ли растоптать сельскохозяйственные угодья и черепаховые яйца."
flag-description-custom-build="Управляет возможностью совершения действий с блоками и сущностями, таких, как поломка, установка и взаимодействие."
flag-description-custom-chest-access="Управляет возможностью игрока взаимодействовать с инвентарями сундуков."
@ -327,6 +338,7 @@ GriefDefender {
flag-description-custom-creeper-entity-explosion="Управляет способностью лианы взрывать сущности."
flag-description-custom-crop-growth="Управляет возможностью культур расти."
flag-description-custom-damage-animals="Управляет возможностью животных получать урон."
flag-description-custom-endcrystal-use="Controls whether endcrystals can be placed or broken."
flag-description-custom-enderman-grief="Управляет возможностью Странников Края ломать и ставить блоки."
flag-description-custom-exp-drop="Управляет возможностью выпадения сфер опыта."
flag-description-custom-explosion-block="Управляет возможностью взрывов влиять на блоки."
@ -683,6 +695,7 @@ GriefDefender {
result-type-requires-owner="&cНе удалось изменить регион вида {type} на {target_type}. Требуется владелец."
result-type-success=SUCCESS
schematic-abandon-all-restore-warning="&6Вы уверены, что хотите &nудалить&6 &cВСЕ&6 ваши регионы? &cВСЕ ДАННЫЕ БУДУТ УДАЛЕНЫ&f!!&6 При подтверждении все регионы будет восстановлены в состояние, в котором они были при создании."
schematic-abandon-all-restore-warning-world="&6Вы уверены, что хотите &nудалить&6 &cВСЕ&6 ваши регионы в &a{world}? &cВСЕ ДАННЫЕ БУДУТ УДАЛЕНЫ&f!!&6 При подтверждении все регионы будет восстановлены в состояние, в котором они были при создании."
schematic-abandon-restore-warning="&6Вы уверены, что хотите &nудалить&6 этот регион? &cВСЕ ДАННЫЕ БУДУТ УДАЛЕНЫ&f!!&6 При подтверждении этот регион будет восстановлен в состояние, в котором они были при создании."
schematic-create="&aСоздание резервной копии..."
schematic-create-complete="&aРезервная копия создана."

View File

@ -2,13 +2,13 @@
name=GriefDefender
group=com.griefdefender
url=https://github.com/bloodmc/GriefDefender
version=1.3.4
version=1.4.2
apiVersion=1.0.0-20200528.202302-24
# Bukkit
adapterVersion=1.15.2-20200608.154231-14
spigotVersion=1.15.2-R0.1-SNAPSHOT
adapterVersion=1.16.1-20200625.044010-2
spigotVersion=1.16.1-R0.1-SNAPSHOT
# Sponge
adapterSpongeVersion=1.12.2-20200607.180353-5
adapterSpongeVersion=1.12.2-20200620.004815-11
commonVersion=1.12.2-7.1.7-SNAPSHOT
minecraftVersion=1.12.2
mcpMappings=snapshot_20180808

View File

@ -130,7 +130,7 @@ dependencies {
}
compile "com.github.bloodmc:mcclans-api:develop-SNAPSHOT"
compileOnly "com.sk89q.worldedit:worldedit-core:6.1.4-SNAPSHOT"
compileOnly "net.luckperms:api:5.0"
compileOnly "com.github.lucko:luckperms:master-SNAPSHOT"
compileOnly "us.dynmap:dynmap-api:3.0-SNAPSHOT"
// required for bootstrap

View File

@ -140,12 +140,8 @@ public void addRecord(String flag, String trust, String source, String target, S
.append("Pasting output...", TextColor.GREEN).build());
this.pasteRecords();
this.records.clear();
if (this.user != null) {
GriefDefenderPlugin.getInstance().getDebugUserMap().remove(this.user.getName());
}
if (GriefDefenderPlugin.getInstance().getDebugUserMap().isEmpty()) {
GriefDefenderPlugin.debugActive = false;
}
GriefDefenderPlugin.getInstance().getDebugUserMap().clear();
GriefDefenderPlugin.debugActive = false;
TextAdapter.sendComponent(this.source, TextComponent.builder("").append(GD_TEXT).append("Debug ", TextColor.GRAY).append("OFF", TextColor.RED).build());
}
}

View File

@ -50,6 +50,7 @@
import com.griefdefender.permission.GDPermissions;
import com.griefdefender.permission.option.GDOptions;
import com.griefdefender.storage.BaseStorage;
import com.griefdefender.task.ClaimVisualRevertTask;
import com.griefdefender.util.PermissionUtil;
import net.kyori.text.Component;
import org.spongepowered.api.Sponge;
@ -97,6 +98,8 @@ public class GDPlayerData implements PlayerData {
public GDClaim claimResizing;
public GDClaim claimSubdividing;
public Map<UUID, Runnable> createBlockVisualRevertRunnables = new HashMap<>();
public Map<UUID, List<Transaction<BlockSnapshot>>> createBlockVisualTransactions = new HashMap<>();
public Map<UUID, Task> claimVisualRevertTasks = new HashMap<>();
public Map<UUID, List<Transaction<BlockSnapshot>>> visualClaimBlocks = new HashMap<>();
public List<BlockSnapshot> queuedVisuals = new ArrayList<>();
@ -257,6 +260,9 @@ public String getName() {
@Override
public void revertAllVisuals() {
this.lastShovelLocation = null;
this.claimResizing = null;
this.claimSubdividing = null;
final Player player = this.getSubject().getOnlinePlayer();
if (player == null) {
return;
@ -278,6 +284,10 @@ public void revertAllVisuals() {
GriefDefenderPlugin.getInstance().getWorldEditProvider().revertAllVisuals(this.playerID);
}
// Revert any temp visuals
this.revertTempVisuals();
}
public void revertTempVisuals() {
if (this.tempVisualUniqueId != null) {
this.revertClaimVisual(null, this.tempVisualUniqueId);
this.tempVisualUniqueId = null;
@ -319,12 +329,24 @@ public void revertClaimVisual(GDClaim claim, UUID visualUniqueId) {
}
private void revertVisualBlocks(Player player, GDClaim claim, UUID visualUniqueId) {
this.lastShovelLocation = null;
final List<Transaction<BlockSnapshot>> visualTransactions = this.visualClaimBlocks.get(visualUniqueId);
if (visualTransactions == null || visualTransactions.isEmpty()) {
return;
}
// Gather create block visuals
final List<Transaction<BlockSnapshot>> createBlockVisualTransactions = new ArrayList<>();
for (Runnable runnable : this.createBlockVisualRevertRunnables.values()) {
final ClaimVisualRevertTask revertTask = (ClaimVisualRevertTask) runnable;
if (revertTask.getVisualUniqueId().equals(visualUniqueId)) {
continue;
}
final List<Transaction<BlockSnapshot>> blockTransactions = this.createBlockVisualTransactions.get(revertTask.getVisualUniqueId());
if (blockTransactions != null) {
createBlockVisualTransactions.addAll(blockTransactions);
}
}
for (int i = 0; i < visualTransactions.size(); i++) {
BlockSnapshot snapshot = visualTransactions.get(i).getOriginal();
// If original block does not exist, do not send to player
@ -335,6 +357,16 @@ private void revertVisualBlocks(Player player, GDClaim claim, UUID visualUniqueI
}
continue;
}
boolean ignoreVisual = false;
for (Transaction<BlockSnapshot> createVisualTransaction : createBlockVisualTransactions) {
if (createVisualTransaction.getOriginal().getLocation().equals(snapshot.getLocation().get())) {
ignoreVisual = true;
break;
}
}
if (ignoreVisual) {
continue;
}
player.sendBlockChange(snapshot.getPosition(), snapshot.getState());
}
if (claim != null) {
@ -343,11 +375,8 @@ private void revertVisualBlocks(Player player, GDClaim claim, UUID visualUniqueI
this.claimVisualRevertTasks.remove(visualUniqueId);
this.visualClaimBlocks.remove(visualUniqueId);
// Revert any temp visuals
if (this.tempVisualUniqueId != null) {
this.revertClaimVisual(null, this.tempVisualUniqueId);
this.tempVisualUniqueId = null;
}
this.createBlockVisualRevertRunnables.remove(visualUniqueId);
this.createBlockVisualTransactions.remove(visualUniqueId);
}
@Override
@ -495,7 +524,11 @@ public boolean addAccruedClaimBlocks(int newAccruedClaimBlocks) {
}
public boolean setAccruedClaimBlocks(int newAccruedClaimBlocks) {
if (newAccruedClaimBlocks > this.getMaxAccruedClaimBlocks()) {
return this.setAccruedClaimBlocks(newAccruedClaimBlocks, true);
}
public boolean setAccruedClaimBlocks(int newAccruedClaimBlocks, boolean checkMax) {
if (checkMax && newAccruedClaimBlocks > this.getMaxAccruedClaimBlocks()) {
return false;
}
@ -703,7 +736,6 @@ public UUID getUniqueId() {
}
public GDPermissionUser getSubject() {
this.playerSubject = null;
if (this.playerSubject == null || this.playerSubject.get() == null) {
GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(this.playerID);
this.playerSubject = new WeakReference<>(user);
@ -829,8 +861,11 @@ public void onClaimDelete() {
public void onDisconnect() {
this.claimVisualRevertTasks.clear();
this.visualClaimBlocks.clear();
this.createBlockVisualTransactions.clear();
this.createBlockVisualRevertRunnables.clear();
this.queuedVisuals.clear();
this.claimMode = false;
this.debugClaimPermissions = false;
this.ignoreClaims = false;
this.lastShovelLocation = null;
this.eventResultCache = null;

View File

@ -167,6 +167,7 @@ public static MessageCache getInstance() {
public Component ECONOMY_SIGN_SOLD_LINE4;
public Component ECONOMY_VIRTUAL_NOT_SUPPORTED;
public Component FEATURE_NOT_AVAILABLE;
public Component FLAG_DESCRIPTION_CUSTOM_ARMOR_STAND_USE;
public Component FLAG_DESCRIPTION_CUSTOM_BLOCK_TRAMPLING;
public Component FLAG_DESCRIPTION_CUSTOM_CHEST_ACCESS;
public Component FLAG_DESCRIPTION_CUSTOM_CHORUS_FRUIT_TELEPORT;
@ -174,6 +175,7 @@ public static MessageCache getInstance() {
public Component FLAG_DESCRIPTION_CUSTOM_CREEPER_ENTITY_EXPLOSION;
public Component FLAG_DESCRIPTION_CUSTOM_CROP_GROWTH;
public Component FLAG_DESCRIPTION_CUSTOM_DAMAGE_ANIMALS;
public Component FLAG_DESCRIPTION_CUSTOM_END_CRYSTAL_USE;
public Component FLAG_DESCRIPTION_CUSTOM_ENDERMAN_GRIEF;
public Component FLAG_DESCRIPTION_CUSTOM_EXP_DROP;
public Component FLAG_DESCRIPTION_CUSTOM_FALL_ENTITY_DAMAGE;
@ -204,6 +206,7 @@ public static MessageCache getInstance() {
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_EXIT;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_INVENTORY_INTERACT;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMFRAME_INTERACT;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMHANGING_PLACE;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_DROP;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_PICKUP;
public Component FLAG_DESCRIPTION_CUSTOM_PLAYER_TELEPORT_FROM;
@ -614,6 +617,7 @@ public void loadCache() {
ECONOMY_SIGN_SOLD_LINE4 = MessageStorage.MESSAGE_DATA.getMessage("economy-sign-sold-line4");
ECONOMY_VIRTUAL_NOT_SUPPORTED = MessageStorage.MESSAGE_DATA.getMessage("economy-virtual-not-supported");
FEATURE_NOT_AVAILABLE = MessageStorage.MESSAGE_DATA.getMessage("feature-not-available");
FLAG_DESCRIPTION_CUSTOM_ARMOR_STAND_USE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-armorstand-use");
FLAG_DESCRIPTION_CUSTOM_BLOCK_TRAMPLING = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-block-trampling");
FLAG_DESCRIPTION_CUSTOM_CHEST_ACCESS = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-chest-access");
FLAG_DESCRIPTION_CUSTOM_CHORUS_FRUIT_TELEPORT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-chorus-fruit-teleport");
@ -621,6 +625,7 @@ public void loadCache() {
FLAG_DESCRIPTION_CUSTOM_CREEPER_ENTITY_EXPLOSION = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-creeper-entity-explosion");
FLAG_DESCRIPTION_CUSTOM_CROP_GROWTH = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-crop-growth");
FLAG_DESCRIPTION_CUSTOM_DAMAGE_ANIMALS = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-damage-animals");
FLAG_DESCRIPTION_CUSTOM_END_CRYSTAL_USE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-endcrystal-use");
FLAG_DESCRIPTION_CUSTOM_ENDERMAN_GRIEF = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-enderman-grief");
FLAG_DESCRIPTION_CUSTOM_EXP_DROP = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-exp-drop");
FLAG_DESCRIPTION_CUSTOM_FALL_ENTITY_DAMAGE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-fall-entity-damage");
@ -653,6 +658,7 @@ public void loadCache() {
FLAG_DESCRIPTION_CUSTOM_PLAYER_EXIT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-exit");
FLAG_DESCRIPTION_CUSTOM_PLAYER_INVENTORY_INTERACT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-inventory-interact");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMFRAME_INTERACT = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-itemframe-interact");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEMHANGING_PLACE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-itemhanging-place");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_DROP = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-item-drop");
FLAG_DESCRIPTION_CUSTOM_PLAYER_ITEM_PICKUP = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-item-pickup");
FLAG_DESCRIPTION_CUSTOM_PLAYER_PORTAL_USE = MessageStorage.MESSAGE_DATA.getMessage("flag-description-custom-player-portal-use");

View File

@ -881,6 +881,7 @@ public Set<Long> getChunkHashes(boolean refresh) {
final GDChunk gdChunk = this.worldClaimManager.getChunkIfLoaded(x, z);
if (gdChunk != null) {
this.loadedChunkHashes.add(gdChunk.getChunkKey());
((GDClaim) this.wildernessClaim).loadedChunkHashes.remove(gdChunk.getChunkKey());
}
}
}
@ -1014,7 +1015,7 @@ public ClaimResult transferOwner(UUID newOwnerID, boolean checkEconomy, boolean
}
this.claimData.setOwnerUniqueId(newOwnerID);
if (this.isBasicClaim()) {
if (!this.isAdminClaim()) {
ownerData.getInternalClaims().remove(this);
newOwnerData.getInternalClaims().add(this);
}
@ -1375,6 +1376,9 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) {
}
}
// The current values must be used in order for getClaimBlocks to return current cost
this.lesserBoundaryCorner = currentLesserCorner;
this.greaterBoundaryCorner = currentGreaterCorner;
if (!this.cuboid || GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) {
// check player has enough claim blocks
if ((this.isBasicClaim() || this.isTown()) && this.claimData.requiresClaimBlocks()) {
@ -1400,8 +1404,8 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) {
GriefDefenderPlugin.sendMessage(player, message);
}
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
this.lesserBoundaryCorner = currentLesserCorner;
this.greaterBoundaryCorner = currentGreaterCorner;
return new GDClaimResult(ClaimResultType.ECONOMY_NOT_ENOUGH_FUNDS, message);
}
} else {
@ -1421,8 +1425,7 @@ public ClaimResult resize(int x1, int x2, int y1, int y2, int z1, int z2) {
"block-amount", Math.abs(remainingClaimBlocks))));
}
}
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
this.lesserBoundaryCorner = currentLesserCorner;
this.greaterBoundaryCorner = currentGreaterCorner;
return new GDClaimResult(ClaimResultType.INSUFFICIENT_CLAIM_BLOCKS);
@ -1487,16 +1490,12 @@ private ClaimResult checkSizeLimits(Player player, GDPlayerData playerData, Vect
if (playerData.claimResizing != null) {
final Component message = MessageCache.getInstance().RESIZE_SAME_LOCATION;
GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
// TODO: Add new result type for this
return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message);
}
if (playerData.claimSubdividing == null) {
final Component message = MessageCache.getInstance().CREATE_SUBDIVISION_ONLY;
GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = null;
playerData.claimResizing = null;
// TODO: Add new result type for this
return new GDClaimResult(ClaimResultType.BELOW_MIN_SIZE_X, message);
}

View File

@ -206,9 +206,11 @@ public void addClaim(Claim claimToAdd, boolean writeToStorage) {
this.deleteChunkHashes((GDClaim) claim);
if (!claim.isAdminClaim() && (!claim.isInTown() || !claim.getTownClaim().getOwnerUniqueId().equals(claim.getOwnerUniqueId()))) {
final GDPlayerData playerData = this.getPlayerDataMap().get(claim.getOwnerUniqueId());
Set<Claim> playerClaims = playerData.getInternalClaims();
if (!playerClaims.contains(claim)) {
playerClaims.add(claim);
if (playerData != null) {
Set<Claim> playerClaims = playerData.getInternalClaims();
if (!playerClaims.contains(claim)) {
playerClaims.add(claim);
}
}
}
return;
@ -374,7 +376,7 @@ private void resetPlayerClaimVisuals(Claim claim) {
}
private void deleteChunkHashes(GDClaim claim) {
Set<Long> chunkHashes = claim.getChunkHashes(false);
Set<Long> chunkHashes = claim.getChunkHashes(true);
if (chunkHashes == null) {
return;
}
@ -653,7 +655,7 @@ public GDChunk getChunk(Chunk chunk) {
gdChunk = new GDChunk(chunk);
this.chunksToGDChunks.put(chunkKey, gdChunk);
if (this.chunksToClaimsMap.get(chunkKey) == null) {
this.theWildernessClaim.loadedChunkHashes.add(chunkKey);
this.getWildernessClaim().loadedChunkHashes.add(chunkKey);
}
}
return gdChunk;
@ -681,7 +683,7 @@ public boolean isChunkLoaded(long key) {
public void removeChunk(long key) {
this.chunksToGDChunks.remove(key);
this.theWildernessClaim.loadedChunkHashes.remove(key);
this.getWildernessClaim().loadedChunkHashes.remove(key);
}
private long getChunkKey(int cx, int cz) {

View File

@ -61,6 +61,7 @@
import com.griefdefender.permission.ui.MenuType;
import com.griefdefender.permission.ui.UIHelper;
import com.griefdefender.permission.ui.UIFlagData.FlagContextHolder;
import com.griefdefender.provider.PermissionProvider.PermissionDataType;
import com.griefdefender.registry.FlagRegistryModule;
import com.griefdefender.text.action.GDCallbackHolder;
import com.griefdefender.util.CauseContextHelper;
@ -252,21 +253,7 @@ protected void showCustomFlags(GDPermissionUser src, GDClaim claim, String flagG
}
final Map<String, GDFlagDefinition> definitions = new HashMap<>(flagGroupCat.getFlagDefinitions());
boolean isAdminUser = false;
if (flagGroup.equalsIgnoreCase("user") && src.getOnlinePlayer().hasPermission(GDPermissions.COMMAND_DELETE_ADMIN_CLAIMS)) {
for (String group : groups) {
if (group.equalsIgnoreCase("user")) {
continue;
}
final CustomFlagGroupCategory adminGroup = flagGroups.get(group);
if (adminGroup.isAdminGroup()) {
isAdminUser = true;
if (adminGroup != null) {
definitions.putAll(new HashMap<>(adminGroup.getFlagDefinitions()));
}
}
}
}
final boolean isAdminUser = src.getInternalPlayerData().canManageAdminClaims;
List<Component> textComponents = new ArrayList<>();
for (GDFlagDefinition customFlag : definitions.values()) {
if (customFlag.isEnabled()) {
@ -424,7 +411,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
defaultContexts.add(ClaimContexts.WILDERNESS_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT);
}
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
defaultContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
@ -439,7 +426,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(claim.getDefaultTypeContext())) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT))) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
}
@ -449,7 +436,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(claim.getDefaultTypeContext())) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
} else if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT))) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
if (displayType != MenuType.DEFAULT) {
@ -463,7 +450,7 @@ protected void showFlagPermissions(GDPermissionUser src, GDClaim claim, MenuType
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.INHERIT, mapEntry.getValue());
}
}
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT)) {
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_OVERRIDE_CONTEXT))) {
this.addFilteredContexts(filteredContextMap, contextSet, MenuType.OVERRIDE, mapEntry.getValue());
}
if (contextSet.contains(claim.getOverrideClaimContext())) {
@ -653,39 +640,20 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
}
final List<GDActiveFlagData> definitionResults = new ArrayList<>();
boolean hasClaimContext = false;
Set<Context> definitionContexts = new HashSet<>(customFlag.getContexts());
for (Context context : definitionContexts) {
if (context.getKey().contains("gd_claim")) {
// Admins can set 'gd_claim' context value to 'claim' to represent it should be replaced with each claim UUID
if (context.getValue().equalsIgnoreCase("claim")) {
definitionContexts.remove(context);
hasClaimContext = true;
break;
}
}
}
if (hasClaimContext) {
definitionContexts.add(claim.getContext());
}
boolean hasOverride = false;
UUID parentInheritUniqueId = null;
Component parentInheritFriendlyType = null;
for (FlagData flagData : customFlag.getFlagData()) {
if (customFlag.isAdmin() && !flagGroup.equalsIgnoreCase("user")) {
definitionResults.add(this.getSpecificDefinitionResult(claim, customFlag, flagData));
} else {
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
definitionResults.add(activeData);
if (activeData.getType() == GDActiveFlagData.Type.OVERRIDE) {
hasOverride = true;
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
definitionResults.add(activeData);
if (activeData.getType() == GDActiveFlagData.Type.OVERRIDE) {
hasOverride = true;
hasEditPermission = false;
} else if (activeData.getType() == GDActiveFlagData.Type.OWNER_OVERRIDE_PARENT_INHERIT || activeData.getType() == GDActiveFlagData.Type.CLAIM_PARENT_INHERIT) {
if (claim.allowEdit(src) != null) {
hasEditPermission = false;
} else if (activeData.getType() == GDActiveFlagData.Type.OWNER_OVERRIDE_PARENT_INHERIT || activeData.getType() == GDActiveFlagData.Type.CLAIM_PARENT_INHERIT) {
if (claim.allowEdit(src) != null) {
hasEditPermission = false;
parentInheritUniqueId = activeData.getInheritParentUniqueId();
parentInheritFriendlyType = activeData.getInheritParentFriendlyType();
}
parentInheritUniqueId = activeData.getInheritParentUniqueId();
parentInheritFriendlyType = activeData.getInheritParentFriendlyType();
}
}
}
@ -729,6 +697,7 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
} else {
hoverBuilder.append(MessageCache.getInstance().FLAG_UI_CLICK_ALLOW);
}
hasHover = true;
if (properResult) {
hoverBuilder.append("\nDefault Value: ", TextColor.AQUA);
@ -740,67 +709,70 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
} else {
hoverBuilder.append(customFlag.getDefaultValue().toString().toLowerCase(), TextColor.RED);
}
if (src.getInternalPlayerData().canManageAdminClaims) {
if (!customFlag.getContexts().isEmpty()) {
hoverBuilder.append("\nDefinition Contexts: ");
hoverBuilder.append("\ngd_claim", TextColor.AQUA)
.append("=", TextColor.WHITE)
.append(claim.getUniqueId().toString(), TextColor.GRAY);
for (Context context : customFlag.getContexts()) {
if (!customFlag.isAdmin()) {
continue;
}
final String key = context.getKey();
if (key.contains("default") || key.contains("override")) {
// Only used in config for startup
continue;
}
hoverBuilder.append("\n");
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
if (key.contains("default")) {
keyColor = TextColor.LIGHT_PURPLE;
} else if (key.contains("override")) {
keyColor = TextColor.RED;
} else if (key.contains("server")) {
keyColor = TextColor.GRAY;
}
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
}
}
} else {
hoverBuilder.append("\nClaim ID: ", TextColor.AQUA).append(claim.getUniqueId().toString(), TextColor.GRAY);
}
if (src.getInternalPlayerData().canManageAdminClaims) {
for (FlagData flagData : customFlag.getFlagData()) {
hoverBuilder.append("\nFlag: ")
.append(flagData.getFlag().getName(), TextColor.GREEN);
if (!customFlag.getContexts().isEmpty()) {
hoverBuilder.append("\nDefinition Contexts: ");
if (!customFlag.isAdmin() || flagGroup.equalsIgnoreCase("user")) {
hoverBuilder.append("gd_claim", TextColor.AQUA)
.append("=", TextColor.WHITE)
.append(claim.getUniqueId().toString(), TextColor.GRAY);
}
for (Context context : customFlag.getContexts()) {
if ((!customFlag.isAdmin() || flagGroup.equalsIgnoreCase("user")) && context.getKey().contains("gd_claim")) {
continue;
if (!flagData.getContexts().isEmpty()) {
hoverBuilder.append("\nContexts: ");
}
hoverBuilder.append("\n");
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
if (key.contains("default")) {
keyColor = TextColor.LIGHT_PURPLE;
} else if (key.contains("override")) {
keyColor = TextColor.RED;
} else if (key.contains("server")) {
keyColor = TextColor.GRAY;
for (Context context : flagData.getContexts()) {
hoverBuilder.append("\n");
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
}
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
// show active value
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
hoverBuilder.append("\nActive Result: ")
.append("\nvalue", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getValue().name().toLowerCase(), TextColor.GOLD)
.append("\ntype", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getType().name() + "\n", activeData.getColor());
}
}
for (FlagData flagData : customFlag.getFlagData()) {
hoverBuilder.append("\nFlag: ")
.append(flagData.getFlag().getName(), TextColor.GREEN);
if (!flagData.getContexts().isEmpty()) {
hoverBuilder.append("\nContexts: ");
}
for (Context context : flagData.getContexts()) {
if ((!customFlag.isAdmin() || flagGroup.equalsIgnoreCase("user")) && context.getKey().contains("gd_claim")) {
continue;
}
hoverBuilder.append("\n");
final String key = context.getKey();
final String value = context.getValue();
TextColor keyColor = TextColor.AQUA;
hoverBuilder.append(key, keyColor)
.append("=", TextColor.WHITE)
.append(value.replace("minecraft:", ""), TextColor.GRAY);
}
// show active value
final GDActiveFlagData activeData = this.getActiveDefinitionResult(claim, customFlag, flagData);
hoverBuilder.append("\nActive Result: ")
.append("\nvalue", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getValue().name().toLowerCase(), TextColor.GOLD)
.append("\ntype", TextColor.DARK_AQUA)
.append("=", TextColor.WHITE)
.append(activeData.getType().name() + "\n", activeData.getColor());
}
hasHover = true;
}
} else {
if (hasOverride) {
@ -834,49 +806,6 @@ private Component getCustomClickableText(GDPermissionUser src, GDClaim claim, GD
return textBuilder.build();
}
public GDActiveFlagData getSpecificDefinitionResult(GDClaim claim, GDFlagDefinition flagDefinition, FlagData flagData) {
Set<Context> contexts = new HashSet<>(flagData.getContexts());
contexts.addAll(flagDefinition.getContexts());
boolean hasClaimContext = false;
boolean hasOverrideClaimContext = false;
boolean hasDefaultClaimContext = false;
boolean replaceClaimContext = false;
final Iterator<Context> iterator = contexts.iterator();
while (iterator.hasNext()) {
final Context context = iterator.next();
if (context.getKey().equalsIgnoreCase("gd_claim")) {
hasClaimContext = true;
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
}
} else if (context.getKey().equalsIgnoreCase("gd_claim_default")) {
hasDefaultClaimContext = true;
} else if (context.getKey().equalsIgnoreCase("gd_claim_override")) {
hasOverrideClaimContext = true;
}
}
GDActiveFlagData.Type type = GDActiveFlagData.Type.DEFAULT;
if (hasClaimContext) {
type = GDActiveFlagData.Type.CLAIM;
} else if (hasOverrideClaimContext) {
type = GDActiveFlagData.Type.OVERRIDE;
}
if (replaceClaimContext || !flagDefinition.isAdmin()) {
contexts.add(claim.getContext());
}
Tristate result = PermissionUtil.getInstance().getPermissionValue(claim, GriefDefenderPlugin.DEFAULT_HOLDER, flagData.getFlag().getPermission(), contexts);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, contexts, type);
}
return new GDActiveFlagData(flagDefinition, flagData, result, contexts, GDActiveFlagData.Type.UNDEFINED);
}
public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinition flagDefinition, FlagData flagData) {
Set<Context> contexts = new HashSet<>(flagData.getContexts());
contexts.addAll(flagDefinition.getContexts());
@ -888,32 +817,14 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
Context claimContext = claim.getContext();
while (iterator.hasNext()) {
final Context context = iterator.next();
if (!flagDefinition.isAdmin()) {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE)) {
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
hasOverrideOwnerContext = true;
}
} else {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE)) {
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
hasOverrideOwnerContext = true;
}
} else {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM)) {
claimContext = context;
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
}
} else if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_DEFAULT)) {
iterator.remove();
} else if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE)) {
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceClaimContext = true;
hasOverrideOwnerContext = true;
}
}
iterator.remove();
}
}
final Set<Context> filteredContexts = new HashSet<>(contexts);
@ -922,10 +833,13 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
// Check override
Set<Context> permissionContexts = new HashSet<>(filteredContexts);
permissionContexts.add(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT);
if (!claim.isWilderness()) {
contexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
permissionContexts.add(claim.getWorldContext());
permissionContexts.add(claim.getOverrideTypeContext());
permissionContexts.addAll(flagData.getContexts());
Tristate result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
Tristate result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.OVERRIDE);
}
@ -938,7 +852,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
for (Claim parentClaim : inheritParents) {
GDClaim parent = (GDClaim) parentClaim;
permissionContexts.add(parent.getOverrideClaimContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, parent.getUniqueId(), parent.getFriendlyNameType(), GDActiveFlagData.Type.OWNER_OVERRIDE_PARENT_INHERIT);
}
@ -947,7 +861,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
}
permissionContexts.add(claim.getOverrideClaimContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.OWNER_OVERRIDE);
}
@ -960,7 +874,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
GDClaim parent = (GDClaim) parentClaim;
// check parent context
permissionContexts.add(parent.getContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, parent.getUniqueId(), parent.getFriendlyNameType(), GDActiveFlagData.Type.CLAIM_PARENT_INHERIT);
}
@ -974,8 +888,7 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
} else {
permissionContexts.add(claimContext);
}
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, hasOverrideOwnerContext ? GDActiveFlagData.Type.OWNER_OVERRIDE : GDActiveFlagData.Type.CLAIM);
}
@ -987,18 +900,31 @@ public GDActiveFlagData getActiveDefinitionResult(GDClaim claim, GDFlagDefinitio
// Check default type first
permissionContexts.add(claim.getDefaultTypeContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.PERSISTENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
permissionContexts.remove(claim.getDefaultTypeContext());
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
permissionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
permissionContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.ALL);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
permissionContexts.remove(ClaimContexts.USER_DEFAULT_CONTEXT);
} else {
permissionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.ALL);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
}
permissionContexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
permissionContexts.add(claim.getWorldContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts);
permissionContexts.remove(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
permissionContexts.add(claim.getDefaultTypeContext());
result = PermissionUtil.getInstance().getPermissionValue(claim, (GDPermissionHolder) flagDefinition.getSubject(), flagData.getFlag().getPermission(), permissionContexts, PermissionDataType.TRANSIENT);
if (result != Tristate.UNDEFINED) {
return new GDActiveFlagData(flagDefinition, flagData, result, permissionContexts, GDActiveFlagData.Type.DEFAULT);
}
@ -1164,23 +1090,13 @@ private Consumer<CommandSource> createCustomFlagConsumer(GDPermissionUser src, G
final Iterator<Context> iterator = definitionContexts.iterator();
while (iterator.hasNext()) {
final Context context = iterator.next();
if (!customFlag.isAdmin() || (customFlag.isAdmin() && flagGroup.equalsIgnoreCase("user"))) {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimOverrideContext = true;
} else if (context.getKey().contains(ContextKeys.CLAIM)) {
iterator.remove();
}
addClaimContext = true;
} else {
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimContext = true;
} else if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimOverrideContext = true;
}
if (context.getKey().equalsIgnoreCase(ContextKeys.CLAIM_OVERRIDE) && context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
addClaimOverrideContext = true;
} else if (context.getKey().contains(ContextKeys.CLAIM)) {
iterator.remove();
}
addClaimContext = true;
}
if (addClaimOverrideContext) {
definitionContexts.add(claim.getOverrideClaimContext());

View File

@ -372,7 +372,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
defaultContexts.add(ClaimContexts.WILDERNESS_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT);
}
if (!claim.isWilderness() && !claim.isAdminClaim()) {
if (!claim.isWilderness()) {
defaultContexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
overrideContexts.add(ClaimContexts.USER_OVERRIDE_CONTEXT);
}
@ -383,7 +383,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
Map<String, OptionData> filteredContextMap = new HashMap<>();
for (Map.Entry<Set<Context>, Map<String, String>> mapEntry : PermissionUtil.getInstance().getTransientOptions(this.subject).entrySet()) {
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(claim.getDefaultTypeContext()) || contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
if (contextSet.contains(claim.getDefaultTypeContext()) || (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT)))) {
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
}
@ -391,6 +391,9 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
if (displayType == MenuType.DEFAULT || displayType == MenuType.CLAIM) {
final Set<Context> contexts = new HashSet<>();
contexts.add(ClaimContexts.GLOBAL_DEFAULT_CONTEXT);
if (!claim.isWilderness()) {
contexts.add(ClaimContexts.USER_DEFAULT_CONTEXT);
}
for (Option option : OptionRegistryModule.getInstance().getAll()) {
if (option.isGlobal() && displayType == MenuType.CLAIM) {
continue;
@ -417,7 +420,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
for (Map.Entry<Set<Context>, Map<String, String>> mapEntry : PermissionUtil.getInstance().getPermanentOptions(this.subject).entrySet()) {
final Set<Context> contextSet = mapEntry.getKey();
if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT)) {
if (contextSet.contains(ClaimContexts.GLOBAL_DEFAULT_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_DEFAULT_CONTEXT))) {
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.DEFAULT, mapEntry.getValue());
}
if (contextSet.contains(claim.getDefaultTypeContext())) {
@ -429,7 +432,7 @@ protected void showOptionPermissions(GDPermissionUser src, GDClaim claim, MenuTy
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.CLAIM, mapEntry.getValue());
}
}
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT)) {
if (contextSet.contains(ClaimContexts.GLOBAL_OVERRIDE_CONTEXT) || (!claim.isWilderness() && contextSet.contains(ClaimContexts.USER_OVERRIDE_CONTEXT))) {
this.addFilteredContexts(src, filteredContextMap, contextSet, MenuType.OVERRIDE, mapEntry.getValue());
}
if (contextSet.contains(claim.getOverrideClaimContext())) {

View File

@ -43,7 +43,7 @@
@CommandPermission(GDPermissions.COMMAND_FLAGS_DEBUG)
public class CommandClaimFlagDebug extends BaseCommand {
@CommandAlias("cfd")
@CommandAlias("cfdebug")
@Description("Toggles claim flag debug mode.")
@Subcommand("claim debug")
public void execute(Player player) {

View File

@ -175,7 +175,7 @@ public void execute(CommandSource src, String[] args) {
final GDClaim gdClaim = (GDClaim) claim;
final GDPermissionUser owner = PermissionHolderCache.getInstance().getOrCreateUser(claim.getOwnerUniqueId());
final UUID ownerUniqueId = claim.getOwnerUniqueId();
final boolean isAdmin = gdClaim.allowEdit(player) == null;
final boolean isAdmin = playerData.canManageAdminClaims;
// if not owner of claim, validate perms
if (!isAdmin && !player.getUniqueId().equals(claim.getOwnerUniqueId())) {
if (!gdClaim.getInternalClaimData().getContainers().contains(player.getUniqueId())

View File

@ -44,6 +44,10 @@ public class CommandTownChat extends BaseCommand {
@Description("Toggles town chat.")
@Subcommand("town chat")
public void execute(Player player) {
if (!GriefDefenderPlugin.getGlobalConfig().getConfig().town.townChatEnabled) {
return;
}
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(player.getLocation());
if (!claim.isInTown()) {

View File

@ -53,6 +53,10 @@ public class CommandTownTag extends BaseCommand {
@Syntax("<tag>")
@Subcommand("town tag")
public void execute(Player player, String tag) {
if (!GriefDefenderPlugin.getGlobalConfig().getConfig().town.townChatEnabled) {
return;
}
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAtPlayer(playerData, player.getLocation());
if (claim == null || !claim.isInTown()) {

View File

@ -172,6 +172,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(user.getUniqueId());
}
for (String group : claim.getInternalClaimData().getManagerGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getManagerGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
for (UUID uuid : claim.getInternalClaimData().getBuilders()) {
if (!userIdList.contains(uuid)) {
@ -193,6 +207,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
for (String group : claim.getInternalClaimData().getBuilderGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getBuilderGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
for (UUID uuid : claim.getInternalClaimData().getContainers()) {
if (!userIdList.contains(uuid)) {
@ -214,6 +242,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
for (String group : claim.getInternalClaimData().getContainerGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getContainerGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
for (UUID uuid : claim.getInternalClaimData().getAccessors()) {
if (!userIdList.contains(uuid)) {
@ -235,6 +277,20 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
for (String group : claim.getInternalClaimData().getAccessorGroups()) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), claim.getInternalClaimData().getAccessorGroups(), group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
} else {
final List<UUID> trusts = claim.getUserTrustList(type);
trustList.add(TextComponent.builder("")
@ -268,6 +324,21 @@ public static void showTrustList(Player src, GDClaim claim, GDPlayerData playerD
.build());
userIdList.remove(uuid);
}
final List<String> groupList = claim.getGroupTrustList(type);
for (String group : groupList) {
trustList.add(TextComponent.builder("")
.append(group, TextColor.GOLD)
.append(" ")
.append("[", TextColor.WHITE)
.append(TextComponent.builder()
.append("x", TextColor.RED)
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().UI_CLICK_REMOVE))
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(
createRemoveGroupConsumer(src, claim, playerData, type, returnCommand, claim.getInternalClaimData(), groupList, group))))
.build())
.append("]", TextColor.WHITE)
.build());
}
}
Component footer = null;
@ -353,6 +424,7 @@ private static Consumer<CommandSource> createAddConsumer(Player src, GDClaim cla
return consumer -> {
String name = playerData.commandInput;
List<Component> messages = new ArrayList<>();
boolean isGroup = false;
if (playerData.commandInput.contains("player ")) {
name = name.replace("player ", "");
if (!name.equalsIgnoreCase("public") && PermissionUtil.getInstance().lookupUserUniqueId(name) == null) {
@ -364,6 +436,7 @@ private static Consumer<CommandSource> createAddConsumer(Player src, GDClaim cla
return;
}
} else if (playerData.commandInput.contains("group ")) {
isGroup = true;
name = name.replace("group ", "");
if (!name.equalsIgnoreCase("public") && !PermissionUtil.getInstance().hasGroupSubject(name)) {
messages.add(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_INVALID_PLAYER,
@ -381,7 +454,11 @@ private static Consumer<CommandSource> createAddConsumer(Player src, GDClaim cla
createInputConsumer(src, claim, playerData, type, messages, returnCommand).accept(src);
return;
}
CommandHelper.executeCommand(src, "trust", name + " " + type.getName().toLowerCase());
if (isGroup) {
CommandHelper.executeCommand(src, "trustgroup", name + " " + type.getName().toLowerCase());
} else {
CommandHelper.executeCommand(src, "trust", name + " " + type.getName().toLowerCase());
}
playerData.commandInputTimestamp = null;
playerData.commandConsumer = null;
showTrustList(src, claim, playerData, type, messages, returnCommand);
@ -404,4 +481,13 @@ private static Consumer<CommandSource> createRemoveConsumer(Player src, GDClaim
showTrustList(src, claim, playerData, type, new ArrayList<>(), returnCommand);
};
}
private static Consumer<CommandSource> createRemoveGroupConsumer(Player src, GDClaim claim, GDPlayerData playerData, TrustType type, Component returnCommand, IClaimData data, List<String> trustList, String group) {
return consumer -> {
trustList.remove(group);
data.setRequiresSave(true);
data.save();
showTrustList(src, claim, playerData, type, new ArrayList<>(), returnCommand);
};
}
}

View File

@ -35,6 +35,7 @@
import java.util.Map;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.api.event.cause.entity.damage.DamageTypes;
@ConfigSerializable
public class BlacklistCategory extends ConfigCategory {
@ -48,6 +49,21 @@ public class BlacklistCategory extends ConfigCategory {
@Setting(value = "global-target", comment = "A global list of target id's that are ignored by events. \nNote: This only affects events where the id specified is the target.")
public List<String> globalTargetBlacklist = new ArrayList<>();
@Setting(value = "entity-damage-source-blacklist", comment = "A global list of entity damage sources that are ignored in events by default.")
public List<String> entityDamageSourceBlacklist = new ArrayList<>();
public BlacklistCategory() {
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
this.flagIdBlacklist.put(flag.getName().toLowerCase(), new ArrayList<>());
}
this.flagIdBlacklist.put("block-pre", new ArrayList<>());
this.entityDamageSourceBlacklist.add(DamageTypes.CONTACT.getId().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageTypes.DROWN.getId().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageTypes.HUNGER.getId().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageTypes.SUFFOCATE.getId().toLowerCase());
this.entityDamageSourceBlacklist.add(DamageTypes.VOID.getId().toLowerCase());
}
public List<String> getGlobalSourceBlacklist() {
return this.globalSourceBlacklist;
}
@ -56,13 +72,6 @@ public List<String> getGlobalTargetBlacklist() {
return this.globalTargetBlacklist;
}
public BlacklistCategory() {
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
this.flagIdBlacklist.put(flag.getName().toLowerCase(), new ArrayList<>());
}
this.flagIdBlacklist.put("block-pre", new ArrayList<>());
}
// Used by API
@Nullable
public List<String> getFlagBlacklist(String flag) {

View File

@ -41,9 +41,9 @@ public class DefaultFlagCategory extends ConfigCategory {
@Setting(value = "default-claim-flags", comment = "The default flag settings used by claims. The group name represents the claim type."
+ "\nEx: The group admin will ONLY affect admin claims."
+ "\nSupported groups are : global, admin, basic, subdivision, town, and wilderness."
+ "\nNote: Global represents all claim types."
+ "\nNote: Specific types, such as wilderness, have higher priority than global."
+ "\nSupported groups are : user, admin, basic, subdivision, town, and wilderness."
+ "\nNote: User represents all claim types EXCEPT wilderness."
+ "\nNote: Specific types, such as wilderness, have higher priority than user."
+ "\nNote: Defaults do not force flags onto user claims. A newly created claim will have no flags set and use these default settings until a claim owner sets flags.")
private Map<String, Map<String, Boolean>> defaultClaimFlags = Maps.newHashMap();
@ -52,7 +52,7 @@ public DefaultFlagCategory() {
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
globalFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(null));
}
this.defaultClaimFlags.put("global", globalFlagMap);
this.defaultClaimFlags.put("user", globalFlagMap);
Map<String, Boolean> wildernessFlagMap = new HashMap<>();
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
wildernessFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(ClaimTypes.WILDERNESS));
@ -71,7 +71,14 @@ public void refreshFlags() {
}
}
}
final Map<String, Boolean> globalFlagMap = this.defaultClaimFlags.get("global");
Map<String, Boolean> globalFlagMap = this.defaultClaimFlags.get("user");
if (globalFlagMap == null) {
globalFlagMap = new HashMap<>();
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
globalFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(null));
}
this.defaultClaimFlags.put("user", globalFlagMap);
}
for (Flag flag : FlagRegistryModule.getInstance().getAll()) {
if (!globalFlagMap.containsKey(flag.getName())) {
globalFlagMap.put(flag.getName(), flag.getDefaultClaimTypeValue(null));

View File

@ -38,7 +38,9 @@ public class TownCategory extends ConfigCategory {
public double cost = 0;
@Setting(value = "clan-require-town", comment = "If true, requires a town to be owned for MCClans.")
public boolean clanRequireTown = true;
@Setting(value = "town-chat-enabled", comment = "Whether town chat can be used. (Default: false)"
+ "\nNote: This also affects use of town tags.")
public boolean townChatEnabled = false;
public TownCategory() {
}

View File

@ -42,6 +42,13 @@ public class VisualCategory extends ConfigCategory {
public String claimCreateStartBlock = "minecraft:diamond_block";
@Setting(value = "filler-spacing", comment = "The space between each filler visual block.")
public int fillerSpacing = 10;
@Setting(value = "active-claim-visual-time", comment = "The active time, in seconds, to keep a claim's visuals shown to a player. (Default: 60)"
+ "\nNote: If value is <= 0, GD will use the default value.")
public int claimVisualTime = 60;
@Setting(value = "active-create-block-visual-time", comment = "The active time, in seconds, to keep a claim's create block visual shown to a player. (Default: 180)"
+ "\nNote: This only applies during claim creation."
+ "\nNote: If value is <= 0, GD will use the default value.")
public int createBlockVisualTime = 180;
@Setting(value = "admin-accent-block", comment = "The visual accent block used for admin claims. (Default: minecraft:pumpkin)")
public String visualAdminAccentBlock = "minecraft:pumpkin";

View File

@ -144,7 +144,7 @@ public FlagDefinition deserialize(TypeToken<?> type, ConfigurationNode node) thr
final String value = parts[1];
if (key.equalsIgnoreCase("default") || key.equalsIgnoreCase("gd_claim_default")) {
if (!value.equalsIgnoreCase("global") && !value.equalsIgnoreCase("basic") && !value.equalsIgnoreCase("admin")
&& !value.equalsIgnoreCase("subdivision") && !value.equalsIgnoreCase("town") && !value.equalsIgnoreCase("wilderness")) {
&& !value.equalsIgnoreCase("subdivision") && !value.equalsIgnoreCase("town") && !value.equalsIgnoreCase("user")) {
throw new ObjectMappingException("Invalid context '" + key + "' with value '" + value + "'.");
}
contexts.add(new Context("gd_claim_default", value));

View File

@ -33,14 +33,14 @@ public GDCreateClaimEvent(Claim claim) {
super(claim);
}
public static class Pre extends GDCreateClaimEvent {
public static class Pre extends GDCreateClaimEvent implements CreateClaimEvent.Pre {
public Pre(Claim claim) {
super(claim);
}
}
public static class Post extends GDCreateClaimEvent {
public static class Post extends GDCreateClaimEvent implements CreateClaimEvent.Post {
public Post(Claim claim) {
super(claim);

View File

@ -259,7 +259,7 @@ public boolean onEntityMove(MoveEntityEvent event, Location<World> fromLocation,
}
Component farewellMessage = gpEvent.getExitMessage().orElse(null);
if (farewellMessage != null && !farewellMessage.equals(Text.of())) {
if (farewellMessage != null && farewellMessage != TextComponent.empty() && !toClaim.isParent(fromClaim)) {
ChatType chatType = gpEvent.getExitMessageChatType();
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.equals(Text.of())) {
if (farewellMessage != null && farewellMessage != TextComponent.empty() && !toClaim.isParent(fromClaim)) {
ChatType chatType = gpEvent.getExitMessageChatType();
if (showGpPrefix) {
TextAdapter.sendComponent(player, TextComponent.builder("")

View File

@ -419,8 +419,7 @@ public void onEntityDamage(DamageEntityEvent event, @First DamageSource damageSo
}
public boolean protectEntity(Event event, Entity targetEntity, Cause cause, DamageSource damageSource) {
if (damageSource.getType() == DamageTypes.SUFFOCATE || damageSource.getType() == DamageTypes.DROWN) {
// Ignore as this can only happen if an entity is stuck in wall
if (GriefDefenderPlugin.getGlobalConfig().getConfig().blacklist.entityDamageSourceBlacklist.contains(damageSource.getType().getId().toLowerCase())) {
return false;
}
if (!GDFlags.ENTITY_DAMAGE || !GriefDefenderPlugin.getInstance().claimsEnabledForWorld(targetEntity.getWorld().getUniqueId())) {

View File

@ -56,6 +56,8 @@
import com.griefdefender.configuration.MessageStorage;
import com.griefdefender.event.GDCauseStackManager;
import com.griefdefender.internal.provider.GDWorldEditProvider;
import com.griefdefender.internal.registry.BlockTypeRegistryModule;
import com.griefdefender.internal.registry.GDBlockType;
import com.griefdefender.internal.util.BlockUtil;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.internal.visual.GDClaimVisual;
@ -66,6 +68,7 @@
import com.griefdefender.permission.option.GDOptions;
import com.griefdefender.provider.NucleusProvider;
import com.griefdefender.storage.BaseStorage;
import com.griefdefender.task.ClaimVisualRevertTask;
import com.griefdefender.text.action.GDCallbackHolder;
import com.griefdefender.util.CauseContextHelper;
import com.griefdefender.util.EconomyUtil;
@ -76,11 +79,9 @@
import net.kyori.text.Component;
import net.kyori.text.TextComponent;
import net.kyori.text.event.HoverEvent;
import net.kyori.text.format.TextColor;
import net.kyori.text.serializer.gson.GsonComponentSerializer;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockSnapshot;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.block.BlockTypes;
import org.spongepowered.api.block.tileentity.Sign;
import org.spongepowered.api.block.tileentity.TileEntity;
@ -122,6 +123,7 @@
import org.spongepowered.api.item.inventory.ItemStackSnapshot;
import org.spongepowered.api.item.inventory.transaction.SlotTransaction;
import org.spongepowered.api.plugin.PluginContainer;
import org.spongepowered.api.scheduler.Task;
import org.spongepowered.api.service.ban.BanService;
import org.spongepowered.api.service.economy.Currency;
import org.spongepowered.api.service.economy.account.Account;
@ -147,10 +149,12 @@
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
@ -859,7 +863,7 @@ public void onPlayerInteractItem(InteractItemEvent event, @Root Player player) {
final HandInteractEvent handEvent = (HandInteractEvent) event;
final ItemStack itemInHand = player.getItemInHand(handEvent.getHandType()).orElse(ItemStack.empty());
handleItemInteract(event, player, world, itemInHand);
handleItemInteract(handEvent, player, world, itemInHand);
}
@Listener(order = Order.LAST, beforeModifications = true)
@ -920,19 +924,24 @@ public void onPlayerChangeHeldItem(ChangeInventoryEvent.Held event, @First Playe
GriefDefenderPlugin.sendMessage(player, message);
}
}/* else if (!playerData.claimMode) {
if (playerData.lastShovelLocation != null) {
playerData.revertActiveVisual(player);
// check for any active WECUI visuals
if (this.worldEditProvider != null) {
this.worldEditProvider.revertVisuals(player, playerData, null);
} else {
// check for shovel start visuals
if (!playerData.createBlockVisualRevertRunnables.isEmpty()) {
final Iterator<Entry<UUID, Runnable>> iterator = new HashMap<>(playerData.createBlockVisualRevertRunnables).entrySet().iterator();
while (iterator.hasNext()) {
final Entry<UUID, Runnable> revertEntry = iterator.next();
final ClaimVisualRevertTask revertTask = (ClaimVisualRevertTask) revertEntry.getValue();
if (revertTask.isShovelStartVisual()) {
revertTask.run();
final Task task = playerData.claimVisualRevertTasks.get(revertEntry.getKey());
if (task != null) {
task.cancel();
playerData.claimVisualRevertTasks.remove(revertEntry.getKey());
}
}
}
}
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
playerData.claimResizing = null;
playerData.shovelMode = ShovelTypes.BASIC;
}*/
}
count++;
}
GDTimings.PLAYER_CHANGE_HELD_ITEM_EVENT.stopTimingIfSync();
@ -963,12 +972,13 @@ public void onPlayerUseItem(UseItemStackEvent.Start event, @First Player player)
GDTimings.PLAYER_USE_ITEM_EVENT.stopTimingIfSync();
}
@Listener
public void onInteractBlock(InteractBlockEvent event) {
}
@Listener(order = Order.FIRST, beforeModifications = true)
public void onPlayerInteractBlockPrimary(InteractBlockEvent.Primary.MainHand event) {
final Location<World> location = event.getTargetBlock().getLocation().orElse(null);
if (location == null) {
return;
}
User user = CauseContextHelper.getEventUser(event);
final Object source = CauseContextHelper.getEventFakePlayerSource(event);
final Player player = source instanceof Player ? (Player) source : null;
@ -981,13 +991,19 @@ public void onPlayerInteractBlockPrimary(InteractBlockEvent.Primary.MainHand eve
return;
}
final HandType handType = event.getHandType();
final ItemStack itemInHand = player.getItemInHand(handType).orElse(ItemStack.empty());
if (handleItemInteract(event, player, player.getWorld(), itemInHand).isCancelled()) {
event.setCancelled(true);
return;
}
final BlockSnapshot clickedBlock = event.getTargetBlock();
final Location<World> location = clickedBlock.getLocation().orElse(null);
final String id = GDPermissionManager.getInstance().getPermissionIdentifier(clickedBlock);
final GDPlayerData playerData = this.dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
final GDClaim claim = this.dataStore.getClaimAt(location);
// Handle rent/buy signs
GDClaim claim = null;
if (location != null && !playerData.claimMode) {
claim = this.dataStore.getClaimAt(location);
if (!playerData.claimMode) {
final GriefDefenderConfig<?> activeConfig = GriefDefenderPlugin.getActiveConfig(location.getExtent().getUniqueId());
if (activeConfig.getConfig().economy.isSellSignEnabled() || activeConfig.getConfig().economy.isRentSignEnabled()) {
final Sign sign = SignUtil.getSign(location);
@ -1009,19 +1025,6 @@ public void onPlayerInteractBlockPrimary(InteractBlockEvent.Primary.MainHand eve
}
}
final HandType handType = event.getHandType();
final ItemStack itemInHand = player.getItemInHand(handType).orElse(ItemStack.empty());
if (event.getTargetBlock() != BlockSnapshot.NONE) {
// Run our item hook since Sponge no longer fires InteractItemEvent when targetting a non-air block
if (handleItemInteract(event, player, player.getWorld(), itemInHand).isCancelled()) {
return;
}
} else {
if (investigateClaim(event, player, event.getTargetBlock(), itemInHand)) {
event.setCancelled(true);
}
}
if (playerData.claimMode) {
return;
}
@ -1040,11 +1043,6 @@ public void onPlayerInteractBlockPrimary(InteractBlockEvent.Primary.MainHand eve
}
GDTimings.PLAYER_INTERACT_BLOCK_PRIMARY_EVENT.startTimingIfSync();
if (location == null) {
GDTimings.PLAYER_INTERACT_BLOCK_PRIMARY_EVENT.stopTimingIfSync();
return;
}
final Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, claim, Flags.INTERACT_BLOCK_PRIMARY, source, clickedBlock.getState(), player, TrustTypes.BUILDER, true);
if (result == Tristate.FALSE) {
if (GriefDefenderPlugin.isTargetIdBlacklisted(Flags.BLOCK_BREAK.getName(), clickedBlock.getState(), player.getWorld().getProperties())) {
@ -1071,6 +1069,11 @@ public void onPlayerInteractBlockPrimary(InteractBlockEvent.Primary.MainHand eve
@Listener(order = Order.FIRST, beforeModifications = true)
public void onPlayerInteractBlockSecondary(InteractBlockEvent.Secondary event) {
final Location<World> location = event.getTargetBlock().getLocation().orElse(null);
if (location == null) {
return;
}
User user = CauseContextHelper.getEventUser(event);
final Object source = CauseContextHelper.getEventFakePlayerSource(event);
final Player player = source instanceof Player ? (Player) source : null;
@ -1089,6 +1092,13 @@ public void onPlayerInteractBlockSecondary(InteractBlockEvent.Secondary event) {
return;
}
final BlockSnapshot clickedBlock = event.getTargetBlock();
final String id = GDPermissionManager.getInstance().getPermissionIdentifier(clickedBlock);
final GDBlockType gdBlock = BlockTypeRegistryModule.getInstance().getById(id).orElse(null);
if (gdBlock != null && !gdBlock.isInteractable()) {
return;
}
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(player.getWorld().getUniqueId())) {
return;
}
@ -1096,8 +1106,6 @@ public void onPlayerInteractBlockSecondary(InteractBlockEvent.Secondary event) {
return;
}
final BlockSnapshot clickedBlock = event.getTargetBlock();
final Location<World> location = clickedBlock.getLocation().orElse(null);
final Sign sellSign = SignUtil.getSellSign(location);
// check sign
if (sellSign != null) {
@ -1105,7 +1113,7 @@ public void onPlayerInteractBlockSecondary(InteractBlockEvent.Secondary event) {
EconomyUtil.getInstance().buyClaimConsumerConfirmation(player, claim, sellSign);
return;
}
final Sign rentSign = SignUtil.getRentSign(clickedBlock.getLocation().orElse(null));
final Sign rentSign = SignUtil.getRentSign(location);
if (rentSign != null) {
final GDClaim claim = GriefDefenderPlugin.getInstance().dataStore.getClaimAt(location);
EconomyUtil.getInstance().rentClaimConsumerConfirmation(player, claim, rentSign);
@ -1118,7 +1126,7 @@ public void onPlayerInteractBlockSecondary(InteractBlockEvent.Secondary event) {
final GDClaim claim = this.dataStore.getClaimAt(location);
//GriefDefender.getPermissionManager().getFinalPermission(claim, Flags.ENTITY_SPAWN, source, target, user)
final TileEntity tileEntity = clickedBlock.getLocation().get().getTileEntity().orElse(null);
final TileEntity tileEntity = location.getTileEntity().orElse(null);
final TrustType trustType = (tileEntity != null && NMSUtil.getInstance().containsInventory(tileEntity)) ? TrustTypes.CONTAINER : TrustTypes.ACCESSOR;
if (GDFlags.INTERACT_BLOCK_SECONDARY && playerData != null) {
Tristate result = GDPermissionManager.getInstance().getFinalPermission(event, location, claim, Flags.INTERACT_BLOCK_SECONDARY, source, event.getTargetBlock(), user, trustType, true);
@ -1144,7 +1152,7 @@ public void onPlayerInteractBlockSecondary(InteractBlockEvent.Secondary event) {
NMSUtil.getInstance().closePlayerScreen(player);
}
event.setCancelled(true);
event.setUseBlockResult(org.spongepowered.api.util.Tristate.FALSE);
GDTimings.PLAYER_INTERACT_BLOCK_SECONDARY_EVENT.stopTimingIfSync();
return;
}
@ -1175,7 +1183,7 @@ private void handleFakePlayerInteractBlockSecondary(InteractBlockEvent event, Us
}
}
public InteractEvent handleItemInteract(InteractEvent event, Player player, World world, ItemStack itemInHand) {
public InteractEvent handleItemInteract(HandInteractEvent event, Player player, World world, ItemStack itemInHand) {
final ItemType itemType = itemInHand.getType();
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
if (!playerData.claimMode && (itemInHand.isEmpty() || NMSUtil.getInstance().isItemFood(itemType))) {
@ -1207,23 +1215,16 @@ public InteractEvent handleItemInteract(InteractEvent event, Player player, Worl
final Flag flag = primaryEvent ? Flags.INTERACT_ITEM_PRIMARY : Flags.INTERACT_ITEM_SECONDARY;
if (playerData.claimMode || (!itemInHand.isEmpty() && (itemInHand.getType().equals(GriefDefenderPlugin.getInstance().modificationTool.getType()) ||
itemInHand.getType().equals(GriefDefenderPlugin.getInstance().investigationTool.getType())))) {
GDPermissionManager.getInstance().processEventLog(event, location, claim, flag.getPermission(), itemInHand, blockSnapshot == null ? entity : blockSnapshot, player, TrustTypes.NONE.getName().toLowerCase(), Tristate.TRUE);
if ((playerData.claimMode && event.getHandType() == HandTypes.MAIN_HAND && primaryEvent) || (!playerData.claimMode && GriefDefenderPlugin.getInstance().investigationTool != null && !itemInHand.isEmpty() && itemInHand.getType().equals(GriefDefenderPlugin.getInstance().investigationTool.getType()))) {
investigateClaim(event, player, blockSnapshot, itemInHand);
event.setCancelled(true);
return event;
}
if ((playerData.claimMode && event.getHandType() == HandTypes.MAIN_HAND && !primaryEvent) || (!playerData.claimMode && GriefDefenderPlugin.getInstance().modificationTool != null && !itemInHand.isEmpty() && itemInHand.getType().equals(GriefDefenderPlugin.getInstance().modificationTool.getType()))) {
onPlayerHandleClaimCreateAction(event, blockSnapshot, player, itemInHand, playerData);
// avoid changing blocks after using a shovel
event.setCancelled(true);
if (investigateClaim(event, player, blockSnapshot, itemInHand)) {
return event;
}
if (!primaryEvent) {
if (playerData.claimMode && event instanceof HandInteractEvent) {
final HandInteractEvent handInteractEvent = (HandInteractEvent) event;
if (handInteractEvent.getHandType() == HandTypes.MAIN_HAND) {
onPlayerHandleClaimCreateAction(event, blockSnapshot, player, itemInHand, playerData);
}
} else {
onPlayerHandleClaimCreateAction(event, blockSnapshot, player, itemInHand, playerData);
}
}
return event;
}
@ -1239,6 +1240,23 @@ public InteractEvent handleItemInteract(InteractEvent event, Player player, Worl
event.setCancelled(true);
}
lastInteractItemCancelled = true;
return event;
}
if (blockSnapshot != null && blockSnapshot.getState().getType() != BlockTypes.AIR) {
if (GDPermissionManager.getInstance().getFinalPermission(event, location, claim, flag, itemInHand, blockSnapshot, player, TrustTypes.ACCESSOR, true) == Tristate.FALSE) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PERMISSION_INTERACT_ITEM_BLOCK,
ImmutableMap.of(
"item", itemInHand.getType().getId(),
"block", blockSnapshot.getState().getType().getId()));
GriefDefenderPlugin.sendClaimDenyMessage(claim, player, message);
if (event instanceof InteractBlockEvent.Secondary) {
((InteractBlockEvent.Secondary) event).setUseItemResult(SpongeUtil.getSpongeTristate(Tristate.FALSE));
} else {
event.setCancelled(true);
}
lastInteractItemCancelled = true;
}
}
return event;
}
@ -1267,23 +1285,15 @@ private void onPlayerHandleClaimCreateAction(InteractEvent event, BlockSnapshot
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.startTimingIfSync();
BlockSnapshot clickedBlock = targetBlock;
Location<World> location = clickedBlock.getLocation().orElse(null);
if (clickedBlock.getState().getType() == BlockTypes.AIR) {
boolean ignoreAir = false;
if (this.worldEditProvider != null) {
// Ignore air so players can use client-side WECUI block target which uses max reach distance
if (this.worldEditProvider.hasCUISupport(player) && playerData.getClaimCreateMode() == CreateModeTypes.VOLUME && playerData.lastShovelLocation != null) {
ignoreAir = true;
}
}
final int distance = !ignoreAir ? 100 : NMSUtil.getInstance().getPlayerBlockReachDistance(player);
location = BlockUtil.getInstance().getTargetBlock(player, playerData, distance, ignoreAir).orElse(null);
if (location == null) {
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
return;
boolean ignoreAir = false;
if (this.worldEditProvider != null) {
// Ignore air so players can use client-side WECUI block target which uses max reach distance
if (this.worldEditProvider.hasCUISupport(player) && playerData.getClaimCreateMode() == CreateModeTypes.VOLUME && playerData.lastShovelLocation != null) {
ignoreAir = true;
}
}
final int distance = !ignoreAir ? 100 : NMSUtil.getInstance().getPlayerBlockReachDistance(player);
location = BlockUtil.getInstance().getTargetBlock(player, playerData, distance, ignoreAir).orElse(null);
if (location == null) {
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTimingIfSync();
return;
@ -1366,7 +1376,6 @@ private void onPlayerHandleClaimCreateAction(InteractEvent event, BlockSnapshot
return;
} else if (playerData.shovelMode == ShovelTypes.SUBDIVISION && playerData.lastShovelLocation != null) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CREATE_SUBDIVISION_FAIL);
playerData.lastShovelLocation = null;
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
return;
}
@ -1507,20 +1516,24 @@ private void createClaimFinish(InteractEvent event, Player player, Location<Worl
}
return;
} else {
playerData.lastShovelLocation = null;
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_SUCCESS,
ImmutableMap.of(
"type", gdClaim.getFriendlyNameType(true)));
GriefDefenderPlugin.sendMessage(player, message);
if (this.worldEditProvider != null) {
this.worldEditProvider.stopDragVisual(player);
worldEditProvider.displayClaimCUIVisual(gdClaim, player, playerData, false);
this.worldEditProvider.displayClaimCUIVisual(gdClaim, player, playerData, false);
}
playerData.revertTempVisuals();
final GDClaimVisual visual = gdClaim.getVisualizer();
if (visual.getVisualTransactions().isEmpty()) {
visual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
}
visual.apply(player, false);
playerData.claimSubdividing = null;
playerData.claimResizing = null;
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
}
}
@ -1559,6 +1572,7 @@ private void createSubdivisionStart(InteractEvent event, Player player, ItemStac
GriefDefenderPlugin.sendMessage(player, message);
playerData.lastShovelLocation = location;
playerData.claimSubdividing = claim;
playerData.revertTempVisuals();
GDClaimVisual visualization = GDClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
visualization.apply(player, false);
}
@ -1601,11 +1615,10 @@ private void createSubdivisionFinish(InteractEvent event, Player player, Locatio
event.setCancelled(true);
return;
} else {
playerData.lastShovelLocation = null;
playerData.claimSubdividing = null;
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CREATE_SUCCESS, ImmutableMap.of(
"type", gdClaim.getFriendlyNameType(true)));
GriefDefenderPlugin.sendMessage(player, message);
playerData.revertTempVisuals();
final GDClaimVisual visual = gdClaim.getVisualizer();
if (visual.getVisualTransactions().isEmpty()) {
visual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
@ -1615,6 +1628,10 @@ private void createSubdivisionFinish(InteractEvent event, Player player, Locatio
this.worldEditProvider.stopDragVisual(player);
this.worldEditProvider.displayClaimCUIVisual(gdClaim, player, playerData, false);
}
playerData.claimSubdividing = null;
playerData.claimResizing = null;
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
}
}
@ -1661,14 +1678,14 @@ private void handleResizeStart(InteractEvent event, Player player, Location<Worl
playerData.claimResizing = claim;
playerData.lastShovelLocation = location;
if (GriefDefenderPlugin.getInstance().worldEditProvider != null) {
// get opposite corner
if (GriefDefenderPlugin.getInstance().worldEditProvider != null && (claim.cuboid || !GriefDefenderPlugin.getGlobalConfig().getConfig().visual.hideDrag2d)) {
final int x = playerData.lastShovelLocation.getBlockX() == claim.lesserBoundaryCorner.getX() ? claim.greaterBoundaryCorner.getX() : claim.lesserBoundaryCorner.getX();
final int y = playerData.lastShovelLocation.getBlockY() == claim.lesserBoundaryCorner.getY() ? claim.greaterBoundaryCorner.getY() : claim.lesserBoundaryCorner.getY();
final int z = playerData.lastShovelLocation.getBlockZ() == claim.lesserBoundaryCorner.getZ() ? claim.greaterBoundaryCorner.getZ() : claim.lesserBoundaryCorner.getZ();
this.worldEditProvider.displayClaimCUIVisual(claim, new Vector3i(x, y, z), playerData.lastShovelLocation.getBlockPosition(), player, playerData, false);
}
// Show visual block for resize corner click
playerData.revertTempVisuals();
GDClaimVisual visual = GDClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
visual.apply(player, false);
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_START);
@ -1741,6 +1758,7 @@ private void handleResizeFinish(InteractEvent event, Player player, Location<Wor
}
}
playerData.claimSubdividing = null;
playerData.claimResizing = null;
playerData.lastShovelLocation = null;
playerData.endShovelLocation = null;
@ -1777,6 +1795,7 @@ private void handleResizeFinish(InteractEvent event, Player player, Location<Wor
}
}
playerData.revertClaimVisual((GDClaim) claim);
playerData.revertTempVisuals();
final GDClaimVisual visual = ((GDClaim) claim).getVisualizer();
visual.resetVisuals();
visual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
@ -1791,13 +1810,8 @@ private void handleResizeFinish(InteractEvent event, Player player, Location<Wor
Set<Claim> claims = new HashSet<>();
claims.add(overlapClaim);
CommandHelper.showOverlapClaims(player, claims, location.getBlockY());
} else {
if (!claimResult.getMessage().isPresent()) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().CLAIM_NOT_YOURS);
}
}
playerData.claimSubdividing = null;
event.setCancelled(true);
}
}

View File

@ -81,12 +81,20 @@ public void onWorldSave(SaveWorldEvent.Post event) {
@Listener(order = Order.EARLY)
public void onChunkLoad(LoadChunkEvent event) {
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(event.getTargetChunk().getWorld().getUniqueId())) {
return;
}
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(event.getTargetChunk().getWorld().getUniqueId());
claimWorldManager.getChunk(event.getTargetChunk());
}
@Listener
public void onChunkUnload(UnloadChunkEvent event) {
if (!GriefDefenderPlugin.getInstance().claimsEnabledForWorld(event.getTargetChunk().getWorld().getUniqueId())) {
return;
}
final GDClaimManager claimWorldManager = GriefDefenderPlugin.getInstance().dataStore.getClaimWorldManager(event.getTargetChunk().getWorld().getUniqueId());
final GDChunk gdChunk = claimWorldManager.getChunk(event.getTargetChunk());
if (gdChunk != null) {

View File

@ -40,6 +40,7 @@
import com.griefdefender.internal.util.BlockUtil;
import com.griefdefender.permission.GDPermissionHolder;
import com.griefdefender.permission.GDPermissionUser;
import com.griefdefender.permission.flag.FlagContexts;
import com.griefdefender.permission.option.OptionContexts;
import com.griefdefender.storage.BaseStorage;
import com.griefdefender.util.PermissionUtil;
@ -132,11 +133,6 @@ public class GPBukkitMigrator {
private static final String FLAG_SPLEEF_ARENA = "spleefarena";
private static final String FLAG_TRAPPED_DESTINATION = "trappeddestination";
private static final Context SOURCE_PLAYER = new Context(ContextKeys.SOURCE, "player");
private static final Context TARGET_ICE_FORM = new Context(ContextKeys.TARGET, "ice");
private static final Context TARGET_PLAYER = new Context(ContextKeys.TARGET, "player");
private static final Context TARGET_SNOW_LAYER = new Context("target", "snow_layer");
public static void migrate(World world, Path gpClassicDataPath) throws FileNotFoundException, ClassNotFoundException {
count = 0;
GriefDefenderPlugin.getInstance().getLogger().info("Starting GriefPrevention data migration for world " + world.getName() + "...");
@ -227,20 +223,20 @@ private static void migrateGpFlags(World world) {
// TODO
break;
case FLAG_ENTER_MESSAGE :
claimStorage.getConfig().setGreeting(LegacyComponentSerializer.legacy().deserialize(param, '§'));
claimStorage.getConfig().setGreeting(LegacyComponentSerializer.legacy().deserialize(param, '<EFBFBD>'));
claimStorage.getConfig().setRequiresSave(true);
claimStorage.save();
break;
case FLAG_ENTER_COMMAND :
contexts.add(new Context(ContextKeys.FLAG, Flags.ENTER_CLAIM.getName()));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_CONSOLE);
contexts.add(OptionContexts.COMMAND_RUNFOR_PUBLIC);
PermissionUtil.getInstance().setOptionValue(DEFAULT_HOLDER, Options.PLAYER_COMMAND_ENTER.getPermission(), param, contexts);
break;
case FLAG_ENTER_COMMAND_OWNER :
contexts.add(new Context(ContextKeys.FLAG, Flags.ENTER_CLAIM.getName()));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_CONSOLE);
contexts.add(OptionContexts.COMMAND_RUNFOR_OWNER);
if (claimOwner == null) {
@ -251,7 +247,7 @@ private static void migrateGpFlags(World world) {
break;
case FLAG_ENTER_COMMAND_MEMBERS : {
contexts.add(new Context(ContextKeys.FLAG, Flags.ENTER_CLAIM.getName()));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_CONSOLE);
contexts.add(OptionContexts.COMMAND_RUNFOR_MEMBER);
List<UUID> members = new ArrayList<>();
@ -267,14 +263,14 @@ private static void migrateGpFlags(World world) {
}
case FLAG_ENTER_PLAYER_COMMAND :
contexts.add(new Context(ContextKeys.FLAG, Flags.ENTER_CLAIM.getName()));
contexts.add(new Context(ContextKeys.TARGET, "player"));
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNFOR_PUBLIC);
PermissionUtil.getInstance().setOptionValue(DEFAULT_HOLDER, Options.PLAYER_COMMAND_ENTER.getPermission(), param, contexts);
break;
case FLAG_EXIT_COMMAND_MEMBERS : {
contexts.add(new Context(ContextKeys.FLAG, Flags.EXIT_CLAIM.getName()));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNFOR_MEMBER);
List<UUID> members = new ArrayList<>();
@ -290,7 +286,7 @@ private static void migrateGpFlags(World world) {
}
case FLAG_EXIT_COMMAND_OWNER :
contexts.add(new Context(ContextKeys.FLAG, Flags.EXIT_CLAIM.getName()));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_CONSOLE);
contexts.add(OptionContexts.COMMAND_RUNFOR_MEMBER);
if (claimOwner == null) {
@ -302,13 +298,13 @@ private static void migrateGpFlags(World world) {
case FLAG_EXIT_COMMAND :
case FLAG_EXIT_PLAYER_COMMAND :
contexts.add(new Context(ContextKeys.FLAG, Flags.EXIT_CLAIM.getName()));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNAS_PLAYER);
contexts.add(OptionContexts.COMMAND_RUNFOR_PUBLIC);
PermissionUtil.getInstance().setOptionValue(DEFAULT_HOLDER, Options.PLAYER_COMMAND_EXIT.getPermission(), param, contexts);
break;
case FLAG_EXIT_MESSAGE :
claimStorage.getConfig().setFarewell(LegacyComponentSerializer.legacy().deserialize(param, '§'));
claimStorage.getConfig().setFarewell(LegacyComponentSerializer.legacy().deserialize(param, '<EFBFBD>'));
claimStorage.getConfig().setRequiresSave(true);
claimStorage.save();
break;
@ -346,17 +342,17 @@ private static void migrateGpFlags(World world) {
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.EXPLOSION_ENTITY.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_FALL_DAMAGE :
contexts.add(new Context(ContextKeys.SOURCE, "fall"));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.SOURCE_FALL);
contexts.add(FlagContexts.TARGET_PLAYER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ENTITY_DAMAGE.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_FIRE_DAMAGE :
contexts.add(new Context(ContextKeys.SOURCE, "fire"));
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ENTITY_DAMAGE.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_FIRE_SPREAD :
contexts.add(new Context(ContextKeys.SOURCE, "fire"));
contexts.add(FlagContexts.SOURCE_FIRE);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.BLOCK_SPREAD.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_FLIGHT :
@ -372,43 +368,43 @@ private static void migrateGpFlags(World world) {
PermissionUtil.getInstance().setOptionValue(DEFAULT_HOLDER, Options.PLAYER_DENY_HUNGER.getPermission(), "true", contexts);
break;
case FLAG_NO_ICE_FORM :
contexts.add(TARGET_ICE_FORM);
contexts.add(FlagContexts.TARGET_ICE_FORM);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.BLOCK_MODIFY.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_ITEM_DROP :
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ITEM_DROP.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_ITEM_PICKUP :
contexts.add(TARGET_PLAYER);
contexts.add(FlagContexts.TARGET_PLAYER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ITEM_PICKUP.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_LEAF_DECAY :
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.LEAF_DECAY.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_MOB_DAMAGE :
contexts.add(SOURCE_PLAYER);
contexts.add(new Context(ContextKeys.TARGET, "#monster"));
contexts.add(FlagContexts.SOURCE_PLAYER);
contexts.add(FlagContexts.TARGET_TYPE_MONSTER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ENTITY_DAMAGE.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_MOB_SPAWNS :
contexts.add(new Context(ContextKeys.TARGET, "#monster"));
contexts.add(FlagContexts.TARGET_TYPE_MONSTER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ENTITY_SPAWN.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_PLAYER_DAMAGE :
contexts.add(new Context(ContextKeys.TARGET, "player"));
contexts.add(FlagContexts.TARGET_PLAYER);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.ENTITY_DAMAGE.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_SNOW_FORM :
contexts.add(TARGET_SNOW_LAYER);
contexts.add(FlagContexts.TARGET_SNOW_1_12);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.BLOCK_MODIFY.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_VEHICLE :
contexts.add(new Context(ContextKeys.TARGET, "#vehicle"));
contexts.add(FlagContexts.TARGET_TYPE_VEHICLE);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.INTERACT_ENTITY_SECONDARY.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_NO_VINE_GROWTH :
contexts.add(new Context(ContextKeys.SOURCE, "vine"));
contexts.add(FlagContexts.SOURCE_VINE);
PermissionUtil.getInstance().setPermissionValue(DEFAULT_HOLDER, Flags.BLOCK_GROW.getPermission(), Tristate.FALSE, contexts);
break;
case FLAG_OWNER_FLY : {
@ -502,7 +498,7 @@ private static void migratePlayerData(World world) {
final int bonusBlocks = Integer.parseInt(lines.get(2));
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(world, uuid);
// Set directly in storage as subject data has not been initialized
playerData.setAccruedClaimBlocks(accruedBlocks);
playerData.setAccruedClaimBlocks(accruedBlocks, false);
playerData.setBonusClaimBlocks(bonusBlocks);
} catch (NumberFormatException e) {
e.printStackTrace();
@ -512,7 +508,13 @@ private static void migratePlayerData(World world) {
}
try {
Files.createFile(gpBukkitPlayerDataMigrated.toPath());
final Path gpPlayerDataPath = gpBukkitPlayerDataMigrated.toPath();
if (Files.notExists(gpPlayerDataPath.getParent())) {
Files.createDirectories(gpPlayerDataPath.getParent());
}
if (Files.notExists(gpPlayerDataPath)) {
Files.createFile(gpPlayerDataPath);
}
} catch (IOException e) {
e.printStackTrace();
}
@ -546,6 +548,10 @@ private static void createClaim(World world, File file, boolean parentsOnly) {
e1.printStackTrace();
return;
}
if (region.getChildrenMap().isEmpty()) {
GriefDefenderPlugin.getInstance().getLogger().info("Detected corrupted claim file '" + file + "'. Skipping...");
return;
}
if (parentsOnly && region.getChildrenMap().get("Parent Claim ID").getInt() != -1) {
return;
}

View File

@ -135,7 +135,7 @@ private static void migratePlayerData(World world) {
} else {
final String contextType = GriefDefenderPlugin.getGlobalConfig().getConfig().playerdata.contextType;
if (contextType.equalsIgnoreCase("world")) {
contexts.add(new Context("world", world.getName().toLowerCase()));
// ignore
} else if (contextType.equalsIgnoreCase("global")) {
contexts.add(new Context("server", "global"));
} else {

View File

@ -26,12 +26,13 @@
public class ContextGroupKeys {
public static final String ALL = "#all";
public static final String ANY = "#any";
public static final String AMBIENT = "#ambient";
public static final String ANIMAL = "#animal";
public static final String AQUATIC = "#aquatic";
public static final String CROPS = "#crops";
public static final String FOOD = "#food";
public static final String HANGING = "#hanging";
public static final String MISC = "#misc";
public static final String MONSTER = "#monster";
public static final String PET = "#pet";

Some files were not shown because too many files have changed in this diff Show More