Update to 1.8.4

This commit is contained in:
Thinkofdeath
2015-05-09 21:23:26 +01:00
parent a5b3760b6d
commit 80d0e8ffa7
156 changed files with 121 additions and 380 deletions

View File

@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>bukkit</artifactId> - <artifactId>bukkit</artifactId>
+ <groupId>org.spigotmc</groupId> + <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId> + <artifactId>spigot-api</artifactId>
<version>1.8.3-R0.1-SNAPSHOT</version> <version>1.8.4-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
- <name>Bukkit</name> - <name>Bukkit</name>

View File

@@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ <groupId>org.spigotmc</groupId> + <groupId>org.spigotmc</groupId>
+ <artifactId>spigot</artifactId> + <artifactId>spigot</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>
+ <name>Spigot</name> + <name>Spigot</name>

View File

@@ -1054,7 +1054,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.a((ICommand) (new CommandWorldBorder())); + this.a((ICommand) (new CommandWorldBorder()));
+ this.a((ICommand) (new CommandTitle())); + this.a((ICommand) (new CommandTitle()));
+ this.a((ICommand) (new CommandEntityData())); + this.a((ICommand) (new CommandEntityData()));
+ if (MinecraftServer.getServer().ad()) { + if (MinecraftServer.getServer().ae()) {
+ this.a((ICommand) (new CommandOp())); + this.a((ICommand) (new CommandOp()));
+ this.a((ICommand) (new CommandDeop())); + this.a((ICommand) (new CommandDeop()));
+ this.a((ICommand) (new CommandStop())); + this.a((ICommand) (new CommandStop()));
@@ -1095,23 +1095,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ while (iterator.hasNext()) { + while (iterator.hasNext()) {
+ EntityHuman entityhuman = (EntityHuman) iterator.next(); + EntityHuman entityhuman = (EntityHuman) iterator.next();
+ +
+ if (entityhuman != icommandlistener && minecraftserver.getPlayerList().isOp(entityhuman.getProfile()) && icommand.canUse(icommandlistener) && (!(icommandlistener instanceof RemoteControlCommandListener) || MinecraftServer.getServer().q())) { + if (entityhuman != icommandlistener && minecraftserver.getPlayerList().isOp(entityhuman.getProfile()) && icommand.canUse(icommandlistener)) {
+ boolean flag1 = icommandlistener instanceof MinecraftServer && MinecraftServer.getServer().r();
+ boolean flag2 = icommandlistener instanceof RemoteControlCommandListener && MinecraftServer.getServer().q();
+
+ if (flag1 || flag2 || !(icommandlistener instanceof RemoteControlCommandListener) && !(icommandlistener instanceof MinecraftServer)) {
+ entityhuman.sendMessage(chatmessage); + entityhuman.sendMessage(chatmessage);
+ } + }
+ } + }
+ } + }
+ }
+ +
+ if (icommandlistener != minecraftserver && minecraftserver.worldServer[0].getGameRules().getBoolean("logAdminCommands")) { + if (icommandlistener != minecraftserver && minecraftserver.worldServer[0].getGameRules().getBoolean("logAdminCommands")) {
+ minecraftserver.sendMessage(chatmessage); + minecraftserver.sendMessage(chatmessage);
+ } + }
+ +
+ boolean flag1 = minecraftserver.worldServer[0].getGameRules().getBoolean("sendCommandFeedback"); + boolean flag3 = minecraftserver.worldServer[0].getGameRules().getBoolean("sendCommandFeedback");
+ +
+ if (icommandlistener instanceof CommandBlockListenerAbstract) { + if (icommandlistener instanceof CommandBlockListenerAbstract) {
+ flag1 = ((CommandBlockListenerAbstract) icommandlistener).m(); + flag3 = ((CommandBlockListenerAbstract) icommandlistener).m();
+ } + }
+ +
+ if ((i & 1) != 1 && flag1) { + if ((i & 1) != 1 && flag3 || icommandlistener instanceof MinecraftServer) {
+ icommandlistener.sendMessage(new ChatMessage(s, aobject)); + icommandlistener.sendMessage(new ChatMessage(s, aobject));
+ } + }
+ +
@@ -2011,10 +2016,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ private static final Logger f = LogManager.getLogger(); + private static final Logger f = LogManager.getLogger();
+ public static final IAttribute maxHealth = (new AttributeRanged((IAttribute) null, "generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).a("Max Health").a(true); + public static final IAttribute maxHealth = (new AttributeRanged((IAttribute) null, "generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).a("Max Health").a(true);
+ public static final IAttribute b = (new AttributeRanged((IAttribute) null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).a("Follow Range"); + public static final IAttribute FOLLOW_RANGE = (new AttributeRanged((IAttribute) null, "generic.followRange", 32.0D, 0.0D, 2048.0D)).a("Follow Range");
+ public static final IAttribute c = (new AttributeRanged((IAttribute) null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).a("Knockback Resistance"); + public static final IAttribute c = (new AttributeRanged((IAttribute) null, "generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).a("Knockback Resistance");
+ public static final IAttribute d = (new AttributeRanged((IAttribute) null, "generic.movementSpeed", 0.699999988079071D, 0.0D, Double.MAX_VALUE)).a("Movement Speed").a(true); + public static final IAttribute MOVEMENT_SPEED = (new AttributeRanged((IAttribute) null, "generic.movementSpeed", 0.699999988079071D, 0.0D, Double.MAX_VALUE)).a("Movement Speed").a(true);
+ public static final IAttribute e = new AttributeRanged((IAttribute) null, "generic.attackDamage", 2.0D, 0.0D, Double.MAX_VALUE); + public static final IAttribute ATTACK_DAMAGE = new AttributeRanged((IAttribute) null, "generic.attackDamage", 2.0D, 0.0D, Double.MAX_VALUE);
+ +
+ public static NBTTagList a(AttributeMapBase attributemapbase) { + public static NBTTagList a(AttributeMapBase attributemapbase) {
+ NBTTagList nbttaglist = new NBTTagList(); + NBTTagList nbttaglist = new NBTTagList();
@@ -2609,6 +2614,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException { + void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
+ nbtreadlimiter.a(192L);
+ int j = datainput.readInt(); + int j = datainput.readInt();
+ +
+ nbtreadlimiter.a((long) (8 * j)); + nbtreadlimiter.a((long) (8 * j));
@@ -2676,6 +2682,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException { + void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
+ nbtreadlimiter.a(192L);
+ int j = datainput.readInt(); + int j = datainput.readInt();
+ +
+ nbtreadlimiter.a((long) (32 * j)); + nbtreadlimiter.a((long) (32 * j));
@@ -3725,7 +3732,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Class oclass; + Class oclass;
+ LazyInitVar lazyinitvar; + LazyInitVar lazyinitvar;
+ +
+ if (Epoll.isAvailable() && this.f.ah()) { + if (Epoll.isAvailable() && this.f.ai()) {
+ oclass = EpollServerSocketChannel.class; + oclass = EpollServerSocketChannel.class;
+ lazyinitvar = ServerConnection.b; + lazyinitvar = ServerConnection.b;
+ ServerConnection.e.info("Using epoll channel type"); + ServerConnection.e.info("Using epoll channel type");
@@ -3806,8 +3813,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ServerConnection.e.warn("Failed to handle packet for " + networkmanager.getSocketAddress(), exception); + ServerConnection.e.warn("Failed to handle packet for " + networkmanager.getSocketAddress(), exception);
+ final ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error"); + final ChatComponentText chatcomponenttext = new ChatComponentText("Internal server error");
+ +
+ networkmanager.a(new PacketPlayOutKickDisconnect(chatcomponenttext), new GenericFutureListener<Future<Void>>() { + networkmanager.a(new PacketPlayOutKickDisconnect(chatcomponenttext), new GenericFutureListener() {
+ public void operationComplete(Future<Void> future) throws Exception { + public void operationComplete(Future future) throws Exception {
+ networkmanager.close(chatcomponenttext); + networkmanager.close(chatcomponenttext);
+ } + }
+ }, new GenericFutureListener[0]); + }, new GenericFutureListener[0]);
@@ -3895,14 +3902,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.e.add(statistic); + this.e.add(statistic);
+ if (statistic.d() && j == 0 && i > 0) { + if (statistic.d() && j == 0 && i > 0) {
+ this.g = true; + this.g = true;
+ if (this.c.aA()) { + if (this.c.aB()) {
+ this.c.getPlayerList().sendMessage(new ChatMessage("chat.type.achievement", new Object[] { entityhuman.getScoreboardDisplayName(), statistic.j()})); + this.c.getPlayerList().sendMessage(new ChatMessage("chat.type.achievement", new Object[] { entityhuman.getScoreboardDisplayName(), statistic.j()}));
+ } + }
+ } + }
+ +
+ if (statistic.d() && j > 0 && i == 0) { + if (statistic.d() && j > 0 && i == 0) {
+ this.g = true; + this.g = true;
+ if (this.c.aA()) { + if (this.c.aB()) {
+ this.c.getPlayerList().sendMessage(new ChatMessage("chat.type.achievement.taken", new Object[] { entityhuman.getScoreboardDisplayName(), statistic.j()})); + this.c.getPlayerList().sendMessage(new ChatMessage("chat.type.achievement.taken", new Object[] { entityhuman.getScoreboardDisplayName(), statistic.j()}));
+ } + }
+ } + }
@@ -4005,7 +4012,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ public void a(EntityPlayer entityplayer) { + public void a(EntityPlayer entityplayer) {
+ int i = this.c.as(); + int i = this.c.at();
+ HashMap hashmap = Maps.newHashMap(); + HashMap hashmap = Maps.newHashMap();
+ +
+ if (this.g || i - this.f > 300) { + if (this.g || i - this.f > 300) {
@@ -4408,14 +4415,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ UserCache.UserCacheEntry usercache_usercacheentry1 = (UserCache.UserCacheEntry) this.d.get(uuid); + UserCache.UserCacheEntry usercache_usercacheentry1 = (UserCache.UserCacheEntry) this.d.get(uuid);
+ +
+ this.c.remove(usercache_usercacheentry1.a().getName().toLowerCase(Locale.ROOT)); + this.c.remove(usercache_usercacheentry1.a().getName().toLowerCase(Locale.ROOT));
+ this.c.put(gameprofile.getName().toLowerCase(Locale.ROOT), usercache_usercacheentry);
+ this.e.remove(gameprofile); + this.e.remove(gameprofile);
+ } else {
+ this.d.put(uuid, usercache_usercacheentry);
+ this.c.put(s, usercache_usercacheentry);
+ } + }
+ +
+ this.c.put(gameprofile.getName().toLowerCase(Locale.ROOT), usercache_usercacheentry);
+ this.d.put(uuid, usercache_usercacheentry);
+ this.e.addFirst(gameprofile); + this.e.addFirst(gameprofile);
+ this.c();
+ } + }
+ +
+ public GameProfile getProfile(String s) { + public GameProfile getProfile(String s) {
@@ -4473,29 +4479,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ +
+ public void b() { + public void b() {
+ List list = null;
+ BufferedReader bufferedreader = null; + BufferedReader bufferedreader = null;
+ +
+ label64: {
+ try { + try {
+ bufferedreader = Files.newReader(this.g, Charsets.UTF_8); + bufferedreader = Files.newReader(this.g, Charsets.UTF_8);
+ list = (List) this.b.fromJson(bufferedreader, UserCache.h); + List list = (List) this.b.fromJson(bufferedreader, UserCache.h);
+ break label64;
+ } catch (FileNotFoundException filenotfoundexception) {
+ ;
+ } finally {
+ IOUtils.closeQuietly(bufferedreader);
+ }
+ +
+ return;
+ }
+
+ if (list != null) {
+ this.c.clear(); + this.c.clear();
+ this.d.clear(); + this.d.clear();
+ this.e.clear(); + this.e.clear();
+ list = Lists.reverse(list); + Iterator iterator = Lists.reverse(list).iterator();
+ Iterator iterator = list.iterator();
+ +
+ while (iterator.hasNext()) { + while (iterator.hasNext()) {
+ UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) iterator.next(); + UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) iterator.next();
@@ -4504,6 +4497,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this.a(usercache_usercacheentry.a(), usercache_usercacheentry.b()); + this.a(usercache_usercacheentry.a(), usercache_usercacheentry.b());
+ } + }
+ } + }
+ } catch (FileNotFoundException filenotfoundexception) {
+ ;
+ } catch (JsonParseException jsonparseexception) {
+ ;
+ } finally {
+ IOUtils.closeQuietly(bufferedreader);
+ } + }
+ +
+ } + }

View File

@@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.q; + return this.q;
+ } + }
+ // Spigot End + // Spigot End
public ServerConnection ap() { public ServerConnection aq() {
return this.q; return this.q;
} }
-- --

View File

@@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/DedicatedServer.java --- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
if (this.Q() < 0) { if (this.R() < 0) {
this.setPort(this.propertyManager.getInt("server-port", 25565)); this.setPort(this.propertyManager.getInt("server-port", 25565));
} }
+ // Spigot start + // Spigot start

View File

@@ -1,107 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 11 Jun 2013 12:09:45 +1000
Subject: [PATCH] More Efficient Chunk Save Queue
Optimizes the data structures behind the chunk save queue into ones more suitable for the type of data and access which they are used for.
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
private static final Logger a = LogManager.getLogger();
- private List<ChunkRegionLoader.PendingChunkToSave> b = Lists.newArrayList();
- private Set<ChunkCoordIntPair> c = Sets.newHashSet();
+ // Spigot start
+ private java.util.LinkedHashMap<ChunkCoordIntPair, PendingChunkToSave> pendingSaves = new java.util.LinkedHashMap<ChunkCoordIntPair, PendingChunkToSave>();
+ // private List<ChunkRegionLoader.PendingChunkToSave> b = Lists.newArrayList();
+ // private Set<ChunkCoordIntPair> c = Sets.newHashSet();
+ // Spigot end
private Object d = new Object();
private final File e;
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
synchronized (this.d) {
- if (this.c.contains(chunkcoordintpair)) {
- for (int k = 0; k < this.b.size(); ++k) {
- if (((PendingChunkToSave) this.b.get(k)).a.equals(chunkcoordintpair)) {
- return true;
- }
- }
- }
+ // Spigot start
+ if (pendingSaves.containsKey(chunkcoordintpair)) {
+ return true;
+ }
+ // Spigot end
}
return RegionFileCache.a(this.e, i, j).chunkExists(i & 31, j & 31);
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
Object object = this.d;
synchronized (this.d) {
- if (this.c.contains(chunkcoordintpair)) {
- for (int k = 0; k < this.b.size(); ++k) {
- if (((ChunkRegionLoader.PendingChunkToSave) this.b.get(k)).a.equals(chunkcoordintpair)) {
- nbttagcompound = ((ChunkRegionLoader.PendingChunkToSave) this.b.get(k)).b;
- break;
- }
- }
+ // Spigot start
+ PendingChunkToSave pendingchunktosave = pendingSaves.get(chunkcoordintpair);
+ if (pendingchunktosave != null) {
+ nbttagcompound = pendingchunktosave.b;
}
+ // Spigot end
}
if (nbttagcompound == null) {
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
Object object = this.d;
synchronized (this.d) {
- if (this.c.contains(chunkcoordintpair)) {
- for (int i = 0; i < this.b.size(); ++i) {
- if (((ChunkRegionLoader.PendingChunkToSave) this.b.get(i)).a.equals(chunkcoordintpair)) {
- this.b.set(i, new ChunkRegionLoader.PendingChunkToSave(chunkcoordintpair, nbttagcompound));
- return;
- }
- }
+ // Spigot start
+ if (this.pendingSaves.put(chunkcoordintpair, new PendingChunkToSave(chunkcoordintpair, nbttagcompound)) != null) {
+ return;
}
- this.b.add(new ChunkRegionLoader.PendingChunkToSave(chunkcoordintpair, nbttagcompound));
- this.c.add(chunkcoordintpair);
+ // this.b.add(new ChunkRegionLoader.PendingChunkToSave(chunkcoordintpair, nbttagcompound));
+ // this.c.add(chunkcoordintpair);
+ // Spigot end
FileIOThread.a().a(this);
}
}
@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
Object object = this.d;
synchronized (this.d) {
- if (this.b.isEmpty()) {
+ // Spigot start
+ if (this.pendingSaves.isEmpty()) {
return false;
}
- chunkregionloader_pendingchunktosave = (ChunkRegionLoader.PendingChunkToSave) this.b.remove(0);
- this.c.remove(chunkregionloader_pendingchunktosave.a);
+ chunkregionloader_pendingchunktosave = this.pendingSaves.values().iterator().next();
+ this.pendingSaves.remove(chunkregionloader_pendingchunktosave.a);
+ // Spigot end
}
if (chunkregionloader_pendingchunktosave != null) {
--

View File

@@ -120,7 +120,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
} }
public void aN() { public void aO() {
+ SpigotTimings.serverCommandTimer.startTiming(); // Spigot + SpigotTimings.serverCommandTimer.startTiming(); // Spigot
while (!this.l.isEmpty()) { while (!this.l.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.l.remove(0); ServerCommand servercommand = (ServerCommand) this.l.remove(0);
@@ -132,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ SpigotTimings.serverCommandTimer.stopTiming(); // Spigot + SpigotTimings.serverCommandTimer.stopTiming(); // Spigot
} }
public boolean ad() { public boolean ae() {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
@@ -254,9 +254,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
import org.bukkit.event.server.RemoteServerCommandEvent; import org.bukkit.event.server.RemoteServerCommandEvent;
import org.bukkit.event.world.WorldSaveEvent; import org.bukkit.event.world.WorldSaveEvent;
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
protected void y() {} protected void z() {}
protected void z() throws ExceptionWorldConflict { // CraftBukkit - added throws protected void A() throws ExceptionWorldConflict { // CraftBukkit - added throws
+ SpigotTimings.serverTickTimer.startTiming(); // Spigot + SpigotTimings.serverTickTimer.startTiming(); // Spigot
long i = System.nanoTime(); long i = System.nanoTime();
@@ -282,7 +282,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ org.spigotmc.CustomTimingsHandler.tick(); // Spigot + org.spigotmc.CustomTimingsHandler.tick(); // Spigot
} }
public void A() { public void B() {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.c("levels"); this.methodProfiler.c("levels");
@@ -350,7 +350,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.methodProfiler.c("connection"); this.methodProfiler.c("connection");
+ SpigotTimings.connectionTimer.startTiming(); // Spigot + SpigotTimings.connectionTimer.startTiming(); // Spigot
this.ap().c(); this.aq().c();
+ SpigotTimings.connectionTimer.stopTiming(); // Spigot + SpigotTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players"); this.methodProfiler.c("players");
+ SpigotTimings.playerListTimer.startTiming(); // Spigot + SpigotTimings.playerListTimer.startTiming(); // Spigot

View File

@@ -12,13 +12,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// 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");
+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage, "1.8.3" ) ); // Spigot + chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage, "1.8.4" ) ); // Spigot
this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
this.b.close(chatcomponenttext); this.b.close(chatcomponenttext);
} else if (packethandshakinginsetprotocol.b() < 47) { } else if (packethandshakinginsetprotocol.b() < 47) {
- chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.8.3"); - chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.8.4");
+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage, "1.8.3" ) ); // Spigot + chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage, "1.8.4" ) ); // Spigot
this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext)); this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
this.b.close(chatcomponenttext); this.b.close(chatcomponenttext);
} else { } else {
@@ -37,8 +37,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -0,0 +0,0 @@ public abstract class PlayerList {
} 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;
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");
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot + event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot
} }

View File

@@ -13,13 +13,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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);
+ // Spigot Start + // Spigot Start
+ if ( entity == player && !player.v() ) // RENAME + if ( entity == player && !player.isSpectator() )
+ { + {
+ disconnect( "Cannot interact with self!" ); + disconnect( "Cannot interact with self!" );
+ return; + return;
+ } + }
+ // Spigot End + // Spigot End
this.player.z(); this.player.resetIdleTimer();
if (entity != null) { if (entity != null) {
-- --

View File

@@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
// CraftBukkit end // CraftBukkit end
- if (this.aR() > 0L) { - if (this.aS() > 0L) {
+ if (false && this.aR() > 0L) { // Spigot - disable + if (false && this.aS() > 0L) { // Spigot - disable
Thread thread1 = new Thread(new ThreadWatchdog(this)); Thread thread1 = new Thread(new ThreadWatchdog(this));
thread1.setName("Server Watchdog"); thread1.setName("Server Watchdog");

View File

@@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, hostname); EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, hostname);
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
this.g = LoginListener.EnumProtocolState.KEY; this.g = LoginListener.EnumProtocolState.KEY;
this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.P().getPublic(), this.e)); this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.Q().getPublic(), this.e));
} else { } else {
- this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; - this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
+ // Spigot start + // Spigot start
@@ -62,7 +62,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
+ new LoginHandler().fireEvents(); + new LoginHandler().fireEvents();
+ } else if (LoginListener.this.server.S()) { + } else if (LoginListener.this.server.T()) {
+ LoginListener.c.warn("Failed to verify username but will let them in anyway!"); + LoginListener.c.warn("Failed to verify username but will let them in anyway!");
+ LoginListener.this.i = LoginListener.this.a(gameprofile); + LoginListener.this.i = LoginListener.this.a(gameprofile);
+ LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; + LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@@ -71,7 +71,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ 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()) {
+ LoginListener.c.warn("Authentication servers are down but will let them in anyway!"); + LoginListener.c.warn("Authentication servers are down but will let them in anyway!");
+ LoginListener.this.i = LoginListener.this.a(gameprofile); + LoginListener.this.i = LoginListener.this.a(gameprofile);
+ LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; + LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// 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()) {
- LoginListener.c.warn("Failed to verify username but will let them in anyway!"); - LoginListener.c.warn("Failed to verify username but will let them in anyway!");
- LoginListener.this.i = LoginListener.this.a(gameprofile); - LoginListener.this.i = LoginListener.this.a(gameprofile);
- LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; - LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@@ -111,7 +111,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- 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()) {
- LoginListener.c.warn("Authentication servers are down but will let them in anyway!"); - LoginListener.c.warn("Authentication servers are down but will let them in anyway!");
- LoginListener.this.i = LoginListener.this.a(gameprofile); - LoginListener.this.i = LoginListener.this.a(gameprofile);
- LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; - LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;

View File

@@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Spigot end // Spigot end
@@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.P().getPublic(), this.e)); this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.Q().getPublic(), this.e));
} else { } else {
// Spigot start // Spigot start
- try { - try {
@@ -108,7 +108,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> { @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> {
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();
public Channel k; // CraftBukkit - public, PAIL: Rename channel public Channel channel; // CraftBukkit - public
- private SocketAddress l; - private SocketAddress l;
+ // Spigot Start + // Spigot Start
+ public SocketAddress l; + public SocketAddress l;
@@ -126,7 +126,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Spigot Start + // Spigot Start
+ public SocketAddress getRawAddress() + public SocketAddress getRawAddress()
+ { + {
+ return this.k.remoteAddress(); + return this.channel.remoteAddress();
+ } + }
+ // Spigot End + // Spigot End
} }

View File

@@ -30,12 +30,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
} }
// Spigot End // Spigot End
public ServerConnection ap() { public ServerConnection aq() {
- return this.q; - return this.q;
+ return this.q == null ? this.q = new ServerConnection(this) : this.q; // Spigot + return this.q == null ? this.q = new ServerConnection(this) : this.q; // Spigot
} }
public boolean ar() { public boolean as() {
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java --- a/src/main/java/org/spigotmc/SpigotConfig.java

View File

@@ -11,11 +11,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
this.a(MinecraftEncryption.b()); this.a(MinecraftEncryption.b());
DedicatedServer.LOGGER.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.Q()); DedicatedServer.LOGGER.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.R());
+ if (!org.spigotmc.SpigotConfig.lateBind) { + if (!org.spigotmc.SpigotConfig.lateBind) {
try { try {
this.ap().a(inetaddress, this.Q()); this.aq().a(inetaddress, this.R());
} catch (IOException ioexception) { } catch (IOException ioexception) {
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?"); DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?");
@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (org.spigotmc.SpigotConfig.lateBind) { + if (org.spigotmc.SpigotConfig.lateBind) {
+ try { + try {
+ this.ap().a(inetaddress, this.Q()); + this.aq().a(inetaddress, this.R());
+ } catch (IOException ioexception) { + } catch (IOException ioexception) {
+ DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!"); + DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!");
+ DedicatedServer.LOGGER.warn("The exception was: {}", new Object[] { ioexception.toString()}); + DedicatedServer.LOGGER.warn("The exception was: {}", new Object[] { ioexception.toString()});
@@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ } + }
+ +
if (false && this.aR() > 0L) { // Spigot - disable if (false && this.aS() > 0L) { // Spigot - disable
Thread thread1 = new Thread(new ThreadWatchdog(this)); Thread thread1 = new Thread(new ThreadWatchdog(this));
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java

View File

@@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java --- a/src/main/java/net/minecraft/server/NBTTagByteArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java
@@ -0,0 +0,0 @@ public class NBTTagByteArray extends NBTBase { @@ -0,0 +0,0 @@ public class NBTTagByteArray extends NBTBase {
void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException { void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
nbtreadlimiter.a(192L);
int j = datainput.readInt(); int j = datainput.readInt();
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24); + com.google.common.base.Preconditions.checkArgument( j < 1 << 24);
@@ -21,8 +21,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java --- a/src/main/java/net/minecraft/server/NBTTagIntArray.java
+++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java
@@ -0,0 +0,0 @@ public class NBTTagIntArray extends NBTBase { @@ -0,0 +0,0 @@ public class NBTTagIntArray extends NBTBase {
void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException { void load(DataInput datainput, int i, NBTReadLimiter nbtreadlimiter) throws IOException {
nbtreadlimiter.a(192L);
int j = datainput.readInt(); int j = datainput.readInt();
+ com.google.common.base.Preconditions.checkArgument( j < 1 << 24); + com.google.common.base.Preconditions.checkArgument( j < 1 << 24);

View File

@@ -36,14 +36,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
try { try {
if (this.init()) { if (this.init()) {
@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.r.setServerInfo(new ServerPing.ServerData("1.8.3", 47)); this.r.setServerInfo(new ServerPing.ServerData("1.8.4", 47));
this.a(this.r); this.a(this.r);
+ // Spigot start + // Spigot start
+ Arrays.fill( recentTps, 20 ); + Arrays.fill( recentTps, 20 );
+ long lastTick = System.nanoTime(), catchupTime = 0, curTime, wait, tickSection = lastTick; + long lastTick = System.nanoTime(), catchupTime = 0, curTime, wait, tickSection = lastTick;
while (this.isRunning) { while (this.isRunning) {
- long j = ay(); - long j = az();
- 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) {
@@ -68,14 +68,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- i += k; - i += k;
- this.ab = j; - this.ab = j;
- 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();
- } - }
+ if ( MinecraftServer.currentTick++ % SAMPLE_INTERVAL == 0 ) + if ( MinecraftServer.currentTick++ % SAMPLE_INTERVAL == 0 )
+ { + {
@@ -88,7 +88,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ lastTick = curTime; + lastTick = curTime;
- Thread.sleep(Math.max(1L, 50L - i)); - Thread.sleep(Math.max(1L, 50L - i));
+ this.z(); + this.A();
this.Q = true; this.Q = true;
} }
+ // Spigot end + // Spigot end

View File

@@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start - Add "isDisconnected" method // CraftBukkit start - Add "isDisconnected" method
- public final boolean isDisconnected() { - public final boolean isDisconnected() {
+ public boolean isDisconnected() { // Spigot + public boolean isDisconnected() { // Spigot
return !this.player.joining && !this.networkManager.k.config().isAutoRead(); return !this.player.joining && !this.networkManager.channel.config().isAutoRead();
} }
-- --

View File

@@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
} }
// CraftBukkit end // CraftBukkit end
@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
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

View File

@@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
} }
protected boolean aQ() { protected boolean aR() {
+ server.getLogger().info( "**** Beginning UUID conversion, this may take A LONG time ****"); // Spigot, let the user know whats up! + server.getLogger().info( "**** Beginning UUID conversion, this may take A LONG time ****"); // Spigot, let the user know whats up!
boolean flag = false; boolean flag = false;

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Print Stack on InternalException
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 0000000000000000000000000000000000000000..00000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java --- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> { @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> {

Some files were not shown because too many files have changed in this diff Show More