Archiviert
13
0

Update to 1.8.4

Dieser Commit ist enthalten in:
Thinkofdeath 2015-05-05 21:43:47 +01:00
Ursprung 0a645a2726
Commit a486600749
24 geänderte Dateien mit 270 neuen und 287 gelöschten Zeilen

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:22.103608145 +0000 +++ src/main/java/net/minecraft/server/BlockDispenser.java 2015-05-05 21:41:19.976649120 +0100
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
public static final BlockStateBoolean TRIGGERED = BlockStateBoolean.of("triggered"); public static final BlockStateBoolean TRIGGERED = BlockStateBoolean.of("triggered");
public static final RegistryDefault<Item, IDispenseBehavior> N = new RegistryDefault(new DispenseBehaviorItem()); public static final RegistryDefault<Item, IDispenseBehavior> N = new RegistryDefault(new DispenseBehaviorItem());
@ -23,5 +23,5 @@
ItemStack itemstack1 = idispensebehavior.a(sourceblock, itemstack); ItemStack itemstack1 = idispensebehavior.a(sourceblock, itemstack);
+ eventFired = false; // CraftBukkit - reset event status + eventFired = false; // CraftBukkit - reset event status
tileentitydispenser.setItem(i, itemstack1.count == 0 ? null : itemstack1); tileentitydispenser.setItem(i, itemstack1.count <= 0 ? null : itemstack1);
} }

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:22.115608145 +0000 +++ src/main/java/net/minecraft/server/BlockDropper.java 2015-05-05 21:41:19.988648941 +0100
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
package net.minecraft.server; package net.minecraft.server;
@ -46,5 +46,5 @@
+ if (event.getItem().equals(oitemstack) && itemstack1 == null) { + if (event.getItem().equals(oitemstack) && itemstack1 == null) {
+ // CraftBukkit end + // CraftBukkit end
itemstack1 = itemstack.cloneItemStack(); itemstack1 = itemstack.cloneItemStack();
if (--itemstack1.count == 0) { if (--itemstack1.count <= 0) {
itemstack1 = null; itemstack1 = null;

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/BlockVine.java 2015-02-26 22:40:22.283608143 +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-02-26 22:40:22.287608143 +0000 +++ src/main/java/net/minecraft/server/BlockVine.java 2015-05-05 21:53:38.737118335 +0100
@@ -3,6 +3,8 @@ @@ -3,6 +3,8 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.Random; import java.util.Random;
@ -9,14 +9,14 @@
public class BlockVine extends Block { public class BlockVine extends Block {
public static final BlockStateBoolean UP = BlockStateBoolean.of("up"); 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()) { 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 + // CraftBukkit start - Call BlockSpreadEvent
+ // world.setTypeAndData(blockposition.up(), iblockdata1, 2); + // world.setTypeAndData(blockposition1, iblockdata1, 2);
+ BlockPosition target = blockposition.up(); + BlockPosition target = blockposition1;
+ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + 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()); + org.bukkit.block.Block block = world.getWorld().getBlockAt(target.getX(), target.getY(), target.getZ());
+ CraftEventFactory.handleBlockSpreadEvent(block, source, this, toLegacyData(iblockdata1)); + CraftEventFactory.handleBlockSpreadEvent(block, source, this, toLegacyData(iblockdata1));
@ -24,50 +24,50 @@
} }
} }
@@ -219,17 +227,29 @@ @@ -220,17 +228,29 @@
BlockPosition blockposition2 = blockposition1.shift(enumdirection1); BlockPosition blockposition3 = blockposition2.shift(enumdirection1);
BlockPosition blockposition3 = blockposition1.shift(enumdirection2); BlockPosition blockposition4 = blockposition2.shift(enumdirection2);
+ // CraftBukkit start - Call BlockSpreadEvent + // CraftBukkit start - Call BlockSpreadEvent
+ org.bukkit.block.Block source = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + 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(blockposition1.getX(), blockposition1.getY(), blockposition1.getZ());
+ +
if (flag1 && this.c(world.getType(blockposition2).getBlock())) { if (flag1 && this.c(world.getType(blockposition3).getBlock())) {
- world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition1, 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)))); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection1), Boolean.valueOf(true))));
} else if (flag2 && this.c(world.getType(blockposition3).getBlock())) { } else if (flag2 && this.c(world.getType(blockposition4).getBlock())) {
- world.setTypeAndData(blockposition1, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2); - world.setTypeAndData(blockposition2, this.getBlockData().set(a(enumdirection2), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition1, 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)))); + 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())) { } else if (flag1 && world.isEmpty(blockposition3) && 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())) {
- 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);
+ // 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()); + 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)))); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true))));
} else if (this.c(world.getType(blockposition1.up()).getBlock())) { } else if (flag2 && world.isEmpty(blockposition4) && this.c(world.getType(blockposition.shift(enumdirection2)).getBlock())) {
- world.setTypeAndData(blockposition1, this.getBlockData(), 2); - world.setTypeAndData(blockposition4, this.getBlockData().set(a(enumdirection.opposite()), Boolean.valueOf(true)), 2);
+ // world.setTypeAndData(blockposition1, this.getBlockData(), 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())); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(this.getBlockData()));
} }
+ // CraftBukkit end + // CraftBukkit end
} else if (block.material.k() && block.d()) { } else if (block.material.k() && block.d()) {
world.setTypeAndData(blockposition, iblockdata.set(a(enumdirection), Boolean.valueOf(true)), 2); 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()) { 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 + // 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 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)); + CraftEventFactory.handleBlockSpreadEvent(bukkitBlock, source, this, toLegacyData(iblockdata3));
+ // CraftBukkit end + // CraftBukkit end
} }

Datei anzeigen

