From d3574f1519001e4ea75e439f0552f783082955d7 Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 22 Aug 2020 17:59:05 +0200 Subject: [PATCH] Add support for 1.16.2 --- pom.xml | 2 +- script/entries.txt | 1 + src/main/java/de/epiceric/shopchest/ShopChest.java | 1 + .../java/de/epiceric/shopchest/language/LanguageUtils.java | 5 +++++ src/main/java/de/epiceric/shopchest/utils/Utils.java | 2 ++ src/main/resources/lang/de_DE.lang | 1 + src/main/resources/lang/en_US.lang | 1 + 7 files changed, 12 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e19beff..0b9fd7d 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ org.spigotmc spigot-api - 1.16.1-R0.1-SNAPSHOT + 1.16.2-R0.1-SNAPSHOT provided diff --git a/script/entries.txt b/script/entries.txt index 1dad6e1..3826ec6 100644 --- a/script/entries.txt +++ b/script/entries.txt @@ -1064,6 +1064,7 @@ item.minecraft.phantom_membrane item.minecraft.phantom_spawn_egg item.minecraft.pig_spawn_egg item.minecraft.piglin_banner_pattern.desc +item.minecraft.piglin_brute_spawn_egg item.minecraft.piglin_spawn_egg item.minecraft.pillager_spawn_egg item.minecraft.pink_dye diff --git a/src/main/java/de/epiceric/shopchest/ShopChest.java b/src/main/java/de/epiceric/shopchest/ShopChest.java index 0d5e5b5..f30c6b5 100644 --- a/src/main/java/de/epiceric/shopchest/ShopChest.java +++ b/src/main/java/de/epiceric/shopchest/ShopChest.java @@ -185,6 +185,7 @@ public class ShopChest extends JavaPlugin { case "v1_14_R1": case "v1_15_R1": case "v1_16_R1": + case "v1_16_R2": break; default: debug("Server version not officially supported: " + Utils.getServerVersion() + "!"); diff --git a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java index 3885bc5..6630b8e 100644 --- a/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java +++ b/src/main/java/de/epiceric/shopchest/language/LanguageUtils.java @@ -2059,6 +2059,11 @@ public class LanguageUtils { itemNames.add(new ItemName(Material.WEEPING_VINES_PLANT, langConfig.getString("block.minecraft.weeping_vines_plant", "Weeping Vines Plant"))); itemNames.add(new ItemName(Material.ZOGLIN_SPAWN_EGG, langConfig.getString("item.minecraft.zoglin_spawn_egg", "Zoglin Spawn Egg"))); itemNames.add(new ItemName(Material.ZOMBIFIED_PIGLIN_SPAWN_EGG, langConfig.getString("item.minecraft.zombified_piglin_spawn_egg", "Zombified Piglin Spawn Egg"))); + + if (Utils.getMajorVersion() > 16 || Utils.getRevision() >= 2) { + // Add 1.16.2 item names + itemNames.add(new ItemName(Material.PIGLIN_BRUTE_SPAWN_EGG, langConfig.getString("item.minecraft.piglin_brute_spawn_egg", "Piglin Brute Spawn Egg"))); + } } else { // Add pre-1.16 item names that don't exist anymore itemNames.add(new ItemName(Material.valueOf("ZOMBIE_PIGMAN_SPAWN_EGG"), langConfig.getString("item.minecraft.zombie_pigman_spawn_egg", "Zombie Pigman Spawn Egg"))); diff --git a/src/main/java/de/epiceric/shopchest/utils/Utils.java b/src/main/java/de/epiceric/shopchest/utils/Utils.java index 671f966..4b90028 100644 --- a/src/main/java/de/epiceric/shopchest/utils/Utils.java +++ b/src/main/java/de/epiceric/shopchest/utils/Utils.java @@ -412,6 +412,8 @@ public class Utils { dataWatcherObjectFieldNames = new String[] {"T", "AIR_TICKS", "aA", "az", "aB", "aC", "ITEM", "b"}; } else if ("v1_16_R1".equals(version)) { dataWatcherObjectFieldNames = new String[] {"T", "AIR_TICKS", "ay", "ax", "az", "aA", "ITEM", "b"}; + } else if ("v1_16_R2".equals(version)) { + dataWatcherObjectFieldNames = new String[] {"S", "AIR_TICKS", "ar", "aq", "as", "at", "ITEM", "b"}; } else { return null; } diff --git a/src/main/resources/lang/de_DE.lang b/src/main/resources/lang/de_DE.lang index 2e52ff3..d27387a 100644 --- a/src/main/resources/lang/de_DE.lang +++ b/src/main/resources/lang/de_DE.lang @@ -1158,6 +1158,7 @@ item.minecraft.phantom_membrane=Phantomhaut item.minecraft.phantom_spawn_egg=Phantom-Spawn-Ei item.minecraft.pig_spawn_egg=Schweine-Spawn-Ei item.minecraft.piglin_banner_pattern.desc=Schnauze +item.minecraft.piglin_brute_spawn_egg=Piglin-Barbaren-Spawn-Ei item.minecraft.piglin_spawn_egg=Piglin-Spawn-Ei item.minecraft.pillager_spawn_egg=Plünderer-Spawn-Ei item.minecraft.pink_dye=Rosa Farbstoff diff --git a/src/main/resources/lang/en_US.lang b/src/main/resources/lang/en_US.lang index c35e8fa..5283086 100644 --- a/src/main/resources/lang/en_US.lang +++ b/src/main/resources/lang/en_US.lang @@ -1285,6 +1285,7 @@ item.minecraft.ocelot_spawn_egg=Ocelot Spawn Egg item.minecraft.panda_spawn_egg=Panda Spawn Egg item.minecraft.parrot_spawn_egg=Parrot Spawn Egg item.minecraft.pig_spawn_egg=Pig Spawn Egg +item.minecraft.piglin_brute_spawn_egg=Piglin Brute Spawn Egg item.minecraft.piglin_spawn_egg=Piglin Spawn Egg item.minecraft.pillager_spawn_egg=Pillager Spawn Egg item.minecraft.phantom_spawn_egg=Phantom Spawn Egg