mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-03 15:08:02 +01:00
Update Materials.java with 1.21 tags and materials
This commit is contained in:
parent
27f009594a
commit
2bd426baf8
@ -22,7 +22,9 @@
|
|||||||
import com.google.common.collect.BiMap;
|
import com.google.common.collect.BiMap;
|
||||||
import com.google.common.collect.HashBiMap;
|
import com.google.common.collect.HashBiMap;
|
||||||
import com.sk89q.worldguard.protection.flags.Flags;
|
import com.sk89q.worldguard.protection.flags.Flags;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.Tag;
|
import org.bukkit.Tag;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
@ -80,6 +82,10 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
ENTITY_ITEMS.put(EntityType.ARMOR_STAND, Material.ARMOR_STAND);
|
ENTITY_ITEMS.put(EntityType.ARMOR_STAND, Material.ARMOR_STAND);
|
||||||
ENTITY_ITEMS.put(EntityType.END_CRYSTAL, Material.END_CRYSTAL);
|
ENTITY_ITEMS.put(EntityType.END_CRYSTAL, Material.END_CRYSTAL);
|
||||||
|
|
||||||
|
// preset some tags to a default value, override some of them:
|
||||||
|
putMaterialTag(Tag.DOORS, MODIFIED_ON_RIGHT);
|
||||||
|
putMaterialTag(Tag.TRAPDOORS, MODIFIED_ON_RIGHT);
|
||||||
|
|
||||||
MATERIAL_FLAGS.put(Material.AIR, 0);
|
MATERIAL_FLAGS.put(Material.AIR, 0);
|
||||||
MATERIAL_FLAGS.put(Material.STONE, 0);
|
MATERIAL_FLAGS.put(Material.STONE, 0);
|
||||||
MATERIAL_FLAGS.put(Material.GRASS_BLOCK, 0);
|
MATERIAL_FLAGS.put(Material.GRASS_BLOCK, 0);
|
||||||
@ -150,12 +156,6 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
MATERIAL_FLAGS.put(Material.CAKE, MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.CAKE, MODIFIED_ON_RIGHT);
|
||||||
MATERIAL_FLAGS.put(Material.REPEATER, MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.REPEATER, MODIFIED_ON_RIGHT);
|
||||||
// MATERIAL_FLAGS.put(Material.STAINED_GLASS, 0);
|
// MATERIAL_FLAGS.put(Material.STAINED_GLASS, 0);
|
||||||
MATERIAL_FLAGS.put(Material.ACACIA_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.BIRCH_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.DARK_OAK_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.JUNGLE_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.OAK_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.SPRUCE_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.INFESTED_STONE, 0);
|
MATERIAL_FLAGS.put(Material.INFESTED_STONE, 0);
|
||||||
MATERIAL_FLAGS.put(Material.INFESTED_STONE_BRICKS, 0);
|
MATERIAL_FLAGS.put(Material.INFESTED_STONE_BRICKS, 0);
|
||||||
MATERIAL_FLAGS.put(Material.INFESTED_MOSSY_STONE_BRICKS, 0);
|
MATERIAL_FLAGS.put(Material.INFESTED_MOSSY_STONE_BRICKS, 0);
|
||||||
@ -227,11 +227,6 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
MATERIAL_FLAGS.put(Material.IRON_TRAPDOOR, 0);
|
MATERIAL_FLAGS.put(Material.IRON_TRAPDOOR, 0);
|
||||||
MATERIAL_FLAGS.put(Material.RED_SANDSTONE, 0);
|
MATERIAL_FLAGS.put(Material.RED_SANDSTONE, 0);
|
||||||
MATERIAL_FLAGS.put(Material.RED_SANDSTONE_STAIRS, 0);
|
MATERIAL_FLAGS.put(Material.RED_SANDSTONE_STAIRS, 0);
|
||||||
MATERIAL_FLAGS.put(Material.SPRUCE_DOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.BIRCH_DOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.JUNGLE_DOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.ACACIA_DOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.DARK_OAK_DOOR, MODIFIED_ON_RIGHT);
|
|
||||||
|
|
||||||
MATERIAL_FLAGS.put(Material.DIRT_PATH, 0);
|
MATERIAL_FLAGS.put(Material.DIRT_PATH, 0);
|
||||||
MATERIAL_FLAGS.put(Material.CHORUS_PLANT, 0);
|
MATERIAL_FLAGS.put(Material.CHORUS_PLANT, 0);
|
||||||
@ -247,7 +242,7 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
MATERIAL_FLAGS.put(Material.PURPUR_SLAB, 0);
|
MATERIAL_FLAGS.put(Material.PURPUR_SLAB, 0);
|
||||||
MATERIAL_FLAGS.put(Material.STRUCTURE_BLOCK, MODIFIED_ON_LEFT | MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.STRUCTURE_BLOCK, MODIFIED_ON_LEFT | MODIFIED_ON_RIGHT);
|
||||||
MATERIAL_FLAGS.put(Material.REPEATING_COMMAND_BLOCK, MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.REPEATING_COMMAND_BLOCK, MODIFIED_ON_RIGHT);
|
||||||
MATERIAL_FLAGS.put(Material.CHAIN_COMMAND_BLOCK , MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.CHAIN_COMMAND_BLOCK, MODIFIED_ON_RIGHT);
|
||||||
|
|
||||||
MATERIAL_FLAGS.put(Material.MAGMA_BLOCK, 0);
|
MATERIAL_FLAGS.put(Material.MAGMA_BLOCK, 0);
|
||||||
MATERIAL_FLAGS.put(Material.NETHER_WART_BLOCK, 0);
|
MATERIAL_FLAGS.put(Material.NETHER_WART_BLOCK, 0);
|
||||||
@ -677,7 +672,6 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
MATERIAL_FLAGS.put(Material.CRIMSON_FUNGUS, 0);
|
MATERIAL_FLAGS.put(Material.CRIMSON_FUNGUS, 0);
|
||||||
MATERIAL_FLAGS.put(Material.CRIMSON_NYLIUM, 0);
|
MATERIAL_FLAGS.put(Material.CRIMSON_NYLIUM, 0);
|
||||||
MATERIAL_FLAGS.put(Material.CRIMSON_ROOTS, 0);
|
MATERIAL_FLAGS.put(Material.CRIMSON_ROOTS, 0);
|
||||||
MATERIAL_FLAGS.put(Material.CRIMSON_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.CRYING_OBSIDIAN, 0);
|
MATERIAL_FLAGS.put(Material.CRYING_OBSIDIAN, 0);
|
||||||
MATERIAL_FLAGS.put(Material.GILDED_BLACKSTONE, 0);
|
MATERIAL_FLAGS.put(Material.GILDED_BLACKSTONE, 0);
|
||||||
MATERIAL_FLAGS.put(Material.LODESTONE, 0);
|
MATERIAL_FLAGS.put(Material.LODESTONE, 0);
|
||||||
@ -718,7 +712,6 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
MATERIAL_FLAGS.put(Material.WARPED_FUNGUS_ON_A_STICK, 0);
|
MATERIAL_FLAGS.put(Material.WARPED_FUNGUS_ON_A_STICK, 0);
|
||||||
MATERIAL_FLAGS.put(Material.WARPED_NYLIUM, 0);
|
MATERIAL_FLAGS.put(Material.WARPED_NYLIUM, 0);
|
||||||
MATERIAL_FLAGS.put(Material.WARPED_ROOTS, 0);
|
MATERIAL_FLAGS.put(Material.WARPED_ROOTS, 0);
|
||||||
MATERIAL_FLAGS.put(Material.WARPED_TRAPDOOR, MODIFIED_ON_RIGHT);
|
|
||||||
MATERIAL_FLAGS.put(Material.WARPED_WART_BLOCK, 0);
|
MATERIAL_FLAGS.put(Material.WARPED_WART_BLOCK, 0);
|
||||||
MATERIAL_FLAGS.put(Material.WEEPING_VINES, 0);
|
MATERIAL_FLAGS.put(Material.WEEPING_VINES, 0);
|
||||||
MATERIAL_FLAGS.put(Material.WEEPING_VINES_PLANT, 0);
|
MATERIAL_FLAGS.put(Material.WEEPING_VINES_PLANT, 0);
|
||||||
@ -843,9 +836,46 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
MATERIAL_FLAGS.put(Material.ARMADILLO_SCUTE, 0);
|
MATERIAL_FLAGS.put(Material.ARMADILLO_SCUTE, 0);
|
||||||
MATERIAL_FLAGS.put(Material.WOLF_ARMOR, 0);
|
MATERIAL_FLAGS.put(Material.WOLF_ARMOR, 0);
|
||||||
|
|
||||||
// Generated via tag
|
// 1.21
|
||||||
putMaterialTag(Tag.WOODEN_DOORS, MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.CHISELED_TUFF, 0);
|
||||||
putMaterialTag(Tag.WOODEN_TRAPDOORS, MODIFIED_ON_RIGHT);
|
MATERIAL_FLAGS.put(Material.POLISHED_TUFF, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.TUFF_BRICKS, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.CHISELED_TUFF_BRICKS, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.HEAVY_CORE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.EXPOSED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WEATHERED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.OXIDIZED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_EXPOSED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_WEATHERED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_OXIDIZED_CHISELED_COPPER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.CRAFTER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.FLOW_BANNER_PATTERN, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.GUSTER_BANNER_PATTERN, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WEATHERED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.EXPOSED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.OXIDIZED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_WEATHERED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_EXPOSED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_OXIDIZED_COPPER_GRATE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WEATHERED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.EXPOSED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.OXIDIZED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_WEATHERED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_EXPOSED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.WAXED_OXIDIZED_COPPER_BULB, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.TRIAL_SPAWNER, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.TRIAL_KEY, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.OMINOUS_TRIAL_KEY, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.VAULT, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.OMINOUS_BOTTLE, 0);
|
||||||
|
MATERIAL_FLAGS.put(Material.BREEZE_ROD, 0);
|
||||||
|
|
||||||
putMaterialTag(Tag.SHULKER_BOXES, MODIFIED_ON_RIGHT);
|
putMaterialTag(Tag.SHULKER_BOXES, MODIFIED_ON_RIGHT);
|
||||||
putMaterialTag(Tag.ITEMS_BOATS, 0);
|
putMaterialTag(Tag.ITEMS_BOATS, 0);
|
||||||
putMaterialTag(Tag.BANNERS, 0);
|
putMaterialTag(Tag.BANNERS, 0);
|
||||||
@ -902,6 +932,9 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
if (isSpawnEgg(material)) {
|
if (isSpawnEgg(material)) {
|
||||||
MATERIAL_FLAGS.put(material, 0);
|
MATERIAL_FLAGS.put(material, 0);
|
||||||
}
|
}
|
||||||
|
if (material.name().startsWith("MUSIC_DISC_")) {
|
||||||
|
MATERIAL_FLAGS.put(material, 0);
|
||||||
|
}
|
||||||
if (!MATERIAL_FLAGS.containsKey(material)) {
|
if (!MATERIAL_FLAGS.containsKey(material)) {
|
||||||
logger.fine("Missing material definition for " + (material.isBlock() ? "block " : "item ") + material.name());
|
logger.fine("Missing material definition for " + (material.isBlock() ? "block " : "item ") + material.name());
|
||||||
}
|
}
|
||||||
@ -909,15 +942,15 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
|
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.SPEED);
|
// DAMAGE_EFFECTS.add(PotionEffectType.SPEED);
|
||||||
DAMAGE_EFFECTS.add(PotionEffectType.SLOWNESS);
|
DAMAGE_EFFECTS.add(PotionEffectType.SLOWNESS);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.FAST_DIGGING);
|
// DAMAGE_EFFECTS.add(PotionEffectType.HASTE);
|
||||||
DAMAGE_EFFECTS.add(PotionEffectType.MINING_FATIGUE);
|
DAMAGE_EFFECTS.add(PotionEffectType.MINING_FATIGUE);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.INCREASE_DAMAGE);
|
// DAMAGE_EFFECTS.add(PotionEffectType.STRENGTH);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.HEAL);
|
// DAMAGE_EFFECTS.add(PotionEffectType.INSTANT_HEALTH);
|
||||||
DAMAGE_EFFECTS.add(PotionEffectType.INSTANT_DAMAGE);
|
DAMAGE_EFFECTS.add(PotionEffectType.INSTANT_DAMAGE);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.JUMP);
|
// DAMAGE_EFFECTS.add(PotionEffectType.JUMP_BOOST);
|
||||||
DAMAGE_EFFECTS.add(PotionEffectType.NAUSEA);
|
DAMAGE_EFFECTS.add(PotionEffectType.NAUSEA);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.REGENERATION);
|
// DAMAGE_EFFECTS.add(PotionEffectType.REGENERATION);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.DAMAGE_RESISTANCE);
|
// DAMAGE_EFFECTS.add(PotionEffectType.RESISTANCE);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.FIRE_RESISTANCE);
|
// DAMAGE_EFFECTS.add(PotionEffectType.FIRE_RESISTANCE);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.WATER_BREATHING);
|
// DAMAGE_EFFECTS.add(PotionEffectType.WATER_BREATHING);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.INVISIBILITY);
|
// DAMAGE_EFFECTS.add(PotionEffectType.INVISIBILITY);
|
||||||
@ -940,6 +973,11 @@ private static void putMaterialTag(Tag<Material> tag, Integer value) {
|
|||||||
DAMAGE_EFFECTS.add(PotionEffectType.BAD_OMEN);
|
DAMAGE_EFFECTS.add(PotionEffectType.BAD_OMEN);
|
||||||
// DAMAGE_EFFECTS.add(PotionEffectType.HERO_OF_THE_VILLAGE);
|
// DAMAGE_EFFECTS.add(PotionEffectType.HERO_OF_THE_VILLAGE);
|
||||||
DAMAGE_EFFECTS.add(PotionEffectType.DARKNESS);
|
DAMAGE_EFFECTS.add(PotionEffectType.DARKNESS);
|
||||||
|
DAMAGE_EFFECTS.add(PotionEffectType.TRIAL_OMEN);
|
||||||
|
DAMAGE_EFFECTS.add(PotionEffectType.WIND_CHARGED);
|
||||||
|
DAMAGE_EFFECTS.add(PotionEffectType.WEAVING);
|
||||||
|
DAMAGE_EFFECTS.add(PotionEffectType.OOZING);
|
||||||
|
DAMAGE_EFFECTS.add(PotionEffectType.INFESTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Materials() {
|
private Materials() {
|
||||||
@ -1139,10 +1177,11 @@ public static EntityType getEntitySpawnEgg(Material material) {
|
|||||||
case ALLAY_SPAWN_EGG -> EntityType.ALLAY;
|
case ALLAY_SPAWN_EGG -> EntityType.ALLAY;
|
||||||
case ARMADILLO_SPAWN_EGG -> EntityType.ARMADILLO;
|
case ARMADILLO_SPAWN_EGG -> EntityType.ARMADILLO;
|
||||||
case AXOLOTL_SPAWN_EGG -> EntityType.AXOLOTL;
|
case AXOLOTL_SPAWN_EGG -> EntityType.AXOLOTL;
|
||||||
case SPIDER_SPAWN_EGG -> EntityType.SPIDER;
|
|
||||||
case BAT_SPAWN_EGG -> EntityType.BAT;
|
case BAT_SPAWN_EGG -> EntityType.BAT;
|
||||||
case BEE_SPAWN_EGG -> EntityType.BEE;
|
case BEE_SPAWN_EGG -> EntityType.BEE;
|
||||||
case BLAZE_SPAWN_EGG -> EntityType.BLAZE;
|
case BLAZE_SPAWN_EGG -> EntityType.BLAZE;
|
||||||
|
case BOGGED_SPAWN_EGG -> EntityType.BOGGED;
|
||||||
|
case BREEZE_SPAWN_EGG -> EntityType.BREEZE;
|
||||||
case CAT_SPAWN_EGG -> EntityType.CAT;
|
case CAT_SPAWN_EGG -> EntityType.CAT;
|
||||||
case CAMEL_SPAWN_EGG -> EntityType.CAMEL;
|
case CAMEL_SPAWN_EGG -> EntityType.CAMEL;
|
||||||
case CAVE_SPIDER_SPAWN_EGG -> EntityType.CAVE_SPIDER;
|
case CAVE_SPIDER_SPAWN_EGG -> EntityType.CAVE_SPIDER;
|
||||||
@ -1192,6 +1231,7 @@ public static EntityType getEntitySpawnEgg(Material material) {
|
|||||||
case SLIME_SPAWN_EGG -> EntityType.SLIME;
|
case SLIME_SPAWN_EGG -> EntityType.SLIME;
|
||||||
case SNIFFER_SPAWN_EGG -> EntityType.SNIFFER;
|
case SNIFFER_SPAWN_EGG -> EntityType.SNIFFER;
|
||||||
case SNOW_GOLEM_SPAWN_EGG -> EntityType.SNOW_GOLEM;
|
case SNOW_GOLEM_SPAWN_EGG -> EntityType.SNOW_GOLEM;
|
||||||
|
case SPIDER_SPAWN_EGG -> EntityType.SPIDER;
|
||||||
case SQUID_SPAWN_EGG -> EntityType.SQUID;
|
case SQUID_SPAWN_EGG -> EntityType.SQUID;
|
||||||
case STRAY_SPAWN_EGG -> EntityType.STRAY;
|
case STRAY_SPAWN_EGG -> EntityType.STRAY;
|
||||||
case STRIDER_SPAWN_EGG -> EntityType.STRIDER;
|
case STRIDER_SPAWN_EGG -> EntityType.STRIDER;
|
||||||
@ -1366,15 +1406,13 @@ public static boolean hasDamageEffect(Collection<PotionEffect> effects) {
|
|||||||
* @return true if equippable armor
|
* @return true if equippable armor
|
||||||
*/
|
*/
|
||||||
public static boolean isArmor(Material type) {
|
public static boolean isArmor(Material type) {
|
||||||
|
if (Tag.ITEMS_HEAD_ARMOR.isTagged(type) || Tag.ITEMS_CHEST_ARMOR.isTagged(type) ||
|
||||||
|
Tag.ITEMS_LEG_ARMOR.isTagged(type) || Tag.ITEMS_FOOT_ARMOR.isTagged(type) ||
|
||||||
|
Tag.ITEMS_SKULLS.isTagged(type)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case LEATHER_HELMET, LEATHER_CHESTPLATE, LEATHER_LEGGINGS, LEATHER_BOOTS,
|
case CARVED_PUMPKIN, ELYTRA -> true;
|
||||||
CHAINMAIL_HELMET, CHAINMAIL_CHESTPLATE, CHAINMAIL_LEGGINGS, CHAINMAIL_BOOTS,
|
|
||||||
IRON_HELMET, IRON_CHESTPLATE, IRON_LEGGINGS, IRON_BOOTS,
|
|
||||||
DIAMOND_HELMET, DIAMOND_CHESTPLATE, DIAMOND_LEGGINGS, DIAMOND_BOOTS,
|
|
||||||
GOLDEN_HELMET, GOLDEN_CHESTPLATE, GOLDEN_LEGGINGS, GOLDEN_BOOTS,
|
|
||||||
NETHERITE_HELMET, NETHERITE_CHESTPLATE, NETHERITE_LEGGINGS, NETHERITE_BOOTS,
|
|
||||||
TURTLE_HELMET, ELYTRA ->
|
|
||||||
true;
|
|
||||||
default -> false;
|
default -> false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -1465,27 +1503,18 @@ public static boolean isToolApplicable(Material toolMaterial, Material targetMat
|
|||||||
public static boolean isFire(Material type) {
|
public static boolean isFire(Material type) {
|
||||||
return type == Material.FIRE || type == Material.SOUL_FIRE;
|
return type == Material.FIRE || type == Material.SOUL_FIRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isWaxedCopper(Material type) {
|
public static boolean isWaxedCopper(Material type) {
|
||||||
return switch (type) {
|
// copied from the MaterialTags class in Paper
|
||||||
case WAXED_COPPER_BLOCK, WAXED_EXPOSED_COPPER, WAXED_WEATHERED_COPPER, WAXED_OXIDIZED_COPPER,
|
return type.name().startsWith("WAXED_") && type.name().contains("COPPER");
|
||||||
WAXED_CUT_COPPER, WAXED_EXPOSED_CUT_COPPER, WAXED_WEATHERED_CUT_COPPER,
|
|
||||||
WAXED_OXIDIZED_CUT_COPPER, WAXED_CUT_COPPER_STAIRS, WAXED_EXPOSED_CUT_COPPER_STAIRS,
|
|
||||||
WAXED_WEATHERED_CUT_COPPER_STAIRS, WAXED_OXIDIZED_CUT_COPPER_STAIRS, WAXED_CUT_COPPER_SLAB,
|
|
||||||
WAXED_EXPOSED_CUT_COPPER_SLAB, WAXED_WEATHERED_CUT_COPPER_SLAB, WAXED_OXIDIZED_CUT_COPPER_SLAB ->
|
|
||||||
true;
|
|
||||||
default -> false;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isUnwaxedCopper(Material type) {
|
public static boolean isUnwaxedCopper(Material type) {
|
||||||
|
// copied from the MaterialTags class in Paper
|
||||||
return switch (type) {
|
return switch (type) {
|
||||||
case COPPER_BLOCK, EXPOSED_COPPER, WEATHERED_COPPER, OXIDIZED_COPPER, CUT_COPPER,
|
case COPPER_BLOCK, CHISELED_COPPER, COPPER_DOOR, COPPER_TRAPDOOR, COPPER_GRATE, COPPER_BULB -> true;
|
||||||
EXPOSED_CUT_COPPER, WEATHERED_CUT_COPPER, OXIDIZED_CUT_COPPER, CUT_COPPER_STAIRS,
|
default -> type.name().startsWith("EXPOSED_") || type.name().startsWith("WEATHERED_") ||
|
||||||
EXPOSED_CUT_COPPER_STAIRS, WEATHERED_CUT_COPPER_STAIRS, OXIDIZED_CUT_COPPER_STAIRS,
|
type.name().startsWith("OXIDIZED_") || type.name().startsWith("CUT_COPPER");
|
||||||
CUT_COPPER_SLAB, EXPOSED_CUT_COPPER_SLAB, WEATHERED_CUT_COPPER_SLAB, OXIDIZED_CUT_COPPER_SLAB ->
|
|
||||||
true;
|
|
||||||
default -> false;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user