mirror of https://github.com/taoneill/war.git
Fix #437, add team config 'borderdrop' to permit item drop near walls
This commit is contained in:
parent
ef26173ba1
commit
b7cf69666c
|
@ -235,6 +235,7 @@ public class War extends JavaPlugin {
|
||||||
teamDefaultConfig.put(TeamConfig.APPLYPOTION, "");
|
teamDefaultConfig.put(TeamConfig.APPLYPOTION, "");
|
||||||
teamDefaultConfig.put(TeamConfig.ECOREWARD, 0.0);
|
teamDefaultConfig.put(TeamConfig.ECOREWARD, 0.0);
|
||||||
teamDefaultConfig.put(TeamConfig.INVENTORYDROP, false);
|
teamDefaultConfig.put(TeamConfig.INVENTORYDROP, false);
|
||||||
|
teamDefaultConfig.put(TeamConfig.BORDERDROP, false);
|
||||||
|
|
||||||
this.getDefaultInventories().clearLoadouts();
|
this.getDefaultInventories().clearLoadouts();
|
||||||
HashMap<Integer, ItemStack> defaultLoadout = new HashMap<Integer, ItemStack>();
|
HashMap<Integer, ItemStack> defaultLoadout = new HashMap<Integer, ItemStack>();
|
||||||
|
|
|
@ -20,7 +20,8 @@ public enum TeamConfig {
|
||||||
PLACEBLOCK (Boolean.class),
|
PLACEBLOCK (Boolean.class),
|
||||||
APPLYPOTION(String.class),
|
APPLYPOTION(String.class),
|
||||||
ECOREWARD(Double.class),
|
ECOREWARD(Double.class),
|
||||||
INVENTORYDROP(Boolean.class);
|
INVENTORYDROP(Boolean.class),
|
||||||
|
BORDERDROP(Boolean.class);
|
||||||
|
|
||||||
private final Class<?> configType;
|
private final Class<?> configType;
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,8 @@ public class WarPlayerListener implements Listener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (zone.isNearWall(player.getLocation()) && itemStack != null) {
|
if (zone.isNearWall(player.getLocation()) && itemStack != null
|
||||||
|
&& !team.getTeamConfig().resolveBoolean(TeamConfig.BORDERDROP)) {
|
||||||
War.war.badMsg(player, "drop.item.border");
|
War.war.badMsg(player, "drop.item.border");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue