From 8b0659a2b4fe2a722557afbcf6192a74d652c473 Mon Sep 17 00:00:00 2001 From: Ali Moghnieh Date: Sun, 20 Nov 2016 16:03:56 +0000 Subject: [PATCH] Update to 1.11. - Support new enchantments. - Support new mobs. - Rename MobData WHITHER_SKELETON to WITHER_SKELETON. - implement NOOP methods of new API methods for fake classes. - Amend item dictionary. --- .../com/earth2me/essentials/Enchantments.java | 19 +++ .../com/earth2me/essentials/Essentials.java | 1 - .../src/com/earth2me/essentials/Mob.java | 16 ++- .../src/com/earth2me/essentials/MobData.java | 2 +- .../earth2me/essentials/OfflinePlayer.java | 55 ++++++++ .../essentials/craftbukkit/FakeWorld.java | 10 ++ Essentials/src/items.csv | 117 ++++++++++++++++++ .../com/earth2me/essentials/FakeServer.java | 5 - pom.xml | 2 +- 9 files changed, 218 insertions(+), 9 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Enchantments.java b/Essentials/src/com/earth2me/essentials/Enchantments.java index 3e802b38c..f98007395 100644 --- a/Essentials/src/com/earth2me/essentials/Enchantments.java +++ b/Essentials/src/com/earth2me/essentials/Enchantments.java @@ -173,6 +173,25 @@ public class Enchantments { ENCHANTMENTS.put("mending", mending); } } catch (IllegalArgumentException ignored) {} + + // 1.11 + try { + Enchantment bindingCurse = Enchantment.getByName("BINDING_CURSE"); + if (bindingCurse != null) { + ENCHANTMENTS.put("bindingcurse", bindingCurse); + ALIASENCHANTMENTS.put("bindcurse", bindingCurse); + ALIASENCHANTMENTS.put("binding", bindingCurse); + ALIASENCHANTMENTS.put("bind", bindingCurse); + } + Enchantment vanishingCurse = Enchantment.getByName("VANISHING_CURSE"); + if (vanishingCurse != null) { + ENCHANTMENTS.put("vanishingcurse", vanishingCurse); + ALIASENCHANTMENTS.put("vanishcurse", vanishingCurse); + ALIASENCHANTMENTS.put("vanishing", vanishingCurse); + ALIASENCHANTMENTS.put("vanish", vanishingCurse); + + } + } catch (IllegalArgumentException ignored) {} } public static Enchantment getByName(String name) { diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 50ef0723c..38c1633a5 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -143,7 +143,6 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials { LOGGER.log(Level.INFO, tl("usingTempFolderForTesting")); LOGGER.log(Level.INFO, dataFolder.toString()); - this.initialize(null, server, new PluginDescriptionFile(new FileReader(new File("src" + File.separator + "plugin.yml"))), dataFolder, null, null); settings = new Settings(this); userMap = new UserMap(this); permissionsHandler = new PermissionsHandler(this, false); diff --git a/Essentials/src/com/earth2me/essentials/Mob.java b/Essentials/src/com/earth2me/essentials/Mob.java index f64c2802e..52e95da4f 100644 --- a/Essentials/src/com/earth2me/essentials/Mob.java +++ b/Essentials/src/com/earth2me/essentials/Mob.java @@ -57,9 +57,23 @@ public enum Mob { ARMOR_STAND("ArmorStand", Enemies.NEUTRAL, "ARMOR_STAND"), ENDERMITE("Endermite", Enemies.ENEMY, "ENDERMITE"), GUARDIAN("Guardian", Enemies.ENEMY, "GUARDIAN"), + ELDER_GUARDIAN("ElderGuardian", Enemies.ENEMY, "ELDER_GUARDIAN"), RABBIT("Rabbit", Enemies.FRIENDLY, "RABBIT"), SHULKER("Shulker", Enemies.ENEMY, "SHULKER"), - POLAR_BEAR("PolarBear", Enemies.NEUTRAL, "POLAR_BEAR"); + POLAR_BEAR("PolarBear", Enemies.NEUTRAL, "POLAR_BEAR"), + WITHER_SKELETON("WitherSkeleton", Enemies.ENEMY, "WITHER_SKELETON"), + STRAY_SKELETON("StraySkeleton", Enemies.ENEMY, "STRAY"), + ZOMBIE_VILLAGER("ZombieVillager", Enemies.FRIENDLY, "ZOMBIE_VILLAGER"), + SKELETON_HORSE("SkeletonHorse", Enemies.FRIENDLY, "SKELETON_HORSE"), + ZOMBIE_HORSE("ZombieHorse", Enemies.FRIENDLY, "ZOMBIE_HORSE"), + DONKEY("Donkey", Enemies.FRIENDLY, "DONKEY"), + MULE("Mule", Enemies.FRIENDLY, "MULE"), + EVOKER("Evoker", Enemies.ENEMY, "EVOKER"), + VEX("Vex", Enemies.ENEMY, "VEX"), + VINDICATOR("Vindicator", Enemies.ENEMY, "VINDICATOR"), + LLAMA("Llama", Enemies.NEUTRAL, "LLAMA"), + HUSK("Husk", Enemies.ENEMY, "HUSK"), + ; public static final Logger logger = Logger.getLogger("Essentials"); diff --git a/Essentials/src/com/earth2me/essentials/MobData.java b/Essentials/src/com/earth2me/essentials/MobData.java index a43fe863e..cc879ac92 100644 --- a/Essentials/src/com/earth2me/essentials/MobData.java +++ b/Essentials/src/com/earth2me/essentials/MobData.java @@ -82,7 +82,7 @@ public enum MobData { STONE_SWORD_SKELETON("stonesword", EntityType.SKELETON, Material.STONE_SWORD, false), SWORD_SKELETON("sword", EntityType.SKELETON, Material.STONE_SWORD, true), BOW_SKELETON("bow", EntityType.SKELETON, Material.BOW, true), - WHITHER_SKELETON("wither", EntityType.SKELETON, Data.WITHER, true), + WITHER_SKELETON("wither", EntityType.SKELETON, Data.WITHER, true), POWERED_CREEPER("powered", EntityType.CREEPER, Data.ELECTRIFIED, true), ELECTRIC_CREEPER("electric", EntityType.CREEPER, Data.ELECTRIFIED, false), CHARGED_CREEPER("charged", EntityType.CREEPER, Data.ELECTRIFIED, false), diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 79ec1b194..e212d514f 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -769,6 +769,11 @@ public class OfflinePlayer implements Player { return false; } + @Override + public PotionEffect getPotionEffect(PotionEffectType potionEffectType) { + return null; + } + @Override public void removePotionEffect(PotionEffectType pet) { } @@ -884,6 +889,11 @@ public class OfflinePlayer implements Player { return false; } + @Override + public boolean isHandRaised() { + return false; + } + @Override public void abandonConversation(Conversation arg0, ConversationAbandonedEvent arg1) { } @@ -1047,6 +1057,31 @@ public class OfflinePlayer implements Player { public void setGravity(boolean b) { } + @Override + public int getPortalCooldown() { + return 0; + } + + @Override + public void setPortalCooldown(int i) { + + } + + @Override + public Set getScoreboardTags() { + return null; + } + + @Override + public boolean addScoreboardTag(String s) { + return false; + } + + @Override + public boolean removeScoreboardTag(String s) { + return false; + } + @Override public void setPlayerWeather(WeatherType arg0) { } @@ -1113,6 +1148,16 @@ public class OfflinePlayer implements Player { public void playSound(Location arg0, String arg1, float arg2, float arg3) { } + @Override + public void playSound(Location location, Sound sound, SoundCategory soundCategory, float v, float v1) { + + } + + @Override + public void playSound(Location location, String s, SoundCategory soundCategory, float v, float v1) { + + } + @Override public void stopSound(Sound sound) { } @@ -1121,6 +1166,16 @@ public class OfflinePlayer implements Player { public void stopSound(String s) { } + @Override + public void stopSound(Sound sound, SoundCategory soundCategory) { + + } + + @Override + public void stopSound(String s, SoundCategory soundCategory) { + + } + @Override public boolean isHealthScaled() { return false; diff --git a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java index e991c573a..1410fbfe6 100644 --- a/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/craftbukkit/FakeWorld.java @@ -587,6 +587,16 @@ public class FakeWorld implements World { throw new UnsupportedOperationException("Not supported yet."); } + @Override + public void playSound(Location location, Sound sound, SoundCategory soundCategory, float v, float v1) { + + } + + @Override + public void playSound(Location location, String s, SoundCategory soundCategory, float v, float v1) { + + } + @Override public int getAmbientSpawnLimit() { throw new UnsupportedOperationException("Not supported yet."); diff --git a/Essentials/src/items.csv b/Essentials/src/items.csv index 96569a989..0d45e09f0 100644 --- a/Essentials/src/items.csv +++ b/Essentials/src/items.csv @@ -4141,6 +4141,121 @@ blockrednb,215,0 boneblock,216,0 skeletonboneblock,216,0 skeletonblock,216,0 +observer,218,0 +budblock,218,0 +bud,218,0 +shulkerbox,219,0 +whiteshulkerbox,219,0 +wshulkerbox,219,0 +whitechest,219,0 +wchest,219,0 +orangeshulkerbox,220,0 +oshulkerbox,220,0 +orangechest,220,0 +ochest,220,0 +magentashulkerbox,221,0 +magentachest,221,0 +mshulkerbox,221,0 +mchest,221,0 +mashulkerbox,221,0 +machest,221,0 +lightblueshulkerbox,222,0 +lightbluechest,222,0 +lblueshulkerbox,222,0 +lbluechest,222,0 +lbshulkerbox,222,0 +lbchest,222,0 +lblushulkerbox,222,0 +lightbluchest,222,0 +lbluchest,222,0 +yellowshulkerbox,223,0 +yshulkerbox,223,0 +yellowchest,223,0 +ychest,223,0 +limeshulkerbox,224,0 +lshulkerbox,224,0 +lgreenshulkerbox,224,0 +lgreshulkerbox,224,0 +limechest,224,0 +lgrechest,224,0 +lchest,224,0 +pinkshulkerbox,225,0 +pishulkerbox,225,0 +pinkchest,225,0 +pichest,225,0 +grayshulkerbox,226,0 +greyshulkerbox,226,0 +darkgrayshulkerbox,226,0 +darkgreyshulkerbox,226,0 +dgrayshulkerbox,226,0 +dgreyshulkerbox,226,0 +grashulkerbox,226,0 +greshulkerbox,226,0 +dgrashulkerbox,226,0 +dgreshulkerbox,226,0 +graychest,226,0 +greychest,226,0 +darkgraychest,226,0 +darkgreychest,226,0 +dgraychest,226,0 +dgreychest,226,0 +grachest,226,0 +darkgrachest,226,0 +dgrachest,226,0 +silvershulkerbox,227,0 +silverchest,227,0 +sishulkerbox,227,0 +sichest,227,0 +lgshulkerbox,227,0 +lgchest,227,0 +lightgrayshulkerbox,227,0 +lightgreyshulkerbox,227,0 +lightgraychest,227,0 +lightgreychest,227,0 +lightgrashulkerbox,227,0 +lightgreshulkerbox,227,0 +lightgrachest,227,0 +lightgrechest,227,0 +lgraychest,227,0 +lgreychest,227,0 +lgrachest,227,0 +lgrechest,227,0 +cyanshulkerbox,228,0 +cyanchest,228,0 +cshulkerbox,228,0 +cchest,228,0 +purpleshulkerbox,229,0 +purplechest,229,0 +pushulkerbox,229,0 +puchest,229,0 +blueshulkerbox,230,0 +bluechest,230,0 +blushulkerbox,230,0 +bluchest,230,0 +brownshulkerbox,231,0 +brownchest,231,0 +broshulkerbox,231,0 +brochest,231,0 +darkgreenshulkerbox,232,0 +darkgreenchest,232,0 +greenshulkerbox,232,0 +greenchest,232,0 +greenshulkerbox,232,0 +greenchest,232,0 +greshulkerbox,232,0 +grechest,232,0 +dgreshulkerbox,232,0 +dgrechest,232,0 +darkgreshulkerbox,232,0 +darkgrechest,232,0 +redshulkerbox,233,0 +rshulkerbox,233,0 +redchest,233,0 +rchest,233,0 +blackshulkerbox,234,0 +blashulkerbox,234,0 +blackchest,234,0 +blachest,234,0 structureblock,255,0 ironshovel,256,0 ironspade,256,0 @@ -7115,6 +7230,8 @@ acaciadoor,196,0 acaciadooritem,430,0 darkoakdoor,197,0 darkoakdooritem,431,0 +totem,449,0 +shulkershell,450,0 13disc,2256,0 goldmusicrecord,2256,0 goldmusicdisk,2256,0 diff --git a/Essentials/test/com/earth2me/essentials/FakeServer.java b/Essentials/test/com/earth2me/essentials/FakeServer.java index 8de8649fe..fcb433034 100644 --- a/Essentials/test/com/earth2me/essentials/FakeServer.java +++ b/Essentials/test/com/earth2me/essentials/FakeServer.java @@ -770,11 +770,6 @@ public class FakeServer implements Server { throw new UnsupportedOperationException("Not supported yet."); } - @Override - public boolean useExactLoginLocation() { - throw new UnsupportedOperationException("Not supported yet."); - } - @Override public int getTicksPerAnimalSpawns() { throw new UnsupportedOperationException("Not supported yet."); diff --git a/pom.xml b/pom.xml index 71a81296f..dd655e8fc 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ org.bukkit bukkit - 1.10-R0.1-SNAPSHOT + 1.11-R0.1-SNAPSHOT provided