1
0
forked from xjboss/KCauldronX

Fix bukkit's world name

This commit is contained in:
Prototik 2015-05-21 19:20:26 +07:00
parent cfda3c2dca
commit 2c219227af
3 changed files with 39 additions and 3 deletions

View File

@ -264,7 +264,7 @@
+ // Cauldron end + // Cauldron end
+ } + }
+ +
+ if (p_73078_3_ != null && !denyItem && !denyBlock) + if (p_73078_3_ != null && !denyResult)
{ {
- p_73078_3_.setItemDamage(meta); - p_73078_3_.setItemDamage(meta);
- p_73078_3_.stackSize = size; - p_73078_3_.stackSize = size;

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java --- ../src-base/minecraft/net/minecraft/world/WorldServerMulti.java
+++ ../src-work/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"; private static final String __OBFID = "CL_00001430";
@ -12,15 +12,17 @@
+ this.mapStorage = p_i45283_6_.mapStorage; + this.mapStorage = p_i45283_6_.mapStorage;
+ this.worldScoreboard = p_i45283_6_.getScoreboard(); + this.worldScoreboard = p_i45283_6_.getScoreboard();
+ this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); + this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo());
+ this.worldInfo.setWorldName(p_i45283_3_);
+ } + }
+ +
+ // Cauldron start - vanilla compatibility + // 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_) 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_); 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.worldScoreboard = p_i45283_6_.getScoreboard();
this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo()); this.worldInfo = new DerivedWorldInfo(p_i45283_6_.getWorldInfo());
+ this.worldInfo.setWorldName(p_i45283_3_);
} }
+ // Cauldron end + // Cauldron end

View File

@ -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);
+ }
}