@ -1,24 +1,20 @@
--- /home/matt/mc-dev-private//net/minecraft/server/ChunkRegionLoader.java 2015-03-22 19:01:20.065879491 +0000 --- /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-03-22 19:01:20.065879491 +0000 +++ src/main/java/net/minecraft/server/ChunkRegionLoader.java 2015-05-05 21:41:20.236645254 +0100
@@ -25,7 +25,39 @@ @@ -25,7 +25,35 @@
this.e = file; this.d = file;
} }
+ // CraftBukkit start + // CraftBukkit start
+ public boolean chunkExists(World world, int i, int j) { + public boolean chunkExists(World world, int i, int j) {
+ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); + ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
+ +
+ synchronized (this.d) {
+ if (this.c.contains(chunkcoordintpair)) { + if (this.c.contains(chunkcoordintpair)) {
+ for (int k = 0; k < this.b.size(); ++k) { + if (this.b.containsKey(chunkcoordintpair)) {
+ if (((PendingChunkToSave) this.b.get(k)).a.equals(chunkcoordintpair)) {
+ return true; + 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 + // CraftBukkit end
+ +
@ -37,10 +33,10 @@
+ +
+ public Object[] loadChunk(World world, int i, int j) throws IOException { + public Object[] loadChunk(World world, int i, int j) throws IOException {
+ // CraftBukkit end + // CraftBukkit end
NBTTagCompound nbttagcompound = null;
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
Object object = this.d; NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair);
@@ -54,7 +86,7 @@
@@ -42,7 +70,7 @@
return this.a(world, i, j, nbttagcompound); return this.a(world, i, j, nbttagcompound);
} }
@ -49,7 +45,7 @@
if (!nbttagcompound.hasKeyOfType("Level", 10)) { if (!nbttagcompound.hasKeyOfType("Level", 10)) {
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is missing level data, skipping"); ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is missing level data, skipping");
return null; 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 + ")"); 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("xPos", i);
nbttagcompound1.setInt("zPos", j); nbttagcompound1.setInt("zPos", j);
@ -79,7 +75,7 @@
} }
} }
} }
@@ -308,7 +358,26 @@ @@ -290,7 +336,26 @@
int k1 = l >> 4 & 15; int k1 = l >> 4 & 15;
int l1 = nibblearray1 != null ? nibblearray1.a(i1, j1, k1) : 0; int l1 = nibblearray1 != null ? nibblearray1.a(i1, j1, k1) : 0;
@ -107,7 +103,7 @@
} }
chunksection.a(achar); chunksection.a(achar);
@@ -326,6 +395,13 @@ @@ -308,6 +373,13 @@
chunk.a(nbttagcompound.getByteArray("Biomes")); chunk.a(nbttagcompound.getByteArray("Biomes"));
} }
@ -121,12 +117,11 @@
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10); NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
if (nbttaglist1 != null) { if (nbttaglist1 != null) {
@@ -384,7 +460,7 @@ @@ -366,6 +438,6 @@
} }
} }
- return chunk; - return chunk;
+ // return chunk; // CraftBukkit + // return chunk; // CraftBukkit
} }
}
static class PendingChunkToSave {

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:22.443608141 +0000 +++ src/main/java/net/minecraft/server/DedicatedServer.java 2015-05-05 21:41:20.364643350 +0100
@@ -15,20 +15,32 @@ @@ -15,20 +15,32 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -94,7 +94,7 @@
+ System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); + System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
+ // CraftBukkit end + // 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) { 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\""); 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 + this.convertable = new WorldLoaderServer(server.getWorldContainer()); // CraftBukkit - moved from MinecraftServer constructor
long j = System.nanoTime(); long j = System.nanoTime();
if (this.T() == null) { if (this.U() == null) {
@@ -198,8 +248,19 @@ @@ -198,8 +248,19 @@
DedicatedServer.LOGGER.info("Starting remote control listener"); DedicatedServer.LOGGER.info("Starting remote control listener");
this.n = new RemoteControlListener(this); this.n = new RemoteControlListener(this);
@ -140,7 +140,7 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (this.aR() > 0L) { if (this.aS() > 0L) {
Thread thread1 = new Thread(new ThreadWatchdog(this)); Thread thread1 = new Thread(new ThreadWatchdog(this));
@@ -213,6 +274,12 @@ @@ -213,6 +274,12 @@
@ -160,10 +160,10 @@
System.exit(0); System.exit(0);
} }
- protected void A() { - protected void B() {
+ public void A() { // CraftBukkit - fix decompile error + public void B() { // CraftBukkit - fix decompile error
super.A(); super.B();
this.aN(); this.aO();
} }
@@ -296,7 +363,14 @@ @@ -296,7 +363,14 @@
while (!this.l.isEmpty()) { while (!this.l.isEmpty()) {
@ -181,7 +181,7 @@
} }
} }
@@ -487,13 +561,57 @@ @@ -491,13 +565,57 @@
} }
public String getPlugins() { public String getPlugins() {

Datei anzeigen

@ -1,11 +1,11 @@
--- /home/matt/mc-dev-private//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-03-19 21:25:54.134142162 +0000 +++ src/main/java/net/minecraft/server/EntityGuardian.java 2015-05-05 21:41:20.516641090 +0100
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
private EntityLiving bo; private EntityLiving bo;
private int bp; private int bp;
private boolean bq; private boolean bq;
- private PathfinderGoalRandomStroll br; - private PathfinderGoalRandomStroll goalRandomStroll;
+ public PathfinderGoalRandomStroll br; // CraftBukkit - public, PAIL: Rename goalRandomStroll + public PathfinderGoalRandomStroll goalRandomStroll; // CraftBukkit - public
public EntityGuardian(World world) { public EntityGuardian(World world) {
super(world); super(world);
@ -16,8 +16,8 @@
- protected void initAttributes() { - protected void initAttributes() {
+ public void initAttributes() { // CraftBukkit - public + public void initAttributes() { // CraftBukkit - public
super.initAttributes(); super.initAttributes();
this.getAttributeInstance(GenericAttributes.e).setValue(6.0D); this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6.0D);
this.getAttributeInstance(GenericAttributes.d).setValue(0.5D); this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
@@ -516,7 +516,7 @@ @@ -516,7 +516,7 @@
return (entityliving instanceof EntityHuman || entityliving instanceof EntitySquid) && entityliving.h(this.a) > 9.0D; return (entityliving instanceof EntityHuman || entityliving instanceof EntitySquid) && entityliving.h(this.a) > 9.0D;
} }

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/EntityPlayer.java 2015-02-26 22:40:22.655608139 +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-02-26 22:40:22.659608139 +0000 +++ src/main/java/net/minecraft/server/EntityPlayer.java 2015-05-05 21:53:39.201110879 +0100
@@ -13,6 +13,17 @@ @@ -13,6 +13,17 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -235,7 +235,7 @@
- Collection collection = this.world.getScoreboard().getObjectivesForCriteria(IScoreboardCriteria.d); - Collection collection = this.world.getScoreboard().getObjectivesForCriteria(IScoreboardCriteria.d);
+ this.closeInventory(); + this.closeInventory();
+ this.e((Entity) this); // Remove spectated target + this.setSpectatorTarget(this); // Remove spectated target
+ // CraftBukkit end + // CraftBukkit end
+ +
+ // CraftBukkit - Get our scores instead + // CraftBukkit - Get our scores instead
@ -334,7 +334,7 @@
+ boolean cancelled = false; + boolean cancelled = false;
+ if (iinventory instanceof ITileInventory) { + if (iinventory instanceof ITileInventory) {
+ ITileInventory itileinventory = (ITileInventory) iinventory; + ITileInventory itileinventory = (ITileInventory) iinventory;
+ cancelled = itileinventory.r_() && !this.a(itileinventory.i()) && !this.v(); + cancelled = itileinventory.r_() && !this.a(itileinventory.i()) && !this.isSpectator();
+ } + }
+ +
+ Container container; + Container container;
@ -356,8 +356,8 @@
if (iinventory instanceof ITileInventory) { if (iinventory instanceof ITileInventory) {
ITileInventory itileinventory = (ITileInventory) iinventory; ITileInventory itileinventory = (ITileInventory) iinventory;
- if (itileinventory.r_() && !this.a(itileinventory.i()) && !this.v()) { - if (itileinventory.r_() && !this.a(itileinventory.i()) && !this.isSpectator()) {
+ 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() && 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 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)); this.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("random.door_close", this.locX, this.locY, this.locZ, 1.0F, 1.0F));
+ +
@ -470,15 +470,17 @@
+ // CraftBukkit end */ + // CraftBukkit end */
} }
public boolean v() { public boolean isSpectator() {
@@ -768,6 +949,7 @@ @@ -768,7 +949,8 @@
} }
public boolean a(int i, String s) { public boolean a(int i, String s) {
- if ("seed".equals(s) && !this.server.ae()) {
+ /* CraftBukkit start + /* CraftBukkit start
if ("seed".equals(s) && !this.server.ad()) { + if ("seed".equals(s) && !this.server.ad()) {
return true; return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) { } 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 @@ @@ -781,6 +963,9 @@
} else { } else {
return true; return true;

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:22.755608138 +0000 +++ src/main/java/net/minecraft/server/HandshakeListener.java 2015-05-05 21:41:20.812636689 +0100
@@ -1,7 +1,17 @@ @@ -1,7 +1,17 @@
package net.minecraft.server; package net.minecraft.server;
@ -58,7 +58,7 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
if (packethandshakinginsetprotocol.b() > 47) { 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)); this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
@@ -26,6 +71,7 @@ @@ -26,6 +71,7 @@
this.b.close(chatcomponenttext); this.b.close(chatcomponenttext);

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:22.867608136 +0000 +++ src/main/java/net/minecraft/server/LoginListener.java 2015-05-05 21:41:20.968634369 +0100
@@ -18,6 +18,12 @@ @@ -18,6 +18,12 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -36,9 +36,9 @@
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
this.g = LoginListener.EnumProtocolState.ACCEPTED; 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 @@ @@ -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 { - public void operationComplete(Future future) throws Exception {
@ -60,7 +60,7 @@
@@ -148,6 +157,43 @@ @@ -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) { if (LoginListener.this.i != null) {
+ // CraftBukkit start - fire PlayerPreLoginEvent + // CraftBukkit start - fire PlayerPreLoginEvent
+ if (!networkManager.g()) { + if (!networkManager.g()) {
@ -101,7 +101,7 @@
+ // CraftBukkit end + // CraftBukkit end
LoginListener.c.info("UUID of player " + LoginListener.this.i.getName() + " is " + LoginListener.this.i.getId()); LoginListener.c.info("UUID of player " + LoginListener.this.i.getName() + " is " + LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else if (LoginListener.this.server.S()) { } else if (LoginListener.this.server.T()) {
@@ -156,7 +202,7 @@ @@ -156,7 +202,7 @@
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
} else { } else {
@ -110,7 +110,7 @@
+ LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer + LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer
} }
} catch (AuthenticationUnavailableException authenticationunavailableexception) { } catch (AuthenticationUnavailableException authenticationunavailableexception) {
if (LoginListener.this.server.S()) { if (LoginListener.this.server.T()) {
@@ -167,6 +213,11 @@ @@ -167,6 +213,11 @@
LoginListener.this.disconnect("Authentication servers are down. Please try again later, sorry!"); LoginListener.this.disconnect("Authentication servers are down. Please try again later, sorry!");
LoginListener.c.error("Couldn\'t verify username because servers are unavailable"); LoginListener.c.error("Couldn\'t verify username because servers are unavailable");

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/MinecraftServer.java 2015-03-11 10:44:42.911576345 +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-03-11 10:44:42.915576345 +0000 +++ src/main/java/net/minecraft/server/MinecraftServer.java 2015-05-05 21:41:20.980634191 +0100
@@ -38,14 +38,27 @@ @@ -38,14 +38,27 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -20,12 +20,12 @@
public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics { public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics {
- private static final Logger LOGGER = LogManager.getLogger(); - 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"); public static final File a = new File("usercache.json");
private static MinecraftServer l; private static MinecraftServer l;
- private final Convertable convertable; - private final Convertable convertable;
+ public Convertable convertable; // CraftBukkit - remove final, public + 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; - private final File universe;
+ public File universe; // CraftBukkit - remove final, public + public File universe; // CraftBukkit - remove final, public
private final List<IUpdatePlayerListBox> p = Lists.newArrayList(); private final List<IUpdatePlayerListBox> p = Lists.newArrayList();
@ -33,7 +33,7 @@
public final MethodProfiler methodProfiler = new MethodProfiler(); public final MethodProfiler methodProfiler = new MethodProfiler();
@@ -94,19 +107,61 @@ @@ -94,19 +107,61 @@
private Thread serverThread; private Thread serverThread;
private long ab = ay(); private long ab = az();
- public MinecraftServer(File file, Proxy proxy, File file1) { - public MinecraftServer(File file, Proxy proxy, File file1) {
+ // CraftBukkit start + // CraftBukkit start
@ -149,7 +149,7 @@
+ worlddata = new WorldData(worldsettings, s1); + 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) + 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(); - this.worldServer[j] = (WorldServer) (new DemoWorldServer(this, idatamanager, worlddata, b0, this.methodProfiler)).b();
+ world = (WorldServer) (new DemoWorldServer(this, idatamanager, worlddata, dimension, this.methodProfiler)).b(); + world = (WorldServer) (new DemoWorldServer(this, idatamanager, worlddata, dimension, this.methodProfiler)).b();
} else { } else {
@ -210,7 +210,7 @@
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld())); + this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld()));
+ +
+ world.addIWorldAccess(new WorldManager(this, world)); + world.addIWorldAccess(new WorldManager(this, world));
if (!this.S()) { if (!this.T()) {
- this.worldServer[j].getWorldData().setGameType(this.getGamemode()); - this.worldServer[j].getWorldData().setGameType(this.getGamemode());
+ world.getWorldData().setGameType(this.getGamemode()); + world.getWorldData().setGameType(this.getGamemode());
} }
@ -231,11 +231,11 @@
- MinecraftServer.LOGGER.info("Preparing start region for level " + b0); - MinecraftServer.LOGGER.info("Preparing start region for level " + b0);
- WorldServer worldserver = this.worldServer[b0]; - WorldServer worldserver = this.worldServer[b0];
- BlockPosition blockposition = worldserver.getSpawn(); - BlockPosition blockposition = worldserver.getSpawn();
- long j = ay(); - long j = az();
- -
- for (int k = -192; k <= 192 && this.isRunning(); k += 16) { - for (int k = -192; k <= 192 && this.isRunning(); k += 16) {
- for (int l = -192; l <= 192 && this.isRunning(); l += 16) { - for (int l = -192; l <= 192 && this.isRunning(); l += 16) {
- long i1 = ay(); - long i1 = az();
- -
- if (i1 - j > 1000L) { - if (i1 - j > 1000L) {
- this.a_("Preparing spawn area", i * 100 / 625); - this.a_("Preparing spawn area", i * 100 / 625);
@ -251,12 +251,12 @@
+ } + }
+ +
+ BlockPosition blockposition = worldserver.getSpawn(); + BlockPosition blockposition = worldserver.getSpawn();
+ long j = ay(); + long j = az();
+ i = 0; + i = 0;
+ +
+ for (int k = -192; k <= 192 && this.isRunning(); k += 16) { + for (int k = -192; k <= 192 && this.isRunning(); k += 16) {
+ for (int l = -192; l <= 192 && this.isRunning(); l += 16) { + for (int l = -192; l <= 192 && this.isRunning(); l += 16) {
+ long i1 = ay(); + long i1 = az();
+ +
+ if (i1 - j > 1000L) { + if (i1 - j > 1000L) {
+ this.a_("Preparing spawn area", i * 100 / 625); + this.a_("Preparing spawn area", i * 100 / 625);
@ -275,11 +275,11 @@
+ this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld())); + this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.r(); this.s();
} }
@@ -264,35 +404,52 @@ @@ -266,15 +406,19 @@
protected void r() { protected void s() {
this.f = null; this.f = null;
this.g = 0; this.g = 0;
+ +
@ -301,19 +301,15 @@
if (worldserver != null) { if (worldserver != null) {
if (!flag) { if (!flag) {
MinecraftServer.LOGGER.info("Saving chunks for level \'" + worldserver.getWorldData().getName() + "\'/" + worldserver.worldProvider.getName()); @@ -283,6 +427,7 @@
}
- try { try {
- worldserver.save(true, (IProgressUpdate) null); worldserver.save(true, (IProgressUpdate) null);
- } catch (ExceptionWorldConflict exceptionworldconflict) { + worldserver.saveLevel(); // CraftBukkit
- MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage()); } catch (ExceptionWorldConflict exceptionworldconflict) {
- } MinecraftServer.LOGGER.warn(exceptionworldconflict.getMessage());
+ worldserver.save(true, (IProgressUpdate) null);
+ worldserver.saveLevel();
} }
} @@ -292,9 +437,25 @@
} }
} }
@ -337,10 +333,10 @@
+ this.server.disablePlugins(); + this.server.disablePlugins();
+ } + }
+ // CraftBukkit end + // CraftBukkit end
if (this.ap() != null) { if (this.aq() != null) {
this.ap().b(); this.aq().b();
} }
@@ -307,11 +464,13 @@ @@ -309,11 +470,13 @@
MinecraftServer.LOGGER.info("Saving worlds"); MinecraftServer.LOGGER.info("Saving worlds");
this.saveChunks(false); this.saveChunks(false);
@ -354,7 +350,7 @@
} }
if (this.n.d()) { if (this.n.d()) {
@@ -352,6 +511,7 @@ @@ -354,6 +517,7 @@
long k = j - this.ab; long k = j - this.ab;
if (k > 2000L && this.ab - this.R >= 15000L) { 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)}); 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; k = 2000L;
this.R = this.ab; this.R = this.ab;
@@ -364,11 +524,12 @@ @@ -366,11 +530,12 @@
i += k; i += k;
this.ab = j; this.ab = j;
- if (this.worldServer[0].everyoneDeeplySleeping()) { - if (this.worldServer[0].everyoneDeeplySleeping()) {
+ if (this.worlds.get(0).everyoneDeeplySleeping()) { + if (this.worlds.get(0).everyoneDeeplySleeping()) { // CraftBukkit
this.z(); this.A();
i = 0L; i = 0L;
} else { } else {
while (i > 50L) { while (i > 50L) {
+ MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit
i -= 50L; i -= 50L;
this.z(); this.A();
} }
@@ -406,6 +567,12 @@ @@ -408,6 +573,12 @@
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1); MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally { } finally {
@ -386,19 +382,19 @@
+ } catch (Exception ignored) { + } catch (Exception ignored) {
+ } + }
+ // CraftBukkit end + // 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 A() {
+ protected void z() throws ExceptionWorldConflict { // CraftBukkit - added throws + protected void A() throws ExceptionWorldConflict { // CraftBukkit - added throws
long i = System.nanoTime(); long i = System.nanoTime();
++this.ticks; ++this.ticks;
@@ -471,7 +638,7 @@ @@ -473,7 +644,7 @@
this.r.b().a(agameprofile); this.r.b().a(agameprofile);
} }
@ -407,7 +403,7 @@
this.methodProfiler.a("save"); this.methodProfiler.a("save");
this.v.savePlayers(); this.v.savePlayers();
this.saveChunks(true); this.saveChunks(true);
@@ -506,20 +673,40 @@ @@ -508,20 +679,40 @@
this.methodProfiler.c("levels"); this.methodProfiler.c("levels");
@ -451,7 +447,7 @@
this.methodProfiler.a("tick"); this.methodProfiler.a("tick");
@@ -546,9 +733,9 @@ @@ -548,9 +739,9 @@
worldserver.getTracker().updatePlayers(); worldserver.getTracker().updatePlayers();
this.methodProfiler.b(); this.methodProfiler.b();
this.methodProfiler.b(); this.methodProfiler.b();
@ -463,7 +459,7 @@
} }
this.methodProfiler.c("connection"); this.methodProfiler.c("connection");
@@ -572,10 +759,11 @@ @@ -574,10 +765,11 @@
this.p.add(iupdateplayerlistbox); this.p.add(iupdateplayerlistbox);
} }
@ -476,7 +472,7 @@
boolean flag = true; boolean flag = true;
String s = null; String s = null;
String s1 = "."; String s1 = ".";
@@ -653,6 +841,27 @@ @@ -655,15 +847,38 @@
dedicatedserver.stop(); dedicatedserver.stop();
} }
}); });
@ -504,10 +500,11 @@
} catch (Exception exception) { } catch (Exception exception) {
MinecraftServer.LOGGER.fatal("Failed to start the minecraft server", 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 + /* CraftBukkit start - prevent abuse
this.serverThread = new Thread(this, "Server thread"); this.serverThread = new Thread(this, "Server thread");
this.serverThread.start(); this.serverThread.start();
@ -515,7 +512,7 @@
} }
public File d(String s) { public File d(String s) {
@@ -677,7 +888,14 @@ @@ -679,7 +894,14 @@
} }
public WorldServer getWorldServer(int i) { public WorldServer getWorldServer(int i) {
@ -530,8 +527,8 @@
+ // CraftBukkit end + // CraftBukkit end
} }
public String D() { public String E() {
@@ -713,7 +931,7 @@ @@ -715,7 +937,7 @@
} }
public boolean isDebugging() { public boolean isDebugging() {
@ -540,7 +537,7 @@
} }
public void g(String s) { public void g(String s) {
@@ -728,7 +946,7 @@ @@ -730,7 +952,7 @@
} }
public String getServerModName() { public String getServerModName() {
@ -549,7 +546,7 @@
} }
public CrashReport b(CrashReport crashreport) { public CrashReport b(CrashReport crashreport) {
@@ -757,6 +975,7 @@ @@ -759,6 +981,7 @@
} }
public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, BlockPosition blockposition) { public List<String> tabCompleteCommand(ICommandListener icommandlistener, String s, BlockPosition blockposition) {
@ -557,7 +554,7 @@
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
if (s.startsWith("/")) { if (s.startsWith("/")) {
@@ -795,6 +1014,9 @@ @@ -797,6 +1020,9 @@
return arraylist; return arraylist;
} }
@ -567,16 +564,16 @@
} }
public static MinecraftServer getServer() { public static MinecraftServer getServer() {
@@ -802,7 +1024,7 @@ @@ -804,7 +1030,7 @@
} }
public boolean N() { public boolean O() {
- return this.universe != null; - return this.universe != null;
+ return true; // CraftBukkit + return true; // CraftBukkit
} }
public String getName() { public String getName() {
@@ -858,8 +1080,10 @@ @@ -860,8 +1086,10 @@
} }
public void a(EnumDifficulty enumdifficulty) { public void a(EnumDifficulty enumdifficulty) {
@ -589,7 +586,7 @@
if (worldserver != null) { if (worldserver != null) {
if (worldserver.getWorldData().isHardcore()) { if (worldserver.getWorldData().isHardcore()) {
@@ -901,15 +1125,17 @@ @@ -903,15 +1131,17 @@
this.N = true; this.N = true;
this.getConvertable().d(); this.getConvertable().d();
@ -611,7 +608,7 @@
this.safeShutdown(); this.safeShutdown();
} }
@@ -942,9 +1168,11 @@ @@ -944,9 +1174,11 @@
int i = 0; int i = 0;
if (this.worldServer != null) { if (this.worldServer != null) {
@ -626,8 +623,8 @@
WorldData worlddata = worldserver.getWorldData(); WorldData worlddata = worldserver.getWorldData();
mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimension())); mojangstatisticsgenerator.a("world[" + i + "][dimension]", Integer.valueOf(worldserver.worldProvider.getDimension()));
@@ -977,7 +1205,7 @@ @@ -979,7 +1211,7 @@
public abstract boolean ad(); public abstract boolean ae();
public boolean getOnlineMode() { public boolean getOnlineMode() {
- return this.onlineMode; - return this.onlineMode;
@ -635,7 +632,7 @@
} }
public void setOnlineMode(boolean flag) { public void setOnlineMode(boolean flag) {
@@ -1049,8 +1277,9 @@ @@ -1051,8 +1283,9 @@
} }
public void setGamemode(WorldSettings.EnumGamemode worldsettings_enumgamemode) { public void setGamemode(WorldSettings.EnumGamemode worldsettings_enumgamemode) {
@ -647,7 +644,7 @@
} }
} }
@@ -1082,7 +1311,7 @@ @@ -1084,7 +1317,7 @@
} }
public World getWorld() { public World getWorld() {
@ -656,7 +653,7 @@
} }
public Entity f() { public Entity f() {
@@ -1153,8 +1382,10 @@ @@ -1155,8 +1388,10 @@
WorldServer[] aworldserver = this.worldServer; WorldServer[] aworldserver = this.worldServer;
int i = aworldserver.length; int i = aworldserver.length;
@ -669,7 +666,7 @@
if (worldserver != null) { if (worldserver != null) {
Entity entity = worldserver.getEntity(uuid); Entity entity = worldserver.getEntity(uuid);
@@ -1169,7 +1400,7 @@ @@ -1171,7 +1406,7 @@
} }
public boolean getSendCommandFeedback() { public boolean getSendCommandFeedback() {
@ -678,7 +675,7 @@
} }
public void a(CommandObjectiveExecutor.EnumCommandResult commandobjectiveexecutor_enumcommandresult, int i) {} 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) { public <V> ListenableFuture<V> a(Callable<V> callable) {
Validate.notNull(callable); Validate.notNull(callable);

Datei anzeigen

@ -1,10 +1,10 @@
--- /home/matt/mc-dev-private//net/minecraft/server/NBTTagList.java 2015-04-16 22:20:21.171362490 +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-04-16 22:20:21.191362490 +0100 +++ src/main/java/net/minecraft/server/NBTTagList.java 2015-05-05 21:53:39.561105095 +0100
@@ -40,6 +40,7 @@ @@ -40,6 +40,7 @@
nbtreadlimiter.a(8L); } else {
this.type = datainput.readByte(); this.type = datainput.readByte();
int j = datainput.readInt(); int j = datainput.readInt();
+ nbtreadlimiter.a(j * 8); // CraftBukkit + nbtreadlimiter.a(j * 8); // CraftBukkit
this.list = Lists.newArrayList(); if (this.type == 0 && j > 0) {
throw new RuntimeException("Missing type on ListTag");

Datei anzeigen

@ -1,20 +1,20 @@
--- /home/matt/mc-dev-private//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-03-19 21:26:27.850141796 +0000 +++ src/main/java/net/minecraft/server/NetworkManager.java 2015-05-05 21:41:21.012633714 +0100
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
private final EnumProtocolDirection h; private final EnumProtocolDirection h;
private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue(); private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue();
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock(); private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
- private Channel k; - private Channel channel;
+ public Channel k; // CraftBukkit - public, PAIL: Rename channel + public Channel channel; // CraftBukkit - public
private SocketAddress l; private SocketAddress l;
private PacketListener m; private PacketListener m;
private IChatBaseComponent n; private IChatBaseComponent n;
@@ -231,7 +231,7 @@ @@ -231,7 +231,7 @@
public void close(IChatBaseComponent ichatbasecomponent) { public void close(IChatBaseComponent ichatbasecomponent) {
if (this.k.isOpen()) { if (this.channel.isOpen()) {
- this.k.close().awaitUninterruptibly(); - this.channel.close().awaitUninterruptibly();
+ this.k.close(); // We can't wait as this may be called from an event loop. + this.channel.close(); // We can't wait as this may be called from an event loop.
this.n = ichatbasecomponent; this.n = ichatbasecomponent;
} }

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:22.927608136 +0000 +++ src/main/java/net/minecraft/server/PacketStatusListener.java 2015-05-05 21:53:39.601104451 +0100
@@ -1,5 +1,16 @@ @@ -1,5 +1,16 @@
package net.minecraft.server; package net.minecraft.server;
@ -29,8 +29,8 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
public void a(PacketStatusInStart packetstatusinstart) { public void a(PacketStatusInStart packetstatusinstart) {
- this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aF())); - this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aG()));
+ // this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aF())); + // this.networkManager.handle(new PacketStatusOutServerInfo(this.minecraftServer.aG()));
+ // CraftBukkit start - fire ping event + // CraftBukkit start - fire ping event
+ if (state != WAITING) { + if (state != WAITING) {
+ networkManager.close(null); + networkManager.close(null);

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/PlayerConnection.java 2015-04-17 11:54:58.464656095 +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-04-17 11:54:58.468656095 +0100 +++ src/main/java/net/minecraft/server/PlayerConnection.java 2015-05-05 21:53:39.701102844 +0100
@@ -17,6 +17,48 @@ @@ -17,6 +17,48 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -262,26 +262,16 @@
} }
if (this.checkMovement) { if (this.checkMovement) {
@@ -212,12 +375,14 @@ @@ -215,7 +378,7 @@
double d11 = d7 - this.player.locX; double d14 = this.player.motX * this.player.motX + this.player.motY * this.player.motY + this.player.motZ * this.player.motZ;
double d12 = d8 - this.player.locY; double d15 = d11 * d11 + d12 * d12 + d13 * d13;
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;
- if (d17 > 100.0D && (!this.minecraftServer.S() || !this.minecraftServer.R().equals(this.player.getName()))) { - if (d15 - d14 > 100.0D && (!this.minecraftServer.T() || !this.minecraftServer.S().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 + 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 + " (" + d14 + ", " + d15 + ", " + d16 + ")"); 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); this.a(this.o, this.p, this.q, this.player.yaw, this.player.pitch);
return; return;
@@ -286,10 +451,53 @@ @@ -284,10 +447,53 @@
} }
public void a(double d0, double d1, double d2, float f, float f1) { public void a(double d0, double d1, double d2, float f, float f1) {
@ -336,7 +326,7 @@
this.checkMovement = false; this.checkMovement = false;
this.o = d0; this.o = d0;
this.p = d1; this.p = d1;
@@ -323,32 +531,49 @@ @@ -321,32 +527,49 @@
public void a(PacketPlayInBlockDig packetplayinblockdig) { public void a(PacketPlayInBlockDig packetplayinblockdig) {
PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.u()); PlayerConnectionUtils.ensureMainThread(packetplayinblockdig, this, this.player.u());
@ -344,12 +334,12 @@
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinblockdig.a(); BlockPosition blockposition = packetplayinblockdig.a();
this.player.z(); this.player.resetIdleTimer();
+ // CraftBukkit start + // CraftBukkit start
switch (PlayerConnection.SyntheticClass_1.a[packetplayinblockdig.c().ordinal()]) { switch (PlayerConnection.SyntheticClass_1.a[packetplayinblockdig.c().ordinal()]) {
- case 1: - case 1:
+ case 1: // DROP_ITEM + case 1: // DROP_ITEM
if (!this.player.v()) { if (!this.player.isSpectator()) {
+ // limit how quickly items can be dropped + // 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 the ticks aren't the same then the count starts from 0 and we update the lastDropTick.
+ if (this.lastDropTick != MinecraftServer.currentTick) { + if (this.lastDropTick != MinecraftServer.currentTick) {
@ -372,7 +362,7 @@
- case 2: - case 2:
+ case 2: // DROP_ALL_ITEMS + case 2: // DROP_ALL_ITEMS
if (!this.player.v()) { if (!this.player.isSpectator()) {
this.player.a(true); this.player.a(true);
} }
@ -392,7 +382,7 @@
double d0 = this.player.locX - ((double) blockposition.getX() + 0.5D); double d0 = this.player.locX - ((double) blockposition.getX() + 0.5D);
double d1 = this.player.locY - ((double) blockposition.getY() + 0.5D) + 1.5D; double d1 = this.player.locY - ((double) blockposition.getY() + 0.5D) + 1.5D;
double d2 = this.player.locZ - ((double) blockposition.getZ() + 0.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)) { if (!this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b()); this.player.playerInteractManager.a(blockposition, packetplayinblockdig.b());
} else { } else {
@ -408,7 +398,7 @@
} }
} else { } else {
if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) { if (packetplayinblockdig.c() == PacketPlayInBlockDig.EnumPlayerDigType.STOP_DESTROY_BLOCK) {
@@ -383,11 +616,22 @@ @@ -381,11 +612,22 @@
default: default:
throw new IllegalArgumentException("Invalid player action"); throw new IllegalArgumentException("Invalid player action");
} }
@ -431,7 +421,7 @@
ItemStack itemstack = this.player.inventory.getItemInHand(); ItemStack itemstack = this.player.inventory.getItemInHand();
boolean flag = false; boolean flag = false;
BlockPosition blockposition = packetplayinblockplace.a(); BlockPosition blockposition = packetplayinblockplace.a();
@@ -399,7 +643,50 @@ @@ -397,7 +639,50 @@
return; return;
} }
@ -483,7 +473,7 @@
} else if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight() - 1 && (enumdirection == EnumDirection.UP || blockposition.getY() >= this.minecraftServer.getMaxBuildHeight())) { } 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())}); 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)); this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage));
flag = true; flag = true;
} else { } else {
@ -504,7 +494,7 @@
} }
flag = true; flag = true;
@@ -432,7 +730,8 @@ @@ -430,7 +726,8 @@
this.player.activeContainer.b(); this.player.activeContainer.b();
this.player.g = false; this.player.g = false;
@ -514,7 +504,7 @@
this.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, slot.rawSlotIndex, this.player.inventory.getItemInHand())); 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; WorldServer[] aworldserver = this.minecraftServer.worldServer;
int i = aworldserver.length; int i = aworldserver.length;
@ -525,16 +515,16 @@
if (worldserver != null) { if (worldserver != null) {
entity = packetplayinspectate.a(worldserver); entity = packetplayinspectate.a(worldserver);
@@ -460,6 +759,8 @@ @@ -458,6 +755,8 @@
if (entity != null) { if (entity != null) {
this.player.e((Entity) this.player); this.player.setSpectatorTarget(this.player);
this.player.mount((Entity) null); this.player.mount((Entity) null);
+ +
+ /* CraftBukkit start - replace with bukkit handling for multi-world + /* CraftBukkit start - replace with bukkit handling for multi-world
if (entity.world != this.player.world) { if (entity.world != this.player.world) {
WorldServer worldserver1 = this.player.u(); WorldServer worldserver1 = this.player.u();
WorldServer worldserver2 = (WorldServer) entity.world; WorldServer worldserver2 = (WorldServer) entity.world;
@@ -484,6 +785,9 @@ @@ -482,6 +781,9 @@
} else { } else {
this.player.enderTeleportTo(entity.locX, entity.locY, entity.locZ); 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(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) {}
public void a(IChatBaseComponent ichatbasecomponent) { public void a(IChatBaseComponent ichatbasecomponent) {
- PlayerConnection.c.info(this.player.getName() + " lost connection: " + ichatbasecomponent);
+ // CraftBukkit start - Rarely it would send a disconnect line twice + // CraftBukkit start - Rarely it would send a disconnect line twice
+ if (this.processedDisconnect) { + if (this.processedDisconnect) {
+ return; + return;
@ -556,10 +545,10 @@
+ this.processedDisconnect = true; + this.processedDisconnect = true;
+ } + }
+ // CraftBukkit end + // 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. + // 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 chatmessage = new ChatMessage("multiplayer.player.left", new Object[] { this.player.getScoreboardDisplayName()});
chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW); chatmessage.getChatModifier().setColor(EnumChatFormat.YELLOW);
@ -573,10 +562,10 @@
+ this.minecraftServer.getPlayerList().sendMessage(CraftChatMessage.fromString(quitMessage)); + this.minecraftServer.getPlayerList().sendMessage(CraftChatMessage.fromString(quitMessage));
+ } + }
+ // CraftBukkit end + // 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"); PlayerConnection.c.info("Stopping singleplayer server as player logged out");
this.minecraftServer.safeShutdown(); this.minecraftServer.safeShutdown();
@@ -521,6 +840,15 @@ @@ -519,6 +836,15 @@
} }
} }
@ -592,7 +581,7 @@
try { try {
this.networkManager.handle(packet); this.networkManager.handle(packet);
} catch (Throwable throwable) { } catch (Throwable throwable) {
@@ -541,18 +869,34 @@ @@ -539,18 +865,34 @@
} }
public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) { public void a(PacketPlayInHeldItemSlot packetplayinhelditemslot) {
@ -604,12 +593,12 @@
+ this.server.getPluginManager().callEvent(event); + this.server.getPluginManager().callEvent(event);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ this.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex)); + this.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
+ this.player.z(); // PAIL: Rename resetIdleTimer + this.player.resetIdleTimer();
+ return; + return;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.player.inventory.itemInHandIndex = packetplayinhelditemslot.a(); this.player.inventory.itemInHandIndex = packetplayinhelditemslot.a();
this.player.z(); this.player.resetIdleTimer();
} else { } else {
PlayerConnection.c.warn(this.player.getName() + " tried to set an invalid carried item"); PlayerConnection.c.warn(this.player.getName() + " tried to set an invalid carried item");
+ this.disconnect("Nope!"); // CraftBukkit + this.disconnect("Nope!"); // CraftBukkit
@ -629,7 +618,7 @@
ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]);
chatmessage.getChatModifier().setColor(EnumChatFormat.RED); chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
@@ -565,39 +909,249 @@ @@ -563,39 +905,249 @@
for (int i = 0; i < s.length(); ++i) { for (int i = 0; i < s.length(); ++i) {
if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) {
@ -827,7 +816,7 @@
public void a(PacketPlayInArmAnimation packetplayinarmanimation) { public void a(PacketPlayInArmAnimation packetplayinarmanimation) {
+ if (this.player.dead) return; // CraftBukkit + if (this.player.dead) return; // CraftBukkit
PlayerConnectionUtils.ensureMainThread(packetplayinarmanimation, this, this.player.u()); PlayerConnectionUtils.ensureMainThread(packetplayinarmanimation, this, this.player.u());
this.player.z(); this.player.resetIdleTimer();
+ // CraftBukkit start - Raytrace to look for 'rogue armswings' + // CraftBukkit start - Raytrace to look for 'rogue armswings'
+ float f1 = this.player.pitch; + float f1 = this.player.pitch;
+ float f2 = this.player.yaw; + float f2 = this.player.yaw;
@ -884,10 +873,10 @@
+ break; + break;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
this.player.z(); this.player.resetIdleTimer();
switch (PlayerConnection.SyntheticClass_1.b[packetplayinentityaction.b().ordinal()]) { switch (PlayerConnection.SyntheticClass_1.b[packetplayinentityaction.b().ordinal()]) {
case 1: case 1:
@@ -618,7 +1172,7 @@ @@ -616,7 +1168,7 @@
case 5: case 5:
this.player.a(false, true, true); this.player.a(false, true, true);
@ -896,7 +885,7 @@
break; break;
case 6: case 6:
@@ -640,6 +1194,7 @@ @@ -638,6 +1190,7 @@
} }
public void a(PacketPlayInUseEntity packetplayinuseentity) { public void a(PacketPlayInUseEntity packetplayinuseentity) {
@ -904,7 +893,7 @@
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u()); PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u());
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver); Entity entity = packetplayinuseentity.a((World) worldserver);
@@ -654,18 +1209,67 @@ @@ -652,18 +1205,67 @@
} }
if (this.player.h(entity) < d0) { if (this.player.h(entity) < d0) {
@ -957,7 +946,7 @@
+ // CraftBukkit end + // CraftBukkit end
} else if (packetplayinuseentity.a() == PacketPlayInUseEntity.EnumEntityUseAction.ATTACK) { } 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) {
+ 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.disconnect("Attempting to attack an invalid entity");
this.minecraftServer.warning("Player " + this.player.getName() + " tried to attack an invalid entity"); this.minecraftServer.warning("Player " + this.player.getName() + " tried to attack an invalid entity");
return; return;
@ -973,7 +962,7 @@
} }
} }
} }
@@ -680,7 +1284,8 @@ @@ -678,7 +1280,8 @@
switch (PlayerConnection.SyntheticClass_1.c[packetplayinclientcommand_enumclientcommand.ordinal()]) { switch (PlayerConnection.SyntheticClass_1.c[packetplayinclientcommand_enumclientcommand.ordinal()]) {
case 1: case 1:
if (this.player.viewingCredits) { if (this.player.viewingCredits) {
@ -981,9 +970,9 @@
+ // this.player = this.minecraftServer.getPlayerList().moveToWorld(this.player, 0, true); + // 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 + 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()) { } 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!"); 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) { public void a(PacketPlayInCloseWindow packetplayinclosewindow) {
@ -998,15 +987,15 @@
public void a(PacketPlayInWindowClick packetplayinwindowclick) { public void a(PacketPlayInWindowClick packetplayinwindowclick) {
+ if (this.player.dead) return; // CraftBukkit + if (this.player.dead) return; // CraftBukkit
PlayerConnectionUtils.ensureMainThread(packetplayinwindowclick, this, this.player.u()); 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.activeContainer.windowId == packetplayinwindowclick.a() && this.player.activeContainer.c(this.player)) {
- if (this.player.v()) { - if (this.player.isSpectator()) {
+ boolean cancelled = this.player.v(); // CraftBukkit - see below if + boolean cancelled = this.player.isSpectator(); // CraftBukkit - see below if
+ if (false) { // CraftBukkit this.player.v()) { + if (false) { // this.player.isSpectator()) {
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) { 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); this.player.a(this.player.activeContainer, (List) arraylist);
} else { } else {
@ -1278,7 +1267,7 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) { if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true)); 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(); boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() < 36 + PlayerInventory.getHotbarSize();
@ -1328,7 +1317,7 @@
if (flag1 && flag2 && flag3) { if (flag1 && flag2 && flag3) {
if (itemstack == null) { if (itemstack == null) {
@@ -813,6 +1727,7 @@ @@ -811,6 +1723,7 @@
} }
public void a(PacketPlayInTransaction packetplayintransaction) { public void a(PacketPlayInTransaction packetplayintransaction) {
@ -1336,15 +1325,15 @@
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.u()); PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.u());
Short oshort = (Short) this.n.get(this.player.activeContainer.windowId); Short oshort = (Short) this.n.get(this.player.activeContainer.windowId);
@@ -823,6 +1738,7 @@ @@ -821,6 +1734,7 @@
} }
public void a(PacketPlayInUpdateSign packetplayinupdatesign) { public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
+ if (this.player.dead) return; // CraftBukkit + if (this.player.dead) return; // CraftBukkit
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.u()); PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.u());
this.player.z(); this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
@@ -839,14 +1755,30 @@ @@ -837,14 +1751,30 @@
if (!tileentitysign.b() || tileentitysign.c() != this.player) { if (!tileentitysign.b() || tileentitysign.c() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign"); this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@ -1376,7 +1365,7 @@
tileentitysign.update(); tileentitysign.update();
worldserver.notify(blockposition); worldserver.notify(blockposition);
@@ -869,11 +1801,27 @@ @@ -867,11 +1797,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) { public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.u()); PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.u());
@ -1405,7 +1394,7 @@
ArrayList arraylist = Lists.newArrayList(); ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b()).iterator(); 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(); itemstack1 = this.player.inventory.getItemInHand();
if (itemstack1 != null) { if (itemstack1 != null) {
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) { if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@ -1422,7 +1411,7 @@
return; return;
} finally { } finally {
packetdataserializer.release(); packetdataserializer.release();
@@ -942,16 +1893,21 @@ @@ -940,16 +1889,21 @@
itemstack1 = this.player.inventory.getItemInHand(); itemstack1 = this.player.inventory.getItemInHand();
if (itemstack1 != null) { if (itemstack1 != null) {
if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.WRITABLE_BOOK) { if (itemstack.getItem() == Items.WRITTEN_BOOK && itemstack1.getItem() == Items.WRITABLE_BOOK) {
@ -1444,7 +1433,7 @@
return; return;
} finally { } finally {
packetdataserializer.release(); packetdataserializer.release();
@@ -968,11 +1924,12 @@ @@ -966,11 +1920,12 @@
} }
} catch (Exception exception2) { } catch (Exception exception2) {
PlayerConnection.c.error("Couldn\'t select trade", exception2); PlayerConnection.c.error("Couldn\'t select trade", exception2);
@ -1458,7 +1447,7 @@
packetdataserializer = packetplayincustompayload.b(); packetdataserializer = packetplayincustompayload.b();
try { try {
@@ -1008,6 +1965,7 @@ @@ -1006,6 +1961,7 @@
} }
} catch (Exception exception3) { } catch (Exception exception3) {
PlayerConnection.c.error("Couldn\'t set command block", exception3); PlayerConnection.c.error("Couldn\'t set command block", exception3);
@ -1466,7 +1455,7 @@
} finally { } finally {
packetdataserializer.release(); packetdataserializer.release();
} }
@@ -1033,6 +1991,7 @@ @@ -1031,6 +1987,7 @@
} }
} catch (Exception exception4) { } catch (Exception exception4) {
PlayerConnection.c.error("Couldn\'t set beacon", 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) { } else if ("MC|ItemName".equals(packetplayincustompayload.a()) && this.player.activeContainer instanceof ContainerAnvil) {
@@ -1048,7 +2007,28 @@ @@ -1046,7 +2003,28 @@
containeranvil.a(""); containeranvil.a("");
} }
} }
@ -1499,7 +1488,7 @@
+ // CraftBukkit start - Add "isDisconnected" method + // CraftBukkit start - Add "isDisconnected" method
+ public final boolean isDisconnected() { + 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 { static class SyntheticClass_1 {

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-03-21 20:36:24.932515542 +0000 +++ src/main/java/net/minecraft/server/PlayerList.java 2015-05-05 21:53:39.729102395 +0100
@@ -18,6 +18,26 @@ @@ -18,6 +18,26 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; 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"))); 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 + entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit
playerconnection.sendPacket(new PacketPlayOutCustomPayload("MC|Brand", (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); 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)); playerconnection.sendPacket(new PacketPlayOutSpawnPosition(blockposition));
@@ -89,17 +125,23 @@ @@ -89,17 +125,23 @@
entityplayer.getStatisticManager().updateStatistics(entityplayer); entityplayer.getStatisticManager().updateStatistics(entityplayer);
this.sendScoreboard((ScoreboardServer) worldserver.getScoreboard(), entityplayer); this.sendScoreboard((ScoreboardServer) worldserver.getScoreboard(), entityplayer);
this.server.aG(); this.server.aH();
- ChatMessage chatmessage; - ChatMessage chatmessage;
+ // CraftBukkit start - login message is handled in the event + // CraftBukkit start - login message is handled in the event
+ // ChatMessage chatmessage; + // ChatMessage chatmessage;
@ -150,7 +150,7 @@
+ NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().i(); // CraftBukkit + NBTTagCompound nbttagcompound = this.server.worlds.get(0).getWorldData().i(); // CraftBukkit
NBTTagCompound nbttagcompound1; NBTTagCompound nbttagcompound1;
if (entityplayer.getName().equals(this.server.R()) && nbttagcompound != null) { if (entityplayer.getName().equals(this.server.S()) && nbttagcompound != null) {
@@ -226,33 +271,72 @@ @@ -226,33 +271,72 @@
} }
@ -319,9 +319,9 @@
+ // return s; + // return s;
+ event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s); + event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s);
} else { } else {
- return this.players.size() >= this.maxPlayers ? "The server is full!" : null; - return this.players.size() >= this.maxPlayers && !this.f(gameprofile) ? "The server is full!" : null;
+ // return this.players.size() >= this.maxPlayers ? "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) { + if (this.players.size() >= this.maxPlayers && !this.f(gameprofile)) {
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full"); + event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full");
+ } + }
} }
@ -746,7 +746,7 @@
@@ -589,10 +962,24 @@ @@ -589,10 +962,24 @@
public void addOp(GameProfile gameprofile) { 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 + // CraftBukkit start
+ Player player = server.server.getPlayer(gameprofile.getId()); + Player player = server.server.getPlayer(gameprofile.getId());
@ -772,8 +772,8 @@
} }
public boolean isOp(GameProfile gameprofile) { 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.T() && this.server.worldServer[0].getWorldData().v() && this.server.S().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.worlds.get(0).getWorldData().v() && this.server.S().equalsIgnoreCase(gameprofile.getName()) || this.t; // CraftBukkit
} }
public EntityPlayer getPlayer(String s) { public EntityPlayer getPlayer(String s) {

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/PortalTravelAgent.java 2015-04-16 21:22:47.467439143 +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-04-16 21:22:47.471439143 +0100 +++ src/main/java/net/minecraft/server/PortalTravelAgent.java 2015-05-05 21:41:21.188631097 +0100
@@ -5,6 +5,12 @@ @@ -5,6 +5,12 @@
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -141,7 +141,7 @@
double d2 = (double) ((BlockPosition) object).getX() + 0.5D; double d2 = (double) ((BlockPosition) object).getX() + 0.5D;
double d3 = (double) ((BlockPosition) object).getY() + 0.5D; double d3 = (double) ((BlockPosition) object).getY() + 0.5D;
@@ -134,26 +223,60 @@ @@ -132,26 +221,60 @@
f3 = -1.0F; f3 = -1.0F;
f4 = 1.0F; f4 = 1.0F;
} }
@ -216,7 +216,7 @@
int l = i; int l = i;
int i1 = j; int i1 = j;
int j1 = k; int j1 = k;
@@ -178,10 +301,10 @@ @@ -176,10 +299,10 @@
double d4; double d4;
for (i2 = i - b0; i2 <= i + b0; ++i2) { for (i2 = i - b0; i2 <= i + b0; ++i2) {
@ -229,7 +229,7 @@
label271: label271:
for (k2 = this.a.V() - 1; k2 >= 0; --k2) { 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; d4 = d1 * d1 + d3 * d3 + d2 * d2;
if (d0 < 0.0D || d4 < d0) { if (d0 < 0.0D || d4 < d0) {
d0 = d4; d0 = d4;
@@ -230,10 +353,10 @@ @@ -228,10 +351,10 @@
if (d0 < 0.0D) { if (d0 < 0.0D) {
for (i2 = i - b0; i2 <= i + b0; ++i2) { for (i2 = i - b0; i2 <= i + b0; ++i2) {
@ -251,7 +251,7 @@
label219: label219:
for (k2 = this.a.V() - 1; k2 >= 0; --k2) { for (k2 = this.a.V() - 1; k2 >= 0; --k2) {
@@ -258,7 +381,7 @@ @@ -256,7 +379,7 @@
} }
} }

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-02-26 22:40:23.127608134 +0000 +++ src/main/java/net/minecraft/server/TileEntityChest.java 2015-05-05 21:41:21.312629253 +0100
@@ -3,6 +3,11 @@ @@ -3,6 +3,11 @@
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -82,7 +82,7 @@
@@ -315,8 +358,20 @@ @@ -315,8 +358,20 @@
public void closeContainer(EntityHuman entityhuman) { 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 + int oldPower = Math.max(0, Math.min(15, this.l)); // CraftBukkit - Get power before new viewer is added
--this.l; --this.l;
+ if (this.world == null) return; // CraftBukkit + if (this.world == null) return; // CraftBukkit

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//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-03-19 21:25:55.170142151 +0000 +++ src/main/java/net/minecraft/server/WorldData.java 2015-05-05 21:41:21.384628182 +0100
@@ -1,6 +1,11 @@ @@ -1,6 +1,11 @@
package net.minecraft.server; package net.minecraft.server;
@ -63,14 +63,14 @@
public void setDifficulty(EnumDifficulty enumdifficulty) { public void setDifficulty(EnumDifficulty enumdifficulty) {
this.z = enumdifficulty; this.z = enumdifficulty;
+ // CraftBukkit start + // 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) { + for (EntityPlayer player : (java.util.List<EntityPlayer>) (java.util.List) world.players) {
+ player.playerConnection.sendPacket(packet); + player.playerConnection.sendPacket(packet);
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} }
public boolean z() { public boolean isDifficultyLocked() {
@@ -664,4 +700,12 @@ @@ -664,4 +700,12 @@
} }
}); });

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/WorldNBTStorage.java 2015-02-26 22:40:23.231608132 +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-02-26 22:40:23.235608132 +0000 +++ src/main/java/net/minecraft/server/WorldNBTStorage.java 2015-05-05 21:41:21.444627290 +0100
@@ -11,6 +11,12 @@ @@ -11,6 +11,12 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -15,7 +15,7 @@
private static final Logger a = LogManager.getLogger(); private static final Logger a = LogManager.getLogger();
@@ -19,6 +25,7 @@ @@ -19,6 +25,7 @@
private final File dataDir; private final File dataDir;
private final long sessionId = MinecraftServer.ay(); private final long sessionId = MinecraftServer.az();
private final String f; private final String f;
+ private UUID uuid = null; // CraftBukkit + private UUID uuid = null; // CraftBukkit

Datei anzeigen

@ -1,5 +1,5 @@
--- /home/matt/mc-dev-private//net/minecraft/server/WorldServer.java 2015-04-13 11:02:47.684046165 +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-04-13 11:02:47.688046165 +0100 +++ src/main/java/net/minecraft/server/WorldServer.java 2015-05-05 21:41:21.452627171 +0100
@@ -16,14 +16,27 @@ @@ -16,14 +16,27 @@
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -56,7 +56,7 @@
+ this.Q = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit + this.Q = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
this.B(); this.B();
this.C(); this.C();
this.getWorldBorder().a(minecraftserver.aH()); this.getWorldBorder().a(minecraftserver.aI());
@@ -63,6 +84,7 @@ @@ -63,6 +84,7 @@
this.villages.a((World) this); this.villages.a((World) this);
} }
@ -202,7 +202,7 @@
public BiomeBase.BiomeMeta a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { public BiomeBase.BiomeMeta a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
@@ -161,7 +281,7 @@ @@ -161,7 +281,7 @@
if (entityhuman.v()) { if (entityhuman.isSpectator()) {
++i; ++i;
- } else if (entityhuman.isSleeping()) { - } else if (entityhuman.isSleeping()) {
+ } else if (entityhuman.isSleeping() || entityhuman.fauxSleeping) { + } else if (entityhuman.isSleeping() || entityhuman.fauxSleeping) {
@ -249,13 +249,13 @@
} }
entityhuman = (EntityHuman) iterator.next(); entityhuman = (EntityHuman) iterator.next();
- } while (!entityhuman.v() && entityhuman.isDeeplySleeping()); - } while (!entityhuman.isSpectator() && entityhuman.isDeeplySleeping());
+ +
+ // CraftBukkit start + // CraftBukkit start
+ if (entityhuman.isDeeplySleeping()) { + if (entityhuman.isDeeplySleeping()) {
+ foundActualSleepers = true; + foundActualSleepers = true;
+ } + }
+ } while (!entityhuman.v() && (entityhuman.isDeeplySleeping() || entityhuman.fauxSleeping)); + } while (!entityhuman.isSpectator() && (entityhuman.isDeeplySleeping() || entityhuman.fauxSleeping));
+ // CraftBukkit end + // CraftBukkit end
return false; return false;

Datei anzeigen

@ -4,7 +4,7 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.8.3-R0.1-SNAPSHOT</version> <version>1.8.4-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
@ -12,8 +12,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<junit.version>4.11</junit.version> <junit.version>4.11</junit.version>
<minecraft.version>1.8.3</minecraft.version> <minecraft.version>1.8.4</minecraft.version>
<minecraft_version>1_8_R2</minecraft_version> <minecraft_version>1_8_R3</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>
<maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.source>1.6</maven.compiler.source>

Datei anzeigen

@ -24,7 +24,7 @@ public class CraftGuardian extends CraftMonster implements Guardian {
@Override @Override
public boolean isElder() { public boolean isElder() {
return ((EntityGuardian)entity).cn(); // PAIL: Rename isElder return ((EntityGuardian)entity).isElder();
} }
@Override @Override
@ -32,22 +32,22 @@ public class CraftGuardian extends CraftMonster implements Guardian {
EntityGuardian entityGuardian = (EntityGuardian) entity; EntityGuardian entityGuardian = (EntityGuardian) entity;
if (!isElder() && shouldBeElder) { if (!isElder() && shouldBeElder) {
entityGuardian.a( true ); // PAIL: Rename setElder entityGuardian.setElder(true);
} else if (isElder() && !shouldBeElder) { } 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 // Since minecraft does not reset the elder Guardian to a guardian we have to do that
entity.setSize(0.85F, 0.85F); entity.setSize(0.85F, 0.85F);
// Since aW() calls its supers it will try to re register attributes which is invalid // Since aW() calls its supers it will try to re register attributes which is invalid
// check these on update // check these on update
entityGuardian.getAttributeInstance(GenericAttributes.e).setValue(6.0D); // PAIL: Rename ATTACK_DAMAGE entityGuardian.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(6.0D);
entityGuardian.getAttributeInstance(GenericAttributes.d).setValue(0.5D); // PAIL: Rename MOVEMENT_SPEED entityGuardian.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.5D);
entityGuardian.getAttributeInstance(GenericAttributes.b).setValue(16.0D); // PAIL: Rename FOLLOW_RANGE entityGuardian.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(16.0D);
entityGuardian.getAttributeInstance(GenericAttributes.maxHealth).setValue(30.0D); entityGuardian.getAttributeInstance(GenericAttributes.maxHealth).setValue(30.0D);
// Update pathfinding (random stroll back to 80) // 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 // Tell minecraft that we need persistence since the guardian changed
entityGuardian.initAttributes(); entityGuardian.initAttributes();

Datei anzeigen

@ -759,7 +759,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return; return;
} }
getHandle().e((Entity) getHandle()); // PAIL: Rename setSpectatorTarget getHandle().setSpectatorTarget(getHandle());
getHandle().playerInteractManager.setGameMode(WorldSettings.EnumGamemode.getById(mode.getValue())); getHandle().playerInteractManager.setGameMode(WorldSettings.EnumGamemode.getById(mode.getValue()));
getHandle().fallDistance = 0; getHandle().fallDistance = 0;
getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue())); getHandle().playerConnection.sendPacket(new PacketPlayOutGameStateChange(3, mode.getValue()));

Datei anzeigen

@ -34,7 +34,7 @@ public class PerMaterialTest extends AbstractTestingBase {
@BeforeClass @BeforeClass
public static void getFireValues() { 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}") @Parameters(name= "{index}: {0}")