Skip to content
Permalink
Browse files

More materials.

  • Loading branch information...
wizjany committed Jun 2, 2019
1 parent d9a5dea commit 14315bdb59e8a6b23a1092db094ffdc239ce361e
Showing with 55 additions and 8 deletions.
  1. +55 −8 worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/Materials.java
@@ -224,7 +224,6 @@
MATERIAL_FLAGS.put(Material.EMERALD_BLOCK, 0);
MATERIAL_FLAGS.put(Material.COMMAND_BLOCK, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.BEACON, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.COBBLESTONE_WALL, 0);
MATERIAL_FLAGS.put(Material.ANVIL, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.CHIPPED_ANVIL, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.DAMAGED_ANVIL, MODIFIED_ON_RIGHT);
@@ -395,7 +394,6 @@
MATERIAL_FLAGS.put(Material.MAGENTA_STAINED_GLASS, 0);
MATERIAL_FLAGS.put(Material.MAGENTA_STAINED_GLASS_PANE, 0);
MATERIAL_FLAGS.put(Material.MAGENTA_TERRACOTTA, 0);
MATERIAL_FLAGS.put(Material.MOSSY_COBBLESTONE_WALL, 0);
MATERIAL_FLAGS.put(Material.MUSHROOM_STEM, 0);
MATERIAL_FLAGS.put(Material.OBSERVER, 0);
MATERIAL_FLAGS.put(Material.ORANGE_STAINED_GLASS, 0);
@@ -436,6 +434,26 @@
MATERIAL_FLAGS.put(Material.YELLOW_STAINED_GLASS_PANE, 0);
MATERIAL_FLAGS.put(Material.YELLOW_TERRACOTTA, 0);

MATERIAL_FLAGS.put(Material.BAMBOO, 0);
MATERIAL_FLAGS.put(Material.BAMBOO_SAPLING, 0);
MATERIAL_FLAGS.put(Material.BARREL, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.BELL, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.BLAST_FURNACE, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.CAMPFIRE, MODIFIED_ON_RIGHT | MODIFIED_ON_LEFT);
MATERIAL_FLAGS.put(Material.CARTOGRAPHY_TABLE, 0);
MATERIAL_FLAGS.put(Material.COMPOSTER, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.FLETCHING_TABLE, 0);
MATERIAL_FLAGS.put(Material.GRINDSTONE, 0);
MATERIAL_FLAGS.put(Material.JIGSAW, MODIFIED_ON_RIGHT | MODIFIED_ON_LEFT);
MATERIAL_FLAGS.put(Material.LANTERN, 0);
MATERIAL_FLAGS.put(Material.LECTERN, 0);
MATERIAL_FLAGS.put(Material.LOOM, 0);
MATERIAL_FLAGS.put(Material.SCAFFOLDING, 0);
MATERIAL_FLAGS.put(Material.SMITHING_TABLE, 0);
MATERIAL_FLAGS.put(Material.SMOKER, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.STONECUTTER, 0);
MATERIAL_FLAGS.put(Material.SWEET_BERRY_BUSH, MODIFIED_ON_RIGHT);

MATERIAL_FLAGS.put(Material.IRON_SHOVEL, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.IRON_PICKAXE, 0);
MATERIAL_FLAGS.put(Material.IRON_AXE, 0);
@@ -476,7 +494,6 @@
MATERIAL_FLAGS.put(Material.DIAMOND_HOE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.GOLDEN_HOE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.WHEAT_SEEDS, MODIFIES_BLOCKS);
// MATERIAL_FLAGS.put(Material.WHEAT_CROPS, 0); // Where is this?
MATERIAL_FLAGS.put(Material.BREAD, 0);
MATERIAL_FLAGS.put(Material.LEATHER_HELMET, 0);
MATERIAL_FLAGS.put(Material.LEATHER_CHESTPLATE, 0);
@@ -529,17 +546,24 @@
MATERIAL_FLAGS.put(Material.GLOWSTONE_DUST, 0);
MATERIAL_FLAGS.put(Material.COD, 0);
MATERIAL_FLAGS.put(Material.COOKED_COD, 0);
MATERIAL_FLAGS.put(Material.INK_SAC, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.INK_SAC, 0);
MATERIAL_FLAGS.put(Material.BLACK_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.BLUE_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.BROWN_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.CYAN_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.GRAY_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.GREEN_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.LIGHT_BLUE_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.LIGHT_GRAY_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.LIME_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.MAGENTA_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.ORANGE_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.PINK_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.PURPLE_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.COCOA_BEANS, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.RED_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.WHITE_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.YELLOW_DYE, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.COCOA_BEANS, 0);
MATERIAL_FLAGS.put(Material.BONE_MEAL, MODIFIES_BLOCKS);
MATERIAL_FLAGS.put(Material.BONE, 0);
MATERIAL_FLAGS.put(Material.SUGAR, 0);
@@ -613,6 +637,7 @@
MATERIAL_FLAGS.put(Material.RABBIT_FOOT, 0);
MATERIAL_FLAGS.put(Material.RABBIT_HIDE, 0);
MATERIAL_FLAGS.put(Material.ARMOR_STAND, 0);
MATERIAL_FLAGS.put(Material.LEATHER_HORSE_ARMOR, 0);
MATERIAL_FLAGS.put(Material.IRON_HORSE_ARMOR, 0);
MATERIAL_FLAGS.put(Material.GOLDEN_HORSE_ARMOR, 0);
MATERIAL_FLAGS.put(Material.DIAMOND_HORSE_ARMOR, 0);
@@ -658,6 +683,16 @@
MATERIAL_FLAGS.put(Material.TROPICAL_FISH, 0);
MATERIAL_FLAGS.put(Material.TROPICAL_FISH_BUCKET, 0);

