mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-06-23 09:54:53 +02:00
Update for 1.1.0 release.
* Add support for all visual blocks to be changed in config. * Add config setting 'hide-wecui-drag-visuals-2d' to disable drag visuals while in 2D mode (true by default) * Fix start block visual disappearing when second block overlaps an existing claim. * Fix second block point on existing claim corner starting a resize. * Fix all active visuals disappearing when starting a resize. * Fix some lang issues.
This commit is contained in:
parent
39af6e2430
commit
a75d0410bf
|
@ -117,6 +117,7 @@
|
|||
import com.griefdefender.internal.provider.WorldGuardProvider;
|
||||
import com.griefdefender.internal.registry.BlockTypeRegistryModule;
|
||||
import com.griefdefender.internal.registry.EntityTypeRegistryModule;
|
||||
import com.griefdefender.internal.registry.GDBlockType;
|
||||
import com.griefdefender.internal.registry.GDEntityType;
|
||||
import com.griefdefender.internal.registry.GDItemType;
|
||||
import com.griefdefender.internal.registry.ItemTypeRegistryModule;
|
||||
|
@ -232,6 +233,7 @@ public class GriefDefenderPlugin {
|
|||
|
||||
private boolean isEconomyModeEnabled = false;
|
||||
|
||||
public GDBlockType createVisualBlock;
|
||||
public GDItemType modificationTool;
|
||||
public GDItemType investigationTool;
|
||||
public int maxInspectionDistance = 100;
|
||||
|
@ -741,6 +743,8 @@ public void loadConfig() {
|
|||
PermissionHolderCache.getInstance().getOrCreatePermissionCache(GriefDefenderPlugin.DEFAULT_HOLDER).invalidateAll();
|
||||
CLAIM_BLOCK_SYSTEM = BaseStorage.globalConfig.getConfig().playerdata.claimBlockSystem;
|
||||
final GDItemType defaultModTool = ItemTypeRegistryModule.getInstance().getById("minecraft:golden_shovel").orElse(null);
|
||||
final GDBlockType defaultCreateVisualBlock = BlockTypeRegistryModule.getInstance().getById("minecraft:diamond_block").orElse(null);
|
||||
this.createVisualBlock = BlockTypeRegistryModule.getInstance().getById(BaseStorage.globalConfig.getConfig().visual.claimCreateStartBlock).orElse(defaultCreateVisualBlock);
|
||||
this.modificationTool = ItemTypeRegistryModule.getInstance().getById(BaseStorage.globalConfig.getConfig().claim.modificationTool).orElse(defaultModTool);
|
||||
this.investigationTool = ItemTypeRegistryModule.getInstance().getById(BaseStorage.globalConfig.getConfig().claim.investigationTool).orElse(ItemTypeRegistryModule.getInstance().getById("minecraft:stick").get());
|
||||
this.maxInspectionDistance = BaseStorage.globalConfig.getConfig().general.maxClaimInspectionDistance;
|
||||
|
|
|
@ -498,6 +498,7 @@ public void loadCache() {
|
|||
PLAYERINFO_UI_TITLE = MESSAGE_DATA.getMessage("playerinfo-ui-title");
|
||||
PLUGIN_EVENT_CANCEL = MESSAGE_DATA.getMessage("plugin-event-cancel");
|
||||
PLUGIN_RELOAD = MESSAGE_DATA.getMessage("plugin-reload");
|
||||
RESIZE_OVERLAP = MESSAGE_DATA.getMessage("resize-overlap");
|
||||
RESIZE_OVERLAP_SUBDIVISION = MESSAGE_DATA.getMessage("resize-overlap-subdivision");
|
||||
RESIZE_SAME_LOCATION = MESSAGE_DATA.getMessage("resize-same-location");
|
||||
RESIZE_START = MESSAGE_DATA.getMessage("resize-start");
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
import com.griefdefender.internal.util.BlockUtil;
|
||||
import com.griefdefender.internal.util.VecHelper;
|
||||
import com.griefdefender.internal.visual.ClaimVisual;
|
||||
import com.griefdefender.internal.visual.GDClaimVisualType;
|
||||
import com.griefdefender.permission.GDPermissionHolder;
|
||||
import com.griefdefender.permission.GDPermissionManager;
|
||||
import com.griefdefender.permission.GDPermissionUser;
|
||||
|
@ -80,7 +81,7 @@
|
|||
import com.griefdefender.registry.TrustTypeRegistryModule;
|
||||
import com.griefdefender.storage.BaseStorage;
|
||||
import com.griefdefender.util.PermissionUtil;
|
||||
import com.griefdefender.visual.ClaimVisualType;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.format.TextColor;
|
||||
|
@ -872,7 +873,7 @@ public ClaimResult transferOwner(UUID newOwnerID) {
|
|||
if (this.isAdminClaim()) {
|
||||
// convert to basic
|
||||
this.type = ClaimTypes.BASIC;
|
||||
this.getVisualizer().setType(ClaimVisualType.CLAIM);
|
||||
this.getVisualizer().setType(ClaimVisual.BASIC);
|
||||
this.claimData.setType(ClaimTypes.BASIC);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,12 @@ public GDClaimType(String id, String name) {
|
|||
} else if (name.equalsIgnoreCase("town")) {
|
||||
this.defaultContext = ClaimContexts.TOWN_DEFAULT_CONTEXT;
|
||||
this.overrideContext = ClaimContexts.TOWN_OVERRIDE_CONTEXT;
|
||||
} else {
|
||||
} else if (name.equalsIgnoreCase("wilderness")) {
|
||||
this.defaultContext = ClaimContexts.WILDERNESS_DEFAULT_CONTEXT;
|
||||
this.overrideContext = ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT;
|
||||
} else {
|
||||
this.defaultContext = new Context("gd_claim_default", name.toLowerCase());
|
||||
this.overrideContext = new Context("gd_claim_override", name.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,8 +54,6 @@ public class ClaimCategory extends ConfigCategory {
|
|||
public int taxApplyHour = 12;
|
||||
@Setting(value = "bank-transaction-log-limit")
|
||||
public int bankTransactionLogLimit = 60;
|
||||
@Setting(value = "hide-borders-when-using-wecui", comment = "Whether to hide the glowstone/gold block borders when using WECUI.")
|
||||
public boolean hideBorders = false;
|
||||
|
||||
public ClaimCategory() {
|
||||
|
||||
|
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* 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 org.bukkit.Bukkit;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||
|
||||
@ConfigSerializable
|
||||
public class VisualCategory extends ConfigCategory {
|
||||
|
||||
@Setting(value = "hide-borders-when-using-wecui", comment = "Whether to hide the glowstone/gold block borders when using WECUI.")
|
||||
public boolean hideBorders = false;
|
||||
@Setting(value = "hide-wecui-drag-visuals-2d", comment = "Whether drag visuals should be shown while creating a claim in 2D mode.")
|
||||
public boolean hideDrag2d = true;
|
||||
|
||||
@Setting(value = "claim-create-block", comment = "The visual block used during claim creation. (Default: minecraft:diamond_block)")
|
||||
public String claimCreateStartBlock = "minecraft:diamond_block";
|
||||
|
||||
@Setting(value = "admin-accent-block", comment = "The visual accent block used for admin claims. (Default: minecraft:pumpkin)")
|
||||
public String visualAdminAccentBlock = "minecraft:pumpkin";
|
||||
@Setting(value = "admin-corner-block", comment = "The visual corner block used for admin claims. (Default: minecraft:glowstone)")
|
||||
public String visualAdminCornerBlock = "minecraft:glowstone";
|
||||
@Setting(value = "admin-filler-block", comment = "The visual filler block used for admin claims. (Default: minecraft:pumpkin)")
|
||||
public String visualAdminFillerBlock = "minecraft:pumpkin";
|
||||
|
||||
@Setting(value = "basic-accent-block", comment = "The visual accent block used for basic claims. (Default: minecraft:gold_block)")
|
||||
public String visualBasicAccentBlock = "minecraft:gold_block";
|
||||
@Setting(value = "basic-corner-block", comment = "The visual corner block used for basic claims. (Default: minecraft:glowstone)")
|
||||
public String visualBasicCornerBlock = "minecraft:glowstone";
|
||||
@Setting(value = "basic-filler-block", comment = "The visual filler block used for basic claims. (Default: minecraft:gold_block)")
|
||||
public String visualBasicFillerBlock = "minecraft:gold_block";
|
||||
|
||||
@Setting(value = "error-accent-block", comment = "The visual accent block used to visualize an error in a claim. (Default: minecraft:netherrack)")
|
||||
public String visualErrorAccentBlock = "minecraft:netherrack";
|
||||
@Setting(value = "error-corner-block", comment = "The visual corner block used to visualize an error in a claim. (Default: minecraft:redstone_ore)")
|
||||
public String visualErrorCornerBlock = "minecraft:redstone_ore";
|
||||
@Setting(value = "error-filler-block", comment = "The visual filler block used to visualize an error in a claim. (Default: minecraft:diamond_block)")
|
||||
public String visualErrorFillerBlock = "minecraft:diamond_block";
|
||||
|
||||
@Setting(value = "subdivision-accent-block", comment = "The visual accent block used for subdivision claims. (Default: minecraft:white_wool or minecraft:wool for legacy versions)")
|
||||
public String visualSubdivisionAccentBlock;
|
||||
@Setting(value = "subdivision-corner-block", comment = "The visual corner block used for subdivision claims. (Default: minecraft:iron_block)")
|
||||
public String visualSubdivisionCornerBlock = "minecraft:iron_block";
|
||||
@Setting(value = "subdivision-filler-block", comment = "The visual filler block used for subdivision claims. (Default: minecraft:white_wool or minecraft:wool for legacy versions)")
|
||||
public String visualSubdivisionFillerBlock;
|
||||
|
||||
@Setting(value = "town-accent-block", comment = "The visual accent block used for town claims. (Default: minecraft:emerald_block)")
|
||||
public String visualTownAccentBlock = "minecraft:emerald_block";
|
||||
@Setting(value = "town-corner-block", comment = "The visual corner block used for town claims. (Default: minecraft:glowstone)")
|
||||
public String visualTownCornerBlock = "minecraft:glowstone";
|
||||
@Setting(value = "town-filler-block", comment = "The visual filler block used for town claims. (Default: minecraft:emerald_block)")
|
||||
public String visualTownFillerBlock = "minecraft:emerald_block";
|
||||
|
||||
@Setting(value = "nature-accent-block", comment = "The visual accent block used while in restore nature mode. (Default: minecraft:diamond_block)")
|
||||
public String visualNatureAccentBlock = "minecraft:diamond_block";
|
||||
@Setting(value = "nature-corner-block", comment = "The visual corner block used while in restore nature mode. (Default: minecraft:diamond_block)")
|
||||
public String visualNatureCornerBlock = "minecraft:diamond_block";
|
||||
|
||||
public VisualCategory() {
|
||||
final String version = Bukkit.getVersion();
|
||||
if (version.contains("1.8.8") || version.contains("1.12")) {
|
||||
this.visualSubdivisionAccentBlock = "minecraft:wool";
|
||||
this.visualSubdivisionFillerBlock = "minecraft:wool";
|
||||
} else {
|
||||
this.visualSubdivisionAccentBlock = "minecraft:white_wool";
|
||||
this.visualSubdivisionFillerBlock = "minecraft:white_wool";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -29,6 +29,8 @@
|
|||
import com.griefdefender.configuration.category.GeneralCategory;
|
||||
import com.griefdefender.configuration.category.OptionCategory;
|
||||
import com.griefdefender.configuration.category.TownCategory;
|
||||
import com.griefdefender.configuration.category.VisualCategory;
|
||||
|
||||
import ninja.leaping.configurate.objectmapping.Setting;
|
||||
|
||||
public class ConfigBase {
|
||||
|
@ -51,4 +53,7 @@ public class ConfigBase {
|
|||
|
||||
@Setting
|
||||
public TownCategory town = new TownCategory();
|
||||
|
||||
@Setting
|
||||
public VisualCategory visual = new VisualCategory();
|
||||
}
|
|
@ -49,13 +49,14 @@
|
|||
import com.griefdefender.internal.util.NMSUtil;
|
||||
import com.griefdefender.internal.util.VecHelper;
|
||||
import com.griefdefender.internal.visual.ClaimVisual;
|
||||
import com.griefdefender.internal.visual.GDClaimVisualType;
|
||||
import com.griefdefender.permission.GDFlags;
|
||||
import com.griefdefender.permission.GDPermissionManager;
|
||||
import com.griefdefender.permission.GDPermissionUser;
|
||||
import com.griefdefender.permission.GDPermissions;
|
||||
import com.griefdefender.storage.BaseStorage;
|
||||
import com.griefdefender.util.Direction;
|
||||
import com.griefdefender.visual.ClaimVisualType;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
|
@ -650,7 +651,7 @@ public void onBlockPlace(BlockPlaceEvent event) {
|
|||
|
||||
// show the player the protected area
|
||||
GDClaim newClaim = this.storage.getClaimAt(block.getLocation());
|
||||
ClaimVisual visualization = new ClaimVisual(newClaim, ClaimVisualType.CLAIM);
|
||||
ClaimVisual visualization = new ClaimVisual(newClaim, ClaimVisual.BASIC);
|
||||
visualization.createClaimBlockVisuals(blockPos.getY(), player.getLocation(), playerData);
|
||||
visualization.apply(player);
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
import com.griefdefender.internal.util.NMSUtil;
|
||||
import com.griefdefender.internal.util.VecHelper;
|
||||
import com.griefdefender.internal.visual.ClaimVisual;
|
||||
import com.griefdefender.internal.visual.GDClaimVisualType;
|
||||
import com.griefdefender.permission.GDFlags;
|
||||
import com.griefdefender.permission.GDPermissionManager;
|
||||
import com.griefdefender.permission.GDPermissionUser;
|
||||
|
@ -69,7 +70,7 @@
|
|||
import com.griefdefender.util.BlockRayHit;
|
||||
import com.griefdefender.util.PaginationUtil;
|
||||
import com.griefdefender.util.PlayerUtil;
|
||||
import com.griefdefender.visual.ClaimVisualType;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.bukkit.TextAdapter;
|
||||
|
@ -227,13 +228,13 @@ public void onPlayerChangeHeldItem(PlayerItemHeldEvent event) {
|
|||
if (GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLAYER_REMAINING_BLOCKS_3D,
|
||||
ImmutableMap.of(
|
||||
"block-amount", playerData.getRemainingClaimBlocks()));
|
||||
"block-amount", playerData.getRemainingClaimBlocks(),
|
||||
"chunk-amount", playerData.getRemainingChunks()));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
} else {
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.PLAYER_REMAINING_BLOCKS_2D,
|
||||
ImmutableMap.of(
|
||||
"block-amount", playerData.getRemainingClaimBlocks(),
|
||||
"chunk-amount", playerData.getRemainingChunks()));
|
||||
"block-amount", playerData.getRemainingClaimBlocks()));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
}
|
||||
} else {
|
||||
|
@ -1003,7 +1004,7 @@ private void onPlayerHandleShovelAction(PlayerInteractEvent event, Block clicked
|
|||
ImmutableMap.of(
|
||||
"player", claim.getOwnerName()));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
ClaimVisual claimVisual = new ClaimVisual(claim, ClaimVisualType.ERROR);
|
||||
ClaimVisual claimVisual = new ClaimVisual(claim, ClaimVisual.ERROR);
|
||||
claimVisual.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
|
||||
claimVisual.apply(player);
|
||||
GDTimings.PLAYER_HANDLE_SHOVEL_ACTION.stopTiming();
|
||||
|
@ -1036,13 +1037,13 @@ private void onPlayerHandleShovelAction(PlayerInteractEvent event, Block clicked
|
|||
ImmutableMap.of(
|
||||
"player", claim.getOwnerName()));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
ClaimVisual visualization = new ClaimVisual(claim, ClaimVisualType.ERROR);
|
||||
ClaimVisual visualization = new ClaimVisual(claim, ClaimVisual.ERROR);
|
||||
visualization.createClaimBlockVisuals(location.getBlockY(), player.getLocation(), playerData);
|
||||
visualization.apply(player);
|
||||
Set<Claim> claims = new HashSet<>();
|
||||
claims.add(claim);
|
||||
CommandHelper.showClaims(player, claims, location.getBlockY(), true);
|
||||
} else if (BlockUtil.getInstance().clickedClaimCorner(claim, VecHelper.toVector3i(location))) {
|
||||
} else if (playerData.lastShovelLocation == null && BlockUtil.getInstance().clickedClaimCorner(claim, VecHelper.toVector3i(location))) {
|
||||
handleResizeStart(event, player, location, playerData, claim);
|
||||
} else if ((playerData.shovelMode == ShovelTypes.SUBDIVISION
|
||||
|| ((claim.isTown() || claim.isAdminClaim()) && (playerData.lastShovelLocation == null || playerData.claimSubdividing != null)) && playerData.shovelMode != ShovelTypes.TOWN)) {
|
||||
|
@ -1135,7 +1136,7 @@ private void createClaimStart(PlayerInteractEvent event, Player player, Location
|
|||
playerData.lastShovelLocation = location;
|
||||
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.CLAIM_START,
|
||||
ImmutableMap.of(
|
||||
"type", playerData.shovelMode.getName()));
|
||||
"type", PlayerUtil.getInstance().getClaimTypeComponentFromShovel(playerData.shovelMode)));
|
||||
GriefDefenderPlugin.sendMessage(player, message);
|
||||
ClaimVisual visual = ClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
|
||||
visual.apply(player, false);
|
||||
|
@ -1341,7 +1342,6 @@ private void handleResizeStart(PlayerInteractEvent event, Player player, Locatio
|
|||
return;
|
||||
}
|
||||
|
||||
playerData.revertActiveVisual(player);
|
||||
playerData.claimResizing = claim;
|
||||
playerData.lastShovelLocation = location;
|
||||
if (this.worldEditProvider != null) {
|
||||
|
@ -1350,6 +1350,9 @@ private void handleResizeStart(PlayerInteractEvent event, Player player, Locatio
|
|||
final int z = playerData.lastShovelLocation.getBlockZ() == claim.lesserBoundaryCorner.getZ() ? claim.greaterBoundaryCorner.getZ() : claim.lesserBoundaryCorner.getZ();
|
||||
this.worldEditProvider.visualizeClaim(claim, new Vector3i(x, y, z), VecHelper.toVector3i(playerData.lastShovelLocation), player, playerData, false);
|
||||
}
|
||||
// Show visual block for resize corner click
|
||||
ClaimVisual visual = ClaimVisual.fromClick(location, location.getBlockY(), PlayerUtil.getInstance().getVisualTypeFromShovel(playerData.shovelMode), player, playerData);
|
||||
visual.apply(player, false);
|
||||
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().RESIZE_START);
|
||||
}
|
||||
|
||||
|
@ -1426,12 +1429,12 @@ private void handleResizeFinish(PlayerInteractEvent event, Player player, Locati
|
|||
if (GriefDefenderPlugin.CLAIM_BLOCK_SYSTEM == ClaimBlockSystem.VOLUME) {
|
||||
final double claimableChunks = claimBlocksRemaining / 65536.0;
|
||||
final Map<String, Object> params = ImmutableMap.of(
|
||||
"remaining-chunks", Math.round(claimableChunks * 100.0)/100.0,
|
||||
"remaining-blocks", claimBlocksRemaining);
|
||||
"chunk-amount", Math.round(claimableChunks * 100.0)/100.0,
|
||||
"block-amount", claimBlocksRemaining);
|
||||
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_SUCCESS_3D, params));
|
||||
} else {
|
||||
final Map<String, Object> params = ImmutableMap.of(
|
||||
"remaining-blocks", claimBlocksRemaining);
|
||||
"block-amount", claimBlocksRemaining);
|
||||
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.RESIZE_SUCCESS_2D, params));
|
||||
}
|
||||
playerData.revertActiveVisual(player);
|
||||
|
@ -1491,7 +1494,7 @@ private boolean investigateClaim(PlayerInteractEvent event, Player player, Block
|
|||
|
||||
boolean hideBorders = this.worldEditProvider != null &&
|
||||
this.worldEditProvider.hasCUISupport(player) &&
|
||||
GriefDefenderPlugin.getActiveConfig(player.getWorld().getUID()).getConfig().claim.hideBorders;
|
||||
GriefDefenderPlugin.getActiveConfig(player.getWorld().getUID()).getConfig().visual.hideBorders;
|
||||
if (!hideBorders) {
|
||||
ClaimVisual visualization = ClaimVisual.fromClaims(claims, playerData.getClaimCreateMode() == 1 ? height : PlayerUtil.getInstance().getEyeHeight(player), player.getLocation(), playerData, null);
|
||||
visualization.apply(player);
|
||||
|
|
|
@ -55,7 +55,8 @@ public ClaimVisualApplyTask(Player player, GDPlayerData playerData, ClaimVisual
|
|||
|
||||
@Override
|
||||
public void run() {
|
||||
if (this.playerData.visualBlocks != null) {
|
||||
// Only revert active visual if we are not currently creating a claim
|
||||
if (this.playerData.visualBlocks != null && this.playerData.lastShovelLocation == null) {
|
||||
if (this.resetActive) {
|
||||
this.playerData.revertActiveVisual(this.player);
|
||||
}
|
||||
|
@ -70,7 +71,12 @@ public void run() {
|
|||
this.playerData.visualClaimId = this.visualization.getClaim().getUniqueId();
|
||||
this.visualization.getClaim().playersWatching.add(this.player.getUniqueId());
|
||||
}
|
||||
this.playerData.visualBlocks = new ArrayList<>(this.visualization.visualTransactions);
|
||||
// If we still have active visuals to revert, combine with new
|
||||
if (this.playerData.visualBlocks != null) {
|
||||
this.playerData.visualBlocks.addAll(this.visualization.visualTransactions);
|
||||
} else {
|
||||
this.playerData.visualBlocks = new ArrayList<>(this.visualization.visualTransactions);
|
||||
}
|
||||
|
||||
if (playerData.lastShovelLocation == null) {
|
||||
this.playerData.visualRevertTask = Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(GDBootstrap.getInstance(), new ClaimVisualRevertTask(this.player, this.playerData), 1200);
|
||||
|
|
|
@ -33,9 +33,14 @@
|
|||
import com.griefdefender.cache.PermissionHolderCache;
|
||||
import com.griefdefender.claim.GDClaim;
|
||||
import com.griefdefender.configuration.MessageStorage;
|
||||
import com.griefdefender.internal.visual.ClaimVisual;
|
||||
import com.griefdefender.internal.visual.GDClaimVisualType;
|
||||
import com.griefdefender.permission.GDPermissionUser;
|
||||
import com.griefdefender.visual.ClaimVisualType;
|
||||
|
||||
import net.kyori.text.Component;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.format.TextColor;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
@ -72,17 +77,48 @@ public ClaimType getClaimTypeFromShovel(ShovelType shovelMode) {
|
|||
return ClaimTypes.BASIC;
|
||||
}
|
||||
|
||||
public ClaimVisualType getVisualTypeFromShovel(ShovelType shovelMode) {
|
||||
public Component getClaimTypeComponentFromShovel(ShovelType shovelMode) {
|
||||
return getClaimTypeComponentFromShovel(shovelMode, true);
|
||||
}
|
||||
|
||||
public Component getClaimTypeComponentFromShovel(ShovelType shovelMode, boolean upper) {
|
||||
if (shovelMode == ShovelTypes.ADMIN) {
|
||||
return ClaimVisualType.ADMINCLAIM;
|
||||
if (upper) {
|
||||
return TextComponent.of(ClaimTypes.ADMIN.getName().toUpperCase(), TextColor.RED);
|
||||
}
|
||||
return TextComponent.of("Admin", TextColor.RED);
|
||||
}
|
||||
|
||||
if (shovelMode == ShovelTypes.TOWN) {
|
||||
if (upper) {
|
||||
return TextComponent.of(ClaimTypes.TOWN.getName().toUpperCase(), TextColor.GREEN);
|
||||
}
|
||||
return TextComponent.of("Town", TextColor.GREEN);
|
||||
}
|
||||
|
||||
if (shovelMode == ShovelTypes.SUBDIVISION) {
|
||||
if (upper) {
|
||||
return TextComponent.of(ClaimTypes.SUBDIVISION.getName().toUpperCase(), TextColor.AQUA);
|
||||
}
|
||||
return TextComponent.of("Subdivision", TextColor.AQUA);
|
||||
}
|
||||
if (upper) {
|
||||
return TextComponent.of(ClaimTypes.BASIC.getName().toUpperCase(), TextColor.YELLOW);
|
||||
}
|
||||
return TextComponent.of("Basic", TextColor.YELLOW);
|
||||
}
|
||||
|
||||
public GDClaimVisualType getVisualTypeFromShovel(ShovelType shovelMode) {
|
||||
if (shovelMode == ShovelTypes.ADMIN) {
|
||||
return ClaimVisual.ADMIN;
|
||||
}
|
||||
if (shovelMode == ShovelTypes.SUBDIVISION) {
|
||||
return ClaimVisualType.SUBDIVISION;
|
||||
return ClaimVisual.SUBDIVISION;
|
||||
}
|
||||
if (shovelMode == ShovelTypes.TOWN) {
|
||||
return ClaimVisualType.TOWN;
|
||||
return ClaimVisual.TOWN;
|
||||
}
|
||||
return ClaimVisualType.CLAIM;
|
||||
return ClaimVisual.BASIC;
|
||||
}
|
||||
|
||||
public String lookupPlayerName(String uuid) {
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* 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.visual;
|
||||
|
||||
public enum ClaimVisualType {
|
||||
CLAIM,
|
||||
SUBDIVISION,
|
||||
ERROR,
|
||||
RESTORENATURE,
|
||||
ADMINCLAIM,
|
||||
TOWN
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.12.2",
|
||||
"sha1": "54c03855b6142db1a5990ac402ba71cc293d3bd6",
|
||||
"path": "com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20190728.132013-10.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20190728.132013-10.jar"
|
||||
"sha1": "4f4dc26b1e6a0acb199789f58de6290cb9c4a98c",
|
||||
"path": "com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20190731.042132-12.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.12.2-SNAPSHOT/adapter-1.12.2-20190731.042132-12.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
|
@ -13,6 +13,12 @@
|
|||
"path": "com/griefdefender/api/1.0.0-SNAPSHOT/api-1.0.0-20190727.235445-3.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/api/1.0.0-SNAPSHOT/api-1.0.0-20190727.235445-3.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": "org.ow2.asm:asm-debug-all:5.2",
|
||||
"sha1": "3354e11e2b34215f06dab629ab88e06aca477c19",
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.13.2",
|
||||
"sha1": "0556e4da91ed579c341df7e133ed070822f36337",
|
||||
"path": "com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20190728.132257-9.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20190728.132257-9.jar"
|
||||
"sha1": "7a95a77f607a439a488e4a412a2a4bc2e71823c7",
|
||||
"path": "com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20190731.044022-11.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.13.2-SNAPSHOT/adapter-1.13.2-20190731.044022-11.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.14.2",
|
||||
"sha1": "9eba6f3814486cc15e7133f4e97c3b3bc6726e2b",
|
||||
"path": "com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20190728.132330-9.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20190728.132330-9.jar"
|
||||
"sha1": "077efa9ca33501a1effd6d3452521664e68d444f",
|
||||
"path": "com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20190731.044134-11.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.2-SNAPSHOT/adapter-1.14.2-20190731.044134-11.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.14.3",
|
||||
"sha1": "7358cd17acd25fee5ed490024ad0c8fb0be1403d",
|
||||
"path": "com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20190728.132409-10.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20190728.132409-10.jar"
|
||||
"sha1": "ea13e4e168d457534c4643fb669ceab3edaa67de",
|
||||
"path": "com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20190731.044239-12.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.3-SNAPSHOT/adapter-1.14.3-20190731.044239-12.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.14.4",
|
||||
"sha1": "158df31d5f92819a2e8e8d6bddc7b9a2daab15cd",
|
||||
"path": "com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20190728.132446-5.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20190728.132446-5.jar"
|
||||
"sha1": "e82a7efc930209a55fd950f16049e93e5d611e86",
|
||||
"path": "com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20190731.044400-7.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.14.4-SNAPSHOT/adapter-1.14.4-20190731.044400-7.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"libraries": [
|
||||
{
|
||||
"name": "com.griefdefender:adapter:1.8.8",
|
||||
"sha1": "f351d0ee319a7d56a247affc855057f0739af895",
|
||||
"path": "com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20190728.132149-10.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20190728.132149-10.jar"
|
||||
"sha1": "9e2bcd797702d27370565a7a49f4a44069178ea3",
|
||||
"path": "com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20190731.041903-12.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/adapter/1.8.8-SNAPSHOT/adapter-1.8.8-20190731.041903-12.jar"
|
||||
},
|
||||
{
|
||||
"name": "com.griefdefender:api:1.0.0",
|
||||
|
@ -13,6 +13,12 @@
|
|||
"path": "com/griefdefender/api/1.0.0-SNAPSHOT/api-1.0.0-20190727.235445-3.jar",
|
||||
"url": "https://repo.glaremasters.me/repository/bloodshot/com/griefdefender/api/1.0.0-SNAPSHOT/api-1.0.0-20190727.235445-3.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": "org.ow2.asm:asm-debug-all:5.2",
|
||||
"sha1": "3354e11e2b34215f06dab629ab88e06aca477c19",
|
||||
|
|
|
@ -178,8 +178,8 @@ GriefDefender {
|
|||
create-cancel="&cThe creation of this claim has been cancelled."
|
||||
create-cuboid-disabled="&cThe creation of &d3D&c cuboid claims has been disabled by an administrator.\nYou can only create &d3D&c claims as an Admin or on a &d2D&c claim that you own."
|
||||
create-failed-claim-limit="&cYou've reached your limit of &a{limit}&c on {type}&c claims. Use &f/abandon&c to remove one before creating another."
|
||||
create-insufficient-blocks-2d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more blocks."
|
||||
create-insufficient-blocks-3d="&cYou don't have enough blocks to claim this area.\nYou need &a{amount}&c more chunks. &f({block-amount})"
|
||||
create-insufficient-blocks-2d="&cYou don't have enough blocks to claim this area.\nYou need &a{block-amount}&c more blocks."
|
||||
create-insufficient-blocks-3d="&cYou don't have enough blocks to claim this area.\nYou need &a{chunk-amount}&c more chunks. &f({block-amount})"
|
||||
create-overlap="&cYou can't create a claim here because it would overlap your other claim. Use &f/abandonclaim&c to delete it, or use your shovel at a corner to resize it."
|
||||
create-overlap-player="&cYou can't create a claim here because it would overlap &6{player}&c's claim."
|
||||
create-overlap-short="&cYour selected area overlaps an existing claim."
|
||||
|
@ -401,8 +401,8 @@ GriefDefender {
|
|||
resize-overlap-subdivision="&cYou can't create a subdivision here because it would overlap another subdivision. Consider &f/abandon&c to delete it, or use your shovel at a corner to resize it."
|
||||
resize-same-location="&cYou must select a different block location to resize claim."
|
||||
resize-start="&aResizing claim. Use your shovel again at the new location for this corner."
|
||||
resize-success-2d="&aClaim resized. You have &6{amount} &amore blocks remaining."
|
||||
resize-success-3d="&aClaim resized. You have &6{amount} &amore chunks remaining. &f({block-amount})"
|
||||
resize-success-2d="&aClaim resized. You have &6{block-amount} &amore blocks remaining."
|
||||
resize-success-3d="&aClaim resized. You have &6{chunk-amount} &amore chunks remaining. &f({block-amount})"
|
||||
result-type-change-deny="&cYou cannot change a claim to {type}."
|
||||
result-type-change-not-admin="&cYou do not have administrative permissions to change type to {type}&c."
|
||||
result-type-child-same="{type}&c claims cannot have direct {type}&c children claims."
|
||||
|
|
Loading…
Reference in New Issue
Block a user