Update to Minecraft 1.19.3

This commit is contained in:
Joo200 2022-12-09 13:23:57 +01:00
parent cb100bb797
commit ba55cc79c2
7 changed files with 150 additions and 295 deletions

View File

@ -1,9 +1,10 @@
object Versions {
// const val PISTON = "0.4.3"
// const val AUTO_VALUE = "1.6.5"
const val WORLDEDIT = "7.2.10"
const val JUNIT = "5.7.0"
const val SQUIRRELID = "0.3.0"
const val GUAVA = "31.0.1-jre"
const val MOCKITO = "3.7.7"
// const val PISTON = "0.4.3"
// const val AUTO_VALUE = "1.6.5"
const val WORLDEDIT = "7.2.12"
const val JUNIT = "5.9.1"
const val MOCKITO = "4.9.0"
const val SQUIRRELID = "0.3.1"
const val GUAVA = "31.1-jre"
const val FINDBUGS = "3.0.2"
}

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -28,15 +28,15 @@
dependencies {
"api"(project(":worldguard-core"))
"compileOnly"("io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT")
"runtimeOnly"("org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT") {
"compileOnly"("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
"runtimeOnly"("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT") {
exclude("junit", "junit")
}
"api"("com.sk89q.worldedit:worldedit-bukkit:${Versions.WORLDEDIT}") { isTransitive = false }
"implementation"("com.google.guava:guava:${Versions.GUAVA}")
"compileOnly"("com.sk89q:commandbook:2.3") { isTransitive = false }
"shadeOnly"("io.papermc:paperlib:1.0.7")
"shadeOnly"("org.bstats:bstats-bukkit:2.1.0")
"shadeOnly"("org.bstats:bstats-bukkit:3.0.0")
"shadeOnly"("co.aikar:minecraft-timings:1.0.4")
}

View File

@ -1197,9 +1197,12 @@ private static <T extends Event & Cancellable> void handleBlockRightClick(T even
}
// Handle created spawn eggs
if (item != null && Materials.isSpawnEgg(item.getType())) {
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), Materials.getEntitySpawnEgg(item.getType())));
return;
if (item != null) {
EntityType possibleEntityType = Materials.getEntitySpawnEgg(item.getType());
if (possibleEntityType != null) {
Events.fireToCancel(event, new SpawnEntityEvent(event, cause, placed.getLocation().add(0.5, 0, 0.5), possibleEntityType));
return;
}
}
// handle water/lava placement

View File

