mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-03 14:01:56 +01:00
Merge branch 'master' of https://github.com/Sturmeh/worldguard into Worldguard.
This commit is contained in:
commit
47a4046d47
@ -67,6 +67,8 @@ public void initialize() {
|
||||
PluginListener.Priority.HIGH);
|
||||
loader.addListener(PluginLoader.Hook.DISCONNECT, listener, this,
|
||||
PluginListener.Priority.HIGH);
|
||||
loader.addListener(PluginLoader.Hook.ITEM_DROP , listener, this,
|
||||
PluginListener.Priority.HIGH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,6 +77,7 @@ public class WorldGuardListener extends PluginListener {
|
||||
private boolean blockLagFix;
|
||||
private Set<Integer> fireNoSpreadBlocks;
|
||||
private Set<Integer> allowedLavaSpreadOver;
|
||||
private Set<Integer> itemDropBlacklist;
|
||||
private boolean classicWater;
|
||||
private Map<Integer,BlacklistEntry> blacklist;
|
||||
|
||||
@ -132,6 +133,7 @@ public void loadConfiguration() {
|
||||
blockLighter = properties.getBoolean("block-lighter", false);
|
||||
preventLavaFire = properties.getBoolean("disable-lava-fire", false);
|
||||
disableAllFire = properties.getBoolean("disable-all-fire-spread", false);
|
||||
itemDropBlacklist = toBlockIDSet(properties.getString("item-drop-blacklist", ""));
|
||||
fireNoSpreadBlocks = toBlockIDSet(properties.getString("disallowed-fire-spread-blocks", ""));
|
||||
allowedLavaSpreadOver = toBlockIDSet(properties.getString("allowed-lava-spread-blocks", ""));
|
||||
classicWater = properties.getBoolean("classic-water", false);
|
||||
@ -214,6 +216,28 @@ public String onLoginChecks(String user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a player drops an item.
|
||||
*
|
||||
* @param player
|
||||
* player who dropped the item
|
||||
* @param item
|
||||
* item that was dropped
|
||||
* @return true if you don't want the dropped item to be spawned in the
|
||||
* world
|
||||
*/
|
||||
public boolean onItemDrop(Player player, Item item) {
|
||||
if (itemDropBlacklist != null) {
|
||||
int n = item.getItemId();
|
||||
if (itemDropBlacklist.contains(n)) {
|
||||
player.sendMessage(Colors.Rose + "Item was destroyed!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when someone presses right click. If they right clicked with a
|
||||
* block you can return true to cancel that. You can intercept this to add
|
||||
|
Loading…
Reference in New Issue
Block a user