mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 21:15:57 +01:00
parent
4f14f1f736
commit
bab420a359
@ -884,6 +884,14 @@ public void onPlayerItem(PlayerItemEvent event) {
|
|||||||
public void onPlayerDropItem(PlayerDropItemEvent event) {
|
public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||||
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
ConfigurationManager cfg = plugin.getGlobalStateManager();
|
||||||
WorldConfiguration wcfg = cfg.get(event.getPlayer().getWorld());
|
WorldConfiguration wcfg = cfg.get(event.getPlayer().getWorld());
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
if (wcfg.useRegions) {
|
||||||
|
if (!plugin.getGlobalRegionManager().allows(DefaultFlag.ITEM_DROP, player.getLocation())) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage(ChatColor.RED + "You don't have permission to do that in this area.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (wcfg.getBlacklist() != null) {
|
if (wcfg.getBlacklist() != null) {
|
||||||
Item ci = event.getItemDrop();
|
Item ci = event.getItemDrop();
|
||||||
|
@ -64,6 +64,7 @@ public final class DefaultFlag {
|
|||||||
public static final StateFlag RECEIVE_CHAT = new StateFlag("receive-chat", true);
|
public static final StateFlag RECEIVE_CHAT = new StateFlag("receive-chat", true);
|
||||||
public static final StateFlag ENTRY = new StateFlag("entry", true);
|
public static final StateFlag ENTRY = new StateFlag("entry", true);
|
||||||
public static final StateFlag EXIT = new StateFlag("exit", true);
|
public static final StateFlag EXIT = new StateFlag("exit", true);
|
||||||
|
public static final StateFlag ITEM_DROP = new StateFlag("item-drop", true);
|
||||||
public static final StateFlag ENTITY_PAINTING_DESTROY = new StateFlag("entity-painting-destroy", true);
|
public static final StateFlag ENTITY_PAINTING_DESTROY = new StateFlag("entity-painting-destroy", true);
|
||||||
public static final StateFlag POTION_SPLASH = new StateFlag("potion-splash", true);
|
public static final StateFlag POTION_SPLASH = new StateFlag("potion-splash", true);
|
||||||
public static final StringFlag GREET_MESSAGE = new StringFlag("greeting", RegionGroup.ALL);
|
public static final StringFlag GREET_MESSAGE = new StringFlag("greeting", RegionGroup.ALL);
|
||||||
@ -93,7 +94,7 @@ public final class DefaultFlag {
|
|||||||
MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS,
|
MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS,
|
||||||
CREEPER_EXPLOSION, ENDERDRAGON_BLOCK_DAMAGE, GHAST_FIREBALL, ENDER_BUILD,
|
CREEPER_EXPLOSION, ENDERDRAGON_BLOCK_DAMAGE, GHAST_FIREBALL, ENDER_BUILD,
|
||||||
GREET_MESSAGE, FAREWELL_MESSAGE, NOTIFY_ENTER, NOTIFY_LEAVE,
|
GREET_MESSAGE, FAREWELL_MESSAGE, NOTIFY_ENTER, NOTIFY_LEAVE,
|
||||||
EXIT, ENTRY, LIGHTNING, ENTITY_PAINTING_DESTROY,
|
EXIT, ENTRY, LIGHTNING, ENTITY_PAINTING_DESTROY, ITEM_DROP,
|
||||||
HEAL_AMOUNT, HEAL_DELAY, MIN_HEAL, MAX_HEAL,
|
HEAL_AMOUNT, HEAL_DELAY, MIN_HEAL, MAX_HEAL,
|
||||||
FEED_DELAY, FEED_AMOUNT, MIN_FOOD, MAX_FOOD,
|
FEED_DELAY, FEED_AMOUNT, MIN_FOOD, MAX_FOOD,
|
||||||
SNOW_FALL, SNOW_MELT, ICE_FORM, ICE_MELT, GAME_MODE,
|
SNOW_FALL, SNOW_MELT, ICE_FORM, ICE_MELT, GAME_MODE,
|
||||||
|
Loading…
Reference in New Issue
Block a user