Fix nether world border center not adjusting

This commit is contained in:
md_5 2017-06-18 19:23:33 +10:00
parent 4e27449ac2
commit 03f1e37ae2
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,15 @@
--- a/net/minecraft/server/PacketPlayOutWorldBorder.java
+++ b/net/minecraft/server/PacketPlayOutWorldBorder.java
@@ -18,8 +18,10 @@
public PacketPlayOutWorldBorder(WorldBorder worldborder, PacketPlayOutWorldBorder.EnumWorldBorderAction packetplayoutworldborder_enumworldborderaction) {
this.a = packetplayoutworldborder_enumworldborderaction;
- this.c = worldborder.getCenterX();
- this.d = worldborder.getCenterZ();
+ // CraftBukkit start - multiply out nether border
+ this.c = worldborder.getCenterX() * (worldborder.world.worldProvider instanceof WorldProviderHell ? 8 : 1);
+ this.d = worldborder.getCenterZ() * (worldborder.world.worldProvider instanceof WorldProviderHell ? 8 : 1);
+ // CraftBukkit end
this.f = worldborder.getSize();
this.e = worldborder.j();
this.g = worldborder.i();

View file

@ -0,0 +1,16 @@
--- a/net/minecraft/server/WorldProviderHell.java
+++ b/net/minecraft/server/WorldProviderHell.java
@@ -44,11 +44,11 @@
public WorldBorder getWorldBorder() {
return new WorldBorder() {
public double getCenterX() {
- return super.getCenterX() / 8.0D;
+ return super.getCenterX(); // CraftBukkit
}
public double getCenterZ() {
- return super.getCenterZ() / 8.0D;
+ return super.getCenterZ(); // CraftBukkit
}
};
}