From 2c219227af7e4bc06b1359ecd5dab62d5c456359 Mon Sep 17 00:00:00 2001 From: Prototik Date: Thu, 21 May 2015 19:20:26 +0700 Subject: [PATCH] Fix bukkit's world name --- .../management/ItemInWorldManager.java.patch | 2 +- .../world/WorldServerMulti.java.patch | 6 ++-- .../world/storage/DerivedWorldInfo.java.patch | 34 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch diff --git a/patches/net/minecraft/server/management/ItemInWorldManager.java.patch b/patches/net/minecraft/server/management/ItemInWorldManager.java.patch index 0d583c3..fe743fe 100644 --- a/patches/net/minecraft/server/management/ItemInWorldManager.java.patch +++ b/patches/net/minecraft/server/management/ItemInWorldManager.java.patch @@ -264,7 +264,7 @@ + // Cauldron end + } + -+ if (p_73078_3_ != null && !denyItem && !denyBlock) ++ if (p_73078_3_ != null && !denyResult) { - p_73078_3_.setItemDamage(meta); - p_73078_3_.stackSize = size; diff --git a/patches/net/minecraft/world/WorldServerMulti.java.patch b/patches/net/minecraft/world/WorldServerMulti.java.patch index 5843059..02a78e5 100644 --- a/patches/net/minecraft/world/WorldServerMulti.java.patch +++ b/patches/net/minecraft/world/WorldServerMulti.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java +++ ../src-work/minecraft/net/minecraft/world/WorldServerMulti.java -@@ -9,6 +9,17 @@ +@@ -9,16 +9,35 @@ { private static final String __OBFID = "CL_00001430"; @@ -12,15 +12,17 @@ + this.mapStorage = p_i45283_6_.mapStorage; + this.worldScoreboard = p_i45283_6_.getScoreboard(); + this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); ++ this.worldInfo.setWorldName(p_i45283_3_); + } + + // Cauldron start - vanilla compatibility public WorldServerMulti(MinecraftServer p_i45283_1_, ISaveHandler p_i45283_2_, String p_i45283_3_, int p_i45283_4_, WorldSettings p_i45283_5_, WorldServer p_i45283_6_, Profiler p_i45283_7_) { super(p_i45283_1_, p_i45283_2_, p_i45283_3_, p_i45283_4_, p_i45283_5_, p_i45283_7_); -@@ -16,9 +27,15 @@ + this.mapStorage = p_i45283_6_.mapStorage; this.worldScoreboard = p_i45283_6_.getScoreboard(); this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); ++ this.worldInfo.setWorldName(p_i45283_3_); } + // Cauldron end diff --git a/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch b/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch new file mode 100644 index 0000000..9573f80 --- /dev/null +++ b/patches/net/minecraft/world/storage/DerivedWorldInfo.java.patch @@ -0,0 +1,34 @@ +--- ../src-base/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java ++++ ../src-work/minecraft/net/minecraft/world/storage/DerivedWorldInfo.java +@@ -75,7 +75,8 @@ + + public String getWorldName() + { +- return this.theWorldInfo.getWorldName(); ++ String name = super.getWorldName(); ++ return name != null ? name : this.theWorldInfo.getWorldName(); + } + + public int getSaveVersion() +@@ -129,8 +130,6 @@ + + public void setSpawnPosition(int p_76081_1_, int p_76081_2_, int p_76081_3_) {} + +- public void setWorldName(String p_76062_1_) {} +- + public void setSaveVersion(int p_76078_1_) {} + + public void setThundering(boolean p_76069_1_) {} +@@ -174,4 +173,12 @@ + { + return this.theWorldInfo.getGameRulesInstance(); + } ++ ++ public int getDimension() { ++ return this.theWorldInfo.getDimension(); ++ } ++ ++ public void setDimension(int dim) { ++ this.theWorldInfo.setDimension(dim); ++ } + }