Added HOPPER flag

#401
This commit is contained in:
Florian CUNY 2018-12-28 10:54:07 +01:00
parent b5620e25e7
commit 3e7c97c370
4 changed files with 12 additions and 3 deletions

View File

@ -164,8 +164,6 @@ public class BlockInteractionListener extends FlagListener {
case YELLOW_SHULKER_BOX:
case SHULKER_BOX:
case FLOWER_POT:
case HOPPER:
case HOPPER_MINECART:
checkIsland(e, loc, Flags.CHEST);
break;
case DISPENSER:
@ -174,6 +172,10 @@ public class BlockInteractionListener extends FlagListener {
case DROPPER:
checkIsland(e, loc, Flags.DROPPER);
break;
case HOPPER:
case HOPPER_MINECART:
checkIsland(e, loc, Flags.HOPPER);
break;
case ACACIA_DOOR:
case BIRCH_DOOR:
case DARK_OAK_DOOR:

View File

@ -39,7 +39,6 @@ public class InventoryListener extends FlagListener {
checkIsland(e, e.getInventory().getLocation(), Flags.MOUNT_INVENTORY);
}
else if (inventoryHolder instanceof Chest
|| inventoryHolder instanceof Hopper
|| inventoryHolder instanceof ShulkerBox) {
checkIsland(e, e.getInventory().getLocation(), Flags.CHEST);
}
@ -49,6 +48,9 @@ public class InventoryListener extends FlagListener {
else if (inventoryHolder instanceof Dropper) {
checkIsland(e, e.getInventory().getLocation(), Flags.DROPPER);
}
else if (inventoryHolder instanceof Hopper) {
checkIsland(e, e.getInventory().getLocation(), Flags.HOPPER);
}
else if (inventoryHolder instanceof Furnace) {
checkIsland(e, e.getInventory().getLocation(), Flags.FURNACE);
}

View File

@ -70,6 +70,7 @@ public final class Flags {
public static final Flag CHEST = new Flag.Builder("CHEST", Material.CHEST).build();
public static final Flag DISPENSER = new Flag.Builder("DISPENSER", Material.DISPENSER).build();
public static final Flag DROPPER = new Flag.Builder("DROPPER", Material.DROPPER).build();
public static final Flag HOPPER = new Flag.Builder("HOPPER", Material.HOPPER).build();
public static final Flag DOOR = new Flag.Builder("DOOR", Material.OAK_DOOR).defaultSetting(true).build();
public static final Flag TRAPDOOR = new Flag.Builder("TRAPDOOR", Material.OAK_TRAPDOOR).defaultSetting(true).build();
public static final Flag CRAFTING = new Flag.Builder("CRAFTING", Material.CRAFTING_TABLE).defaultSetting(true).build();

View File

@ -443,6 +443,10 @@ protection:
description: "Toggle chest access"
name: "Chests"
hint: "Chest access disabled"
HOPPER:
name: "Hoppers"
description: "Toggle hopper interaction"
hint: "Hopper interaction disabled"
CHEST_DAMAGE:
description: "Toggle chest damage from explosions"
name: "Chest Damage"