Fix #437, add team config 'borderdrop' to permit item drop near walls

This commit is contained in:
Connor Monahan 2017-07-20 16:15:35 -04:00
parent ef26173ba1
commit b7cf69666c
3 changed files with 5 additions and 2 deletions

View File

@ -235,6 +235,7 @@ public class War extends JavaPlugin {
teamDefaultConfig.put(TeamConfig.APPLYPOTION, "");
teamDefaultConfig.put(TeamConfig.ECOREWARD, 0.0);
teamDefaultConfig.put(TeamConfig.INVENTORYDROP, false);
teamDefaultConfig.put(TeamConfig.BORDERDROP, false);
this.getDefaultInventories().clearLoadouts();
HashMap<Integer, ItemStack> defaultLoadout = new HashMap<Integer, ItemStack>();

View File

@ -20,7 +20,8 @@ public enum TeamConfig {
PLACEBLOCK (Boolean.class),
APPLYPOTION(String.class),
ECOREWARD(Double.class),
INVENTORYDROP(Boolean.class);
INVENTORYDROP(Boolean.class),
BORDERDROP(Boolean.class);
private final Class<?> configType;

View File

@ -139,7 +139,8 @@ public class WarPlayerListener implements Listener {
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");
event.setCancelled(true);
return;