summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nms-patches/BlockDispenser.patch6
-rw-r--r--nms-patches/BlockDropper.patch6
-rw-r--r--nms-patches/BlockVine.patch56
-rw-r--r--nms-patches/ChunkRegionLoader.patch37
-rw-r--r--nms-patches/DedicatedServer.patch20
-rw-r--r--nms-patches/EntityGuardian.patch12
-rw-r--r--nms-patches/EntityPlayer.patch20
-rw-r--r--nms-patches/HandshakeListener.patch6
-rw-r--r--nms-patches/LoginListener.patch14
-rw-r--r--nms-patches/MinecraftServer.patch127
-rw-r--r--nms-patches/NBTTagList.patch10
-rw-r--r--nms-patches/NetworkManager.patch14
-rw-r--r--nms-patches/PacketStatusListener.patch8
-rw-r--r--nms-patches/PlayerConnection.patch127
-rw-r--r--nms-patches/PlayerList.patch24
-rw-r--r--nms-patches/PortalTravelAgent.patch14
-rw-r--r--nms-patches/TileEntityChest.patch6
-rw-r--r--nms-patches/WorldData.patch8
-rw-r--r--nms-patches/WorldNBTStorage.patch6
-rw-r--r--nms-patches/WorldServer.patch12
-rw-r--r--pom.xml6
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java14
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java2
-rw-r--r--src/test/java/org/bukkit/PerMaterialTest.java2
24 files changed, 270 insertions, 287 deletions
diff --git a/nms-patches/BlockDispenser.patch b/nms-patches/BlockDispenser.patch
index 9cc5c12a..51e40014 100644
--- a/nms-patches/BlockDispenser.patch
+++ b/nms-patches/BlockDispenser.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/BlockDispenser.java 2015-02-26 22:40:22.103608145 +0000
-+++ src/main/java/net/minecraft/server/BlockDispenser.java 2015-02-26 22:40:22.103608145 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/BlockDispenser.java 2015-05-05 21:41:19.972649179 +0100
++++ src/main/java/net/minecraft/server/BlockDispenser.java 2015-05-05 21:41:19.976649120 +0100
@@ -8,6 +8,7 @@
public static final BlockStateBoolean TRIGGERED = BlockStateBoolean.of("triggered");
public static final RegistryDefault<Item, IDispenseBehavior> N = new RegistryDefault(new DispenseBehaviorItem());
@@ -23,5 +23,5 @@
ItemStack itemstack1 = idispensebehavior.a(sourceblock, itemstack);
+ eventFired = false; // CraftBukkit - reset event status
- tileentitydispenser.setItem(i, itemstack1.count == 0 ? null : itemstack1);
+ tileentitydispenser.setItem(i, itemstack1.count <= 0 ? null : itemstack1);
}
diff --git a/nms-patches/BlockDropper.patch b/nms-patches/BlockDropper.patch
index 60af6a4c..e611888f 100644
--- a/nms-patches/BlockDropper.patch
+++ b/nms-patches/BlockDropper.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/BlockDropper.java 2015-02-26 22:40:22.115608145 +0000
-+++ src/main/java/net/minecraft/server/BlockDropper.java 2015-02-26 22:40:22.115608145 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/BlockDropper.java 2015-05-05 21:41:19.988648941 +0100
++++ src/main/java/net/minecraft/server/BlockDropper.java 2015-05-05 21:41:19.988648941 +0100
@@ -1,5 +1,10 @@
package net.minecraft.server;
@@ -46,5 +46,5 @@
+ if (event.getItem().equals(oitemstack) && itemstack1 == null) {
+ // CraftBukkit end
itemstack1 = itemstack.cloneItemStack();
- if (--itemstack1.count == 0) {
+ if (--itemstack1.count <= 0) {
itemstack1 = null;
diff --git a/nms-patches/BlockVine.patch b/nms-patches/BlockVine.patch
index 88ed4419..0bbb1970 100644
--- a/nms-patches/BlockVine.patch
+++ b/nms-patches/BlockVine.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/BlockVine.java 2015-02-26 22:40:22.283608143 +0000
-+++ src/main/java/net/minecraft/server/BlockVine.java 2015-02-26 22:40:22.287608143 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/BlockVine.java 2015-05-05 21:53:38.737118335 +0100
++++ src/main/java/net/minecraft/server/BlockVine.java 2015-05-05 21:53:38.737118335 +0100
@@ -3,6 +3,8 @@
import java.util.Iterator;
import java.util.Random;
@@ -9,14 +9,14 @@
public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockStateBoolean.of("up");
-@@ -199,7 +201,13 @@
+@@ -200,7 +202,13 @@
}
if (((Boolean) iblockdata1.get(BlockVine.NORTH)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.EAST)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.SOUTH)).booleanValue() || ((Boolean) iblockdata1.get(BlockVine.WEST)).booleanValue()) {
-- world.setTypeAndData(blockposition.up(), iblockdata1, 2);
+- world.setTypeAndData(blockposition1, iblockdata1, 2);
+ // CraftBukkit start - Call BlockSpreadEvent
-+ // world.setTypeAndData(blockposition.up(), iblockdata1, 2);
-+ BlockPosition target = blockposition.up();
++ // world.setTypeAndData(blockposition1, iblockdata1, 2);
++ BlockPosition target = blockposition1;
+ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ org.bukkit.block.Block block = world.getWorld().getBlockAt(target.getX(), target.getY(), target.getZ());
+ CraftEventFactory.handleBlockSpreadEvent(block, source, this, toLegacyData(iblockdata1));
@@ -24,50 +24,50 @@
}
}
-@@ -219,17 +227,29 @@
- BlockPosition blockposition2 = blockposition1.shift(enumdirection1);
- BlockPosition blockposition3 = blockposition1.shift(enumdirection2);
+@@ -220,17 +228,29 @@
+ BlockPosition blockposition3 = blockposition2.shift(enumdirection1);
+ BlockPosition blockposition4 = blockposition2.shift(enumdirection2);
+ // CraftBukkit start - Call BlockSpreadEvent
+ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ());
+
- if (flag1 && this.c(world.getType(blockposition2).getBlock())) {
-- world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2);
-+ // world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2);
+ if (flag1 && this.c(world.getType(blockposition3).getBlock())) {
+- world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2);
++ // world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true))));
- } else if (flag2 && this.c(world.getType(blockposition3).getBlock())) {
-- world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2);
-+ // world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2);
+ } else if (flag2 && this.c(world.getType(blockposition4).getBlock())) {
+- world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2);
++ // world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2);
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true))));
- } else if (flag1 && world.isEmpty(blockposition2) && this.c(world.getType(blockposition.shift(enumdirection1)).getBlock())) {
-- world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
-+ // world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
-+ bukkitBlock = world.getWorld().getBlockAt(blockposition2.getX(), blockposition2.getY(), blockposition2.getZ());
-+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true))));
- } else if (flag2 && world.isEmpty(blockposition3) && this.c(world.getType(blockposition.shift(enumdirection2)).getBlock())) {
+ } else if (flag1 && world.isEmpty(blockposition3) && this.c(world.getType(blockposition.shift(enumdirection1)).getBlock())) {
- world.setTypeAndData(blockposition3, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition3, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ bukkitBlock = world.getWorld().getBlockAt(blockposition3.getX(), blockposition3.getY(), blockposition3.getZ());
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true))));
- } else if (this.c(world.getType(blockposition1.up()).getBlock())) {
-- world.setTypeAndData(blockposition1, this.getBlockData(), 2);
-+ // world.setTypeAndData(blockposition1, this.getBlockData(), 2);
+ } else if (flag2 && world.isEmpty(blockposition4) && this.c(world.getType(blockposition.shift(enumdirection2)).getBlock())) {
+- world.setTypeAndData(blockposition4, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
++ // world.setTypeAndData(blockposition4, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
++ bukkitBlock = world.getWorld().getBlockAt(blockposition4.getX(), blockposition4.getY(), blockposition4.getZ());
++ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true))));
+ } else if (this.c(world.getType(blockposition2.up()).getBlock())) {
+- world.setTypeAndData(blockposition2, this.getBlockData(), 2);
++ // world.setTypeAndData(blockposition2, this.getBlockData(), 2);
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData()));
}
+ // CraftBukkit end
} else if (block.material.k() && block.d()) {
world.setTypeAndData(blockposition, iblockdata.set(a(enumdirection), Boolean.valueOf(true)), 2);
}
-@@ -256,7 +276,12 @@
+@@ -257,7 +277,12 @@
}
if (((Boolean) iblockdata3.get(BlockVine.NORTH)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.EAST)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.SOUTH)).booleanValue() || ((Boolean) iblockdata3.get(BlockVine.WEST)).booleanValue()) {
-- world.setTypeAndData(blockposition1, iblockdata3, 2);
+- world.setTypeAndData(blockposition2, iblockdata3, 2);
+ // CraftBukkit start - Call BlockSpreadEvent
-+ // world.setTypeAndData(blockposition1, iblockdata3, 2);
++ // world.setTypeAndData(blockposition2, iblockdata3, 2);
+ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
-+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ());
++ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition2.getX(), blockposition2.getY(), blockposition2.getZ());
+ CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(iblockdata3));
+ // CraftBukkit end
}
diff --git a/nms-patches/ChunkRegionLoader.patch b/nms-patches/ChunkRegionLoader.patch
index a829e2df..10543c50 100644
--- a/nms-patches/ChunkRegionLoader.patch
+++ b/nms-patches/ChunkRegionLoader.patch
@@ -1,24 +1,20 @@
---- /home/matt/mc-dev-private//net/minecraft/server/ChunkRegionLoader.java 2015-03-22 19:01:20.065879491 +0000
-+++ src/main/java/net/minecraft/server/ChunkRegionLoader.java 2015-03-22 19:01:20.065879491 +0000
-@@ -25,7 +25,39 @@
- this.e = file;
+--- /home/matt/mc-dev-private//net/minecraft/server/ChunkRegionLoader.java 2015-05-05 21:41:20.236645254 +0100
++++ src/main/java/net/minecraft/server/ChunkRegionLoader.java 2015-05-05 21:41:20.236645254 +0100
+@@ -25,7 +25,35 @@
+ this.d = file;
}
+ // CraftBukkit start
+ public boolean chunkExists(World world, int i, int j) {
+ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
+
-+ synchronized (this.d) {
-+ if (this.c.contains(chunkcoordintpair)) {
-+ for (int k = 0; k < this.b.size(); ++k) {
-+ if (((PendingChunkToSave) this.b.get(k)).a.equals(chunkcoordintpair)) {
-+ return true;
-+ }
-+ }
++ if (this.c.contains(chunkcoordintpair)) {
++ if (this.b.containsKey(chunkcoordintpair)) {
++ return true;
+ }
+ }
+
-+ return RegionFileCache.a(this.e, i, j).chunkExists(i & 31, j & 31);
++ return RegionFileCache.a(this.d, i, j).chunkExists(i & 31, j & 31);
+ }
+ // CraftBukkit end
+
@@ -37,10 +33,10 @@
+
+ public Object[] loadChunk(World world, int i, int j) throws IOException {
+ // CraftBukkit end
- NBTTagCompound nbttagcompound = null;
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
- Object object = this.d;
-@@ -54,7 +86,7 @@
+ NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair);
+
+@@ -42,7 +70,7 @@
return this.a(world, i, j, nbttagcompound);
}
@@ -49,7 +45,7 @@
if (!nbttagcompound.hasKeyOfType("Level", 10)) {
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is missing level data, skipping");
return null;
-@@ -71,10 +103,28 @@
+@@ -59,10 +87,28 @@
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.locX + ", " + chunk.locZ + ")");
nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j);
@@ -79,7 +75,7 @@
}
}
}
-@@ -308,7 +358,26 @@
+@@ -290,7 +336,26 @@
int k1 = l >> 4 & 15;
int l1 = nibblearray1 != null ? nibblearray1.a(i1, j1, k1) : 0;
@@ -107,7 +103,7 @@
}
chunksection.a(achar);
-@@ -326,6 +395,13 @@
+@@ -308,6 +373,13 @@
chunk.a(nbttagcompound.getByteArray("Biomes"));
}
@@ -121,12 +117,11 @@
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
if (nbttaglist1 != null) {
-@@ -384,7 +460,7 @@
+@@ -366,6 +438,6 @@
}
}
- return chunk;
+ // return chunk; // CraftBukkit
}
-
- static class PendingChunkToSave {
+ }
diff --git a/nms-patches/DedicatedServer.patch b/nms-patches/DedicatedServer.patch
index f84e8961..7edf9e18 100644
--- a/nms-patches/DedicatedServer.patch
+++ b/nms-patches/DedicatedServer.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/DedicatedServer.java 2015-02-26 22:40:22.443608141 +0000
-+++ src/main/java/net/minecraft/server/DedicatedServer.java 2015-02-26 22:40:22.443608141 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/DedicatedServer.java 2015-05-05 21:41:20.360643410 +0100
++++ src/main/java/net/minecraft/server/DedicatedServer.java 2015-05-05 21:41:20.364643350 +0100
@@ -15,20 +15,32 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -94,7 +94,7 @@
+ System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
+ // CraftBukkit end
+
- DedicatedServer.LOGGER.info("Starting minecraft server version 1.8.3");
+ DedicatedServer.LOGGER.info("Starting minecraft server version 1.8.4");
if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
@@ -122,7 +122,7 @@
+ this.convertable = new WorldLoaderServer(server.getWorldContainer()); // CraftBukkit - moved from MinecraftServer constructor
long j = System.nanoTime();
- if (this.T() == null) {
+ if (this.U() == null) {
@@ -198,8 +248,19 @@
DedicatedServer.LOGGER.info("Starting remote control listener");
this.n = new RemoteControlListener(this);
@@ -140,7 +140,7 @@
+ }
+ // CraftBukkit end
+
- if (this.aR() > 0L) {
+ if (this.aS() > 0L) {
Thread thread1 = new Thread(new ThreadWatchdog(this));
@@ -213,6 +274,12 @@
@@ -160,10 +160,10 @@
System.exit(0);
}
-- protected void A() {
-+ public void A() { // CraftBukkit - fix decompile error
- super.A();
- this.aN();
+- protected void B() {
++ public void B() { // CraftBukkit - fix decompile error
+ super.B();
+ this.aO();
}
@@ -296,7 +363,14 @@
while (!this.l.isEmpty()) {
@@ -181,7 +181,7 @@
}
}
-@@ -487,13 +561,57 @@
+@@ -491,13 +565,57 @@
}
public String getPlugins() {
diff --git a/nms-patches/EntityGuardian.patch b/nms-patches/EntityGuardian.patch
index b8f55e35..db8c4f35 100644
--- a/nms-patches/EntityGuardian.patch
+++ b/nms-patches/EntityGuardian.patch
@@ -1,11 +1,11 @@
---- /home/matt/mc-dev-private//net/minecraft/server/EntityGuardian.java 2015-03-19 21:25:54.134142162 +0000
-+++ src/main/java/net/minecraft/server/EntityGuardian.java 2015-03-19 21:25:54.134142162 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/EntityGuardian.java 2015-05-05 21:41:20.516641090 +0100
++++ src/main/java/net/minecraft/server/EntityGuardian.java 2015-05-05 21:41:20.516641090 +0100
@@ -14,7 +14,7 @@
private EntityLiving bo;
private int bp;
private boolean bq;
-- private PathfinderGoalRandomStroll br;
-+ public PathfinderGoalRandomStroll br; // CraftBukkit - public, PAIL: Rename goalRandomStroll
+- private PathfinderGoalRandomStroll goalRandomStroll;
++ public PathfinderGoalRandomStroll goalRandomStroll; // CraftBukkit - public
public EntityGuardian(World world) {
super(world);
@@ -16,8 +16,8 @@
- protected void initAttributes() {
+ public void initAttributes() { // CraftBukkit - public
super.initAttributes();
- this.getAttributeInstance(GenericAttributes.e).setValue(6.0D);
- this.getAttributeInstance(GenericAttributes.d).setValue(0.5D);
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6.0D);
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
@@ -516,7 +516,7 @@
return (entityliving instanceof EntityHuman || entityliving instanceof EntitySquid) && entityliving.h(this.a) > 9.0D;
}
diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch
index e8c0af4c..b46da9c3 100644
--- a/nms-patches/EntityPlayer.patch
+++ b/nms-patches/EntityPlayer.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/EntityPlayer.java 2015-02-26 22:40:22.655608139 +0000
-+++ src/main/java/net/minecraft/server/EntityPlayer.java 2015-02-26 22:40:22.659608139 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/EntityPlayer.java 2015-05-05 21:53:39.197110943 +0100
++++ src/main/java/net/minecraft/server/EntityPlayer.java 2015-05-05 21:53:39.201110879 +0100
@@ -13,6 +13,17 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -235,7 +235,7 @@
- Collection collection = this.world.getScoreboard().getObjectivesForCriteria(IScoreboardCriteria.d);
+ this.closeInventory();
-+ this.e((Entity) this); // Remove spectated target
++ this.setSpectatorTarget(this); // Remove spectated target
+ // CraftBukkit end
+
+ // CraftBukkit - Get our scores instead
@@ -334,7 +334,7 @@
+ boolean cancelled = false;
+ if (iinventory instanceof ITileInventory) {
+ ITileInventory itileinventory = (ITileInventory) iinventory;
-+ cancelled = itileinventory.r_() && !this.a(itileinventory.i()) && !this.v();
++ cancelled = itileinventory.r_() && !this.a(itileinventory.i()) && !this.isSpectator();
+ }
+
+ Container container;
@@ -356,8 +356,8 @@
if (iinventory instanceof ITileInventory) {
ITileInventory itileinventory = (ITileInventory) iinventory;
-- if (itileinventory.r_() && !this.a(itileinventory.i()) && !this.v()) {
-+ if (itileinventory.r_() && !this.a(itileinventory.i()) && !this.v() && container == null) { // CraftBukkit - allow plugins to uncancel the lock
+- if (itileinventory.r_() && !this.a(itileinventory.i()) && !this.isSpectator()) {
++ if (itileinventory.r_() && !this.a(itileinventory.i()) && !this.isSpectator() && container == null) { // CraftBukkit - allow plugins to uncancel the lock
this.playerConnection.sendPacket(new PacketPlayOutChat(new ChatMessage("container.isLocked", new Object[] { iinventory.getScoreboardDisplayName()}), (byte) 2));
this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("random.door_close", this.locX, this.locY, this.locZ, 1.0F, 1.0F));
+
@@ -470,15 +470,17 @@
+ // CraftBukkit end */
}
- public boolean v() {
-@@ -768,6 +949,7 @@
+ public boolean isSpectator() {
+@@ -768,7 +949,8 @@
}
public boolean a(int i, String s) {
+- if ("seed".equals(s) && !this.server.ae()) {
+ /* CraftBukkit start
- if ("seed".equals(s) && !this.server.ad()) {
++ if ("seed".equals(s) && !this.server.ad()) {
return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) {
+ if (this.server.getPlayerList().isOp(this.getProfile())) {
@@ -781,6 +963,9 @@
} else {
return true;
diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch
index 3a6a8c1c..1f02d4ff 100644
--- a/nms-patches/HandshakeListener.patch
+++ b/nms-patches/HandshakeListener.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/HandshakeListener.java 2015-02-26 22:40:22.755608138 +0000
-+++ src/main/java/net/minecraft/server/HandshakeListener.java 2015-02-26 22:40:22.755608138 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/HandshakeListener.java 2015-05-05 21:41:20.808636748 +0100
++++ src/main/java/net/minecraft/server/HandshakeListener.java 2015-05-05 21:41:20.812636689 +0100
@@ -1,7 +1,17 @@
package net.minecraft.server;
@@ -58,7 +58,7 @@
+ // CraftBukkit end
+
if (packethandshakinginsetprotocol.b() > 47) {
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.3");
+ chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.4");
this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
@@ -26,6 +71,7 @@
this.b.close(chatcomponenttext);
diff --git a/nms-patches/LoginListener.patch b/nms-patches/LoginListener.patch
index c9be91fe..54012dd6 100644
--- a/nms-patches/LoginListener.patch
+++ b/nms-patches/LoginListener.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/LoginListener.java 2015-02-26 22:40:22.867608136 +0000
-+++ src/main/java/net/minecraft/server/LoginListener.java 2015-02-26 22:40:22.867608136 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/LoginListener.java 2015-05-05 21:41:20.964634428 +0100
++++ src/main/java/net/minecraft/server/LoginListener.java 2015-05-05 21:41:20.968634369 +0100
@@ -18,6 +18,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -36,9 +36,9 @@
+ // CraftBukkit end
} else {
this.g = LoginListener.EnumProtocolState.ACCEPTED;
- if (this.server.aJ() >= 0 && !this.networkManager.c()) {
+ if (this.server.aK() >= 0 && !this.networkManager.c()) {
@@ -90,7 +99,7 @@
- LoginListener.this.networkManager.a(LoginListener.this.server.aJ());
+ LoginListener.this.networkManager.a(LoginListener.this.server.aK());
}
- public void operationComplete(Future future) throws Exception {
@@ -60,7 +60,7 @@
@@ -148,6 +157,43 @@
- LoginListener.this.i = LoginListener.this.server.aC().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s);
+ LoginListener.this.i = LoginListener.this.server.aD().hasJoinedServer(new GameProfile((UUID) null, gameprofile.getName()), s);
if (LoginListener.this.i != null) {
+ // CraftBukkit start - fire PlayerPreLoginEvent
+ if (!networkManager.g()) {
@@ -101,7 +101,7 @@
+ // CraftBukkit end
LoginListener.c.info("UUID of player " + LoginListener.this.i.getName() + " is " + LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
- } else if (LoginListener.this.server.S()) {
+ } else if (LoginListener.this.server.T()) {
@@ -156,7 +202,7 @@
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else {
@@ -110,7 +110,7 @@
+ LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer
}
} catch (AuthenticationUnavailableException authenticationunavailableexception) {
- if (LoginListener.this.server.S()) {
+ if (LoginListener.this.server.T()) {
@@ -167,6 +213,11 @@
LoginListener.this.disconnect("Authentication servers are down. Please try again later, sorry!");
LoginListener.c.error("Couldn\'t verify username because servers are unavailable");
diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch
index 2a647207..e02078e1 100644
--- a/nms-patches/MinecraftServer.patch
+++ b/nms-patches/MinecraftServer.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/MinecraftServer.java 2015-03-11 10:44:42.911576345 +0000
-+++ src/main/java/net/minecraft/server/MinecraftServer.java 2015-03-11 10:44:42.915576345 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/MinecraftServer.java 2015-05-05 21:41:20.976634250 +0100
++++ src/main/java/net/minecraft/server/MinecraftServer.java 2015-05-05 21:41:20.980634191 +0100
@@ -38,14 +38,27 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -20,12 +20,12 @@
public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics {
- private static final Logger LOGGER = LogManager.getLogger();
-+ public static final Logger LOGGER = LogManager.getLogger();
++ public static final Logger LOGGER = LogManager.getLogger(); // CraftBukkit - make public
public static final File a = new File("usercache.json");
private static MinecraftServer l;
- private final Convertable convertable;
+ public Convertable convertable; // CraftBukkit - remove final, public
- private final MojangStatisticsGenerator n = new MojangStatisticsGenerator("server", this, ay());
+ private final MojangStatisticsGenerator n = new MojangStatisticsGenerator("server", this, az());
- private final File universe;
+ public File universe; // CraftBukkit - remove final, public
private final List<IUpdatePlayerListBox> p = Lists.newArrayList();
@@ -33,7 +33,7 @@
public final MethodProfiler methodProfiler = new MethodProfiler();
@@ -94,19 +107,61 @@
private Thread serverThread;
- private long ab = ay();
+ private long ab = az();
- public MinecraftServer(File file, Proxy proxy, File file1) {
+ // CraftBukkit start
@@ -149,7 +149,7 @@
+ worlddata = new WorldData(worldsettings, s1);
+ }
+ worlddata.checkName(s1); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
- if (this.W()) {
+ if (this.X()) {
- this.worldServer[j] = (WorldServer) (new DemoWorldServer(this, idatamanager, worlddata, b0, this.methodProfiler)).b();
+ world = (WorldServer) (new DemoWorldServer(this, idatamanager, worlddata, dimension, this.methodProfiler)).b();
} else {
@@ -210,7 +210,7 @@
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld()));
+
+ world.addIWorldAccess(new WorldManager(this, world));
- if (!this.S()) {
+ if (!this.T()) {
- this.worldServer[j].getWorldData().setGameType(this.getGamemode());
+ world.getWorldData().setGameType(this.getGamemode());
}
@@ -231,11 +231,11 @@
- MinecraftServer.LOGGER.info("Preparing start region for level " + b0);
- WorldServer worldserver = this.worldServer[b0];
- BlockPosition blockposition = worldserver.getSpawn();
-- long j = ay();
+- long j = az();
-
- for (int k = -192; k <= 192 && this.isRunning(); k += 16) {
- for (int l = -192; l <= 192 && this.isRunning(); l += 16) {
-- long i1 = ay();
+- long i1 = az();
-
- if (i1 - j > 1000L) {
- this.a_("Preparing spawn area", i * 100 / 625);
@@ -251,12 +251,12 @@
+ }
+
+ BlockPosition blockposition = worldserver.getSpawn();
-+ long j = ay();
++ long j = az();
+ i = 0;
+
+ for (int k = -192; k <= 192 && this.isRunning(); k += 16) {
+ for (int l = -192; l <= 192 && this.isRunning(); l += 16) {
-+ long i1 = ay();
++ long i1 = az();
+
+ if (i1 - j > 1000L) {
+ this.a_("Preparing spawn area", i * 100 / 625);
@@ -275,11 +275,11 @@
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
+ }
+ // CraftBukkit end
- this.r();
+ this.s();
}
-@@ -264,35 +404,52 @@
- protected void r() {
+@@ -266,15 +406,19 @@
+ protected void s() {
this.f = null;
this.g = 0;
+
@@ -301,19 +301,15 @@
if (worldserver != null) {
if (!flag) {
- MinecraftServer.LOGGER.info("Saving chunks for level \'" + worldserver.getWorldData().getName() + "\'/" + worldserver.worldProvider.getName());
- }
-
-- try {
-- worldserver.save(true, (IProgressUpdate) null);
-- } catch (ExceptionWorldConflict exceptionworldconflict) {
-- MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage());
-- }
-+ worldserver.save(true, (IProgressUpdate) null);
-+ worldserver.saveLevel();
- }
- }
+@@ -283,6 +427,7 @@
+ try {
+ worldserver.save(true, (IProgressUpdate) null);
++ worldserver.saveLevel(); // CraftBukkit
+ } catch (ExceptionWorldConflict exceptionworldconflict) {
+ MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage());
+ }
+@@ -292,9 +437,25 @@
}
}
@@ -337,10 +333,10 @@
+ this.server.disablePlugins();
+ }
+ // CraftBukkit end
- if (this.ap() != null) {
- this.ap().b();
+ if (this.aq() != null) {
+ this.aq().b();
}
-@@ -307,11 +464,13 @@
+@@ -309,11 +470,13 @@
MinecraftServer.LOGGER.info("Saving worlds");
this.saveChunks(false);
@@ -354,7 +350,7 @@
}
if (this.n.d()) {
-@@ -352,6 +511,7 @@
+@@ -354,6 +517,7 @@
long k = j - this.ab;
if (k > 2000L && this.ab - this.R >= 15000L) {
@@ -362,21 +358,21 @@
MinecraftServer.LOGGER.warn("Can\'t keep up! Did the system time change, or is the server overloaded? Running {}ms behind, skipping {} tick(s)", new Object[] { Long.valueOf(k), Long.valueOf(k / 50L)});
k = 2000L;
this.R = this.ab;
-@@ -364,11 +524,12 @@
+@@ -366,11 +530,12 @@
i += k;
this.ab = j;
- if (this.worldServer[0].everyoneDeeplySleeping()) {
-+ if (this.worlds.get(0).everyoneDeeplySleeping()) {
- this.z();
++ if (this.worlds.get(0).everyoneDeeplySleeping()) { // CraftBukkit
+ this.A();
i = 0L;
} else {
while (i > 50L) {
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
i -= 50L;
- this.z();
+ this.A();
}
-@@ -406,6 +567,12 @@
+@@ -408,6 +573,12 @@
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@@ -386,19 +382,19 @@
+ } catch (Exception ignored) {
+ }
+ // CraftBukkit end
- this.y();
+ this.z();
}
-@@ -445,7 +612,7 @@
+@@ -447,7 +618,7 @@
- protected void y() {}
+ protected void z() {}
-- protected void z() {
-+ protected void z() throws ExceptionWorldConflict { // CraftBukkit - added throws
+- protected void A() {
++ protected void A() throws ExceptionWorldConflict { // CraftBukkit - added throws
long i = System.nanoTime();
++this.ticks;
-@@ -471,7 +638,7 @@
+@@ -473,7 +644,7 @@
this.r.b().a(agameprofile);
}
@@ -407,7 +403,7 @@
this.methodProfiler.a("save");
this.v.savePlayers();
this.saveChunks(true);
-@@ -506,20 +673,40 @@
+@@ -508,20 +679,40 @@
this.methodProfiler.c("levels");
@@ -451,7 +447,7 @@
this.methodProfiler.a("tick");
-@@ -546,9 +733,9 @@
+@@ -548,9 +739,9 @@
worldserver.getTracker().updatePlayers();
this.methodProfiler.b();
this.methodProfiler.b();
@@ -463,7 +459,7 @@
}
this.methodProfiler.c("connection");
-@@ -572,10 +759,11 @@
+@@ -574,10 +765,11 @@
this.p.add(iupdateplayerlistbox);
}
@@ -476,7 +472,7 @@
boolean flag = true;
String s = null;
String s1 = ".";
-@@ -653,6 +841,27 @@
+@@ -655,15 +847,38 @@
dedicatedserver.stop();
}
});
@@ -504,10 +500,11 @@
} catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", exception);
}
-@@ -660,8 +869,10 @@
+
}
- public void C() {
+- public void D() {
++ public void C() {
+ /* CraftBukkit start - prevent abuse
this.serverThread = new Thread(this, "Server thread");
this.serverThread.start();
@@ -515,7 +512,7 @@
}
public File d(String s) {
-@@ -677,7 +888,14 @@
+@@ -679,7 +894,14 @@
}
public WorldServer getWorldServer(int i) {
@@ -530,8 +527,8 @@
+ // CraftBukkit end
}
- public String D() {
-@@ -713,7 +931,7 @@
+ public String E() {
+@@ -715,7 +937,7 @@
}
public boolean isDebugging() {
@@ -540,7 +537,7 @@
}
public void g(String s) {
-@@ -728,7 +946,7 @@
+@@ -730,7 +952,7 @@
}
public String getServerModName() {
@@ -549,7 +546,7 @@
}
public CrashReport b(CrashReport crashreport) {
-@@ -757,6 +975,7 @@
+@@ -759,6 +981,7 @@
}
public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, BlockPosition blockposition) {
@@ -557,7 +554,7 @@
ArrayList arraylist = Lists.newArrayList();
if (s.startsWith("/")) {
-@@ -795,6 +1014,9 @@
+@@ -797,6 +1020,9 @@
return arraylist;
}
@@ -567,16 +564,16 @@
}
public static MinecraftServer getServer() {
-@@ -802,7 +1024,7 @@
+@@ -804,7 +1030,7 @@
}
- public boolean N() {
+ public boolean O() {
- return this.universe != null;
+ return true; // CraftBukkit
}
public String getName() {
-@@ -858,8 +1080,10 @@
+@@ -860,8 +1086,10 @@
}
public void a(EnumDifficulty enumdifficulty) {
@@ -589,7 +586,7 @@
if (worldserver != null) {
if (worldserver.getWorldData().isHardcore()) {
-@@ -901,15 +1125,17 @@
+@@ -903,15 +1131,17 @@
this.N = true;
this.getConvertable().d();
@@ -611,7 +608,7 @@
this.safeShutdown();
}
-@@ -942,9 +1168,11 @@
+@@ -944,9 +1174,11 @@
int i = 0;
if (this.worldServer != null) {
@@ -626,8 +623,8 @@
WorldData worlddata = worldserver.getWorldData();
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimension()));
-@@ -977,7 +1205,7 @@
- public abstract boolean ad();
+@@ -979,7 +1211,7 @@
+ public abstract boolean ae();
public boolean getOnlineMode() {
- return this.onlineMode;
@@ -635,7 +632,7 @@
}
public void setOnlineMode(boolean flag) {
-@@ -1049,8 +1277,9 @@
+@@ -1051,8 +1283,9 @@
}
public void setGamemode(WorldSettings.EnumGamemode worldsettings_enumgamemode) {
@@ -647,7 +644,7 @@
}
}
-@@ -1082,7 +1311,7 @@
+@@ -1084,7 +1317,7 @@
}
public World getWorld() {
@@ -656,7 +653,7 @@
}
public Entity f() {
-@@ -1153,8 +1382,10 @@
+@@ -1155,8 +1388,10 @@
WorldServer[] aworldserver = this.worldServer;
int i = aworldserver.length;
@@ -669,7 +666,7 @@
if (worldserver != null) {
Entity entity = worldserver.getEntity(uuid);
-@@ -1169,7 +1400,7 @@
+@@ -1171,7 +1406,7 @@
}
public boolean getSendCommandFeedback() {
@@ -678,7 +675,7 @@
}
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {}
-@@ -1180,7 +1411,7 @@
+@@ -1182,7 +1417,7 @@
public <V> ListenableFuture<V> a(Callable<V> callable) {
Validate.notNull(callable);
diff --git a/nms-patches/NBTTagList.patch b/nms-patches/NBTTagList.patch
index f0b70c45..ae5a3012 100644
--- a/nms-patches/NBTTagList.patch
+++ b/nms-patches/NBTTagList.patch
@@ -1,10 +1,10 @@
---- /home/matt/mc-dev-private//net/minecraft/server/NBTTagList.java 2015-04-16 22:20:21.171362490 +0100
-+++ src/main/java/net/minecraft/server/NBTTagList.java 2015-04-16 22:20:21.191362490 +0100
+--- /home/matt/mc-dev-private//net/minecraft/server/NBTTagList.java 2015-05-05 21:53:39.561105095 +0100
++++ src/main/java/net/minecraft/server/NBTTagList.java 2015-05-05 21:53:39.561105095 +0100
@@ -40,6 +40,7 @@
- nbtreadlimiter.a(8L);
+ } else {
this.type = datainput.readByte();
int j = datainput.readInt();
+ nbtreadlimiter.a(j * 8); // CraftBukkit
- this.list = Lists.newArrayList();
-
+ if (this.type == 0 && j > 0) {
+ throw new RuntimeException("Missing type on ListTag");
diff --git a/nms-patches/NetworkManager.patch b/nms-patches/NetworkManager.patch
index 70ba4ac0..d2ae5ed8 100644
--- a/nms-patches/NetworkManager.patch
+++ b/nms-patches/NetworkManager.patch
@@ -1,20 +1,20 @@
---- /home/matt/mc-dev-private//net/minecraft/server/NetworkManager.java 2015-03-19 21:26:27.850141796 +0000
-+++ src/main/java/net/minecraft/server/NetworkManager.java 2015-03-19 21:26:27.850141796 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/NetworkManager.java 2015-05-05 21:41:21.008633774 +0100
++++ src/main/java/net/minecraft/server/NetworkManager.java 2015-05-05 21:41:21.012633714 +0100
@@ -63,7 +63,7 @@
private final EnumProtocolDirection h;
private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue();
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
-- private Channel k;
-+ public Channel k; // CraftBukkit - public, PAIL: Rename channel
+- private Channel channel;
++ public Channel channel; // CraftBukkit - public
private SocketAddress l;
private PacketListener m;
private IChatBaseComponent n;
@@ -231,7 +231,7 @@
public void close(IChatBaseComponent ichatbasecomponent) {
- if (this.k.isOpen()) {
-- this.k.close().awaitUninterruptibly();
-+ this.k.close(); // We can't wait as this may be called from an event loop.
+ if (this.channel.isOpen()) {
+- this.channel.close().awaitUninterruptibly();
++ this.channel.close(); // We can't wait as this may be called from an event loop.
this.n = ichatbasecomponent;
}
diff --git a/nms-patches/PacketStatusListener.patch b/nms-patches/PacketStatusListener.patch
index ef19ea4f..5d43a2ba 100644
--- a/nms-patches/PacketStatusListener.patch
+++ b/nms-patches/PacketStatusListener.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/PacketStatusListener.java 2015-02-26 22:40:22.927608136 +0000
-+++ src/main/java/net/minecraft/server/PacketStatusListener.java 2015-02-26 22:40:22.927608136 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/PacketStatusListener.java 2015-05-05 21:53:39.601104451 +0100
++++ src/main/java/net/minecraft/server/PacketStatusListener.java 2015-05-05 21:53:39.601104451 +0100
@@ -1,5 +1,16 @@
package net.minecraft.server;
@@ -29,8 +29,8 @@
+ // CraftBukkit end
+
public void a(PacketStatusInStart packetstatusinstart) {
-- this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aF()));
-+ // this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aF()));
+- this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aG()));
++ // this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aG()));
+ // CraftBukkit start - fire ping event
+ if (state != WAITING) {
+ networkManager.close(null);
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index da30860a..6da76021 100644
--- a/nms-patches/PlayerConnection.patch
+++ b/nms-patches/PlayerConnection.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/PlayerConnection.java 2015-04-17 11:54:58.464656095 +0100
-+++ src/main/java/net/minecraft/server/PlayerConnection.java 2015-04-17 11:54:58.468656095 +0100
+--- /home/matt/mc-dev-private//net/minecraft/server/PlayerConnection.java 2015-05-05 21:53:39.701102844 +0100
++++ src/main/java/net/minecraft/server/PlayerConnection.java 2015-05-05 21:53:39.701102844 +0100
@@ -17,6 +17,48 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -262,26 +262,16 @@
}
if (this.checkMovement) {
-@@ -212,12 +375,14 @@
- double d11 = d7 - this.player.locX;
- double d12 = d8 - this.player.locY;
- double d13 = d9 - this.player.locZ;
-- double d14 = Math.min(Math.abs(d11), Math.abs(this.player.motX));
-- double d15 = Math.min(Math.abs(d12), Math.abs(this.player.motY));
-- double d16 = Math.min(Math.abs(d13), Math.abs(this.player.motZ));
-+ // CraftBukkit start - min to max
-+ double d14 = Math.max(Math.abs(d11), Math.abs(this.player.motX));
-+ double d15 = Math.max(Math.abs(d12), Math.abs(this.player.motY));
-+ double d16 = Math.max(Math.abs(d13), Math.abs(this.player.motZ));
-+ // CraftBukkit end
- double d17 = d14 * d14 + d15 * d15 + d16 * d16;
+@@ -215,7 +378,7 @@
+ double d14 = this.player.motX * this.player.motX + this.player.motY * this.player.motY + this.player.motZ * this.player.motZ;
+ double d15 = d11 * d11 + d12 * d12 + d13 * d13;
-- if (d17 > 100.0D && (!this.minecraftServer.S() || !this.minecraftServer.R().equals(this.player.getName()))) {
-+ if (d17 > 100.0D && this.checkMovement && (!this.minecraftServer.S() || !this.minecraftServer.R().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports
- PlayerConnection.c.warn(this.player.getName() + " moved too quickly! " + d11 + "," + d12 + "," + d13 + " (" + d14 + ", " + d15 + ", " + d16 + ")");
+- if (d15 - d14 > 100.0D && (!this.minecraftServer.T() || !this.minecraftServer.S().equals(this.player.getName()))) {
++ if (d15 - d14 > 100.0D && this.checkMovement && (!this.minecraftServer.T() || !this.minecraftServer.S().equals(this.player.getName()))) { // CraftBukkit - Added this.checkMovement condition to solve this check being triggered by teleports
+ PlayerConnection.c.warn(this.player.getName() + " moved too quickly! " + d11 + "," + d12 + "," + d13 + " (" + d11 + ", " + d12 + ", " + d13 + ")");
this.a(this.o, this.p, this.q, this.player.yaw, this.player.pitch);
return;
-@@ -286,10 +451,53 @@
+@@ -284,10 +447,53 @@
}
public void a(double d0, double d1, double d2, float f, float f1) {
@@ -336,7 +326,7 @@
this.checkMovement = false;
this.o = d0;
this.p = d1;
-@@ -323,32 +531,49 @@
+@@ -321,32 +527,49 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.u());
@@ -344,12 +334,12 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a();
- this.player.z();
+ this.player.resetIdleTimer();
+ // CraftBukkit start
switch (PlayerConnection.SyntheticClass_1.a[packetplayinblockdig.c().ordinal()]) {
- case 1:
+ case 1: // DROP_ITEM
- if (!this.player.v()) {
+ if (!this.player.isSpectator()) {
+ // limit how quickly items can be dropped
+ // If the ticks aren't the same then the count starts from 0 and we update the lastDropTick.
+ if (this.lastDropTick != MinecraftServer.currentTick) {
@@ -372,7 +362,7 @@
- case 2:
+ case 2: // DROP_ALL_ITEMS
- if (!this.player.v()) {
+ if (!this.player.isSpectator()) {
this.player.a(true);
}
@@ -392,7 +382,7 @@
double d0 = this.player.locX - ((double) blockposition.getX() + 0.5D);
double d1 = this.player.locY - ((double) blockposition.getY() + 0.5D) + 1.5D;
double d2 = this.player.locZ - ((double) blockposition.getZ() + 0.5D);
-@@ -363,7 +588,15 @@
+@@ -361,7 +584,15 @@
if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else {
@@ -408,7 +398,7 @@
}
} else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
-@@ -383,11 +616,22 @@
+@@ -381,11 +612,22 @@
default:
throw new IllegalArgumentException("Invalid player action");
}
@@ -431,7 +421,7 @@
ItemStack itemstack = this.player.inventory.getItemInHand();
boolean flag = false;
BlockPosition blockposition = packetplayinblockplace.a();
-@@ -399,7 +643,50 @@
+@@ -397,7 +639,50 @@
return;
}
@@ -483,7 +473,7 @@
} else if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight() - 1 && (enumdirection == EnumDirection.UP || blockposition.getY() >= this.minecraftServer.getMaxBuildHeight())) {
ChatMessage chatmessage = new ChatMessage("build.tooHigh", new Object[] { Integer.valueOf(this.minecraftServer.getMaxBuildHeight())});
-@@ -407,8 +694,19 @@
+@@ -405,8 +690,19 @@
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage));
flag = true;
} else {
@@ -504,7 +494,7 @@
}
flag = true;
-@@ -432,7 +730,8 @@
+@@ -430,7 +726,8 @@
this.player.activeContainer.b();
this.player.g = false;
@@ -514,7 +504,7 @@
this.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, slot.rawSlotIndex, this.player.inventory.getItemInHand()));
}
}
-@@ -446,8 +745,8 @@
+@@ -444,8 +741,8 @@
WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length;
@@ -525,16 +515,16 @@
if (worldserver != null) {
entity = packetplayinspectate.a(worldserver);
-@@ -460,6 +759,8 @@
+@@ -458,6 +755,8 @@
if (entity != null) {
- this.player.e((Entity) this.player);
+ this.player.setSpectatorTarget(this.player);
this.player.mount((Entity) null);
+
+ /* CraftBukkit start - replace with bukkit handling for multi-world
if (entity.world != this.player.world) {
WorldServer worldserver1 = this.player.u();
WorldServer worldserver2 = (WorldServer) entity.world;
-@@ -484,6 +785,9 @@
+@@ -482,6 +781,9 @@
} else {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ);
}
@@ -544,11 +534,10 @@
}
}
-@@ -492,14 +796,29 @@
+@@ -490,14 +792,29 @@
public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {}
public void a(IChatBaseComponent ichatbasecomponent) {
-- PlayerConnection.c.info(this.player.getName() + " lost connection: " + ichatbasecomponent);
+ // CraftBukkit start - Rarely it would send a disconnect line twice
+ if (this.processedDisconnect) {
+ return;
@@ -556,10 +545,10 @@
+ this.processedDisconnect = true;
+ }
+ // CraftBukkit end
-+ PlayerConnection.c.info(this.player.getName() + " lost connection: " + ichatbasecomponent.c()); // CraftBukkit - Don't toString the component
+ PlayerConnection.c.info(this.player.getName() + " lost connection: " + ichatbasecomponent);
+ // CraftBukkit start - Replace vanilla quit message handling with our own.
+ /*
- this.minecraftServer.aG();
+ this.minecraftServer.aH();
ChatMessage chatmessage = new ChatMessage("multiplayer.player.left", new Object[] { this.player.getScoreboardDisplayName()});
chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW);
@@ -573,10 +562,10 @@
+ this.minecraftServer.getPlayerList().sendMessage(CraftChatMessage.fromString(quitMessage));
+ }
+ // CraftBukkit end
- if (this.minecraftServer.S() && this.player.getName().equals(this.minecraftServer.R())) {
+ if (this.minecraftServer.T() && this.player.getName().equals(this.minecraftServer.S())) {
PlayerConnection.c.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown();
-@@ -521,6 +840,15 @@
+@@ -519,6 +836,15 @@
}
}
@@ -592,7 +581,7 @@
try {
this.networkManager.handle(packet);
} catch (Throwable throwable) {
-@@ -541,18 +869,34 @@
+@@ -539,18 +865,34 @@
}
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
@@ -604,12 +593,12 @@
+ this.server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ this.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
-+ this.player.z(); // PAIL: Rename resetIdleTimer
++ this.player.resetIdleTimer();
+ return;
+ }
+ // CraftBukkit end
this.player.inventory.itemInHandIndex = packetplayinhelditemslot.a();
- this.player.z();
+ this.player.resetIdleTimer();
} else {
PlayerConnection.c.warn(this.player.getName() + " tried to set an invalid carried item");
+ this.disconnect("Nope!"); // CraftBukkit
@@ -629,7 +618,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
-@@ -565,39 +909,249 @@
+@@ -563,39 +905,249 @@
for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@@ -827,7 +816,7 @@
public void a(PacketPlayInArmAnimation packetplayinarmanimation) {
+ if (this.player.dead) return; // CraftBukkit
PlayerConnectionUtils.ensureMainThread(packetplayinarmanimation, this, this.player.u());
- this.player.z();
+ this.player.resetIdleTimer();
+ // CraftBukkit start - Raytrace to look for 'rogue armswings'
+ float f1 = this.player.pitch;
+ float f2 = this.player.yaw;
@@ -884,10 +873,10 @@
+ break;
+ }
+ // CraftBukkit end
- this.player.z();
+ this.player.resetIdleTimer();
switch (PlayerConnection.SyntheticClass_1.b[packetplayinentityaction.b().ordinal()]) {
case 1:
-@@ -618,7 +1172,7 @@
+@@ -616,7 +1168,7 @@
case 5:
this.player.a(false, true, true);
@@ -896,7 +885,7 @@
break;
case 6:
-@@ -640,6 +1194,7 @@
+@@ -638,6 +1190,7 @@
}
public void a(PacketPlayInUseEntity packetplayinuseentity) {
@@ -904,7 +893,7 @@
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u());
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
-@@ -654,18 +1209,67 @@
+@@ -652,18 +1205,67 @@
}
if (this.player.h(entity) < d0) {
@@ -957,7 +946,7 @@
+ // CraftBukkit end
} else if (packetplayinuseentity.a() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK) {
- if (entity instanceof EntityItem || entity instanceof EntityExperienceOrb || entity instanceof EntityArrow || entity == this.player) {
-+ if (entity instanceof EntityItem || entity instanceof EntityExperienceOrb || entity instanceof EntityArrow || (entity == this.player && !player.v())) { // CraftBukkit, PAIL: Rename isSpectator
++ if (entity instanceof EntityItem || entity instanceof EntityExperienceOrb || entity instanceof EntityArrow || (entity == this.player && !player.isSpectator())) { // CraftBukkit
this.disconnect("Attempting to attack an invalid entity");
this.minecraftServer.warning("Player " + this.player.getName() + " tried to attack an invalid entity");
return;
@@ -973,7 +962,7 @@
}
}
}
-@@ -680,7 +1284,8 @@
+@@ -678,7 +1280,8 @@
switch (PlayerConnection.SyntheticClass_1.c[packetplayinclientcommand_enumclientcommand.ordinal()]) {
case 1:
if (this.player.viewingCredits) {
@@ -981,9 +970,9 @@
+ // this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true);
+ this.minecraftServer.getPlayerList().changeDimension(this.player, 0, PlayerTeleportEvent.TeleportCause.END_PORTAL); // CraftBukkit - reroute logic through custom portal management
} else if (this.player.u().getWorldData().isHardcore()) {
- if (this.minecraftServer.S() && this.player.getName().equals(this.minecraftServer.R())) {
+ if (this.minecraftServer.T() && this.player.getName().equals(this.minecraftServer.S())) {
this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!");
-@@ -711,15 +1316,21 @@
+@@ -709,15 +1312,21 @@
}
public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
@@ -998,15 +987,15 @@
public void a(PacketPlayInWindowClick packetplayinwindowclick) {
+ if (this.player.dead) return; // CraftBukkit
PlayerConnectionUtils.ensureMainThread(packetplayinwindowclick, this, this.player.u());
- this.player.z();
+ this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinwindowclick.a() && this.player.activeContainer.c(this.player)) {
-- if (this.player.v()) {
-+ boolean cancelled = this.player.v(); // CraftBukkit - see below if
-+ if (false) { // CraftBukkit this.player.v()) {
+- if (this.player.isSpectator()) {
++ boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
++ if (false) { // this.player.isSpectator()) {
ArrayList arraylist = Lists.newArrayList();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
-@@ -728,7 +1339,270 @@
+@@ -726,7 +1335,270 @@
this.player.a(this.player.activeContainer, (List) arraylist);
} else {
@@ -1278,7 +1267,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
-@@ -789,8 +1663,48 @@
+@@ -787,8 +1659,48 @@
}
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() < 36 + PlayerInventory.getHotbarSize();
@@ -1328,7 +1317,7 @@
if (flag1 && flag2 && flag3) {
if (itemstack == null) {
-@@ -813,6 +1727,7 @@
+@@ -811,6 +1723,7 @@
}
public void a(PacketPlayInTransaction packetplayintransaction) {
@@ -1336,15 +1325,15 @@
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.u());
Short oshort = (Short) this.n.get(this.player.activeContainer.windowId);
-@@ -823,6 +1738,7 @@
+@@ -821,6 +1734,7 @@
}
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
+ if (this.player.dead) return; // CraftBukkit
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.u());
- this.player.z();
+ this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
-@@ -839,14 +1755,30 @@
+@@ -837,14 +1751,30 @@
if (!tileentitysign.b() || tileentitysign.c() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@@ -1376,7 +1365,7 @@
tileentitysign.update();
worldserver.notify(blockposition);
-@@ -869,11 +1801,27 @@
+@@ -867,11 +1797,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.u());
@@ -1405,7 +1394,7 @@
ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b()).iterator();
-@@ -913,13 +1861,16 @@
+@@ -911,13 +1857,16 @@
itemstack1 = this.player.inventory.getItemInHand();
if (itemstack1 != null) {
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@@ -1422,7 +1411,7 @@
return;
} finally {
packetdataserializer.release();
-@@ -942,16 +1893,21 @@
+@@ -940,16 +1889,21 @@
itemstack1 = this.player.inventory.getItemInHand();
if (itemstack1 != null) {
if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.WRITABLE_BOOK) {
@@ -1444,7 +1433,7 @@
return;
} finally {
packetdataserializer.release();
-@@ -968,11 +1924,12 @@
+@@ -966,11 +1920,12 @@
}
} catch (Exception exception2) {
PlayerConnection.c.error("Couldn\'t select trade", exception2);
@@ -1458,7 +1447,7 @@
packetdataserializer = packetplayincustompayload.b();
try {
-@@ -1008,6 +1965,7 @@
+@@ -1006,6 +1961,7 @@
}
} catch (Exception exception3) {
PlayerConnection.c.error("Couldn\'t set command block", exception3);
@@ -1466,7 +1455,7 @@
} finally {
packetdataserializer.release();
}
-@@ -1033,6 +1991,7 @@
+@@ -1031,6 +1987,7 @@
}
} catch (Exception exception4) {
PlayerConnection.c.error("Couldn\'t set beacon", exception4);
@@ -1474,7 +1463,7 @@
}
}
} else if ("MC|ItemName".equals(packetplayincustompayload.a()) && this.player.activeContainer instanceof ContainerAnvil) {
-@@ -1048,7 +2007,28 @@
+@@ -1046,7 +2003,28 @@
containeranvil.a("");
}
}
@@ -1499,7 +1488,7 @@
+ // CraftBukkit start - Add "isDisconnected" method
+ public final boolean isDisconnected() {
-+ return !this.player.joining && !this.networkManager.k.config().isAutoRead();
++ return !this.player.joining && !this.networkManager.channel.config().isAutoRead();
}
static class SyntheticClass_1 {
diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch
index 8ec48414..1183104e 100644
--- a/nms-patches/PlayerList.patch
+++ b/nms-patches/PlayerList.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/PlayerList.java 2015-03-21 20:36:24.932515542 +0000
-+++ src/main/java/net/minecraft/server/PlayerList.java 2015-03-21 20:36:24.932515542 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/PlayerList.java 2015-05-05 21:53:39.729102395 +0100
++++ src/main/java/net/minecraft/server/PlayerList.java 2015-05-05 21:53:39.729102395 +0100
@@ -18,6 +18,26 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -89,12 +89,12 @@
playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimension(), worldserver.getDifficulty(), this.getMaxPlayers(), worlddata.getType(), worldserver.getGameRules().getBoolean("reducedDebugInfo")));
+ entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
playerconnection.sendPacket(new PacketPlayOutCustomPayload("MC|Brand", (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName())));
- playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.y(), worlddata.z()));
+ playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
playerconnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
@@ -89,17 +125,23 @@
entityplayer.getStatisticManager().updateStatistics(entityplayer);
this.sendScoreboard((ScoreboardServer) worldserver.getScoreboard(), entityplayer);
- this.server.aG();
+ this.server.aH();
- ChatMessage chatmessage;
+ // CraftBukkit start - login message is handled in the event
+ // ChatMessage chatmessage;
@@ -150,7 +150,7 @@
+ NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().i(); // CraftBukkit
NBTTagCompound nbttagcompound1;
- if (entityplayer.getName().equals(this.server.R()) && nbttagcompound != null) {
+ if (entityplayer.getName().equals(this.server.S()) && nbttagcompound != null) {
@@ -226,33 +271,72 @@
}
@@ -319,9 +319,9 @@
+ // return s;
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s);
} else {
-- return this.players.size() >= this.maxPlayers ? "The server is full!" : null;
-+ // return this.players.size() >= this.maxPlayers ? "The server is full!" : null;
-+ if (this.players.size() >= this.maxPlayers) {
+- return this.players.size() >= this.maxPlayers && !this.f(gameprofile) ? "The server is full!" : null;
++ // return this.players.size() >= this.maxPlayers && !this.f(gameprofile) ? "The server is full!" : null;
++ if (this.players.size() >= this.maxPlayers && !this.f(gameprofile)) {
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full");
+ }
}
@@ -746,12 +746,12 @@
@@ -589,10 +962,24 @@
public void addOp(GameProfile gameprofile) {
- this.operators.add(new OpListEntry(gameprofile, this.server.p()));
+ this.operators.add(new OpListEntry(gameprofile, this.server.p(), this.operators.b(gameprofile)));
+
+ // CraftBukkit start
+ Player player = server.server.getPlayer(gameprofile.getId());
+ if (player != null) {
-+ player.recalculatePermissions();
++ player.recalculatePermissions();
+ }
+ // CraftBukkit end
}
@@ -772,8 +772,8 @@
}
public boolean isOp(GameProfile gameprofile) {
-- return this.operators.d(gameprofile) || this.server.S() && this.server.worldServer[0].getWorldData().v() && this.server.R().equalsIgnoreCase(gameprofile.getName()) || this.t;
-+ return this.operators.d(gameprofile) || this.server.S() && this.server.worlds.get(0).getWorldData().v() && this.server.R().equalsIgnoreCase(gameprofile.getName()) || this.t; // CraftBukkit
+- return this.operators.d(gameprofile) || this.server.T() && this.server.worldServer[0].getWorldData().v() && this.server.S().equalsIgnoreCase(gameprofile.getName()) || this.t;
++ return this.operators.d(gameprofile) || this.server.T() && this.server.worlds.get(0).getWorldData().v() && this.server.S().equalsIgnoreCase(gameprofile.getName()) || this.t; // CraftBukkit
}
public EntityPlayer getPlayer(String s) {
diff --git a/nms-patches/PortalTravelAgent.patch b/nms-patches/PortalTravelAgent.patch
index a955a317..f1ca162d 100644
--- a/nms-patches/PortalTravelAgent.patch
+++ b/nms-patches/PortalTravelAgent.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/PortalTravelAgent.java 2015-04-16 21:22:47.467439143 +0100
-+++ src/main/java/net/minecraft/server/PortalTravelAgent.java 2015-04-16 21:22:47.471439143 +0100
+--- /home/matt/mc-dev-private//net/minecraft/server/PortalTravelAgent.java 2015-05-05 21:41:21.188631097 +0100
++++ src/main/java/net/minecraft/server/PortalTravelAgent.java 2015-05-05 21:41:21.188631097 +0100
@@ -5,6 +5,12 @@
import java.util.List;
import java.util.Random;
@@ -141,7 +141,7 @@
double d2 = (double) ((BlockPosition) object).getX() + 0.5D;
double d3 = (double) ((BlockPosition) object).getY() + 0.5D;
-@@ -134,26 +223,60 @@
+@@ -132,26 +221,60 @@
f3 = -1.0F;
f4 = 1.0F;
}
@@ -216,7 +216,7 @@
int l = i;
int i1 = j;
int j1 = k;
-@@ -178,10 +301,10 @@
+@@ -176,10 +299,10 @@
double d4;
for (i2 = i - b0; i2 <= i + b0; ++i2) {
@@ -229,7 +229,7 @@
label271:
for (k2 = this.a.V() - 1; k2 >= 0; --k2) {
-@@ -213,7 +336,7 @@
+@@ -211,7 +334,7 @@
}
}
@@ -238,7 +238,7 @@
d4 = d1 * d1 + d3 * d3 + d2 * d2;
if (d0 < 0.0D || d4 < d0) {
d0 = d4;
-@@ -230,10 +353,10 @@
+@@ -228,10 +351,10 @@
if (d0 < 0.0D) {
for (i2 = i - b0; i2 <= i + b0; ++i2) {
@@ -251,7 +251,7 @@
label219:
for (k2 = this.a.V() - 1; k2 >= 0; --k2) {
-@@ -258,7 +381,7 @@
+@@ -256,7 +379,7 @@
}
}
diff --git a/nms-patches/TileEntityChest.patch b/nms-patches/TileEntityChest.patch
index ac339705..cd3b45aa 100644
--- a/nms-patches/TileEntityChest.patch
+++ b/nms-patches/TileEntityChest.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/TileEntityChest.java 2015-02-26 22:40:23.127608134 +0000
-+++ src/main/java/net/minecraft/server/TileEntityChest.java 2015-02-26 22:40:23.127608134 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/TileEntityChest.java 2015-05-05 21:41:21.308629312 +0100
++++ src/main/java/net/minecraft/server/TileEntityChest.java 2015-05-05 21:41:21.312629253 +0100
@@ -3,6 +3,11 @@
import java.util.Iterator;
import java.util.List;
@@ -82,7 +82,7 @@
@@ -315,8 +358,20 @@
public void closeContainer(EntityHuman entityhuman) {
- if (!entityhuman.v() && this.w() instanceof BlockChest) {
+ if (!entityhuman.isSpectator() && this.w() instanceof BlockChest) {
+ int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
--this.l;
+ if (this.world == null) return; // CraftBukkit
diff --git a/nms-patches/WorldData.patch b/nms-patches/WorldData.patch
index a45ed3fc..ce46f4dd 100644
--- a/nms-patches/WorldData.patch
+++ b/nms-patches/WorldData.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/WorldData.java 2015-03-19 21:25:55.170142151 +0000
-+++ src/main/java/net/minecraft/server/WorldData.java 2015-03-19 21:25:55.170142151 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/WorldData.java 2015-05-05 21:41:21.384628182 +0100
++++ src/main/java/net/minecraft/server/WorldData.java 2015-05-05 21:41:21.384628182 +0100
@@ -1,6 +1,11 @@
package net.minecraft.server;
@@ -63,14 +63,14 @@
public void setDifficulty(EnumDifficulty enumdifficulty) {
this.z = enumdifficulty;
+ // CraftBukkit start
-+ PacketPlayOutServerDifficulty packet = new PacketPlayOutServerDifficulty(this.y(), this.z()); // PAIL: Rename getDifficulty, isDifficultyLocked
++ PacketPlayOutServerDifficulty packet = new PacketPlayOutServerDifficulty(this.getDifficulty(), this.isDifficultyLocked());
+ for (EntityPlayer player : (java.util.List<EntityPlayer>) (java.util.List) world.players) {
+ player.playerConnection.sendPacket(packet);
+ }
+ // CraftBukkit end
}
- public boolean z() {
+ public boolean isDifficultyLocked() {
@@ -664,4 +700,12 @@
}
});
diff --git a/nms-patches/WorldNBTStorage.patch b/nms-patches/WorldNBTStorage.patch
index a685c538..33b39349 100644
--- a/nms-patches/WorldNBTStorage.patch
+++ b/nms-patches/WorldNBTStorage.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/WorldNBTStorage.java 2015-02-26 22:40:23.231608132 +0000
-+++ src/main/java/net/minecraft/server/WorldNBTStorage.java 2015-02-26 22:40:23.235608132 +0000
+--- /home/matt/mc-dev-private//net/minecraft/server/WorldNBTStorage.java 2015-05-05 21:41:21.444627290 +0100
++++ src/main/java/net/minecraft/server/WorldNBTStorage.java 2015-05-05 21:41:21.444627290 +0100
@@ -11,6 +11,12 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -15,7 +15,7 @@
private static final Logger a = LogManager.getLogger();
@@ -19,6 +25,7 @@
private final File dataDir;
- private final long sessionId = MinecraftServer.ay();
+ private final long sessionId = MinecraftServer.az();
private final String f;
+ private UUID uuid = null; // CraftBukkit
diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch
index 4169daec..38ee1e5f 100644
--- a/nms-patches/WorldServer.patch
+++ b/nms-patches/WorldServer.patch
@@ -1,5 +1,5 @@
---- /home/matt/mc-dev-private//net/minecraft/server/WorldServer.java 2015-04-13 11:02:47.684046165 +0100
-+++ src/main/java/net/minecraft/server/WorldServer.java 2015-04-13 11:02:47.688046165 +0100
+--- /home/matt/mc-dev-private//net/minecraft/server/WorldServer.java 2015-05-05 21:41:21.448627230 +0100
++++ src/main/java/net/minecraft/server/WorldServer.java 2015-05-05 21:41:21.452627171 +0100
@@ -16,14 +16,27 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -56,7 +56,7 @@
+ this.Q = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
this.B();
this.C();
- this.getWorldBorder().a(minecraftserver.aH());
+ this.getWorldBorder().a(minecraftserver.aI());
@@ -63,6 +84,7 @@
this.villages.a((World) this);
}
@@ -202,7 +202,7 @@
public BiomeBase.BiomeMeta a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
@@ -161,7 +281,7 @@
- if (entityhuman.v()) {
+ if (entityhuman.isSpectator()) {
++i;
- } else if (entityhuman.isSleeping()) {
+ } else if (entityhuman.isSleeping() || entityhuman.fauxSleeping) {
@@ -249,13 +249,13 @@
}
entityhuman = (EntityHuman) iterator.next();
-- } while (!entityhuman.v() && entityhuman.isDeeplySleeping());
+- } while (!entityhuman.isSpectator() && entityhuman.isDeeplySleeping());
+
+ // CraftBukkit start
+ if (entityhuman.isDeeplySleeping()) {
+ foundActualSleepers = true;
+ }
-+ } while (!entityhuman.v() && (entityhuman.isDeeplySleeping() || entityhuman.fauxSleeping));
++ } while (!entityhuman.isSpectator() && (entityhuman.isDeeplySleeping() || entityhuman.fauxSleeping));
+ // CraftBukkit end
return false;
diff --git a/pom.xml b/pom.xml
index d8f00544..c5503f6f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<packaging>jar</packaging>
- <version>1.8.3-R0.1-SNAPSHOT</version>
+ <version>1.8.4-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name>
<url>http://www.bukkit.org</url>
@@ -12,8 +12,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version>
<junit.version>4.11</junit.version>
- <minecraft.version>1.8.3</minecraft.version>
- <minecraft_version>1_8_R2</minecraft_version>
+ <minecraft.version>1.8.4</minecraft.version>
+ <minecraft_version>1_8_R3</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix>
<maven.compiler.source>1.6</maven.compiler.source>
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java
index 9f095488..3a0ce677 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGuardian.java
@@ -24,7 +24,7 @@ public class CraftGuardian extends CraftMonster implements Guardian {
@Override
public boolean isElder() {
- return ((EntityGuardian)entity).cn(); // PAIL: Rename isElder
+ return ((EntityGuardian)entity).isElder();
}
@Override
@@ -32,22 +32,22 @@ public class CraftGuardian extends CraftMonster implements Guardian {
EntityGuardian entityGuardian = (EntityGuardian) entity;
if (!isElder() && shouldBeElder) {
- entityGuardian.a( true ); // PAIL: Rename setElder
+ entityGuardian.setElder(true);
} else if (isElder() && !shouldBeElder) {
- entityGuardian.a( false ); // PAIL: Rename setElder
+ entityGuardian.setElder(false);
// Since minecraft does not reset the elder Guardian to a guardian we have to do that
entity.setSize(0.85F, 0.85F);
// Since aW() calls its supers it will try to re register attributes which is invalid
// check these on update
- entityGuardian.getAttributeInstance(GenericAttributes.e).setValue(6.0D); // PAIL: Rename ATTACK_DAMAGE
- entityGuardian.getAttributeInstance(GenericAttributes.d).setValue(0.5D); // PAIL: Rename MOVEMENT_SPEED
- entityGuardian.getAttributeInstance(GenericAttributes.b).setValue(16.0D); // PAIL: Rename FOLLOW_RANGE
+ entityGuardian.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6.0D);
+ entityGuardian.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
+ entityGuardian.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(16.0D);
entityGuardian.getAttributeInstance(GenericAttributes.maxHealth).setValue(30.0D);
// Update pathfinding (random stroll back to 80)
- entityGuardian.br.b(80); // PAIL: Rename goalRandomStroll.setTimeBetweenMovement
+ entityGuardian.goalRandomStroll.setTimeBetweenMovement(80);
// Tell minecraft that we need persistence since the guardian changed
entityGuardian.initAttributes();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 16a35b85..e229dc07 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -759,7 +759,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return;
}
- getHandle().e((Entity) getHandle()); // PAIL: Rename setSpectatorTarget
+ getHandle().setSpectatorTarget(getHandle());
getHandle().playerInteractManager.setGameMode(WorldSettings.EnumGamemode.getById(mode.getValue()));
getHandle().fallDistance = 0;
getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue()));
diff --git a/src/test/java/org/bukkit/PerMaterialTest.java b/src/test/java/org/bukkit/PerMaterialTest.java
index e36a3e75..2cbf4ecb 100644
--- a/src/test/java/org/bukkit/PerMaterialTest.java
+++ b/src/test/java/org/bukkit/PerMaterialTest.java
@@ -34,7 +34,7 @@ public class PerMaterialTest extends AbstractTestingBase {
@BeforeClass
public static void getFireValues() {
- fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "T"); // PAIL: Rename flameChances
+ fireValues = Util.getInternalState(BlockFire.class, Blocks.FIRE, "flameChances");
}
@Parameters(name= "{index}: {0}")