@ -52,6 +52,10 @@ public final class Materials {
private static final Map<Material, Integer> MATERIAL_FLAGS = new EnumMap<>(Material.class);
private static final Set<PotionEffectType> DAMAGE_EFFECTS = new HashSet<>();
private static void putMaterialTag(Tag<Material> tag, Integer value) {
tag.getValues().forEach(mat -> MATERIAL_FLAGS.put(mat, value));
}
static {
ENTITY_ITEMS.put(EntityType.PAINTING, Material.PAINTING);
ENTITY_ITEMS.put(EntityType.ARROW, Material.ARROW);
@ -110,7 +114,7 @@ public final class Materials {
MATERIAL_FLAGS.put(Material.IRON_BLOCK, 0);
MATERIAL_FLAGS.put(Material.BRICK, 0);
MATERIAL_FLAGS.put(Material.TNT, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.BOOKSHELF, 0);
MATERIAL_FLAGS.put(Material.BOOKSHELF, MODIFIED_ON_RIGHT);
MATERIAL_FLAGS.put(Material.MOSSY_COBBLESTONE, 0);
MATERIAL_FLAGS.put(Material.OBSIDIAN, 0);
MATERIAL_FLAGS.put(Material.TORCH, 0);
@ -816,110 +820,42 @@ public final class Materials {
MATERIAL_FLAGS.put(Material.REINFORCED_DEEPSLATE, 0);
// Generated via tag
for (Material woodenDoor : Tag.WOODEN_DOORS.getValues()) {
MATERIAL_FLAGS.put(woodenDoor, MODIFIED_ON_RIGHT);
}
for (Material woodenTrapdoor : Tag.WOODEN_TRAPDOORS.getValues()) {
MATERIAL_FLAGS.put(woodenTrapdoor, MODIFIED_ON_RIGHT);
}
for (Material shulkerBox : Tag.SHULKER_BOXES.getValues()) {
MATERIAL_FLAGS.put(shulkerBox, MODIFIED_ON_RIGHT);
}
for (Material boat : Tag.ITEMS_BOATS.getValues()) {
MATERIAL_FLAGS.put(boat, 0);
}
for (Material banner : Tag.BANNERS.getValues()) {
MATERIAL_FLAGS.put(banner, 0);
}
for (Material slab : Tag.SLABS.getValues()) {
MATERIAL_FLAGS.put(slab, 0);
}
for (Material plank : Tag.PLANKS.getValues()) {
MATERIAL_FLAGS.put(plank, 0);
}
for (Material carpet : Tag.WOOL_CARPETS.getValues()) {
MATERIAL_FLAGS.put(carpet, 0);
}
for (Material sapling : Tag.SAPLINGS.getValues()) {
MATERIAL_FLAGS.put(sapling, 0);
}
for (Material log : Tag.LOGS.getValues()) {
MATERIAL_FLAGS.put(log, 0);
}
for (Material leaves : Tag.LEAVES.getValues()) {
MATERIAL_FLAGS.put(leaves, 0);
}
for (Material stair : Tag.STAIRS.getValues()) {
MATERIAL_FLAGS.put(stair, 0);
}
for (Material wool : Tag.WOOL.getValues()) {
MATERIAL_FLAGS.put(wool, 0);
}
for (Material plate : Tag.WOODEN_PRESSURE_PLATES.getValues()) {
MATERIAL_FLAGS.put(plate, 0);
}
for (Material button : Tag.BUTTONS.getValues()) {
MATERIAL_FLAGS.put(button, MODIFIED_ON_RIGHT);
}
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);
}
for (Material flower : Tag.SMALL_FLOWERS.getValues()) {
MATERIAL_FLAGS.put(flower, 0);
}
for (Material bed : Tag.BEDS.getValues()) {
MATERIAL_FLAGS.put(bed, MODIFIED_ON_RIGHT);
}
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);
}
for (Material fenceGate : Tag.FENCE_GATES.getValues()) {
MATERIAL_FLAGS.put(fenceGate, MODIFIED_ON_RIGHT);
}
for (Material fence : Tag.FENCES.getValues()) {
MATERIAL_FLAGS.put(fence, 0);
} for (Material coalOre : Tag.COAL_ORES.getValues()) {
MATERIAL_FLAGS.put(coalOre, 0);
}
for (Material ironOre : Tag.IRON_ORES.getValues()) {
MATERIAL_FLAGS.put(ironOre, 0);
}
for (Material goldOre : Tag.GOLD_ORES.getValues()) {
MATERIAL_FLAGS.put(goldOre, 0);
}
for (Material diamondOre : Tag.DIAMOND_ORES.getValues()) {
MATERIAL_FLAGS.put(diamondOre, 0);
}
for (Material redstoneOre : Tag.REDSTONE_ORES.getValues()) {
MATERIAL_FLAGS.put(redstoneOre, 0);
}
for (Material copperOre : Tag.COPPER_ORES.getValues()) {
MATERIAL_FLAGS.put(copperOre, 0);
}
for (Material emeraldOre : Tag.EMERALD_ORES.getValues()) {
MATERIAL_FLAGS.put(emeraldOre, 0);
}
for (Material lapisOre : Tag.LAPIS_ORES.getValues()) {
MATERIAL_FLAGS.put(lapisOre, 0);
}
for (Material candle : Tag.CANDLES.getValues()) {
MATERIAL_FLAGS.put(candle, MODIFIED_ON_RIGHT);
}
for (Material candleCakes : Tag.CANDLE_CAKES.getValues()) {
MATERIAL_FLAGS.put(candleCakes, MODIFIED_ON_RIGHT);
}
for (Material cauldron : Tag.CAULDRONS.getValues()) {
MATERIAL_FLAGS.put(cauldron, MODIFIED_ON_RIGHT);
}
putMaterialTag(Tag.WOODEN_DOORS, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.WOODEN_TRAPDOORS, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.SHULKER_BOXES, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.ITEMS_BOATS, 0);
putMaterialTag(Tag.BANNERS, 0);
putMaterialTag(Tag.SLABS, 0);
putMaterialTag(Tag.PLANKS, 0);
putMaterialTag(Tag.WOOL_CARPETS, 0);
putMaterialTag(Tag.SAPLINGS, 0);
putMaterialTag(Tag.LOGS, 0);
putMaterialTag(Tag.LEAVES, 0);
putMaterialTag(Tag.STAIRS, 0);
putMaterialTag(Tag.WOOL, 0);
putMaterialTag(Tag.WOODEN_PRESSURE_PLATES, 0);
putMaterialTag(Tag.BUTTONS, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.FLOWER_POTS, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.WALLS, 0);
putMaterialTag(Tag.ALL_SIGNS, 0);
putMaterialTag(Tag.SMALL_FLOWERS, 0);
putMaterialTag(Tag.BEDS, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.ITEMS_MUSIC_DISCS, 0);
putMaterialTag(Tag.ITEMS_BANNERS, 0);
putMaterialTag(Tag.FENCE_GATES, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.FENCES, 0);
putMaterialTag(Tag.COAL_ORES, 0);
putMaterialTag(Tag.IRON_ORES, 0);
putMaterialTag(Tag.GOLD_ORES, 0);
putMaterialTag(Tag.DIAMOND_ORES, 0);
putMaterialTag(Tag.REDSTONE_ORES, 0);
putMaterialTag(Tag.COPPER_ORES, 0);
putMaterialTag(Tag.EMERALD_ORES, 0);
putMaterialTag(Tag.LAPIS_ORES, 0);
putMaterialTag(Tag.CANDLES, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.CANDLE_CAKES, MODIFIED_ON_RIGHT);
putMaterialTag(Tag.CAULDRONS, MODIFIED_ON_RIGHT);
Stream.concat(Stream.concat(
Tag.CORAL_BLOCKS.getValues().stream(),
@ -1170,173 +1106,89 @@ public static boolean isInventoryBlock(Material material) {
}
public static boolean isSpawnEgg(Material material) {
return switch (material) {
case AXOLOTL_SPAWN_EGG, BAT_SPAWN_EGG, BEE_SPAWN_EGG, BLAZE_SPAWN_EGG, CAT_SPAWN_EGG,
CAVE_SPIDER_SPAWN_EGG, CHICKEN_SPAWN_EGG, COD_SPAWN_EGG, COW_SPAWN_EGG, CREEPER_SPAWN_EGG,
DOLPHIN_SPAWN_EGG, DONKEY_SPAWN_EGG, DROWNED_SPAWN_EGG, ELDER_GUARDIAN_SPAWN_EGG,
ENDERMAN_SPAWN_EGG, ENDERMITE_SPAWN_EGG, EVOKER_SPAWN_EGG, FOX_SPAWN_EGG,
GHAST_SPAWN_EGG, GLOW_SQUID_SPAWN_EGG, GOAT_SPAWN_EGG, GUARDIAN_SPAWN_EGG,
HOGLIN_SPAWN_EGG, HORSE_SPAWN_EGG, HUSK_SPAWN_EGG, LLAMA_SPAWN_EGG, MAGMA_CUBE_SPAWN_EGG,
MOOSHROOM_SPAWN_EGG, MULE_SPAWN_EGG, OCELOT_SPAWN_EGG, PANDA_SPAWN_EGG, PARROT_SPAWN_EGG,
PHANTOM_SPAWN_EGG, PIGLIN_BRUTE_SPAWN_EGG, PIGLIN_SPAWN_EGG, PIG_SPAWN_EGG, PILLAGER_SPAWN_EGG,
POLAR_BEAR_SPAWN_EGG, PUFFERFISH_SPAWN_EGG, RABBIT_SPAWN_EGG, RAVAGER_SPAWN_EGG,
SALMON_SPAWN_EGG, SHEEP_SPAWN_EGG, SHULKER_SPAWN_EGG, SILVERFISH_SPAWN_EGG,
SKELETON_HORSE_SPAWN_EGG, SKELETON_SPAWN_EGG, SLIME_SPAWN_EGG, SPIDER_SPAWN_EGG,
SQUID_SPAWN_EGG, STRAY_SPAWN_EGG, STRIDER_SPAWN_EGG, TRADER_LLAMA_SPAWN_EGG,
TROPICAL_FISH_SPAWN_EGG, TURTLE_SPAWN_EGG, VEX_SPAWN_EGG, VILLAGER_SPAWN_EGG,
VINDICATOR_SPAWN_EGG, WANDERING_TRADER_SPAWN_EGG, WITCH_SPAWN_EGG, WITHER_SKELETON_SPAWN_EGG,
WOLF_SPAWN_EGG, ZOGLIN_SPAWN_EGG, ZOMBIE_HORSE_SPAWN_EGG, ZOMBIFIED_PIGLIN_SPAWN_EGG,
ZOMBIE_SPAWN_EGG, ZOMBIE_VILLAGER_SPAWN_EGG, ALLAY_SPAWN_EGG, FROG_SPAWN_EGG, TADPOLE_SPAWN_EGG,
WARDEN_SPAWN_EGG ->
true;
default -> false;
};
return getEntitySpawnEgg(material) != null;
}
public static EntityType getEntitySpawnEgg(Material material) {
switch (material) {
case ALLAY_SPAWN_EGG:
return EntityType.ALLAY;
case AXOLOTL_SPAWN_EGG:
return EntityType.AXOLOTL;
case SPIDER_SPAWN_EGG:
return EntityType.SPIDER;
case BAT_SPAWN_EGG:
return EntityType.BAT;
case BEE_SPAWN_EGG:
return EntityType.BEE;
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:
return EntityType.CHICKEN;
case COD_SPAWN_EGG:
return EntityType.COD;
case COW_SPAWN_EGG:
return EntityType.COW;
case CREEPER_SPAWN_EGG:
return EntityType.CREEPER;
case DOLPHIN_SPAWN_EGG:
return EntityType.DOLPHIN;
case DONKEY_SPAWN_EGG:
return EntityType.DONKEY;
case DROWNED_SPAWN_EGG:
return EntityType.DROWNED;
case ELDER_GUARDIAN_SPAWN_EGG:
return EntityType.ELDER_GUARDIAN;
case ENDERMAN_SPAWN_EGG:
return EntityType.ENDERMAN;
case ENDERMITE_SPAWN_EGG:
return EntityType.ENDERMITE;
case EVOKER_SPAWN_EGG:
return EntityType.EVOKER;
case FOX_SPAWN_EGG:
return EntityType.FOX;
case FROG_SPAWN_EGG:
return EntityType.FROG;
case GHAST_SPAWN_EGG:
return EntityType.GHAST;
case GLOW_SQUID_SPAWN_EGG:
return EntityType.GLOW_SQUID;
case GOAT_SPAWN_EGG:
return EntityType.GOAT;
case GUARDIAN_SPAWN_EGG:
return EntityType.GUARDIAN;
case HOGLIN_SPAWN_EGG:
return EntityType.HOGLIN;
case HORSE_SPAWN_EGG:
return EntityType.HORSE;
case HUSK_SPAWN_EGG:
return EntityType.HUSK;
case LLAMA_SPAWN_EGG:
return EntityType.LLAMA;
case MAGMA_CUBE_SPAWN_EGG:
return EntityType.MAGMA_CUBE;
case MOOSHROOM_SPAWN_EGG:
return EntityType.MUSHROOM_COW;
case MULE_SPAWN_EGG:
return EntityType.MULE;
case OCELOT_SPAWN_EGG:
return EntityType.OCELOT;
case PANDA_SPAWN_EGG:
return EntityType.PANDA;
case PARROT_SPAWN_EGG:
return EntityType.PARROT;
case PHANTOM_SPAWN_EGG:
return EntityType.PHANTOM;
case PIGLIN_BRUTE_SPAWN_EGG:
return EntityType.PIGLIN_BRUTE;
case PIGLIN_SPAWN_EGG:
return EntityType.PIGLIN;
case PILLAGER_SPAWN_EGG:
return EntityType.PILLAGER;
case POLAR_BEAR_SPAWN_EGG:
return EntityType.POLAR_BEAR;
case PUFFERFISH_SPAWN_EGG:
return EntityType.PUFFERFISH;
case RABBIT_SPAWN_EGG:
return EntityType.RABBIT;
case RAVAGER_SPAWN_EGG:
return EntityType.RAVAGER;
case SALMON_SPAWN_EGG:
return EntityType.SALMON;
case SHEEP_SPAWN_EGG:
return EntityType.SHEEP;
case SHULKER_SPAWN_EGG:
return EntityType.SHULKER;
case SILVERFISH_SPAWN_EGG:
return EntityType.SILVERFISH;
case SKELETON_HORSE_SPAWN_EGG:
return EntityType.SKELETON_HORSE;
case SKELETON_SPAWN_EGG:
return EntityType.SKELETON;
case SLIME_SPAWN_EGG:
return EntityType.SLIME;
case SQUID_SPAWN_EGG:
return EntityType.SQUID;
case STRAY_SPAWN_EGG:
return EntityType.STRAY;
case STRIDER_SPAWN_EGG:
return EntityType.STRIDER;
case TADPOLE_SPAWN_EGG:
return EntityType.TADPOLE;
case TRADER_LLAMA_SPAWN_EGG:
return EntityType.TRADER_LLAMA;
case TROPICAL_FISH_SPAWN_EGG:
return EntityType.TROPICAL_FISH;
case TURTLE_SPAWN_EGG:
return EntityType.TURTLE;
case VEX_SPAWN_EGG:
return EntityType.VEX;
case VILLAGER_SPAWN_EGG:
return EntityType.VILLAGER;
case VINDICATOR_SPAWN_EGG:
return EntityType.VINDICATOR;
case WANDERING_TRADER_SPAWN_EGG:
return EntityType.WANDERING_TRADER;
case WARDEN_SPAWN_EGG:
return EntityType.WARDEN;
case WITCH_SPAWN_EGG:
return EntityType.WITCH;
case WITHER_SKELETON_SPAWN_EGG:
return EntityType.WITHER_SKELETON;
case WOLF_SPAWN_EGG:
return EntityType.WOLF;
case ZOMBIE_HORSE_SPAWN_EGG:
return EntityType.ZOMBIE_HORSE;
case ZOMBIFIED_PIGLIN_SPAWN_EGG:
return EntityType.ZOMBIFIED_PIGLIN;
case ZOMBIE_SPAWN_EGG:
return EntityType.ZOMBIE;
case ZOMBIE_VILLAGER_SPAWN_EGG:
return EntityType.ZOMBIE_VILLAGER;
case PIG_SPAWN_EGG:
default: // Uhh
return EntityType.PIG;
}
return switch (material) {
case ALLAY_SPAWN_EGG -> EntityType.ALLAY;
case AXOLOTL_SPAWN_EGG -> EntityType.AXOLOTL;
case SPIDER_SPAWN_EGG -> EntityType.SPIDER;
case BAT_SPAWN_EGG -> EntityType.BAT;
case BEE_SPAWN_EGG -> EntityType.BEE;
case BLAZE_SPAWN_EGG -> EntityType.BLAZE;
case CAT_SPAWN_EGG -> EntityType.CAT;
case CAMEL_SPAWN_EGG -> EntityType.CAMEL;
case CAVE_SPIDER_SPAWN_EGG -> EntityType.CAVE_SPIDER;
case CHICKEN_SPAWN_EGG -> EntityType.CHICKEN;
case COD_SPAWN_EGG -> EntityType.COD;
case COW_SPAWN_EGG -> EntityType.COW;
case CREEPER_SPAWN_EGG -> EntityType.CREEPER;
case DOLPHIN_SPAWN_EGG -> EntityType.DOLPHIN;
case DONKEY_SPAWN_EGG -> EntityType.DONKEY;
case DROWNED_SPAWN_EGG -> EntityType.DROWNED;
case ELDER_GUARDIAN_SPAWN_EGG -> EntityType.ELDER_GUARDIAN;
case ENDER_DRAGON_SPAWN_EGG -> EntityType.ENDER_DRAGON;
case ENDERMAN_SPAWN_EGG -> EntityType.ENDERMAN;
case ENDERMITE_SPAWN_EGG -> EntityType.ENDERMITE;
case EVOKER_SPAWN_EGG -> EntityType.EVOKER;
case FOX_SPAWN_EGG -> EntityType.FOX;
case FROG_SPAWN_EGG -> EntityType.FROG;
case GHAST_SPAWN_EGG -> EntityType.GHAST;
case GLOW_SQUID_SPAWN_EGG -> EntityType.GLOW_SQUID;
case GOAT_SPAWN_EGG -> EntityType.GOAT;
case GUARDIAN_SPAWN_EGG -> EntityType.GUARDIAN;
case HOGLIN_SPAWN_EGG -> EntityType.HOGLIN;
case HORSE_SPAWN_EGG -> EntityType.HORSE;
case HUSK_SPAWN_EGG -> EntityType.HUSK;
case IRON_GOLEM_SPAWN_EGG -> EntityType.IRON_GOLEM;
case LLAMA_SPAWN_EGG -> EntityType.LLAMA;
case MAGMA_CUBE_SPAWN_EGG -> EntityType.MAGMA_CUBE;
case MOOSHROOM_SPAWN_EGG -> EntityType.MUSHROOM_COW;
case MULE_SPAWN_EGG -> EntityType.MULE;
case OCELOT_SPAWN_EGG -> EntityType.OCELOT;
case PANDA_SPAWN_EGG -> EntityType.PANDA;
case PARROT_SPAWN_EGG -> EntityType.PARROT;
case PHANTOM_SPAWN_EGG -> EntityType.PHANTOM;
case PIGLIN_BRUTE_SPAWN_EGG -> EntityType.PIGLIN_BRUTE;
case PIGLIN_SPAWN_EGG -> EntityType.PIGLIN;
case PILLAGER_SPAWN_EGG -> EntityType.PILLAGER;
case POLAR_BEAR_SPAWN_EGG -> EntityType.POLAR_BEAR;
case PUFFERFISH_SPAWN_EGG -> EntityType.PUFFERFISH;
case RABBIT_SPAWN_EGG -> EntityType.RABBIT;
case RAVAGER_SPAWN_EGG -> EntityType.RAVAGER;
case SALMON_SPAWN_EGG -> EntityType.SALMON;
case SHEEP_SPAWN_EGG -> EntityType.SHEEP;
case SHULKER_SPAWN_EGG -> EntityType.SHULKER;
case SILVERFISH_SPAWN_EGG -> EntityType.SILVERFISH;
case SKELETON_HORSE_SPAWN_EGG -> EntityType.SKELETON_HORSE;
case SKELETON_SPAWN_EGG -> EntityType.SKELETON;
case SLIME_SPAWN_EGG -> EntityType.SLIME;
case SNOW_GOLEM_SPAWN_EGG -> EntityType.SNOWMAN;
case SQUID_SPAWN_EGG -> EntityType.SQUID;
case STRAY_SPAWN_EGG -> EntityType.STRAY;
case STRIDER_SPAWN_EGG -> EntityType.STRIDER;
case TADPOLE_SPAWN_EGG -> EntityType.TADPOLE;
case TRADER_LLAMA_SPAWN_EGG -> EntityType.TRADER_LLAMA;
case TROPICAL_FISH_SPAWN_EGG -> EntityType.TROPICAL_FISH;
case TURTLE_SPAWN_EGG -> EntityType.TURTLE;
case VEX_SPAWN_EGG -> EntityType.VEX;
case VILLAGER_SPAWN_EGG -> EntityType.VILLAGER;
case VINDICATOR_SPAWN_EGG -> EntityType.VINDICATOR;
case WANDERING_TRADER_SPAWN_EGG -> EntityType.WANDERING_TRADER;
case WARDEN_SPAWN_EGG -> EntityType.WARDEN;
case WITCH_SPAWN_EGG -> EntityType.WITCH;
case WITHER_SPAWN_EGG -> EntityType.WITHER;
case WITHER_SKELETON_SPAWN_EGG -> EntityType.WITHER_SKELETON;
case WOLF_SPAWN_EGG -> EntityType.WOLF;
case ZOGLIN_SPAWN_EGG -> EntityType.ZOGLIN;
case ZOMBIE_HORSE_SPAWN_EGG -> EntityType.ZOMBIE_HORSE;
case ZOMBIFIED_PIGLIN_SPAWN_EGG -> EntityType.ZOMBIFIED_PIGLIN;
case ZOMBIE_SPAWN_EGG -> EntityType.ZOMBIE;
case ZOMBIE_VILLAGER_SPAWN_EGG -> EntityType.ZOMBIE_VILLAGER;
case PIG_SPAWN_EGG -> EntityType.PIG;
default -> null;
};
}
public static boolean isBed(Material material) {
@ -1360,9 +1212,10 @@ public static boolean isCoral(Material material) {
* @return true if the material is a crop
*/
public static boolean isCrop(Material type) {
if (Tag.CROPS.isTagged(type)) return true;
// yea, that's not all, there are some more
return switch (type) {
case WHEAT, CARROTS, POTATOES, BEETROOTS, MELON_STEM, PUMPKIN_STEM,
PUMPKIN, MELON, CACTUS, SUGAR_CANE, BAMBOO, BAMBOO_SAPLING,
case PUMPKIN, MELON, CACTUS, SUGAR_CANE, BAMBOO, BAMBOO_SAPLING,
SWEET_BERRY_BUSH, NETHER_WART, CAVE_VINES, CAVE_VINES_PLANT ->
true;
default -> false;
@ -1517,7 +1370,6 @@ public static boolean isToolApplicable(Material toolMaterial, Material targetMat
case NETHERITE_HOE:
return switch (targetMaterial) {
case GRASS_BLOCK, DIRT, DIRT_PATH, ROOTED_DIRT ->
// case COARSE_DIRT: // already handled by the server...
true;
default -> false;
};
@ -1527,11 +1379,10 @@ public static boolean isToolApplicable(Material toolMaterial, Material targetMat
case GOLDEN_AXE:
case DIAMOND_AXE:
case NETHERITE_AXE:
if (isWaxedCopper(targetMaterial))
return true;
if (isWaxedCopper(targetMaterial)) return true;
if (Tag.LOGS.isTagged(targetMaterial)) return true;
return switch (targetMaterial) {
case OAK_LOG, DARK_OAK_LOG, ACACIA_LOG, BIRCH_LOG, SPRUCE_LOG, JUNGLE_LOG,
OAK_WOOD, DARK_OAK_WOOD, ACACIA_WOOD, BIRCH_WOOD, SPRUCE_WOOD,
case OAK_WOOD, DARK_OAK_WOOD, ACACIA_WOOD, BIRCH_WOOD, SPRUCE_WOOD, PUMPKIN,
JUNGLE_WOOD, CRIMSON_STEM, WARPED_STEM, CRIMSON_HYPHAE, WARPED_HYPHAE ->
true;
default -> false;
@ -1569,7 +1420,7 @@ public static boolean isToolApplicable(Material toolMaterial, Material targetMat
case YELLOW_DYE:
case GLOW_INK_SAC:
case INK_SAC:
return Tag.SIGNS.isTagged(targetMaterial);
return Tag.ALL_SIGNS.isTagged(targetMaterial);
case HONEYCOMB:
return isUnwaxedCopper(targetMaterial);
default:

View File

@ -42,7 +42,7 @@ public ServerReport() {
onlineMode.append("BungeeCord support?", Bukkit.spigot().getConfig().getBoolean("settings.bungeecord", false));
}
if (PaperLib.isPaper()) {
onlineMode.append("Velocity support?", Bukkit.spigot().getPaperConfig().getBoolean("settings.velocity-support.enabled", false));
onlineMode.append("Velocity support?", Bukkit.spigot().getPaperConfig().getBoolean("proxies.velocity.enabled", false));
}
append(onlineMode.getTitle(), onlineMode);

View File

@ -8,11 +8,11 @@
"api"(project(":worldguard-libs:core"))
"api"("com.sk89q.worldedit:worldedit-core:${Versions.WORLDEDIT}")
"implementation"("org.flywaydb:flyway-core:3.0")
"implementation"("org.yaml:snakeyaml:1.29")
"implementation"("org.yaml:snakeyaml:1.33")
"implementation"("com.google.guava:guava:${Versions.GUAVA}")
"compileOnly"("com.google.code.findbugs:jsr305:1.3.9")
"testImplementation"("org.hamcrest:hamcrest-library:1.2.1")
"compileOnly"("com.google.code.findbugs:jsr305:${Versions.FINDBUGS}")
"testImplementation"("org.hamcrest:hamcrest-library:2.2")
}
tasks.withType<JavaCompile>().configureEach {