diff --git a/paper-server/pom.xml b/paper-server/pom.xml index b5bcc44c23..830d7e4bc0 100644 --- a/paper-server/pom.xml +++ b/paper-server/pom.xml @@ -39,7 +39,7 @@ org.bukkit minecraft-server - 1.3 + 1.4 jar compile diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index e8c035be4e..03e5b4b62b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Random; import java.util.logging.Level; import java.util.logging.Logger; import jline.ConsoleReader; @@ -36,7 +37,7 @@ import org.bukkit.craftbukkit.scheduler.CraftScheduler; public final class CraftServer implements Server { private final String serverName = "Craftbukkit"; private final String serverVersion; - private final String protocolVersion = "1.3"; + private final String protocolVersion = "1.4"; private final PluginManager pluginManager = new SimplePluginManager(this); private final BukkitScheduler scheduler = new CraftScheduler(this); private final CommandMap commandMap = new SimpleCommandMap(this); @@ -269,6 +270,10 @@ public final class CraftServer implements Server { } public World createWorld(String name, World.Environment environment) { + return createWorld(name, environment, (new Random()).nextLong()); + } + + public World createWorld(String name, World.Environment environment, long seed) { File folder = new File(name); World world = getWorld(name); @@ -286,7 +291,7 @@ public final class CraftServer implements Server { converter.a(name, new ConvertProgressUpdater(console)); } - WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment == World.Environment.NETHER ? -1 : 0); + WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment == World.Environment.NETHER ? -1 : 0, seed); internal.a(new WorldManager(console, internal)); internal.j = 1; @@ -312,10 +317,10 @@ public final class CraftServer implements Server { i = l; } - ChunkCoordinates chunkcoordinates = internal.l(); + ChunkCoordinates chunkcoordinates = internal.m(); internal.u.d(chunkcoordinates.a + j >> 4, chunkcoordinates.c + k >> 4); - while (internal.e()) { + while (internal.f()) { ; } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 3e009c67b8..52d376d3ac 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -66,7 +66,7 @@ public class CraftWorld implements World { } public Location getSpawnLocation() { - ChunkCoordinates spawn = world.l(); + ChunkCoordinates spawn = world.m(); return new Location(this, spawn.a, spawn.b, spawn.c); } @@ -80,7 +80,7 @@ public class CraftWorld implements World { } public Chunk getChunkAt(int x, int z) { - return this.provider.d(x,z).bukkitChunk; + return this.provider.c(x, z).bukkitChunk; } public Chunk getChunkAt(Block block) { @@ -124,7 +124,7 @@ public class CraftWorld implements World { return false; } - provider.c(x, z); + provider.d(x, z); return true; } @@ -214,7 +214,7 @@ public class CraftWorld implements World { public boolean loadChunk(int x, int z, boolean generate) { if (generate) { // Use the default variant of loadChunk when generate == true. - return provider.d(x, z) != null; + return provider.c(x, z) != null; } provider.a.remove(x, z); @@ -524,7 +524,7 @@ public class CraftWorld implements World { public void save() { // Writes level.dat - world.r(); + world.t(); // Saves all chunks/regions world.o.a(true, null); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 779194d227..cde4dc93f4 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -387,12 +387,12 @@ public class CraftBlock implements Block { int power = 0; BlockRedstoneWire wire = (BlockRedstoneWire) net.minecraft.server.Block.REDSTONE_WIRE; net.minecraft.server.World world = chunk.getHandle().d; - if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.i(x, y - 1, z, 0)) power = wire.g(world, x, y - 1, z, power); - if ((face == BlockFace.UP || face == BlockFace.SELF) && world.i(x, y + 1, z, 1)) power = wire.g(world, x, y + 1, z, power); - if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.i(x, y, z - 1, 2)) power = wire.g(world, x, y, z - 1, power); - if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.i(x, y, z + 1, 3)) power = wire.g(world, x, y, z + 1, power); - if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.i(x - 1, y, z, 4)) power = wire.g(world, x - 1, y, z, power); - if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.i(x + 1, y, z, 5)) power = wire.g(world, x + 1, y, z, power); + if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.i(x, y - 1, z, 0)) power = wire.f(world, x, y - 1, z, power); + if ((face == BlockFace.UP || face == BlockFace.SELF) && world.i(x, y + 1, z, 1)) power = wire.f(world, x, y + 1, z, power); + if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.i(x, y, z - 1, 2)) power = wire.f(world, x, y, z - 1, power); + if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.i(x, y, z + 1, 3)) power = wire.f(world, x, y, z + 1, power); + if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.i(x - 1, y, z, 4)) power = wire.f(world, x - 1, y, z, power); + if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.i(x + 1, y, z, 5)) power = wire.f(world, x + 1, y, z, power); return power > 0 ? power : (face == BlockFace.SELF ? isBlockIndirectlyPowered() : isBlockFaceIndirectlyPowered(face)) ? 15 : 0; } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java index b5fab374c1..c389d3a2f2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -32,7 +32,7 @@ public class CraftChest extends CraftBlockState implements Chest { boolean result = super.update(force); if (result) { - chest.h(); + chest.i(); } return result; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java index 9b519fc20d..d2f432d83b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java @@ -49,7 +49,7 @@ public class CraftDispenser extends CraftBlockState implements Dispenser { boolean result = super.update(force); if (result) { - dispenser.h(); + dispenser.i(); } return result; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java index 30ffa6be02..feb8a84834 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java @@ -32,7 +32,7 @@ public class CraftFurnace extends CraftBlockState implements Furnace { boolean result = super.update(force); if (result) { - furnace.h(); + furnace.i(); } return result; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java index 3b33c0cf47..5983c3dd5a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -33,7 +33,7 @@ public class CraftSign extends CraftBlockState implements Sign { boolean result = super.update(force); if (result) { - sign.h(); + sign.i(); } return result; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 39aa8e5dc4..4be1716c37 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -158,7 +158,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { newEntity.health = entity.health; newEntity.fireTicks = entity.fireTicks; newEntity.inventory = entity.inventory; - newEntity.inventory.e = newEntity; + newEntity.inventory.d = newEntity; newEntity.activeContainer = entity.activeContainer; newEntity.defaultContainer = entity.defaultContainer; newEntity.locX = location.getX(); @@ -194,14 +194,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setSneaking(boolean sneak) { - getHandle().b(sneak); + getHandle().e(sneak); } public boolean isSneaking() { - return getHandle().U(); + return getHandle().Z(); } public void updateInventory() { - getHandle().l(); + getHandle().m(); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java index 0457e1256c..5a0e5fa08f 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java @@ -22,7 +22,7 @@ public class CraftSheep extends CraftAnimals implements Sheep { } public DyeColor getColor() { - return DyeColor.getByData((byte) getHandle().n()); + return DyeColor.getByData((byte) getHandle().o()); } public void setColor(DyeColor color) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java index 9a935c4cb6..3d3cca16a7 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java @@ -21,7 +21,7 @@ public class CraftSlime extends CraftLivingEntity implements Slime { } public int getSize() { - return getHandle().c; + return getHandle().m(); } public void setSize(int size) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index e58fae0e75..e419dc0b9c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -50,7 +50,7 @@ public class CraftEventFactory { if (spawnSize <= 0) return true; if (player.isOp()) return true; - ChunkCoordinates chunkcoordinates = worldServer.l(); + ChunkCoordinates chunkcoordinates = worldServer.m(); int distanceFromSpawn = (int) Math.max(Math.abs(x - chunkcoordinates.a), Math.abs(z - chunkcoordinates.c)); return distanceFromSpawn > spawnSize; diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 57f9a9e9b5..a54b795630 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -19,7 +19,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { } public int getSize() { - return getInventory().m_(); + return getInventory().q_(); } public String getName() { @@ -290,7 +290,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory { } private int getMaxItemStack() { - return getInventory().n_(); + return getInventory().r_(); } public void remove(int materialId) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java index f065836473..39d748b42a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftSlot.java @@ -20,6 +20,6 @@ public class CraftSlot implements org.bukkit.inventory.Slot { } public ItemStack getItem() { - return new CraftItemStack( slot.b() ); + return new CraftItemStack( slot.a() ); } }