GriefDefender/bukkit/src/main/java/com/griefdefender/command/CommandHelper.java

1415 lines
76 KiB
Java
Raw Normal View History

2019-07-24 05:31:17 +02:00
/*
* This file is part of GriefDefender, licensed under the MIT License (MIT).
*
* Copyright (c) bloodmc
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.griefdefender.command;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import java.time.Duration;
import java.time.Instant;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World.Environment;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.plugin.Plugin;
2019-07-24 05:31:17 +02:00
import com.flowpowered.math.vector.Vector3i;
import com.google.common.collect.ImmutableMap;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import com.google.common.reflect.TypeToken;
2019-07-24 05:31:17 +02:00
import com.google.gson.Gson;
import com.griefdefender.GDPlayerData;
import com.griefdefender.GriefDefenderPlugin;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import com.griefdefender.api.GriefDefender;
import com.griefdefender.api.Subject;
2019-07-24 05:31:17 +02:00
import com.griefdefender.api.Tristate;
import com.griefdefender.api.claim.Claim;
import com.griefdefender.api.claim.ClaimContexts;
import com.griefdefender.api.claim.ClaimResult;
2019-07-24 05:31:17 +02:00
import com.griefdefender.api.claim.TrustType;
import com.griefdefender.api.claim.TrustTypes;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
import com.griefdefender.api.economy.PaymentTransaction;
import com.griefdefender.api.economy.PaymentType;
import com.griefdefender.api.economy.TransactionResultType;
import com.griefdefender.api.economy.TransactionType;
2019-07-24 05:31:17 +02:00
import com.griefdefender.api.permission.Context;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
import com.griefdefender.api.permission.ContextKeys;
2019-07-24 05:31:17 +02:00
import com.griefdefender.api.permission.PermissionResult;
import com.griefdefender.api.permission.ResultTypes;
import com.griefdefender.api.permission.flag.Flag;
import com.griefdefender.api.permission.flag.Flags;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import com.griefdefender.api.permission.option.Option;
2019-07-24 05:31:17 +02:00
import com.griefdefender.api.permission.option.Options;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import com.griefdefender.api.permission.option.type.CreateModeTypes;
import com.griefdefender.cache.MessageCache;
2019-07-24 05:31:17 +02:00
import com.griefdefender.cache.PermissionHolderCache;
import com.griefdefender.claim.GDClaim;
import com.griefdefender.configuration.GriefDefenderConfig;
import com.griefdefender.configuration.MessageStorage;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
import com.griefdefender.economy.GDPaymentTransaction;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import com.griefdefender.event.GDCauseStackManager;
2019-07-24 05:31:17 +02:00
import com.griefdefender.internal.pagination.PaginationList;
import com.griefdefender.internal.registry.BlockTypeRegistryModule;
import com.griefdefender.internal.registry.EntityTypeRegistryModule;
import com.griefdefender.internal.registry.ItemTypeRegistryModule;
import com.griefdefender.internal.util.NMSUtil;
import com.griefdefender.internal.util.VecHelper;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
import com.griefdefender.internal.visual.GDClaimVisual;
2019-07-24 05:31:17 +02:00
import com.griefdefender.permission.GDPermissionHolder;
import com.griefdefender.permission.GDPermissionManager;
import com.griefdefender.permission.GDPermissionResult;
import com.griefdefender.permission.GDPermissionUser;
import com.griefdefender.permission.GDPermissions;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
import com.griefdefender.permission.flag.GDFlag;
import com.griefdefender.permission.ui.MenuType;
import com.griefdefender.permission.ui.UIHelper;
2019-07-24 05:31:17 +02:00
import com.griefdefender.text.action.GDCallbackHolder;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
import com.griefdefender.util.EconomyUtil;
2019-07-24 05:31:17 +02:00
import com.griefdefender.util.PermissionUtil;
import com.griefdefender.util.PlayerUtil;
2019-07-24 05:31:17 +02:00
import com.griefdefender.util.TaskUtil;
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.kyori.text.format.TextDecoration;
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
import net.kyori.text.serializer.plain.PlainComponentSerializer;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.economy.EconomyResponse;
public class CommandHelper {
public static Comparator<Component> PLAIN_COMPARATOR = (text1, text2) -> PlainComponentSerializer.INSTANCE.serialize(text1).compareTo(PlainComponentSerializer.INSTANCE.serialize(text2));
public static Player checkPlayer(CommandSender source) {
if (source instanceof Player) {
return ((Player) source);
} else {
return null;
}
}
public static boolean validateFlagTarget(Flag flag, String target) {
if (!(flag instanceof GDFlag)) {
return true;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
if (flag == Flags.BLOCK_BREAK || flag == Flags.BLOCK_PLACE || flag == Flags.COLLIDE_BLOCK) {
2019-07-24 05:31:17 +02:00
if (validateBlockTarget(target) ||
validateItemTarget(target)) {
return true;
}
return false;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
if (flag == Flags.ENTER_CLAIM || flag == Flags.EXIT_CLAIM || flag == Flags.ENTITY_RIDING ||
flag == Flags.ENTITY_DAMAGE || flag == Flags.PORTAL_USE) {
2019-07-24 05:31:17 +02:00
if (validateEntityTarget(target) ||
validateBlockTarget(target) ||
validateItemTarget(target)) {
return true;
}
return false;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
if (flag == Flags.INTERACT_INVENTORY) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
// Always return true due to custom inventories
return true;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
if (flag == Flags.LIQUID_FLOW || flag == Flags.INTERACT_BLOCK_PRIMARY
|| flag == Flags.INTERACT_BLOCK_SECONDARY) {
2019-07-24 05:31:17 +02:00
return validateBlockTarget(target);
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
if (flag == Flags.ENTITY_CHUNK_SPAWN || flag == Flags.ENTITY_SPAWN ||
flag == Flags.INTERACT_ENTITY_PRIMARY || flag == Flags.INTERACT_ENTITY_SECONDARY) {
2019-07-24 05:31:17 +02:00
return validateEntityTarget(target);
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
if (flag == Flags.ITEM_DROP|| flag == Flags.ITEM_PICKUP ||
flag == Flags.ITEM_SPAWN || flag == Flags.ITEM_USE) {
2019-07-24 05:31:17 +02:00
return validateItemTarget(target);
}
return true;
}
private static boolean validateEntityTarget(String target) {
if (EntityTypeRegistryModule.getInstance().getById(target).isPresent()) {
return true;
}
return false;
}
private static boolean validateItemTarget(String target) {
if (ItemTypeRegistryModule.getInstance().getById(target).isPresent()) {
return true;
}
// target could be an item block, so validate blockstate
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
//if (BlockTypeRegistryModule.getInstance().getById(target).isPresent()) {
// return true;
//}
2019-07-24 05:31:17 +02:00
return false;
}
private static boolean validateBlockTarget(String target) {
if (BlockTypeRegistryModule.getInstance().getById(target).isPresent()) {
return true;
}
return false;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static PermissionResult addFlagPermission(CommandSender src, GDPermissionHolder subject, Claim claim, Flag flag, String target, Tristate value, Set<Context> contexts) {
2019-07-24 05:31:17 +02:00
if (src instanceof Player) {
Component denyReason = ((GDClaim) claim).allowEdit((Player) src);
if (denyReason != null) {
GriefDefenderPlugin.sendMessage(src, denyReason);
return new GDPermissionResult(ResultTypes.NO_PERMISSION);
}
if (value == null) {
GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().COMMAND_INVALID);
return new GDPermissionResult(ResultTypes.FAILURE);
}
2019-07-24 05:31:17 +02:00
}
// special handling for commands
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
target = adjustTargetForTypes(target, flag);
if (flag == Flags.COMMAND_EXECUTE || flag == Flags.COMMAND_EXECUTE_PVP) {
2019-07-24 05:31:17 +02:00
target = handleCommandFlag(src, target);
if (target == null) {
// failed
return new GDPermissionResult(ResultTypes.TARGET_NOT_VALID);
}
} else {
if (!target.equalsIgnoreCase("any")) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (!target.startsWith("#") && !target.contains(":")) {
2019-07-24 05:31:17 +02:00
// assume vanilla
target = "minecraft:" + target;
}
String[] parts = target.split(":");
if (parts.length == 1) {
addFlagContexts(contexts, flag, target);
} else if (parts.length > 1 && !parts[1].equalsIgnoreCase("any")) {
addFlagContexts(contexts, flag, target);
if (!target.contains("#") && !CommandHelper.validateFlagTarget(flag, target)) {
2019-07-24 05:31:17 +02:00
return new GDPermissionResult(ResultTypes.TARGET_NOT_VALID);
}
}
} else {
target = "";
}
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
return applyFlagPermission(src, subject, claim, flag, target, value, contexts, null, false);
2019-07-24 05:31:17 +02:00
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static PermissionResult applyFlagPermission(CommandSender src, GDPermissionHolder subject, Claim claim, Flag flag, String target, Tristate value, Set<Context> contexts, MenuType flagType) {
return applyFlagPermission(src, subject, claim, flag, target, value, contexts, flagType, false);
2019-07-24 05:31:17 +02:00
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static PermissionResult applyFlagPermission(CommandSender src, GDPermissionHolder subject, Claim claim, Flag flag, String target, Tristate value, Set<Context> contexts, MenuType flagType, boolean clicked) {
2019-07-24 05:31:17 +02:00
boolean hasDefaultContext = false;
boolean hasOverrideContext = false;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
boolean replaceOverrideContext = false;
2019-07-24 05:31:17 +02:00
Component reason = null;
Iterator<Context> iterator = contexts.iterator();
while (iterator.hasNext()) {
final Context context = iterator.next();
// validate perms
if (context.getKey().equalsIgnoreCase("reason")) {
reason = LegacyComponentSerializer.legacy().deserialize(context.getValue(), '&');
iterator.remove();
continue;
}
if (hasDefaultContext || hasOverrideContext) {
continue;
}
if (context.getKey().contains("gd_claim_default")) {
hasDefaultContext = true;
} else if (context.getKey().contains("gd_claim_override")) {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (context.getValue().equalsIgnoreCase("claim")) {
iterator.remove();
replaceOverrideContext = true;
}
2019-07-24 05:31:17 +02:00
hasOverrideContext = true;
}
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (replaceOverrideContext) {
contexts.add(new Context(ContextKeys.CLAIM_OVERRIDE, claim.getUniqueId().toString()));
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
// Add target context
if (target != null && !target.isEmpty() && !target.equalsIgnoreCase("any")) {
contexts.add(new Context("target", target));
}
2019-07-24 05:31:17 +02:00
if (flagType == null) {
if (hasDefaultContext) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
flagType = MenuType.DEFAULT;
2019-07-24 05:31:17 +02:00
} else if (hasOverrideContext) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
flagType = MenuType.OVERRIDE;
2019-07-24 05:31:17 +02:00
} else {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
flagType = MenuType.CLAIM;
2019-07-24 05:31:17 +02:00
}
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
2019-07-24 05:31:17 +02:00
TextComponent.Builder builder = null;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (flagType == MenuType.OVERRIDE) {
2019-07-24 05:31:17 +02:00
builder = TextComponent.builder("OVERRIDE").color(TextColor.RED);
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
} else if (flagType == MenuType.DEFAULT) {
2019-07-24 05:31:17 +02:00
builder = TextComponent.builder("DEFAULT").color(TextColor.LIGHT_PURPLE);
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
} else if (flagType == MenuType.CLAIM) {
2019-07-24 05:31:17 +02:00
builder = TextComponent.builder("CLAIM").color(TextColor.GOLD);
if (contexts instanceof HashSet) {
contexts.add(claim.getContext());
}
}
Component flagTypeText = builder.build();
if (contexts.isEmpty()) {
// default to claim
contexts.add(claim.getContext());
}
// wilderness overrides affect all worlds
if (!contexts.contains(ClaimContexts.WILDERNESS_OVERRIDE_CONTEXT) && !contexts.contains(claim.getContext())) {
if (contexts instanceof HashSet) {
//contexts.add(claim.getWorld().getContext());
}
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
// Check if player can manage flag with contexts
if (src instanceof Player) {
final GDPermissionUser sourceUser = PermissionHolderCache.getInstance().getOrCreateUser(((Player) src));
final Tristate result = PermissionUtil.getInstance().getPermissionValue(sourceUser, GDPermissions.USER_CLAIM_FLAGS + "." + flag.getName().toLowerCase(), contexts);
if (result != Tristate.TRUE) {
GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().PERMISSION_FLAG_USE);
return new GDPermissionResult(ResultTypes.NO_PERMISSION);
}
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (subject == GriefDefenderPlugin.DEFAULT_HOLDER) {
Update for 1.5.0 * Fix blockstate id lookup not using proper id when block data was different than actual block. * Fix block-break showing air as target when source block broke on its own. * Fix race condition when migrating GP Bukkit playerdata. * Fix race condition during flag definition saves. * Fix wrong owner showing in claim when non-owner changes claim type. * Fix explosions causing no sound when cancelling event. * Fix rent min message showing max. * Fix rent min payment not being applied as credit. * Fix rent restore not working on rent end. * Fix sell sign not working when rent system was disabled. * Fix '/abandonall' not giving all money back when using economy mode. * Fix '/claimsell' requiring for sale to be turned on. * Fix '/givepet' taming pets without owner. * Fix explosion sounds not triggering on cancel. * Fix pvp 'allow-fly' only affecting creative mode. * Fix confirmation message not showing after abandoning a subdivision. * Fix wrong location being checked when placing water/lava with bucket. * Fix dynmap owner style colors not being used. * Fix NPE when using /reload. * Fix ghost claim overlap error when creating claim. * Fix user showing up as cause when using rtp. * Fix high memory usage caused by GDClaimManager fastutil usage. * (Bukkit) Fix NPE during InventoryMoveItemEvent. * (Sponge) Fix explosion-surface being triggered with no settings. * Refactor CompletableFuture handling when applying LP permissions and meta to avoid race conditions. * Remove owner override context for flag definition 'fire-spread' as it doesn't affect global overrides. * Change flag definition 'turtle-egg-hatch' target from 'air' to 'turtle-egg-hatch' * Change flag definition 'snow-melt' target from 'air' to 'snow' * Change onPlayerInteractBlockSecondary event priority from lowest to low in order to support plugins that need to cancel early. * Add support for CustomItems. Any customitem used in game will show up in debug as customitems:<item_id>. You can also use customitems for modification and investigation tool in config. * Add support for Slimefun4. Any slimefun item/block used in game will show up in debug as slimefun:<id>. You can also use slimefun items for modification and investigation tool in config. * Add '/acball' command for adjusting all online players' bonus blocks. * Add '/claiminvestigate' command to investigate claims. * Add '/claimtool' to toggle claim tool usage. * Add source/target any contexts to flag definitions. * Add 'piston-protection-in-claims' setting to control piston protection within claims. * Add pvp setting 'combat-logout' to determine if a player should be killed on logout during combat. Default 'false'. * Add `projectile-impact-entity` to `endcrystal-use` flag definition. * Add aquatic target for `monster-animal-damage` flag definition. * Add `restrict-world-max-height` to determine if claiming should be restricted to world max height. Default 'true'. * Add ability to control dynmap color settings by claim type. * Add permission griefdefender.user.claim.command.info.teleport.inside which controls whether a player can ONLY teleport within the claim they are in. This is useful if players become trapped. Note: This does not allow players to teleport to any other claim except the one they are in. It can only be used if the player cannot build in claim. * Add permission griefdefender.user.claim.command.info.others.creation-date to control whether a player sees creation date in /claiminfo * Add permission griefdefender.user.claim.command.info.others.last-active to control whether a player sees last active date in /claiminfo * Add permission griefdefender.user.claim.command.info.others.claim-uuid to control whether a player sees claim uuid in /claiminfo * All flag definitions will now persist. * Refresh player option cache on permission change. * Show TP info in '/claiminfo' when player does not have TP permission. * (Sponge) Use 'tnt' as identifier instead of 'primedtnt' to match bukkit. * (Sponge) Use 'item_frame' as identifier instead of 'itemframe' to match bukkit.
2020-08-16 06:39:38 +02:00
if (flagType == MenuType.OVERRIDE) {
PermissionUtil.getInstance().setPermissionValue(GriefDefenderPlugin.GD_OVERRIDE_HOLDER, flag, value, contexts);
} else if (flagType == MenuType.CLAIM) {
PermissionUtil.getInstance().setPermissionValue(GriefDefenderPlugin.GD_CLAIM_HOLDER, flag, value, contexts);
} else {
PermissionUtil.getInstance().setPermissionValue(GriefDefenderPlugin.GD_DEFAULT_HOLDER, flag, value, contexts);
}
if (!clicked && src instanceof Player) {
2019-07-24 05:31:17 +02:00
TextAdapter.sendComponent(src, TextComponent.builder("")
.append(TextComponent.builder("\n[").append(MessageCache.getInstance().FLAG_UI_RETURN_FLAGS.color(TextColor.AQUA)).append("]\n")
2019-07-24 05:31:17 +02:00
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createCommandConsumer(src, "claimflag", "")))).build())
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.append(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.FLAG_SET_PERMISSION_TARGET,
ImmutableMap.of(
"type", flagTypeText,
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
"permission", flag.getPermission(),
"contexts", getFriendlyContextString(claim, contexts),
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
"value", getClickableText(src, (GDClaim) claim, subject, contexts, flag, value, flagType).color(TextColor.LIGHT_PURPLE),
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
"target", MessageCache.getInstance().TITLE_ALL)))
.build());
2019-07-24 05:31:17 +02:00
}
} else {
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
PermissionUtil.getInstance().setPermissionValue(subject, flag, value, contexts);
if (!clicked && src instanceof Player) {
2019-07-24 05:31:17 +02:00
TextAdapter.sendComponent(src, TextComponent.builder("")
.append(TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().FLAG_UI_RETURN_FLAGS.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n", TextColor.WHITE)
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createCommandConsumer(src, subject instanceof GDPermissionUser ? "claimflagplayer" : "claimflaggroup", subject.getFriendlyName())))).build())
.append(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.FLAG_SET_PERMISSION_TARGET,
ImmutableMap.of(
"type", flagTypeText,
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
"permission", flag.getPermission(),
"contexts", getFriendlyContextString(claim, contexts),
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
"value", getClickableText(src, (GDClaim) claim, subject, contexts, flag, value, flagType).color(TextColor.LIGHT_PURPLE),
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
"target", subject.getFriendlyName())))
.build());
2019-07-24 05:31:17 +02:00
}
}
return new GDPermissionResult(ResultTypes.SUCCESS);
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
public static String adjustTargetForTypes(String target, Flag flag) {
if (target.equals("player") || target.equals("minecraft:player") || target.equalsIgnoreCase("any")) {
return target;
}
if (flag.getName().contains("entity") || flag == Flags.ITEM_SPAWN) {
final String contextKey = "target";
String[] parts = target.split(":");
String targetId = "";
if (parts.length == 1) {
targetId = parts[0];
} else {
targetId = parts[1];
}
if (targetId.equalsIgnoreCase("animal")) {
return "#animal";
} else if (targetId.equalsIgnoreCase("aquatic")) {
return "#aquatic";
} else if (targetId.equalsIgnoreCase("monster")) {
return "#monster";
} else if (targetId.equalsIgnoreCase("ambient")) {
return "#ambient";
}
return target;
} else {
if ((target.equals("food") || target.endsWith(":food")) && !target.startsWith("#")) {
target = "#" + target;
}
}
return target;
}
public static void addFlagContexts(Set<Context> contexts, Flag flag, String target) {
if (target.equals("player") || target.equals("minecraft:player") || target.equalsIgnoreCase("any")) {
return;
}
if (flag.getName().contains("entity") || flag == Flags.ITEM_SPAWN) {
final String contextKey = "target";
String[] parts = target.split(":");
if (parts.length == 1) {
contexts.add(new Context(contextKey, target));
return;
}
if (parts[1].equalsIgnoreCase("animal")) {
contexts.add(new Context(contextKey, "#animal"));
} else if (parts[1].equalsIgnoreCase("aquatic")) {
contexts.add(new Context(contextKey, "#aquatic"));
} else if (parts[1].equalsIgnoreCase("monster")) {
contexts.add(new Context(contextKey, "#monster"));
} else if (parts[1].equalsIgnoreCase("ambient")) {
contexts.add(new Context(contextKey, "#ambient"));
} else {
contexts.add(new Context(contextKey, target));
}
}
}
public static Component getFriendlyContextString(Claim claim, Set<Context> contexts) {
if (contexts.isEmpty()) {
return TextComponent.of("[]", TextColor.WHITE);
}
TextComponent.Builder builder = TextComponent.builder();
2019-07-24 05:31:17 +02:00
final Iterator<Context> iterator = contexts.iterator();
while (iterator.hasNext()) {
final Context context = iterator.next();
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
builder.append("\n[", TextColor.WHITE)
.append(context.getKey(), TextColor.GREEN)
.append("=", TextColor.GRAY)
.append(context.getValue(), TextColor.WHITE);
if (iterator.hasNext()) {
builder.append("], ");
} else {
builder.append("]");
2019-07-24 05:31:17 +02:00
}
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
return builder.build();
2019-07-24 05:31:17 +02:00
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
public static TextColor getPermissionMenuTypeColor(MenuType type) {
2019-07-24 05:31:17 +02:00
TextColor color = TextColor.LIGHT_PURPLE;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (type == MenuType.CLAIM) {
2019-07-24 05:31:17 +02:00
color = TextColor.GOLD;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
} else if (type == MenuType.OVERRIDE) {
2019-07-24 05:31:17 +02:00
color = TextColor.RED;
}
return color;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static Consumer<CommandSender> createFlagConsumer(CommandSender src, GDClaim claim, Subject subject, Set<Context> contexts, Flag flag, Tristate flagValue, MenuType flagType) {
2019-07-24 05:31:17 +02:00
return consumer -> {
Tristate newValue = Tristate.UNDEFINED;
if (flagValue == Tristate.TRUE) {
newValue = Tristate.FALSE;
} else if (flagValue == Tristate.UNDEFINED) {
newValue = Tristate.TRUE;
}
Component flagTypeText = TextComponent.empty();
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (flagType == MenuType.OVERRIDE) {
2019-07-24 05:31:17 +02:00
flagTypeText = TextComponent.of("OVERRIDE", TextColor.RED);
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
} else if (flagType == MenuType.DEFAULT) {
2019-07-24 05:31:17 +02:00
flagTypeText = TextComponent.of("DEFAULT", TextColor.LIGHT_PURPLE);
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
} else if (flagType == MenuType.CLAIM) {
2019-07-24 05:31:17 +02:00
flagTypeText = TextComponent.of("CLAIM", TextColor.GOLD);
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
2019-07-24 05:31:17 +02:00
Set<Context> newContexts = new HashSet<>(contexts);
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
PermissionUtil.getInstance().setPermissionValue(GriefDefenderPlugin.DEFAULT_HOLDER, flag, newValue, newContexts);
2019-07-24 05:31:17 +02:00
TextAdapter.sendComponent(src, TextComponent.builder("")
.append("Set ", TextColor.GREEN)
.append(flagTypeText)
.append(" permission ")
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
.append(flag.getName().toLowerCase(), TextColor.AQUA)
2019-07-24 05:31:17 +02:00
.append("\n to ", TextColor.GREEN)
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
.append(getClickableText(src, (GDClaim) claim, subject, newContexts, flag, newValue, flagType).color(TextColor.LIGHT_PURPLE))
2019-07-24 05:31:17 +02:00
.append(" for ", TextColor.GREEN)
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.append(subject.getFriendlyName(), TextColor.GOLD).build());
2019-07-24 05:31:17 +02:00
};
}
public static Consumer<CommandSender> createCommandConsumer(CommandSender src, String command, String arguments) {
return createCommandConsumer(src, command, arguments, null);
}
public static Consumer<CommandSender> createCommandConsumer(CommandSender src, String command, String arguments, Consumer<CommandSender> postConsumerTask) {
return consumer -> {
if (!NMSUtil.getInstance().getBukkitCommandMap().dispatch(src, command + " " + arguments)) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
TextAdapter.sendComponent(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_EXECUTE_FAILED,
ImmutableMap.of(
"command", command,
"args", arguments)));
2019-07-24 05:31:17 +02:00
}
if (postConsumerTask != null) {
postConsumerTask.accept(src);
}
};
}
public static void executeCommand(CommandSender src, String command, String arguments) {
if (!NMSUtil.getInstance().getBukkitCommandMap().dispatch(src, command + " " + arguments)) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
TextAdapter.sendComponent(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_EXECUTE_FAILED,
ImmutableMap.of(
"command", command,
"args", arguments)));
2019-07-24 05:31:17 +02:00
}
}
public static void showClaims(CommandSender src, Set<Claim> claims) {
if (claims.isEmpty()) {
// do nothing
return;
}
showClaims(src, claims, 0, false);
}
public static void showOverlapClaims(CommandSender src, Set<Claim> claims, int height) {
showClaims(src, claims, height, true, true);
}
public static void showClaims(CommandSender src, Set<Claim> claims, int height, boolean visualizeClaims) {
showClaims(src, claims, height, visualizeClaims, false);
}
public static void showClaims(CommandSender src, Set<Claim> claims, int height, boolean visualizeClaims, boolean overlap) {
final String worldName = src instanceof Player ? ((Player) src).getWorld().getName() : Bukkit.getWorlds().get(0).getName();
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
List<Component> claimsTextList = generateClaimTextList(new ArrayList<Component>(), claims, worldName, null, src, createShowClaimsConsumer(src, claims, height, visualizeClaims), false, overlap, false);
2019-07-24 05:31:17 +02:00
if (visualizeClaims && src instanceof Player) {
Player player = (Player) src;
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getOrCreatePlayerData(player.getWorld(), player.getUniqueId());
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final boolean hideBorders = GriefDefenderPlugin.getInstance().getWorldEditProvider() != null &&
GriefDefenderPlugin.getInstance().getWorldEditProvider().hasCUISupport(player) &&
GriefDefenderPlugin.getActiveConfig(player.getWorld().getUID()).getConfig().visual.hideBorders;
2019-07-24 05:31:17 +02:00
if (claims.size() > 1) {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (!hideBorders) {
if (height != 0) {
height = playerData.lastValidInspectLocation != null ? playerData.lastValidInspectLocation.getBlockY() : player.getEyeLocation().getBlockY();
}
for (Claim claim : claims) {
GDClaimVisual visualization = GDClaimVisual.fromClaim(claim, playerData.getClaimCreateMode() == CreateModeTypes.VOLUME ? height : player.getEyeLocation().getBlockY(), player.getLocation(), playerData, null);
visualization.apply(player);
}
2019-07-24 05:31:17 +02:00
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (GriefDefenderPlugin.getInstance().getWorldEditProvider() != null) {
GriefDefenderPlugin.getInstance().getWorldEditProvider().visualizeClaims(claims, player, playerData, true);
}
2019-07-24 05:31:17 +02:00
} else {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (!hideBorders) {
for (Claim claim : claims) {
GDClaim gdClaim = (GDClaim) claim;
final GDClaimVisual visual = gdClaim.getVisualizer();
if (visual.getVisualTransactions().isEmpty()) {
visual.createClaimBlockVisuals(height, player.getLocation(), playerData);
}
visual.apply(player);
}
2019-07-24 05:31:17 +02:00
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (GriefDefenderPlugin.getInstance().getWorldEditProvider() != null) {
GriefDefenderPlugin.getInstance().getWorldEditProvider().visualizeClaims(claims, player, playerData, true);
}
2019-07-24 05:31:17 +02:00
}
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (!claimsTextList.isEmpty()) {
PaginationList.Builder builder = PaginationList.builder().title(MessageCache.getInstance().CLAIMLIST_UI_TITLE.color(TextColor.RED)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(claimsTextList);
builder.sendTo(src);
}
2019-07-24 05:31:17 +02:00
}
private static Consumer<CommandSender> createShowClaimsConsumer(CommandSender src, Set<Claim> claims, int height, boolean visualizeClaims) {
return consumer -> {
showClaims(src, claims, height, visualizeClaims);
};
}
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
public static List<Component> generateClaimTextListCommand(List<Component> claimsTextList, Set<Claim> claimList, String worldName, GDPermissionUser user, CommandSender src, Consumer<CommandSender> returnCommand, boolean listChildren) {
return generateClaimTextList(claimsTextList, claimList, worldName, user, src, returnCommand, listChildren, false, true);
2019-07-24 05:31:17 +02:00
}
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
public static List<Component> generateClaimTextList(List<Component> claimsTextList, Set<Claim> claimList, String worldName, GDPermissionUser user, CommandSender src, Consumer<CommandSender> returnCommand, boolean listChildren) {
return generateClaimTextList(claimsTextList, claimList, worldName, user, src, returnCommand, listChildren, false, false);
}
public static List<Component> generateClaimTextList(List<Component> claimsTextList, Set<Claim> claimList, String worldName, GDPermissionUser user, CommandSender src, Consumer<CommandSender> returnCommand, boolean listChildren, boolean overlap, boolean listCommand) {
2019-07-24 05:31:17 +02:00
if (claimList.size() > 0) {
final Player player = src instanceof Player ? (Player) src : null;
2019-07-24 05:31:17 +02:00
for (Claim playerClaim : claimList) {
GDClaim claim = (GDClaim) playerClaim;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (player != null && claim.getEconomyData() != null && !claim.getEconomyData().isForSale()
&& !claim.getEconomyData().isForRent() && (claim.allowEdit(player) != null && !claim.isUserTrusted(player, TrustTypes.ACCESSOR))) {
continue;
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (!listCommand && !overlap && !listChildren && (claim.isSubdivision() && claimList.size() > 1)
&& claim.getEconomyData() != null && !claim.getEconomyData().isForSale() && !claim.getEconomyData().isForRent()) {
2019-07-24 05:31:17 +02:00
continue;
}
double teleportHeight = claim.getOwnerPlayerData() == null ? 65.0D : (claim.getOwnerMinClaimLevel() > 65.0D ? claim.getOwnerMinClaimLevel() : 65);
Vector3i lesserPos = claim.lesserBoundaryCorner;
Vector3i greaterPos = claim.greaterBoundaryCorner;
Vector3i center = claim.lesserBoundaryCorner.add(lesserPos.getX(), lesserPos.getY(), lesserPos.getZ()).div(2);
Vector3i newCenter = new Vector3i(center.getX(), teleportHeight, center.getZ());
Vector3i southWest = new Vector3i(newCenter.getX(), newCenter.getY(), newCenter.getZ());
//final double teleportHeight = claim.getOwnerPlayerData() == null ? 65.0D : (claim.getOwnerPlayerData().getMinClaimLevel() > 65.0D ? claim.getOwnerPlayerData().getMinClaimLevel() : 65);
//Location<World> southWest = claim.lesserBoundaryCorner.setPosition(new Vector3d(claim.lesserBoundaryCorner.getPosition().getX(), teleportHeight, claim.greaterBoundaryCorner.getPosition().getZ()));
Component claimName = claim.getData().getName().orElse(TextComponent.empty());
Component teleportName = claim.getData().getName().orElse(claim.getFriendlyNameType());
Component ownerLine = TextComponent.builder()
.append(MessageCache.getInstance().LABEL_OWNER.color(TextColor.YELLOW))
2019-07-24 05:31:17 +02:00
.append(" : ", TextColor.WHITE)
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.append(claim.getOwnerDisplayName().color(TextColor.GOLD))
2019-07-24 05:31:17 +02:00
.append("\n").build();
Component claimTypeInfo = TextComponent.builder("Type").color(TextColor.YELLOW)
.append(" : ", TextColor.WHITE)
.append(claim.getFriendlyNameType())
.append(" ")
.append(claim.isCuboid() ? "3D " : "2D ", TextColor.GRAY)
.append(" (")
.append(MessageCache.getInstance().LABEL_AREA)
.append(": ", TextColor.WHITE)
2019-07-24 05:31:17 +02:00
.append(String.valueOf(claim.getClaimBlocks()), TextColor.GRAY)
.append(" blocks)\n", TextColor.WHITE).build();
Component clickInfo = MessageCache.getInstance().CLAIMLIST_UI_CLICK_INFO;
2019-07-24 05:31:17 +02:00
Component basicInfo = TextComponent.builder("")
.append(ownerLine)
.append(claimTypeInfo)
.append(clickInfo).build();
Component claimInfoCommandClick = TextComponent.builder("")
.append(claim.getFriendlyNameType())
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "claiminfo", claim.getUniqueId().toString(), createReturnClaimListConsumer(src, returnCommand)))))
.hoverEvent(HoverEvent.showText(basicInfo)).build();
Component claimSpawn = null;
if (player !=null && PermissionUtil.getInstance().canPlayerTeleport(player, claim)) {
final Vector3i spawnPos = claim.getData().getSpawnPos().orElse(null);
if (spawnPos != null) {
Location spawnLoc = new Location(claim.getWorld(), spawnPos.getX(), spawnPos.getY(), spawnPos.getZ());
claimSpawn = TextComponent.builder("")
.append("[")
.append("TP", TextColor.LIGHT_PURPLE)
.append("]")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(src, spawnLoc, claim, true))))
.hoverEvent(HoverEvent.showText(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TELEPORT_TARGET,
ImmutableMap.of(
"name", teleportName,
"target", "'s spawn @ " + spawnPos.toString(),
"world", claim.getWorld().getName()))))
.build();
} else {
claimSpawn = TextComponent.builder("")
.append("[")
.append("TP", TextColor.LIGHT_PURPLE)
.append("]")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createTeleportConsumer(src, VecHelper.toLocation(claim.getWorld(), southWest), claim))))
.hoverEvent(HoverEvent.showText(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TELEPORT_TARGET,
ImmutableMap.of(
"name", teleportName,
"target", southWest.toString(),
"world", claim.getWorld().getName()))))
.build();
}
2019-07-24 05:31:17 +02:00
}
List<Component> childrenTextList = new ArrayList<>();
if (!listChildren) {
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
childrenTextList = generateClaimTextList(new ArrayList<Component>(), claim.getChildren(true), worldName, user, src, returnCommand, true);
2019-07-24 05:31:17 +02:00
}
Component buyClaim = TextComponent.empty();
if (player != null && claim.getEconomyData().isForSale() && claim.getEconomyData().getSalePrice() > -1) {
Component buyInfo = TextComponent.builder()
.append(MessageCache.getInstance().LABEL_PRICE.color(TextColor.AQUA))
.append(" : ", TextColor.WHITE)
2019-07-24 05:31:17 +02:00
.append(String.valueOf(claim.getEconomyData().getSalePrice()), TextColor.GOLD)
.append("\n")
.append(MessageCache.getInstance().CLAIMLIST_UI_CLICK_PURCHASE).build();
2019-07-24 05:31:17 +02:00
buyClaim = TextComponent.builder()
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.append(TextComponent.builder(" [").append(MessageCache.getInstance().LABEL_BUY.color(TextColor.GREEN)).append("]", TextColor.WHITE).build())
2019-07-24 05:31:17 +02:00
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(buyClaimConsumerConfirmation(src, claim))))
.hoverEvent(HoverEvent.showText(player.getUniqueId().equals(claim.getOwnerUniqueId()) ? MessageCache.getInstance().CLAIM_OWNER_ALREADY : buyInfo)).build();
2019-07-24 05:31:17 +02:00
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
Component rentClaim = TextComponent.empty();
if (player != null && claim.getEconomyData().isForRent() && player.hasPermission(GDPermissions.USER_RENT_BASE)) {
Component rentInfo = TextComponent.builder()
.append(MessageCache.getInstance().LABEL_PRICE.color(TextColor.AQUA))
.append(" : ", TextColor.WHITE)
.append(String.valueOf(claim.getEconomyData().getRentRate() + " per " + (claim.getEconomyData().getPaymentType() == PaymentType.DAILY ? "day" : "hour")), TextColor.GOLD)
.append("\n")
.append(MessageCache.getInstance().CLAIMLIST_UI_CLICK_RENT).build();
rentClaim = TextComponent.builder()
.append(TextComponent.builder(" [").append(MessageCache.getInstance().LABEL_RENT.color(TextColor.GREEN)).append("]", TextColor.WHITE).build())
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(EconomyUtil.getInstance().rentClaimConsumerConfirmation(src, claim))))
.hoverEvent(HoverEvent.showText(player.getUniqueId().equals(claim.getOwnerUniqueId()) ? MessageCache.getInstance().CLAIM_OWNER_ALREADY : rentInfo)).build();
}
2019-07-24 05:31:17 +02:00
if (!childrenTextList.isEmpty()) {
Component children = TextComponent.builder("[")
.append(MessageCache.getInstance().LABEL_CHILDREN.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]", TextColor.WHITE)
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(showChildrenList(childrenTextList, src, returnCommand, claim))))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMLIST_UI_CLICK_VIEW_CHILDREN)).build();
2019-07-24 05:31:17 +02:00
claimsTextList.add(TextComponent.builder("")
.append(claimSpawn != null ? claimSpawn.append(TextComponent.of(" ")) : TextComponent.of(""))
2019-07-24 05:31:17 +02:00
.append(claimInfoCommandClick)
.append(" : ", TextColor.WHITE)
.append(claim.getOwnerDisplayName().color(TextColor.GOLD)
.clickEvent(ClickEvent.suggestCommand("/claimlist " + claim.getOwnerName()))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMLIST_UI_CLICK_PLAYER_LIST)))
2019-07-24 05:31:17 +02:00
.append(" ")
.append(claimName == TextComponent.empty() ? TextComponent.of("") : claimName)
.append(" ")
.append(children)
.append(" ")
2019-07-24 05:31:17 +02:00
.append(buyClaim)
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.append(" ")
.append(rentClaim)
2019-07-24 05:31:17 +02:00
.build());
} else {
claimsTextList.add(TextComponent.builder("")
.append(claimSpawn != null ? claimSpawn.append(TextComponent.of(" ")) : TextComponent.of(""))
2019-07-24 05:31:17 +02:00
.append(claimInfoCommandClick)
.append(" : ", TextColor.WHITE)
.append(claim.getOwnerDisplayName().color(TextColor.GOLD)
.clickEvent(ClickEvent.suggestCommand("/claimlist " + claim.getOwnerName()))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().CLAIMLIST_UI_CLICK_PLAYER_LIST)))
2019-07-24 05:31:17 +02:00
.append(" ")
.append(claimName == TextComponent.empty() ? TextComponent.of("") : claimName)
.append(buyClaim)
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.append(" ")
.append(rentClaim)
2019-07-24 05:31:17 +02:00
.build());
}
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (claimsTextList.size() == 0 && player != null) {
final GDPermissionUser srcUser = PermissionHolderCache.getInstance().getOrCreateUser(player);
if (srcUser.getInternalPlayerData().showNoClaimsFoundMessage) {
claimsTextList.add(MessageCache.getInstance().CLAIMLIST_UI_NO_CLAIMS_FOUND.color(TextColor.RED));
} else {
srcUser.getInternalPlayerData().showNoClaimsFoundMessage = true;
}
2019-07-24 05:31:17 +02:00
}
}
return claimsTextList;
}
public static Consumer<CommandSender> buyClaimConsumerConfirmation(CommandSender src, Claim claim) {
return confirm -> {
final Player player = (Player) src;
if (player.getUniqueId().equals(claim.getOwnerUniqueId())) {
return;
}
final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
if (!economy.hasAccount(player)) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_PLAYER_NOT_FOUND, ImmutableMap.of(
"player", player.getName()));
GriefDefenderPlugin.sendMessage(player, message);
2019-07-24 05:31:17 +02:00
return;
}
final double balance = economy.getBalance(player);
2019-07-24 05:31:17 +02:00
if (balance < claim.getEconomyData().getSalePrice()) {
Map<String, Object> params = ImmutableMap.of(
"amount", claim.getEconomyData().getSalePrice(),
2019-07-24 05:31:17 +02:00
"balance", balance,
"amount_required", claim.getEconomyData().getSalePrice() - balance);
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_NOT_ENOUGH_FUNDS, params));
2019-07-24 05:31:17 +02:00
return;
}
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_CONFIRMATION,
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
ImmutableMap.of("amount", "$" + claim.getEconomyData().getSalePrice()));
final Component buyConfirmationText = TextComponent.builder()
.append(message)
.append(TextComponent.builder()
.append("\n[")
.append(MessageCache.getInstance().LABEL_CONFIRM.color(TextColor.GREEN))
.append("]\n")
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(src, createBuyConsumerConfirmed(src, claim), true))).build())
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.build();
GriefDefenderPlugin.sendMessage(player, buyConfirmationText);
2019-07-24 05:31:17 +02:00
};
}
private static Consumer<CommandSender> createBuyConsumerConfirmed(CommandSender src, Claim claim) {
return confirm -> {
final Player player = (Player) src;
final GDPermissionUser owner = PermissionHolderCache.getInstance().getOrCreateUser(claim.getOwnerUniqueId());
final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
if (!economy.hasAccount(owner.getOfflinePlayer())) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_PLAYER_NOT_FOUND, ImmutableMap.of(
"player", owner.getName()));
GriefDefenderPlugin.sendMessage(player, message);
2019-07-24 05:31:17 +02:00
return;
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
GDCauseStackManager.getInstance().pushCause(player);
final ClaimResult result = ((GDClaim) claim).transferOwner(player.getUniqueId(), true, false);
2019-07-24 05:31:17 +02:00
if (!result.successful()) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
final Component defaultMessage = MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_TRANSFER_CANCELLED,
ImmutableMap.of(
"owner", owner.getName(),
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
"player", player.getName(),
"result", result.getMessage().orElse(TextComponent.of(result.getResultType().toString()))));
2019-07-24 05:31:17 +02:00
TextAdapter.sendComponent(src, result.getMessage().orElse(defaultMessage));
return;
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final double balance = economy.getBalance(player);
if (balance < claim.getEconomyData().getSalePrice()) {
Map<String, Object> params = ImmutableMap.of(
"amount", claim.getEconomyData().getSalePrice(),
"balance", balance,
"amount_required", claim.getEconomyData().getSalePrice() - balance);
GriefDefenderPlugin.sendMessage(player, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_NOT_ENOUGH_FUNDS, params));
return;
}
2019-07-24 05:31:17 +02:00
final double salePrice = claim.getEconomyData().getSalePrice();
final EconomyResponse response = economy.depositPlayer(owner.getOfflinePlayer(), salePrice);
if (response.transactionSuccess()) {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final EconomyResponse withdrawResponse = EconomyUtil.getInstance().withdrawFunds(player, salePrice);
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_BUY_CONFIRMED,
ImmutableMap.of(
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
"amount", String.valueOf("$" +salePrice)));
final Component saleMessage = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.ECONOMY_CLAIM_SOLD,
ImmutableMap.of(
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
"amount", String.valueOf("$" +salePrice),
"balance",String.valueOf("$" + economy.getBalance(owner.getOfflinePlayer()))));
if (owner.getOnlinePlayer() != null) {
TextAdapter.sendComponent(owner.getOnlinePlayer(), saleMessage);
}
claim.getEconomyData().setForSale(false);
claim.getEconomyData().setSalePrice(0);
claim.getData().save();
GriefDefenderPlugin.sendMessage(src, message);
2019-07-24 05:31:17 +02:00
}
};
}
public static Consumer<CommandSender> showChildrenList(List<Component> childrenTextList, CommandSender src, Consumer<CommandSender> returnCommand, GDClaim parent) {
return consumer -> {
Component claimListReturnCommand = TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().CLAIMLIST_UI_RETURN_CLAIMSLIST.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n", TextColor.WHITE)
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(returnCommand))).build();
List<Component> textList = new ArrayList<>();
textList.add(claimListReturnCommand);
textList.addAll(childrenTextList);
PaginationList.Builder builder = PaginationList.builder()
.title(parent.getName().orElse(parent.getFriendlyNameType())
.append(TextComponent.of(" ").append(MessageCache.getInstance().CLAIMLIST_UI_TITLE_CHILD_CLAIMS))).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList);
2019-07-24 05:31:17 +02:00
builder.sendTo(src);
};
}
public static Consumer<CommandSender> createReturnClaimListConsumer(CommandSender src, Consumer<CommandSender> returnCommand) {
return consumer -> {
Component claimListReturnCommand = TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().CLAIMLIST_UI_RETURN_CLAIMSLIST.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n", TextColor.WHITE)
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(returnCommand))).build();
TextAdapter.sendComponent(src, claimListReturnCommand);
};
}
public static Consumer<CommandSender> createReturnClaimListConsumer(CommandSender src, String arguments) {
return consumer -> {
Component claimListReturnCommand = TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().CLAIMLIST_UI_RETURN_CLAIMSLIST.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n", TextColor.WHITE)
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "/claimslist", arguments)))).build();
TextAdapter.sendComponent(src, claimListReturnCommand);
};
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static Consumer<CommandSender> createFlagConsumer(CommandSender src, GDPermissionHolder subject, String subjectName, Set<Context> contexts, GDClaim claim, Flag flag, Tristate flagValue, String source) {
2019-07-24 05:31:17 +02:00
return consumer -> {
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
String target = flag.getName().toLowerCase();
2019-07-24 05:31:17 +02:00
if (target.isEmpty()) {
target = "any";
}
Tristate newValue = Tristate.UNDEFINED;
if (flagValue == Tristate.TRUE) {
newValue = Tristate.FALSE;
} else if (flagValue == Tristate.UNDEFINED) {
newValue = Tristate.TRUE;
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
CommandHelper.applyFlagPermission(src, subject, claim, flag, target, newValue, null, MenuType.GROUP);
2019-07-24 05:31:17 +02:00
};
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static Component getClickableText(CommandSender src, GDClaim claim, Subject subject, Set<Context> contexts, Flag flag, Tristate flagValue, MenuType type) {
2019-07-24 05:31:17 +02:00
TextComponent.Builder textBuilder = TextComponent.builder(flagValue.toString().toLowerCase())
.hoverEvent(HoverEvent.showText(TextComponent.builder("")
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.append(MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TOGGLE_VALUE,
ImmutableMap.of("type", type.name().toLowerCase())))
2019-07-24 05:31:17 +02:00
.append("\n")
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.append(UIHelper.getPermissionMenuTypeHoverText(type)).build()))
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, claim, subject, contexts, flag, flagValue, type))));
2019-07-24 05:31:17 +02:00
return textBuilder.build();
}
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
public static Component getClickableText(CommandSender src, GDPermissionHolder subject, String subjectName, Set<Context> contexts, GDClaim claim, Flag flag, Tristate flagValue, String source, MenuType type) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
Component onClickText = MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.CLAIMLIST_UI_CLICK_TOGGLE_VALUE,
ImmutableMap.of("type", "flag"));
2019-07-24 05:31:17 +02:00
boolean hasPermission = true;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (type == MenuType.INHERIT) {
onClickText = MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.FLAG_UI_INHERIT_PARENT,
ImmutableMap.of("name", claim.getFriendlyNameType()));
2019-07-24 05:31:17 +02:00
hasPermission = false;
} else if (src instanceof Player) {
Component denyReason = claim.allowEdit((Player) src);
if (denyReason != null) {
onClickText = denyReason;
hasPermission = false;
}
}
TextComponent.Builder textBuilder = TextComponent.builder(flagValue.toString().toLowerCase())
.hoverEvent(HoverEvent.showText(TextComponent.builder("")
.append(onClickText)
.append("\n")
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
.append(UIHelper.getPermissionMenuTypeHoverText(type)).build()));
2019-07-24 05:31:17 +02:00
if (hasPermission) {
Finish implementing options for next major release. * Fixed '/cfg' and '/cog' commands. * Fixed 'create-mode' not working as intended. * Fixed 'any' usage with flag commands. * Fixed 'command-execute' usage. * Fixed 'command-execute-pvp' usage. * Fixed option removal/save with LP v5. * Added context support for controlling user flag command usage. * Added context support to option GUI. * Added permission 'griefdefender.user.claim.command.flag.arg' which controls if a user can use flag command with arguments. * Added permission 'griefdefender.user.claim.command.flag.gui' which controls if a user can use flag GUI. * Added new group context '#all' which can be used to represent all sources or targets. * Removed 'max-claim-inspection-distance' from config as it is now controlled by 'radius-inspect' option. * Removed 'combat-timeout' from config as it is now controlled by 'pvp-combat-timeout' option. * Implemented the folloing new options 'player-command-enter' - Handles executing commands when a player enters a claim. 'player-command-exit' - Handles executing commands when a player exits a claim. Note: both command options support the following placeholders : %player%, %owner%, %uuid%, %world%, %server%, %location% 'player-gamemode' - Used to determine the gamemode of a player when entering a claim. 'player-deny-godmode' - Used to determine if a player can be in godmode when entering a claim. 'player-walk-speed' - Controls the player walk speed when entering a claim. 'player-weather' - Controls player local weather when entering a claim. 'pvp-combat-command' - Used to determine if a player can use commands during PvP combat. 'pvp-combat-teleport' - Used to determine if a player can teleport during PvP combat. 'pvp-combat-timeout' - Used to determine how many seconds PvP combat is considered to continue after the most recent damage. 'radius-inspect' - Controls the radius in blocks to search within when inspecting for claims. 'spawn-limit' - Used to control the spawn limit for a specific set of entities in a claim. * Only save once when toggling flag definitions that include multiple definitions.
2019-12-31 00:25:55 +01:00
textBuilder.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createFlagConsumer(src, subject, subjectName, contexts, claim, flag, flagValue, source))));
2019-07-24 05:31:17 +02:00
}
return textBuilder.build();
}
public static String handleCommandFlag(CommandSender src, String target) {
String pluginId = "minecraft";
String args = "";
String command = "";
int argsIndex = target.indexOf("[");
if (argsIndex != -1) {
if (argsIndex == 0) {
// invalid
TextAdapter.sendComponent(src, MessageCache.getInstance().COMMAND_INVALID);
2019-07-24 05:31:17 +02:00
return null;
}
command = target.substring(0, argsIndex);
String[] parts = command.split(":");
if (parts.length > 1) {
pluginId = parts[0];
command = parts[1];
}
if (!validateCommandMapping(src, command, pluginId)) {
return null;
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
if (!pluginId.equals("minecraft")) {
Plugin pluginContainer = Bukkit.getPluginManager().getPlugin(pluginId);
2019-07-24 05:31:17 +02:00
if (pluginContainer == null) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
TextAdapter.sendComponent(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.PLUGIN_NOT_FOUND,
ImmutableMap.of("id", pluginId)));
2019-07-24 05:31:17 +02:00
return null;
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
}
2019-07-24 05:31:17 +02:00
args = target.substring(argsIndex, target.length());
Pattern p = Pattern.compile("\\[([^\\]]+)\\]");
Matcher m = p.matcher(args);
if (!m.find()) {
// invalid
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
TextAdapter.sendComponent(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.COMMAND_EXECUTE_FAILED,
ImmutableMap.of(
"command", command,
"args", args)));
2019-07-24 05:31:17 +02:00
return null;
}
args = m.group(1);
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
target = pluginId + ":" + command + "." + args.replace(":", ".");
2019-07-24 05:31:17 +02:00
} else {
String[] parts = target.split(":");
if (parts.length > 1) {
pluginId = parts[0];
command = parts[1];
} else {
command = target;
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
target = pluginId + ":" + command;
2019-07-24 05:31:17 +02:00
}
// validate command
if (!validateCommandMapping(src, command, pluginId)) {
return null;
}
return target;
}
private static boolean validateCommandMapping(CommandSender src, String command, String pluginId) {
if (command.equalsIgnoreCase("any")) {
return true;
}
2019-07-24 05:31:17 +02:00
Command commandMapping = NMSUtil.getInstance().getBukkitCommandMap().getCommand(command);
if (commandMapping == null) {
Update for 1.5.5 release. * Add potion effects support. * Add item enchantment support. * Add pvp lookup methods for claim and playerdata. * Add 'block-tileentity-id-list' used to override mod block id's that are used for many TE's. - Ex. IC2 uses a base block id 'ic2:te' for all TE's. When the id is detected during block/item usage, it will be converted to the actual id. * Add TileEntity registry to better support hybrid servers. * Add '/claiminfo' UUID click support to copy text to chat. * Add support for overriding option 'player-command-exit/enter' on player. * Add command description translation support. * Add zh_HK language support. * Fix event cause not clearing on push. * Fix abandon claim within town returning funds to owner in economy mode. * Fix player afk detection during claim block task. * Fix async chunk load during visual revert. * Fix '/gd claim we' command. * Fix advanced flag GUI toggle with definitions. * Fix rent sign update not checking all children claims. * Fix rent sign not being updated when cancelled via '/claimrent cancel'. * Fix '/claimsell' on admin claim. * Fix NPE when attempting to purchase an admin claim for sale. * Fix command description translations. * Fix isInvulnerable NPE on 1.8.8 servers. * Fix '/abandonworld' exiting when no economy data found for player. * Fix '/deletealladmin' only deleting admin claims in current world when passing no world argument. * Fix '/claimcontract' and '/claimexpand' NPE in economy mode. * Fix GD claim enter/exit prefix. The prefix will now use '[<playername>]'. Note: This can be configured in lang file under 'claim-prefix-enter' and 'claim-prefix-exit' * Clean up advanced flag GUI code. * Disable /buyblocks command when economy-block-cost is <= 0 * Deny town claim abandon if basic claims exist owned by owner. * Allow to input string as option value. * Improve pvp source contexts. * Clean up '/acb' command code. * (Bukkit) Add potion splash protection support. * (Bukkit) Fix tamed entities being hit by projectiles. * (Bukkit) Fix enderman block place protection. * (Hybrid) Fix wrong EnumCreatureType being registered for entities. * (Hybrid) Add TileEntity registry. * (Hybrid) Add mod command support for 'command-execute' flag. * (Sponge) Add PlaceHolderAPI support. * (Sponge) Add Nucleus v2 support. * (Sponge) Add IgniteEntityEvent support. * (Sponge) Fix '/cpp' and '/cpg' command. * (Sponge) Fix player block placement deny not sending message. Fixes #4 Fixes #200, Fixes #206, Fixes #222 Fixes #232, Fixes #237, Fixes #267 Fixes #269, Fixes #276, Fixes #296 Fixes #310, Fixes #311, Fixes #317 Fixes #324, Fixes #333, Fixes #334 Fixes #335, Fixes #336, Fixes #347
2020-12-28 23:28:12 +01:00
// check mod command mapping
commandMapping = NMSUtil.getInstance().getModCommandMap().getCommand(command);
if (commandMapping == null) {
TextAdapter.sendComponent(src, MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.PLUGIN_COMMAND_NOT_FOUND,
ImmutableMap.of(
"command", command,
"id", pluginId)));
return false;
}
2019-07-24 05:31:17 +02:00
}
return true;
}
public static String getTrustPermission(TrustType trustType) {
if (trustType == TrustTypes.ACCESSOR) {
return GDPermissions.TRUST_ACCESSOR;
} else if (trustType == TrustTypes.CONTAINER) {
return GDPermissions.TRUST_CONTAINER;
} else if (trustType == TrustTypes.BUILDER) {
return GDPermissions.TRUST_BUILDER;
} else {
return GDPermissions.TRUST_MANAGER;
}
}
public static Consumer<CommandSender> createTeleportConsumer(CommandSender src, Location location, Claim claim) {
return createTeleportConsumer(src, location, claim, false);
}
public static Consumer<CommandSender> createTeleportConsumer(CommandSender src, Location location, Claim claim, boolean isClaimSpawn) {
2019-07-24 05:31:17 +02:00
return teleport -> {
if (!(src instanceof Player)) {
// ignore
return;
}
final Player player = (Player) src;
// check if world is loaded
if (Bukkit.getWorld(location.getWorld().getUID()) == null) {
TextAdapter.sendComponent(player, MessageCache.getInstance().TELEPORT_NO_SAFE_LOCATION);
return;
}
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(player.getWorld(), player.getUniqueId());
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
final int teleportDelay = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Integer.class), player, Options.PLAYER_TELEPORT_DELAY, claim);
if (isClaimSpawn) {
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
if (teleportDelay > 0) {
playerData.teleportDelay = teleportDelay + 1;
playerData.teleportSourceLocation = player.getLocation();
playerData.teleportLocation = location;
return;
}
player.teleport(location, TeleportCause.PLUGIN);
return;
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final double safeY = location.getWorld().getHighestBlockYAt(location);
location.setY(safeY);
int currentY = location.getBlockY();
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
while (currentY > 0 && currentY < location.getWorld().getMaxHeight()) {
if (PlayerUtil.getInstance().isSafeLocation(location)) {
More fixes and improvements for 1.2.2 release. * Fix flags being reset on claim deletion. * Fix user claim flag permission check. * Fix sign interaction not using proper flag 'interact-block-secondary'. * Fix '/claimexpand' and '/claimcontract' tab completion. * Fix 'entity-damage' flag attempting to protect dropped items. * Fix 'player-keep-inventory' not clearing drops on death. * Fix 'player-keep-level' not clearing XP drops on death. * Fix EntityChangeBlockEvent using wrong source location. * Fix claim create mode triggering twice on first right-click. * Fix default/override claim types not showing up properly in Flag GUI. * Fix entity-damage flag not using proper user on left-click. * Fix abandon-delay default value. * Remove ability to resize claims when auto-schematic-restore is enabled. * Add support for setting no modification/investigation tool in config. * Add '/claim', '/gd mode claim' command to toggle a new claim mode for inspecting and claim creation. * Add 'combat-timeout' pvp setting to config to control how long a player stays in pvp combat after an attack. * Implement 'abandon-delay' option. * Implement 'player-teleport-delay' option. * Implement 'pvp' option. - When a player attempts to attack another player, both players must have pvp allowed. If 1 player is not allowed to PvP, the attack will be cancelled. * Improve '/claimlist' command. - Only trusted claims will be shown to users. - Admins can use '/ignoreclaims' to see all claims. - Fixed server crash if too many claims were listed. - Fixed subdivision filter. * Improve '/claimspawn' command. - The command now takes the following arguments '/claimspawn [name] [player]' Ex. If you want to spawn in a claim that you own named 'lair', you would enter '/claimspawn lair' Ex. If you want to spawn in a claim owned by 'Mike' named 'stables', you would enter '/claimspawn stables mike' * Improve flag definition defaults. * Improve flag default configuration. Fixes #51, Fixes #53, Fixes #54 Fixes #55, Fixes #56, Fixes #57
2019-09-18 17:28:49 +02:00
if (teleportDelay > 0) {
playerData.teleportDelay = teleportDelay + 1;
playerData.teleportLocation = location;
return;
}
player.teleport(location, TeleportCause.PLUGIN);
return;
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
if (location.getWorld().getEnvironment() == Environment.NETHER) {
currentY--;
} else {
currentY++;
}
location.setY(currentY);
}
2019-07-24 05:31:17 +02:00
TextAdapter.sendComponent(player, MessageCache.getInstance().TELEPORT_NO_SAFE_LOCATION);
2019-07-24 05:31:17 +02:00
};
}
public static void handleBankTransaction(CommandSender src, String[] args, GDClaim claim) {
if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) {
GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().ECONOMY_NOT_INSTALLED);
2019-07-24 05:31:17 +02:00
return;
}
if (claim.isSubdivision() || claim.isAdminClaim()) {
return;
}
if (!claim.getEconomyAccountId().isPresent()) {
GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().ECONOMY_VIRTUAL_NOT_SUPPORTED);
2019-07-24 05:31:17 +02:00
return;
}
final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
final String command = args[0];
final double amount = args.length > 1 ? Double.parseDouble(args[1]) : 0;
final UUID playerSource = ((Player) src).getUniqueId();
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(claim.getWorld(), claim.getOwnerUniqueId());
if (playerData.canIgnoreClaim(claim) || claim.getOwnerUniqueId().equals(playerSource) || claim.getUserTrusts(TrustTypes.MANAGER).contains(playerData.playerID)) {
final UUID bankAccount = claim.getEconomyAccountId().orElse(null);
if (bankAccount == null) {
GriefDefenderPlugin.sendMessage(src, MessageCache.getInstance().ECONOMY_VIRTUAL_NOT_SUPPORTED);
2019-07-24 05:31:17 +02:00
return;
}
if (command.equalsIgnoreCase("withdraw")) {
EconomyResponse result = economy.bankWithdraw(bankAccount.toString(), amount);
if (result.transactionSuccess()) {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_WITHDRAW,
ImmutableMap.of(
"amount", amount));
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
GriefDefenderPlugin.sendMessage(src, message);
2019-07-24 05:31:17 +02:00
economy.depositPlayer(((Player) src), amount);
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
claim.getData().getEconomyData().addPaymentTransaction(
new GDPaymentTransaction(TransactionType.BANK_WITHDRAW, TransactionResultType.SUCCESS, playerData.playerID, Instant.now(), amount));
2019-07-24 05:31:17 +02:00
} else {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_WITHDRAW_NO_FUNDS,
ImmutableMap.of(
2019-07-24 05:31:17 +02:00
"balance", economy.bankBalance(bankAccount.toString()),
"amount", amount));
2019-07-24 05:31:17 +02:00
GriefDefenderPlugin.sendMessage(src, message);
claim.getData().getEconomyData()
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.addPaymentTransaction(new GDPaymentTransaction(TransactionType.BANK_WITHDRAW, TransactionResultType.FAIL, playerData.playerID, Instant.now(), amount));
2019-07-24 05:31:17 +02:00
return;
}
} else if (command.equalsIgnoreCase("deposit")) {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
EconomyResponse result = EconomyUtil.getInstance().withdrawFunds(((Player) src), amount);
2019-07-24 05:31:17 +02:00
if (result.transactionSuccess()) {
double depositAmount = amount;
if (claim.getData().isExpired()) {
final double taxBalance = claim.getEconomyData().getTaxBalance();
depositAmount -= claim.getEconomyData().getTaxBalance();
if (depositAmount >= 0) {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
claim.getEconomyData().addPaymentTransaction(new GDPaymentTransaction(TransactionType.TAX, TransactionResultType.SUCCESS, Instant.now(), taxBalance));
2019-07-24 05:31:17 +02:00
claim.getEconomyData().setTaxPastDueDate(null);
claim.getEconomyData().setTaxBalance(0);
claim.getInternalClaimData().setExpired(false);
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TAX_PAID_BALANCE,
ImmutableMap.of(
"amount", taxBalance));
2019-07-24 05:31:17 +02:00
GriefDefenderPlugin.sendMessage(src, message);
if (depositAmount == 0) {
return;
}
} else {
final double newTaxBalance = Math.abs(depositAmount);
claim.getEconomyData().setTaxBalance(newTaxBalance);
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.TAX_PAID_PARTIAL,
ImmutableMap.of(
2019-07-24 05:31:17 +02:00
"amount", depositAmount,
"balance", newTaxBalance));
2019-07-24 05:31:17 +02:00
GriefDefenderPlugin.sendMessage(src, message);
return;
}
}
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_DEPOSIT, ImmutableMap.of(
"amount", depositAmount));
2019-07-24 05:31:17 +02:00
GriefDefenderPlugin.sendMessage(src, message);
economy.bankDeposit(bankAccount.toString(), depositAmount);
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
claim.getData().getEconomyData().addPaymentTransaction(
new GDPaymentTransaction(TransactionType.BANK_DEPOSIT, TransactionResultType.SUCCESS, playerData.playerID, Instant.now(), depositAmount));
2019-07-24 05:31:17 +02:00
} else {
GriefDefenderPlugin.sendMessage(src, GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_WITHDRAW_NO_FUNDS));
2019-07-24 05:31:17 +02:00
claim.getData().getEconomyData()
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.addPaymentTransaction(new GDPaymentTransaction(TransactionType.BANK_DEPOSIT, TransactionResultType.FAIL, playerData.playerID, Instant.now(), amount));
2019-07-24 05:31:17 +02:00
return;
}
}
} else {
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_NO_PERMISSION,
ImmutableMap.of(
"player", claim.getOwnerName()));
2019-07-24 05:31:17 +02:00
GriefDefenderPlugin.sendMessage(src, message);
}
}
public static void displayClaimBankInfo(Player player, GDClaim claim) {
displayClaimBankInfo(player, claim, false, false);
}
public static void displayClaimBankInfo(CommandSender player, GDClaim claim, boolean checkTown, boolean returnToClaimInfo) {
if (GriefDefenderPlugin.getInstance().getVaultProvider() == null) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_NOT_INSTALLED);
2019-07-24 05:31:17 +02:00
return;
}
if (checkTown && !claim.isInTown()) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().TOWN_NOT_IN);
2019-07-24 05:31:17 +02:00
return;
}
if (!checkTown && (claim.isSubdivision() || claim.isAdminClaim())) {
return;
}
final GDClaim town = claim.getTownClaim();
final UUID bankAccount = checkTown ? town.getEconomyAccountId().orElse(null) : claim.getEconomyAccountId().orElse(null);
if (bankAccount == null) {
GriefDefenderPlugin.sendMessage(player, MessageCache.getInstance().ECONOMY_VIRTUAL_NOT_SUPPORTED);
2019-07-24 05:31:17 +02:00
return;
}
final Economy economy = GriefDefenderPlugin.getInstance().getVaultProvider().getApi();
final GDPlayerData playerData = GriefDefenderPlugin.getInstance().dataStore.getPlayerData(claim.getWorld(), claim.getOwnerUniqueId());
final double claimBalance = economy.bankBalance(bankAccount.toString()).balance;
double taxOwed = -1;
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
final double playerTaxRate = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Double.class), (Player) player, Options.TAX_RATE, claim);
2019-07-24 05:31:17 +02:00
if (checkTown) {
if (!town.getOwnerUniqueId().equals(playerData.playerID)) {
for (Claim playerClaim : playerData.getInternalClaims()) {
GDClaim playerTown = (GDClaim) playerClaim.getTown().orElse(null);
if (!playerClaim.isTown() && playerTown != null && playerTown.getUniqueId().equals(claim.getUniqueId())) {
taxOwed += playerTown.getClaimBlocks() * playerTaxRate;
}
}
} else {
taxOwed = town.getClaimBlocks() * playerTaxRate;
}
} else {
taxOwed = claim.getClaimBlocks() * playerTaxRate;
}
final GriefDefenderConfig<?> activeConfig = GriefDefenderPlugin.getActiveConfig(claim.getWorld().getUID());
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final ZonedDateTime withdrawDate = TaskUtil.getNextTargetZoneDate(activeConfig.getConfig().economy.taxApplyHour, 0, 0);
2019-07-24 05:31:17 +02:00
Duration duration = Duration.between(Instant.now().truncatedTo(ChronoUnit.SECONDS), withdrawDate.toInstant()) ;
final long s = duration.getSeconds();
final String timeLeft = String.format("%d:%02d:%02d", s / 3600, (s % 3600) / 60, (s % 60));
final Component message = GriefDefenderPlugin.getInstance().messageData.getMessage(MessageStorage.BANK_INFO,
ImmutableMap.of(
2019-07-24 05:31:17 +02:00
"balance", claimBalance,
"tax-amount", taxOwed,
"time-remaining", timeLeft,
"tax-balance", claim.getData().getEconomyData().getTaxBalance()));
2019-07-24 05:31:17 +02:00
Component transactions = TextComponent.builder("")
.append(MessageCache.getInstance().BANK_TITLE_TRANSACTIONS.color(TextColor.AQUA).decoration(TextDecoration.ITALIC, true))
2019-07-24 05:31:17 +02:00
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(createBankTransactionsConsumer(player, claim, checkTown, returnToClaimInfo))))
.hoverEvent(HoverEvent.showText(MessageCache.getInstance().BANK_CLICK_VIEW_TRANSACTIONS))
2019-07-24 05:31:17 +02:00
.build();
List<Component> textList = new ArrayList<>();
if (returnToClaimInfo) {
textList.add(TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_CLAIMINFO.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(player, "claiminfo", "")))).build());
}
textList.add(message);
textList.add(transactions);
PaginationList.Builder builder = PaginationList.builder()
.title(TextComponent.of("Bank Info", TextColor.AQUA)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList);
builder.sendTo(player);
}
public static Consumer<CommandSender> createBankTransactionsConsumer(CommandSender src, GDClaim claim, boolean checkTown, boolean returnToClaimInfo) {
return settings -> {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
List<PaymentTransaction> paymentTransactions = claim.getData().getEconomyData().getPaymentTransactions(TransactionType.BANK_DEPOSIT);
2019-07-24 05:31:17 +02:00
List<Component> textList = new ArrayList<>();
textList.add(TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_BANKINFO.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(consumer -> { displayClaimBankInfo(src, claim, checkTown, returnToClaimInfo); }))).build());
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
for (PaymentTransaction transaction : paymentTransactions) {
final Duration duration = Duration.between(transaction.getTimestamp(), Instant.now().truncatedTo(ChronoUnit.SECONDS)) ;
2019-07-24 05:31:17 +02:00
final long s = duration.getSeconds();
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(transaction.getSource().orElse(null));
2019-07-24 05:31:17 +02:00
final String timeLeft = String.format("%dh %02dm %02ds", s / 3600, (s % 3600) / 60, (s % 60)) + " ago";
textList.add(TextComponent.builder("")
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.append(transaction.getResultType().name(), getTransactionColor(transaction.getResultType()))
2019-07-24 05:31:17 +02:00
.append(" | ", TextColor.BLUE)
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
.append(TextComponent.of(String.valueOf(transaction.getAmount())))
2019-07-24 05:31:17 +02:00
.append(" | ", TextColor.BLUE)
.append(timeLeft, TextColor.GRAY)
.append(user == null ? TextComponent.empty() : TextComponent.builder("")
.append(" | ", TextColor.BLUE)
.append(user.getName(), TextColor.LIGHT_PURPLE)
.build())
.build());
}
textList.add(TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().CLAIMINFO_UI_RETURN_BANKINFO.color(TextColor.AQUA))
2019-07-24 05:31:17 +02:00
.append("]\n")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "claimbank", "")))).build());
PaginationList.Builder builder = PaginationList.builder()
.title(MessageCache.getInstance().BANK_TITLE_TRANSACTIONS.color(TextColor.AQUA)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList);
2019-07-24 05:31:17 +02:00
builder.sendTo(src);
};
}
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
public static Consumer<CommandSender> createRentTransactionsConsumer(CommandSender src, GDClaim claim, boolean checkTown, boolean returnToClaimInfo) {
return settings -> {
List<PaymentTransaction> paymentTransactions = claim.getData().getEconomyData().getPaymentTransactions(TransactionType.RENT);
List<Component> textList = new ArrayList<>();
textList.add(TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().RENT_UI_RETURN_INFO.color(TextColor.AQUA))
.append("]\n")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "claimrent", "info")))).build());
for (PaymentTransaction transaction : paymentTransactions) {
final Duration duration = Duration.between(transaction.getTimestamp(), Instant.now().truncatedTo(ChronoUnit.SECONDS)) ;
final long s = duration.getSeconds();
final GDPermissionUser user = PermissionHolderCache.getInstance().getOrCreateUser(transaction.getSource().orElse(null));
final String timeLeft = String.format("%dh %02dm %02ds", s / 3600, (s % 3600) / 60, (s % 60)) + " ago";
textList.add(TextComponent.builder("")
.append(transaction.getResultType().name(), getTransactionColor(transaction.getResultType()))
.append(" | ", TextColor.BLUE)
.append(TextComponent.of(String.valueOf(transaction.getAmount())))
.append(" | ", TextColor.BLUE)
.append(timeLeft, TextColor.GRAY)
.append(user == null ? TextComponent.empty() : TextComponent.builder("")
.append(" | ", TextColor.BLUE)
.append(user.getName(), TextColor.LIGHT_PURPLE)
.build())
.build());
}
textList.add(TextComponent.builder("")
.append("\n[")
.append(MessageCache.getInstance().RENT_UI_RETURN_INFO.color(TextColor.AQUA))
.append("]\n")
.clickEvent(ClickEvent.runCommand(GDCallbackHolder.getInstance().createCallbackRunCommand(CommandHelper.createCommandConsumer(src, "claimrent", "info")))).build());
PaginationList.Builder builder = PaginationList.builder()
.title(MessageCache.getInstance().RENT_UI_TITLE_TRANSACTIONS.color(TextColor.AQUA)).padding(TextComponent.builder(" ").decoration(TextDecoration.STRIKETHROUGH, true).build()).contents(textList);
builder.sendTo(src);
};
}
public static TextColor getTransactionColor(TransactionResultType type) {
2019-07-24 05:31:17 +02:00
switch (type) {
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
case SUCCESS :
2019-07-24 05:31:17 +02:00
return TextColor.GREEN;
1.3.1 Update * Fix wrong type being displaying in /claiminfo. * Fix claim teleport in nether. * Fix claim visuals in/out of liquids. * Fix inventory check on interaction. * Fix walkspeed, gamemode, and weather options not resetting back to default on claim exit. * Fix option gui not displaying decimals for doubles. * Fix entity dupe on schematic restore. * Fix claim schematic creation dates on load. * Fix wither causing damage when spawned by players. * Fix ice/snow form flags. * Fix visuals not showing on snow. * Fix inability to attack tameable entities with no owner. * Fix claim cleanup task exiting prematurely. * Fix scaffolding not breaking fully. * Fix Flag GUI preset/advanced translations. * Fix '/cog <group>' not displaying options for group. * Fix option GUI toggle value hover. * Fix block burn across blocks not triggering block-spread. * Fix monsters such as phantom and ghast not being ignored during entity-damage checks. * Fixed tamed entity protection when source is not entity. * Fix snow-melt showing up as block-modify instead of block-break * Fix player buckets not checking place or break. * Fix 'fire-spread' and 'vehicle-use' flag definitions. * Fix NPE when changing claim type * Fix visuals loading unloaded chunks. * Fix player options not being set while in claim. * Fix isTileInventory check. * Fix user playerdata in PlaceHolderProvider. * Fix claim resize exploit. * Fix flag definitions GUI not showing inheritance values. * Fix entity explosion getting wrong user sometimes. * Fix tracking data not always being saved. * Fix #crops tag not working. * Fix tnt chain explosions. * Add 'player-fly-speed' option. * Add support for decimal values in option GUI. * Add missing translation when deleting all player claims. * Add restore claim in progress message. * Add pl_PL language support. Thanks to Maul for contribution * Add permission 'griefdefender.admin.bypass.pvp-creative' to bypass pvp creative protection. * Add permission 'griefdefender.user.claim.rent.base' for new '/claimrent' command. * Add permission 'griefdefender.user.claim.rent.sign' to control rent sign usage. * Add permission 'griefdefender.user.claim.sell.sign' to control sell sign usage. * Add flag definition 'turtle-egg-hatch' * Add flag definition 'falling-block-break' . * Add flag definition 'fire-entity-damage'. * Add flag/option enable control to respective configs. * Add group context support for flag definitions. * Add new context gd_claim_default=user and gd_claim_override=user which applies to all claim types except wilderness and admin. * Add owner override support with gd_claim_override=claim context. You can use this context to have owners be affected in claims. They also have the ability to toggle these. * Add villager-trade and villager-farm definitions. * Add /claimtax command. * Add /claimrent command. Note: To create a rental via command ex. /claimrent 10h - creates rental for $10 per hour ex. /claimrent 10h 5 - creates rental for $10 per hour w/ max 5 days. * Add claim restore functionality for 1.14+ servers. Note: To restore a claim, use /claimrestore * Add toggle support for isExpired in /claiminfo * Add Rent/Sell signs. * Add item frame rotation protection. * Add support for 'AsyncWorldEdit'. * Add /claimrent command for displaying rentable claims. * Add PvP config to manage pvp control. * Add PvP protection when flying during PvP. * Add PvP protection when in creative mode. * Add override support for options. * Add gd_claim_override=claim support for /cf command. * Add entity-damage logs for monster damage. * Add tracking support for piston item spawns. * Add client visual queue to avoid sending too much traffic in a single tick. Default 12 block changes per tick. See 'client-visuals-per-tick' in global.conf to change. * Add 'filler-spacing' to visual config. Default 10 * Add explosion surface blacklists for block/entities. * Add new flag 'inventory-item-move' * Add falling block tracking. * Add rent-schematic-restore-admin for controlling rent restores in admin claims. * Add explosion-cancel-block-limit for controlling explosion block size limit in devents. * Enhance claim visual functionality. * Refactor visual backend to be more efficient with server resources. * Ensure block transactions are never sent more than once to client during a single visual update. * Further enhance visual functionality with left/right clicks. * Improve '/gddebug' by adding a fully functional filter. Ex. '/gddebug record creeper' would show all actions with creeper. Ex. '/gddebug record claim' will show only claim you are standing in. * Cleanup option permission lookups. * Implement visual API. * Improve claim getChunks call. * Improve context display in debug paste. * Allow renters to interact with living entities. * Allow bank/tax systems to be used separately. * Allow pistons to be protected in wilderness. * Confirm buttons will now be invalidated after first click. * Deny owner item spawns in claim that is rented and can restore. * Deny '/giveblocks' on self. * Check max accrued blocks during /giveblocks. * Only adjust accrued blocks when using /giveblocks. * Optimize tracking data saves. * Force last active date save on player login. * Ignore drowning damage. * Move 'pvp' user definition to admin. * Change 'player-health-regen' option default to 0. * Change 'player-walk-speed' option default to 0. * Change 'tax-rate' option default to 0.1 * Change 'fall-entity-damage' to global default context. * Change 'fall-player-damage' to global default context.
2020-06-06 01:26:14 +02:00
case FAIL :
2019-07-24 05:31:17 +02:00
return TextColor.RED;
default :
return TextColor.GREEN;
}
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
public static Component getBaseOptionOverlayText(String option) {
String baseFlag = option.replace(GDPermissions.OPTION_BASE + ".", "");
2019-07-24 05:31:17 +02:00
int endIndex = baseFlag.indexOf(".");
if (endIndex != -1) {
baseFlag = baseFlag.substring(0, endIndex);
}
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
final Option flag = GriefDefender.getRegistry().getType(Option.class, baseFlag).orElse(null);
2019-07-24 05:31:17 +02:00
if (flag == null) {
Update for 1.2.0 release. * Implement custom flag system to allow admins to create any flag they desire with contexts. See wiki for more info. * Rewrite option and flag GUI's to be more user friendly. * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling * Refactor option system to support generics. * Add many new options. See https://github.com/bloodmc/GriefDefenderAPI/blob/master/src/main/java/com/griefdefender/api/permission/option/Options.java * Add new permission 'griefdefender.user.claim.option' to control what options user's can use in their claims. Ex. If a user tries to use 'player-deny-fly', GD will check 'griefdefender.user.claim.option.player-deny-fly' * Added the following permissions to allow admins to designate a player to manage options 'griefdefender.admin.claim.command.option.group.{type}' 'griefdefender.admin.claim.command.option.player.{type}' * Add new claim restore setting 'auto-schematic-restore'. This setting will allow servers to have newly created claims auto-generate a schematic. When these claims expire, the auto-generated schematic will be used for restore. Note: This setting is only designed for newly created worlds where players cannot build in the wilderness. Use with caution and read comments carefully. * Add new message setting 'enter-exit-chat-type'. This setting is used to control the default chat type (Chat/ActionBar/Title) used when sending enter/exit claim messages to players. Note: This can be overridden by plugins. * Add support for controlling raids. You can find the new toggle in /raid * Add various GP command aliases to make it easier for users transitioning to GD * Add confirmations for all claim delete commands. * Add GPFlags migrator. Note: When the GP Bukkit migrator is enabled, GD will automatically look for GPFlags data and migrate with claim data. * Add support for EntityCombustByBlockEvent, EntityCombustByEntityEvent, and EntityDamageByBlockEvent. * Add EssentialsX hook to deny '/fly' command when 'player-deny-flight' is true for a user * Add event result cache. * Add contexts to hover in '/cf' command * Add /givepet command * Add confirmations to abandon and delete commands * Add support for /sellblocks in economy mode * Add new messages for economy mode * Fix NPE during checkSizeLimits * Fix interactions with custom inventories. * Fix custom flags not showing up in '/cf' command. * Fix interact-inventory denying action when interact-block-secondary is true * Fix interact-inventory not checking entity ids. * Fix shovel location being reset with insufficient blocks * Fix GP Bukkit migrator not handling subdivisions properly. * Fix 'block-break' flag being ignored in wilderness * Fix invalid playerdata UUID files being loaded causing errors in console. * Fix HashSet error in TaxApplyTask * Fix 'command-execute' flag * Fix PvP setting in /claiminfo. * Fix claim overrides not checking default group. * Fix various message issues * Fix 'minecraft:air' showing up as used_item context. * Fix EntityChangeBlockEvent user tracking. * Fix abandonclaims not returning blocks to player. * Fix players not being able to use pet inventories in other claims. * Fix players being kicked when using gd callbacks. * Fix '/cf' display issues * Fix '/cf' mod id not being set properly with contexts * Fix '/cf' item id context lookups * Fix '/scb' command * Fix '/gddebug' start/end time. * Fix economy plugin detection * Fix economy mode buy/sell not applying proper funds * Fix ClaimBlocks task not depositing funds while in economy mode * Prevent /buyblocks working in economy mode * Remove economy mode check from /scb and /acb * Rewrite option and flag GUI's to be more user friendly. * Improve PermissionHolderCache * Refactor permission handling to support more permission plugins. * Refactor permission lookups to use storage directly for better context handling Note: '/lp verbose' will no longer be able to track GD flag lookups. * Increase cache to 30min * Change gddebug paste site to griefdefender.github.io
2019-08-23 22:49:00 +02:00
return MessageStorage.MESSAGE_DATA.getMessage(MessageStorage.OPTION_NOT_FOUND, ImmutableMap.of(
"option", baseFlag));
2019-07-24 05:31:17 +02:00
}
return flag.getDescription();
}
public static TrustType getTrustType(String type) {
switch (type.toLowerCase()) {
case "accessor" :
return TrustTypes.ACCESSOR;
case "builder" :
return TrustTypes.BUILDER;
case "container" :
return TrustTypes.CONTAINER;
case "manager" :
return TrustTypes.MANAGER;
case "none" :
return TrustTypes.NONE;
default :
return null;
}
}
public static boolean checkTrustPermission(Player player, TrustType type) {
if (type == TrustTypes.ACCESSOR) {
return player.hasPermission(GDPermissions.GIVE_ACCESS_TRUST);
}
if (type == TrustTypes.BUILDER) {
return player.hasPermission(GDPermissions.GIVE_BUILDER_TRUST);
}
if (type == TrustTypes.CONTAINER) {
return player.hasPermission(GDPermissions.GIVE_CONTAINER_TRUST);
}
if (type == TrustTypes.MANAGER) {
return player.hasPermission(GDPermissions.GIVE_MANAGER_TRUST);
}
if (type == TrustTypes.NONE) {
return player.hasPermission(GDPermissions.REMOVE_TRUST);
}
return true;
}
}