MATERIAL_FLAGS.put(Material.CREEPER_BANNER_PATTERN, 0);
MATERIAL_FLAGS.put(Material.FLOWER_BANNER_PATTERN, 0);
MATERIAL_FLAGS.put(Material.GLOBE_BANNER_PATTERN, 0);
MATERIAL_FLAGS.put(Material.MOJANG_BANNER_PATTERN, 0);
MATERIAL_FLAGS.put(Material.SKULL_BANNER_PATTERN, 0);
MATERIAL_FLAGS.put(Material.CROSSBOW, 0);
MATERIAL_FLAGS.put(Material.SUSPICIOUS_STEW, 0);
MATERIAL_FLAGS.put(Material.SWEET_BERRIES, 0);


// Fake tags
for (Material m : shulkerBoxes) {
MATERIAL_FLAGS.put(m, MODIFIED_ON_RIGHT);
@@ -706,6 +741,9 @@
for (Material pot : Tag.FLOWER_POTS.getValues()) {
MATERIAL_FLAGS.put(pot, MODIFIED_ON_RIGHT);
}
for (Material wall : Tag.WALLS.getValues()) {
MATERIAL_FLAGS.put(wall, 0);
}
for (Material sign : Tag.SIGNS.getValues()) {
MATERIAL_FLAGS.put(sign, 0);
}
@@ -718,6 +756,9 @@
for (Material musicDisc : Tag.ITEMS_MUSIC_DISCS.getValues()) {
MATERIAL_FLAGS.put(musicDisc, 0);
}
for (Material bannerPat : Tag.ITEMS_BANNERS.getValues()) {
MATERIAL_FLAGS.put(bannerPat, 0);
}
Stream.concat(Stream.concat(
Tag.CORAL_BLOCKS.getValues().stream(),
Tag.CORALS.getValues().stream()),
@@ -738,7 +779,7 @@
MATERIAL_FLAGS.put(material, 0);
}
if (!MATERIAL_FLAGS.containsKey(material)) {
logger.info("Missing material definition for " + (material.isBlock() ? "block " : "item ") + material.name());
logger.fine("Missing material definition for " + (material.isBlock() ? "block " : "item ") + material.name());
}
}

@@ -945,6 +986,7 @@ public static boolean isSpawnEgg(Material material) {
case SPIDER_SPAWN_EGG:
case BAT_SPAWN_EGG:
case BLAZE_SPAWN_EGG:
case CAT_SPAWN_EGG:
case CAVE_SPIDER_SPAWN_EGG:
case CHICKEN_SPAWN_EGG:
case COD_SPAWN_EGG:
@@ -1013,6 +1055,8 @@ public static EntityType getEntitySpawnEgg(Material material) {
return EntityType.BAT;
case BLAZE_SPAWN_EGG:
return EntityType.BLAZE;
case CAT_SPAWN_EGG:
return EntityType.CAT;
case CAVE_SPIDER_SPAWN_EGG:
return EntityType.CAVE_SPIDER;
case CHICKEN_SPAWN_EGG:
@@ -1175,9 +1219,12 @@ public static boolean isUseFlagApplicable(Material material) {
case HEAVY_WEIGHTED_PRESSURE_PLATE:
case STONE_PRESSURE_PLATE:
case ANVIL:
case BEACON:
case ENCHANTING_TABLE:
case TRIPWIRE:
case BELL:
case LOOM:
case CARTOGRAPHY_TABLE:
case STONECUTTER:
case GRINDSTONE:
return true;
default: return false;
}

0 comments on commit 14315bd

Please sign in to comment.
You can’t perform that action at this time.