mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-02-09 08:51:59 +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);
|
PluginListener.Priority.HIGH);
|
||||||
loader.addListener(PluginLoader.Hook.DISCONNECT, listener, this,
|
loader.addListener(PluginLoader.Hook.DISCONNECT, listener, this,
|
||||||
PluginListener.Priority.HIGH);
|
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 boolean blockLagFix;
|
||||||
private Set<Integer> fireNoSpreadBlocks;
|
private Set<Integer> fireNoSpreadBlocks;
|
||||||
private Set<Integer> allowedLavaSpreadOver;
|
private Set<Integer> allowedLavaSpreadOver;
|
||||||
|
private Set<Integer> itemDropBlacklist;
|
||||||
private boolean classicWater;
|
private boolean classicWater;
|
||||||
private Map<Integer,BlacklistEntry> blacklist;
|
private Map<Integer,BlacklistEntry> blacklist;
|
||||||
|
|
||||||
@ -132,6 +133,7 @@ public void loadConfiguration() {
|
|||||||
blockLighter = properties.getBoolean("block-lighter", false);
|
blockLighter = properties.getBoolean("block-lighter", false);
|
||||||
preventLavaFire = properties.getBoolean("disable-lava-fire", false);
|
preventLavaFire = properties.getBoolean("disable-lava-fire", false);
|
||||||
disableAllFire = properties.getBoolean("disable-all-fire-spread", false);
|
disableAllFire = properties.getBoolean("disable-all-fire-spread", false);
|
||||||
|
itemDropBlacklist = toBlockIDSet(properties.getString("item-drop-blacklist", ""));
|
||||||
fireNoSpreadBlocks = toBlockIDSet(properties.getString("disallowed-fire-spread-blocks", ""));
|
fireNoSpreadBlocks = toBlockIDSet(properties.getString("disallowed-fire-spread-blocks", ""));
|
||||||
allowedLavaSpreadOver = toBlockIDSet(properties.getString("allowed-lava-spread-blocks", ""));
|
allowedLavaSpreadOver = toBlockIDSet(properties.getString("allowed-lava-spread-blocks", ""));
|
||||||
classicWater = properties.getBoolean("classic-water", false);
|
classicWater = properties.getBoolean("classic-water", false);
|
||||||
@ -213,6 +215,28 @@ public String onLoginChecks(String user) {
|
|||||||
|
|
||||||
return null;
|
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
|
* Called when someone presses right click. If they right clicked with a
|
||||||
|
Loading…
Reference in New Issue
Block a user