Remove a fair chunk of existing patches now applied to CraftBukkit

This commit is contained in:
md_5 2013-04-13 17:06:23 +10:00
parent 7fb2d4957b
commit 010f3ea2b0
40 changed files with 116 additions and 443 deletions

View File

@ -1,11 +1,11 @@
From 62ed461e820ad8337a71486c1dbc2594c9b6e2c6 Mon Sep 17 00:00:00 2001
From 1db91f69acf598609351eec2b307131f30d7da36 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Wed, 30 Jan 2013 23:44:29 -0500
Subject: [PATCH] Spigot POM Changes.
diff --git a/pom.xml b/pom.xml
index d5db496..4c8ff29 100644
index 066717d..67a886a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,43 +1,23 @@
@ -23,7 +23,7 @@ index d5db496..4c8ff29 100644
+
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId>
<version>1.5.1-R0.2-SNAPSHOT</version>
<version>1.5.1-R0.2</version>
- <name>Bukkit</name>
- <url>http://www.bukkit.org</url>
+ <name>Spigot-API</name>

View File

@ -1,41 +0,0 @@
From e713a9083b0802334d046915c9f1995326e8956c Mon Sep 17 00:00:00 2001
From: snowleo <schneeleo@gmail.com>
Date: Wed, 17 Oct 2012 22:30:45 +0200
Subject: [PATCH] Make the plugin class loader thread safe
---
src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 10fc26a..4dca063 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -45,6 +45,7 @@ import org.bukkit.plugin.UnknownDependencyException;
import org.yaml.snakeyaml.error.YAMLException;
import com.google.common.collect.ImmutableList;
+import java.util.concurrent.ConcurrentHashMap;
/**
* Represents a Java plugin loader, allowing plugins in the form of .jar
@@ -61,14 +62,14 @@ public class JavaPluginLoader implements PluginLoader {
@Deprecated
protected final Pattern[] fileFilters = fileFilters0;
- private final Map<String, Class<?>> classes0 = new HashMap<String, Class<?>>();
+ private final Map<String, Class<?>> classes0 = new ConcurrentHashMap<String, Class<?>>();
/**
* @deprecated Internal field that wasn't intended to be exposed
*/
@Deprecated
protected final Map<String, Class<?>> classes = classes0;
- private final Map<String, PluginClassLoader> loaders0 = new LinkedHashMap<String, PluginClassLoader>();
+ private final Map<String, PluginClassLoader> loaders0 = new ConcurrentHashMap<String, PluginClassLoader>();
/**
* @deprecated Internal field that wasn't intended to be exposed
*/
--
1.8.1-rc2

View File

@ -1,11 +1,11 @@
From fff42db730cc4f3b8e39306677f1bbcafbffd76c Mon Sep 17 00:00:00 2001
From 57dbe4d8f468fc1cecb4a3576df83d46f609a2af Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 09:44:24 +1100
Subject: [PATCH] POM Changes.
diff --git a/pom.xml b/pom.xml
index 6415183..fce45f8 100644
index 518aa9b..39ee598 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,20 @@
@ -25,7 +25,7 @@ index 6415183..fce45f8 100644
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot</artifactId>
<packaging>jar</packaging>
<version>1.5.1-R0.2-SNAPSHOT</version>
<version>1.5.1-R0.2</version>
- <name>CraftBukkit</name>
- <url>http://www.bukkit.org</url>
+ <name>Spigot</name>

View File

@ -1,4 +1,4 @@
From 86ac1a6679d21066a6360b12031ebdc7305e6d79 Mon Sep 17 00:00:00 2001
From d626b39cd08b8c58ab090c999ee5e8308b568845 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 17:57:27 +1100
Subject: [PATCH] Spigot Changes
@ -297,41 +297,25 @@ index 38f3038..03d511f 100644
+ // Spigot end
}
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index ee775bf..aa8d83f 100644
index a28d233..e7481dd 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -61,6 +61,7 @@ public class EntityItem extends Entity {
this.lastTick = currentTick;
@@ -62,6 +62,7 @@ public class EntityItem extends Entity {
this.lastTick = MinecraftServer.currentTick;
// CraftBukkit end
+ if (lastTick % 2 == 0) { // Spigot
this.lastX = this.locX;
this.lastY = this.locY;
this.lastZ = this.locZ;
@@ -99,7 +100,7 @@ public class EntityItem extends Entity {
@@ -100,6 +101,7 @@ public class EntityItem extends Entity {
if (this.onGround) {
this.motY *= -0.5D;
}
-
+ } // Spigot
++this.age;
if (!this.world.isStatic && this.age >= 6000) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
index be8a5ed..0c0157f 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -63,10 +63,6 @@ public class EntitySquid extends EntityWaterAnimal {
// CraftBukkit end
}
+ }
- public boolean G() {
- return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, (Entity) this);
- }
-
public void c() {
super.c();
this.e = this.d;
// ++this.age; // CraftBukkit - Moved up
if (!this.world.isStatic && this.age >= 6000) {
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index c81793a..133c310 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
@ -439,10 +423,10 @@ index 0686ba0..c185f64 100644
URL url = new URL("http://session.minecraft.net/game/checkserver.jsp?user=" + URLEncoder.encode(PendingConnection.d(this.pendingConnection), "UTF-8") + "&serverId=" + URLEncoder.encode(s, "UTF-8"));
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(url.openStream()));
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 03b7167..0958209 100644
index d896f69..a77f48d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -67,14 +67,27 @@ public abstract class World implements IBlockAccess {
@@ -66,14 +66,27 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - public, longhashset
public boolean allowMonsters = true;
public boolean allowAnimals = true;
@ -471,7 +455,7 @@ index 03b7167..0958209 100644
public BiomeBase getBiome(int i, int j) {
if (this.isLoaded(i, 0, j)) {
Chunk chunk = this.getChunkAtWorldCoords(i, j);
@@ -100,6 +113,7 @@ public abstract class World implements IBlockAccess {
@@ -99,6 +112,7 @@ public abstract class World implements IBlockAccess {
int lastXAccessed = Integer.MIN_VALUE;
int lastZAccessed = Integer.MIN_VALUE;
final Object chunkLock = new Object();
@ -479,7 +463,7 @@ index 03b7167..0958209 100644
public CraftWorld getWorld() {
return this.world;
@@ -112,11 +126,18 @@ public abstract class World implements IBlockAccess {
@@ -111,11 +125,18 @@ public abstract class World implements IBlockAccess {
// Changed signature
public World(IDataManager idatamanager, String s, WorldSettings worldsettings, WorldProvider worldprovider, MethodProfiler methodprofiler, IConsoleLogManager iconsolelogmanager, ChunkGenerator gen, org.bukkit.World.Environment env) {
this.generator = gen;
@ -498,7 +482,7 @@ index 03b7167..0958209 100644
this.O = this.random.nextInt(12000);
this.H = new int['\u8000'];
this.isStatic = false;
@@ -124,7 +145,7 @@ public abstract class World implements IBlockAccess {
@@ -123,7 +144,7 @@ public abstract class World implements IBlockAccess {
this.methodProfiler = methodprofiler;
this.worldMaps = new WorldMapCollection(idatamanager);
this.logAgent = iconsolelogmanager;
@ -507,7 +491,7 @@ index 03b7167..0958209 100644
if (worldprovider != null) {
this.worldProvider = worldprovider;
} else if (this.worldData != null && this.worldData.j() != 0) {
@@ -1017,6 +1038,39 @@ public abstract class World implements IBlockAccess {
@@ -1016,6 +1037,39 @@ public abstract class World implements IBlockAccess {
int i1 = MathHelper.floor(axisalignedbb.c);
int j1 = MathHelper.floor(axisalignedbb.f + 1.0D);
@ -547,7 +531,7 @@ index 03b7167..0958209 100644
for (int k1 = i; k1 < j; ++k1) {
for (int l1 = i1; l1 < j1; ++l1) {
if (this.isLoaded(k1, 64, l1)) {
@@ -1030,6 +1084,7 @@ public abstract class World implements IBlockAccess {
@@ -1029,6 +1083,7 @@ public abstract class World implements IBlockAccess {
}
}
}
@ -555,7 +539,7 @@ index 03b7167..0958209 100644
double d0 = 0.25D;
List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0));
@@ -1946,6 +2001,11 @@ public abstract class World implements IBlockAccess {
@@ -1945,6 +2000,11 @@ public abstract class World implements IBlockAccess {
this.worldData.setWeatherDuration(1);
}
@ -567,7 +551,7 @@ index 03b7167..0958209 100644
protected void A() {
// this.chunkTickList.clear(); // CraftBukkit - removed
this.methodProfiler.a("buildList");
@@ -1955,25 +2015,42 @@ public abstract class World implements IBlockAccess {
@@ -1954,25 +2014,42 @@ public abstract class World implements IBlockAccess {
int j;
int k;
@ -624,7 +608,7 @@ index 03b7167..0958209 100644
this.methodProfiler.b();
if (this.O > 0) {
@@ -1981,7 +2058,7 @@ public abstract class World implements IBlockAccess {
@@ -1980,7 +2057,7 @@ public abstract class World implements IBlockAccess {
}
this.methodProfiler.a("playerCheckLight");
@ -634,7 +618,7 @@ index 03b7167..0958209 100644
entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 13f67da..a5a0e04 100644
index 6d8495f..0b7ac47 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,5 +1,7 @@

View File

@ -1,4 +1,4 @@
From 733da598baf9b69a7c1522582941ef45442566b8 Mon Sep 17 00:00:00 2001
From 02a200167495100ba6a4178eed5e586bb6ab33ac Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 09:46:33 +1100
Subject: [PATCH] Merge tweaks and configuration
@ -6,10 +6,10 @@ Subject: [PATCH] Merge tweaks and configuration
This allows the merging of Experience orbs, as well as the configuration of the merge radius of items. Additionally it refactors the merge algorithm to be a better experience for players.
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index aa8d83f..6d54e97 100644
index e7481dd..9f1a7b7 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -114,7 +114,10 @@ public class EntityItem extends Entity {
@@ -116,7 +116,10 @@ public class EntityItem extends Entity {
}
private void g() {
@ -21,7 +21,7 @@ index aa8d83f..6d54e97 100644
while (iterator.hasNext()) {
EntityItem entityitem = (EntityItem) iterator.next();
@@ -143,11 +146,13 @@ public class EntityItem extends Entity {
@@ -145,11 +148,13 @@ public class EntityItem extends Entity {
} else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) {
return false;
} else {
@ -41,10 +41,10 @@ index aa8d83f..6d54e97 100644
}
} else {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 0958209..3d77400 100644
index a77f48d..f5730d3 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -950,6 +950,23 @@ public abstract class World implements IBlockAccess {
@@ -949,6 +949,23 @@ public abstract class World implements IBlockAccess {
// Not all projectiles extend EntityProjectile, so check for Bukkit interface instead
event = CraftEventFactory.callProjectileLaunchEvent(entity);
}

View File

@ -1,4 +1,4 @@
From ae810f2bc90405ea57328770e9edb5425368f82c Mon Sep 17 00:00:00 2001
From e7fda7fe893f59f61e809a0bcd2552a9d67941e7 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 7 Mar 2013 20:12:46 +1100
Subject: [PATCH] Async Operation Catching
@ -6,7 +6,7 @@ Subject: [PATCH] Async Operation Catching
Catch and throw an exception when a potentially unsafe operation occurs on a thread other than the main server thread.
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 4de1273..db62084 100644
index 9e2b76f..d7efe3e 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -89,6 +89,7 @@ public class EntityTracker {
@ -26,7 +26,7 @@ index 4de1273..db62084 100644
EntityPlayer entityplayer = (EntityPlayer) entity;
Iterator iterator = this.b.iterator();
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 4871bd7..8aa2e88 100644
index 65cc4e8..970a834 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -286,6 +286,7 @@ public class EntityTrackerEntry {
@ -37,7 +37,7 @@ index 4871bd7..8aa2e88 100644
if (entityplayer != this.tracker) {
double d0 = entityplayer.locX - (double) (this.xLoc / 32);
double d1 = entityplayer.locZ - (double) (this.zLoc / 32);
@@ -470,6 +471,7 @@ public class EntityTrackerEntry {
@@ -474,6 +475,7 @@ public class EntityTrackerEntry {
}
public void clear(EntityPlayer entityplayer) {
@ -46,10 +46,10 @@ index 4871bd7..8aa2e88 100644
this.trackedPlayers.remove(entityplayer);
entityplayer.removeQueue.add(Integer.valueOf(this.tracker.id));
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3d77400..92e8a37 100644
index f5730d3..af85d8b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -919,6 +919,7 @@ public abstract class World implements IBlockAccess {
@@ -918,6 +918,7 @@ public abstract class World implements IBlockAccess {
}
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
@ -57,7 +57,7 @@ index 3d77400..92e8a37 100644
if (entity == null) return false;
// CraftBukkit end
@@ -1025,6 +1026,7 @@ public abstract class World implements IBlockAccess {
@@ -1024,6 +1025,7 @@ public abstract class World implements IBlockAccess {
}
public void removeEntity(Entity entity) {
@ -94,7 +94,7 @@ index a303090..f5e63f8 100644
if (generate) {
// Use the default variant of loadChunk when generate == true.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a93625c..5b74a5b 100644
index 8c30bf5..13532d9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -214,6 +214,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -1,4 +1,4 @@
From 74653439cba166878e6e263082cde72cce8a4a5c Mon Sep 17 00:00:00 2001
From 47193857bccf2fe37af174ee5ae61607138d6758 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Sun, 23 Dec 2012 17:09:40 +1100
Subject: [PATCH] Address BUKKIT-3286 by firing the inventory close event when
@ -7,7 +7,7 @@ Subject: [PATCH] Address BUKKIT-3286 by firing the inventory close event when
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 91b44a0..df33d80 100644
index d647d2e..f948497 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -5,11 +5,13 @@ import java.util.Iterator;
@ -24,7 +24,7 @@ index 91b44a0..df33d80 100644
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerBedLeaveEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
@@ -960,6 +962,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
@@ -961,6 +963,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
super.die();
this.defaultContainer.b(this);
if (this.activeContainer != null) {

View File

@ -1,14 +1,14 @@
From f9fe180eef563c01afa127cd687b41bb1ba5c0af Mon Sep 17 00:00:00 2001
From 2ab60d53837805246d5637de9409d581333d6258 Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Wed, 16 Jan 2013 15:27:22 -0600
Subject: [PATCH] Alternate, sync-free-but-safe chunk reference cache
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 92e8a37..b4ec71e 100644
index af85d8b..eb03aba 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -294,15 +294,13 @@ public abstract class World implements IBlockAccess {
@@ -293,15 +293,13 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start
public Chunk getChunkAt(int i, int j) {

View File

@ -1,21 +0,0 @@
From 9fcce5b028144d7682bd590fa97feaf303bd3272 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 19 Jan 2013 01:11:30 -0500
Subject: [PATCH] Skip entity.move() if we are not moving anywhere.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 51a5b38..1044e4d 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -417,6 +417,7 @@ public abstract class Entity {
}
public void move(double d0, double d1, double d2) {
+ if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot
if (this.Z) {
this.boundingBox.d(d0, d1, d2);
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
--
1.8.2.1

View File

@ -1,11 +1,11 @@
From 64a476e80485ab2a1a28f1b1809071f261eed141 Mon Sep 17 00:00:00 2001
From 42618ef73f272138aca156f65e61f190d359f2e1 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 12:28:17 +1100
Subject: [PATCH] Tick loop optimization - sleep for as long as possible.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 64d5882..8de8570 100644
index 3ee8ddc..8cc26b8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -83,6 +83,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo

View File

@ -1,4 +1,4 @@
From 867a1f6e0321859d2573cdfa83b46376396981b9 Mon Sep 17 00:00:00 2001
From 17b35282ddc9b836277eaac64846981fca852c54 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 10 Jan 2013 00:18:11 -0500
Subject: [PATCH] Improved Timings System
@ -26,7 +26,7 @@ index 8b280ab..31e3fce 100644
// CraftBukkit start - If we didn't need to load the chunk run the callback now
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 1044e4d..171e7e0 100644
index d510392..8a10948 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -14,6 +14,7 @@ import org.bukkit.block.BlockFace;
@ -46,15 +46,15 @@ index 1044e4d..171e7e0 100644
public Entity(World world) {
this.id = entityCount++;
this.l = 1.0D;
@@ -418,6 +421,7 @@ public abstract class Entity {
@@ -423,6 +426,7 @@ public abstract class Entity {
}
// CraftBukkit end
public void move(double d0, double d1, double d2) {
if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot
+ org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
if (this.Z) {
this.boundingBox.d(d0, d1, d2);
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
@@ -717,6 +721,7 @@ public abstract class Entity {
@@ -722,6 +726,7 @@ public abstract class Entity {
this.world.methodProfiler.b();
}
@ -63,7 +63,7 @@ index 1044e4d..171e7e0 100644
protected void C() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 21819ee..787db39 100644
index f8dd417..8fe9a54 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -497,6 +497,7 @@ public abstract class EntityLiving extends Entity {
@ -92,7 +92,7 @@ index 21819ee..787db39 100644
}
// CraftBukkit start - Delegate so we can handle providing a reason for health being regained
@@ -1252,6 +1256,7 @@ public abstract class EntityLiving extends Entity {
@@ -1254,6 +1258,7 @@ public abstract class EntityLiving extends Entity {
}
public void c() {
@ -100,7 +100,7 @@ index 21819ee..787db39 100644
if (this.bX > 0) {
--this.bX;
}
@@ -1303,6 +1308,7 @@ public abstract class EntityLiving extends Entity {
@@ -1305,6 +1310,7 @@ public abstract class EntityLiving extends Entity {
this.aA = this.yaw;
}
}
@ -108,7 +108,7 @@ index 21819ee..787db39 100644
this.world.methodProfiler.b();
this.world.methodProfiler.a("jump");
@@ -1321,6 +1327,7 @@ public abstract class EntityLiving extends Entity {
@@ -1323,6 +1329,7 @@ public abstract class EntityLiving extends Entity {
this.world.methodProfiler.b();
this.world.methodProfiler.a("travel");
@ -116,7 +116,7 @@ index 21819ee..787db39 100644
this.bD *= 0.98F;
this.bE *= 0.98F;
this.bF *= 0.9F;
@@ -1329,11 +1336,14 @@ public abstract class EntityLiving extends Entity {
@@ -1331,11 +1338,14 @@ public abstract class EntityLiving extends Entity {
this.aO *= this.bE();
this.e(this.bD, this.bE);
this.aO = f;
@ -132,7 +132,7 @@ index 21819ee..787db39 100644
this.world.methodProfiler.b();
this.world.methodProfiler.a("looting");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8de8570..16b15df 100644
index 8cc26b8..0205822 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -6,7 +6,6 @@ import java.security.KeyPair;
@ -266,7 +266,7 @@ index db3fc42..174546d 100644
private static Map b = new HashMap();
protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index b4ec71e..e2d0a88 100644
index eb03aba..1bed9ed 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -13,6 +13,7 @@ import java.util.concurrent.Callable;
@ -277,7 +277,7 @@ index b4ec71e..e2d0a88 100644
import org.bukkit.craftbukkit.util.UnsafeList;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.craftbukkit.CraftServer;
@@ -115,6 +116,8 @@ public abstract class World implements IBlockAccess {
@@ -114,6 +115,8 @@ public abstract class World implements IBlockAccess {
final Object chunkLock = new Object();
private byte chunkTickRadius;
@ -286,7 +286,7 @@ index b4ec71e..e2d0a88 100644
public CraftWorld getWorld() {
return this.world;
}
@@ -194,6 +197,7 @@ public abstract class World implements IBlockAccess {
@@ -193,6 +196,7 @@ public abstract class World implements IBlockAccess {
this.a();
this.getServer().addWorld(this.world); // CraftBukkit
@ -294,7 +294,7 @@ index b4ec71e..e2d0a88 100644
}
protected abstract IChunkProvider j();
@@ -1272,6 +1276,7 @@ public abstract class World implements IBlockAccess {
@@ -1271,6 +1275,7 @@ public abstract class World implements IBlockAccess {
this.f.clear();
this.methodProfiler.c("regular");
@ -302,7 +302,7 @@ index b4ec71e..e2d0a88 100644
for (i = 0; i < this.entityList.size(); ++i) {
entity = (Entity) this.entityList.get(i);
@@ -1294,7 +1299,9 @@ public abstract class World implements IBlockAccess {
@@ -1293,7 +1298,9 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.a("tick");
if (!entity.dead) {
try {
@ -312,7 +312,7 @@ index b4ec71e..e2d0a88 100644
} catch (Throwable throwable1) {
crashreport = CrashReport.a(throwable1, "Ticking entity");
crashreportsystemdetails = crashreport.a("Entity being ticked");
@@ -1319,7 +1326,9 @@ public abstract class World implements IBlockAccess {
@@ -1318,7 +1325,9 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.b();
}
@ -322,7 +322,7 @@ index b4ec71e..e2d0a88 100644
this.N = true;
Iterator iterator = this.tileEntityList.iterator();
@@ -1334,8 +1343,11 @@ public abstract class World implements IBlockAccess {
@@ -1333,8 +1342,11 @@ public abstract class World implements IBlockAccess {
if (!tileentity.r() && tileentity.o() && this.isLoaded(tileentity.x, tileentity.y, tileentity.z)) {
try {
@ -334,7 +334,7 @@ index b4ec71e..e2d0a88 100644
crashreport = CrashReport.a(throwable2, "Ticking tile entity");
crashreportsystemdetails = crashreport.a("Tile entity being ticked");
tileentity.a(crashreportsystemdetails);
@@ -1355,6 +1367,8 @@ public abstract class World implements IBlockAccess {
@@ -1354,6 +1366,8 @@ public abstract class World implements IBlockAccess {
}
}
@ -343,7 +343,7 @@ index b4ec71e..e2d0a88 100644
this.N = false;
if (!this.b.isEmpty()) {
this.tileEntityList.removeAll(this.b);
@@ -1393,6 +1407,7 @@ public abstract class World implements IBlockAccess {
@@ -1392,6 +1406,7 @@ public abstract class World implements IBlockAccess {
this.a.clear();
}
@ -351,7 +351,7 @@ index b4ec71e..e2d0a88 100644
this.methodProfiler.b();
this.methodProfiler.b();
}
@@ -1415,6 +1430,7 @@ public abstract class World implements IBlockAccess {
@@ -1414,6 +1429,7 @@ public abstract class World implements IBlockAccess {
byte b0 = 32;
if (!flag || this.e(i - b0, 0, j - b0, i + b0, 0, j + b0)) {
@ -359,7 +359,7 @@ index b4ec71e..e2d0a88 100644
entity.U = entity.locX;
entity.V = entity.locY;
entity.W = entity.locZ;
@@ -1476,6 +1492,7 @@ public abstract class World implements IBlockAccess {
@@ -1475,6 +1491,7 @@ public abstract class World implements IBlockAccess {
entity.passenger = null;
}
}
@ -368,7 +368,7 @@ index b4ec71e..e2d0a88 100644
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f63e364..0abfc35 100644
index a25cbf3..24379e6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -186,9 +186,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate

View File

@ -1,4 +1,4 @@
From 50bc4517a46a353fdd95685653da987eece96a49 Mon Sep 17 00:00:00 2001
From 4e68a1a17ba2f0cd98c20d2b8b3f74abf633de6a Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 10:58:17 +1100
Subject: [PATCH] Add oreobfuscator for Spigot.
@ -134,7 +134,7 @@ index 20f8e8a..3792638 100644
for (k = 0; k < 16; ++k) {
if ((this.f & 1 << k) != 0) {
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index 91bed16..8af36ca 100644
index d03174b..354d4f6 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -285,6 +285,11 @@ public class PlayerInteractManager {

View File

@ -1,4 +1,4 @@
From 5fe8737ece46cdaf9a021fa83e1e55f621275634 Mon Sep 17 00:00:00 2001
From 3544f99022ed5cfe8d2c52ee75c556390fe9103b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 29 Jan 2013 13:25:53 -0500
Subject: [PATCH] Only count entities in chunks being processed for the spawn

View File

@ -1,14 +1,14 @@
From b57ab0df2be482a7c4a9b30a46200659b1f2bf90 Mon Sep 17 00:00:00 2001
From 84836464019bcb8e20890088317310ae168b171b Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 09:20:19 +1100
Subject: [PATCH] Detect, remove and warn about null tile entities.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e2d0a88..16bd795 100644
index 1bed9ed..51816e4 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1334,6 +1334,13 @@ public abstract class World implements IBlockAccess {
@@ -1333,6 +1333,13 @@ public abstract class World implements IBlockAccess {
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();

View File

@ -1,34 +0,0 @@
From 588b88aa24e2ef3f6754056631600c5cf0b1c4dc Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Jan 2013 19:31:14 -0500
Subject: [PATCH] Reduce number of LivingEntity collision checks.
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 787db39..bdbd72a 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1415,12 +1415,20 @@ public abstract class EntityLiving extends Entity {
}
protected void bg() {
+ // Spigot start
+ boolean skip = false;
+ if (!(this instanceof EntityPlayer) && this.ticksLived % 2 != 0) {
+ skip = true;
+ }
+ // Spigot end
+
List list = this.world.getEntities(this, this.boundingBox.grow(0.20000000298023224D, 0.0D, 0.20000000298023224D));
if (list != null && !list.isEmpty()) {
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
+ if (entity instanceof EntityLiving && skip) { continue; } // Spigot
if (entity.L()) {
this.o(entity);
}
--
1.8.2.1

View File

@ -1,4 +1,4 @@
From 6b9fe9fa4f37f41758621439d6fc94589816420f Mon Sep 17 00:00:00 2001
From 2e8b2db30d08ecec2a5af741e65a95e182f20b97 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Feb 2013 05:10:21 -0500
Subject: [PATCH] Entity Activation Range
@ -9,7 +9,7 @@ This will drastically cut down on tick timings for entities that are not in rang
This change can have dramatic impact on gameplay if configured too low. Balance according to your servers desired gameplay.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 171e7e0..4ea11ef 100644
index 8a10948..f5203bc 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -88,7 +88,7 @@ public abstract class Entity {
@ -62,24 +62,8 @@ index f46c920..1699059 100644
public int fromPlayer = 0;
public int shake = 0;
public Entity shooter;
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index 6d54e97..924b6ed 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -100,8 +100,9 @@ public class EntityItem extends Entity {
if (this.onGround) {
this.motY *= -0.5D;
}
- } // Spigot
- ++this.age;
+ }
+ this.age = ticksLived;
+ // Spigot
if (!this.world.isStatic && this.age >= 6000) {
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 16bd795..a50bcb1 100644
index 51816e4..7e10318 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -13,6 +13,7 @@ import java.util.concurrent.Callable;
@ -90,7 +74,7 @@ index 16bd795..a50bcb1 100644
import org.bukkit.craftbukkit.SpigotTimings; // Spigot
import org.bukkit.craftbukkit.util.UnsafeList;
import org.bukkit.generator.ChunkGenerator;
@@ -1276,6 +1277,7 @@ public abstract class World implements IBlockAccess {
@@ -1275,6 +1276,7 @@ public abstract class World implements IBlockAccess {
this.f.clear();
this.methodProfiler.c("regular");
@ -98,7 +82,7 @@ index 16bd795..a50bcb1 100644
timings.entityTick.startTiming(); // Spigot
for (i = 0; i < this.entityList.size(); ++i) {
entity = (Entity) this.entityList.get(i);
@@ -1436,8 +1438,12 @@ public abstract class World implements IBlockAccess {
@@ -1435,8 +1437,12 @@ public abstract class World implements IBlockAccess {
int j = MathHelper.floor(entity.locZ);
byte b0 = 32;

View File

@ -1,4 +1,4 @@
From fcf8d194aaa25f7e619a713a5c025a550e746a96 Mon Sep 17 00:00:00 2001
From 04c9e16daf3efb4197c06628fc6566e92e1032af Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 08:58:35 +1100
Subject: [PATCH] Metrics. Rewrite the Metrics system to be closer to the

View File

@ -1,11 +1,11 @@
From b2a6b2e43bbfb724b5b14d53a05eb6a9b46d451e Mon Sep 17 00:00:00 2001
From 2543e5197437caa9f4b741205fda322e7446ad60 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 12:33:20 +1100
Subject: [PATCH] Watchdog Thread.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 16b15df..4a9d711 100644
index 0205822..65a4e9f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -403,6 +403,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo

View File

@ -1,4 +1,4 @@
From 5a8a674d460ed4ff7502a58cef09557f78532eb6 Mon Sep 17 00:00:00 2001
From 9d989add21f07a6fe53fa6660c3fec6253bf7fe5 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 14 Feb 2013 17:32:20 +1100
Subject: [PATCH] Netty
@ -32,7 +32,7 @@ Subject: [PATCH] Netty
Commons Attribution-ShareAlike 3.0 Unported license.
diff --git a/pom.xml b/pom.xml
index fce45f8..95514d8 100644
index 39ee598..9404837 100644
--- a/pom.xml
+++ b/pom.xml
@@ -132,6 +132,11 @@

View File

@ -1,44 +0,0 @@
From 8d27525a8a31f519e1a587af176fc9ec326c09e8 Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Wed, 20 Feb 2013 23:07:53 -0500
Subject: [PATCH] Optimize getTileEntities performance
Avoid traversing tile entities for every loaded chunk
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 0abfc35..615968f 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -675,17 +675,20 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
public List getTileEntities(int i, int j, int k, int l, int i1, int j1) {
ArrayList arraylist = new ArrayList();
- // CraftBukkit start - Use iterator
- Iterator iterator = this.tileEntityList.iterator();
-
- while (iterator.hasNext()) {
- TileEntity tileentity = (TileEntity) iterator.next();
- // CraftBukkit end
-
- if (tileentity.x >= i && tileentity.y >= j && tileentity.z >= k && tileentity.x < l && tileentity.y < i1 && tileentity.z < j1) {
- arraylist.add(tileentity);
+ // Spigot start - check in chunks: usually just from one
+ for (int cx = (i >> 4); cx <= ((l - 1) >> 4); cx++) {
+ for (int cz = (k >> 4); cz <= ((j1 - 1) >> 4); cz++) {
+ Chunk c = getChunkAt(cx, cz);
+ if (c == null) continue;
+ for (Object te : c.tileEntities.values()) {
+ TileEntity tileentity = (TileEntity) te;
+ if ((tileentity.x >= i) && (tileentity.y >= j) && (tileentity.z >= k) && (tileentity.x < l) && (tileentity.y < i1) && (tileentity.z < j1)) {
+ arraylist.add(tileentity);
+ }
+ }
}
}
+ // Spigot end
return arraylist;
}
--
1.8.2.1

View File

@ -1,27 +0,0 @@
From 0a07b5d906ed825ec54f3f3b7ec2906ddaadc27e Mon Sep 17 00:00:00 2001
From: shakytom <tom.roberts00@gmail.com>
Date: Wed, 20 Feb 2013 22:34:38 -0500
Subject: [PATCH] Improved tile entity lookup for chunk sending
Instead of scanning the entire worlds tile entities to find out what tile entities are in the chunk... just use the arraylist of tile entities we already have.
This results in a good reduction of time spent in player ticking.
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index eb07d8e..410148f 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -173,8 +173,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
iterator1.remove();
if (chunkcoordintpair != null && this.world.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) {
- arraylist.add(this.world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z));
- arraylist1.addAll(((WorldServer) this.world).getTileEntities(chunkcoordintpair.x * 16, 0, chunkcoordintpair.z * 16, chunkcoordintpair.x * 16 + 16, 256, chunkcoordintpair.z * 16 + 16));
+ Chunk chunk = this.world.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z); // Spigot
+ arraylist.add(chunk); // Spigot
+ arraylist1.addAll(chunk.tileEntities.values()); // Spigot
}
}
--
1.8.2.1

View File

@ -1,4 +1,4 @@
From 004df3a6c801a353c88d75ff4ef6d631cbf0cce5 Mon Sep 17 00:00:00 2001
From b723bd7d9d1cfec9ebd959da02965db78de277f4 Mon Sep 17 00:00:00 2001
From: EdGruberman <ed@rjump.com>
Date: Fri, 22 Feb 2013 09:23:51 -0700
Subject: [PATCH] Return bed location itself instead of next to bed; Fixes
@ -6,7 +6,7 @@ Subject: [PATCH] Return bed location itself instead of next to bed; Fixes
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 5b74a5b..a913a1c 100644
index 13532d9..0b5ea21 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -628,10 +628,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -1,4 +1,4 @@
From 5f3f7d223e2d45887573af03dcd9e208874ecc9f Mon Sep 17 00:00:00 2001
From 1ab23a3c52b56cb90074ee4d9969e130cca8095b Mon Sep 17 00:00:00 2001
From: EdGruberman <ed@rjump.com>
Date: Tue, 12 Feb 2013 16:17:31 -0700
Subject: [PATCH] Remove dependency on CraftPlayer.getBedSpawnLocation; Fixes
@ -6,7 +6,7 @@ Subject: [PATCH] Remove dependency on CraftPlayer.getBedSpawnLocation; Fixes
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index eb3e7a4..f94cc54 100644
index da7ad33..eaeb0bf 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -493,7 +493,14 @@ public abstract class PlayerList {

View File

@ -1,4 +1,4 @@
From 29d82480eaedef3660ef53216a027dca06cf136e Mon Sep 17 00:00:00 2001
From 7c950977b64654a0de7e24a32100741163c24f40 Mon Sep 17 00:00:00 2001
From: Yariv Livay <yarivlivay@gmail.com>
Date: Sat, 2 Mar 2013 09:36:52 +1100
Subject: [PATCH] BUKKIT-3661, fixed missing HangingBreakEvent when

View File

@ -1,14 +1,14 @@
From fb04e2f8c99e6fa036b84be52e23b02b8d61f90d Mon Sep 17 00:00:00 2001
From e3e72524c928ed7f4092e7192564b681cffc9942 Mon Sep 17 00:00:00 2001
From: Yariv Livay <yarivlivay@gmail.com>
Date: Mon, 25 Feb 2013 22:26:36 +0200
Subject: [PATCH] Adds BUKKIT-3667, Faux sleepers wake up normally
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 0c36785..3ce9f8b 100644
index e158935..735eb8a 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -417,7 +417,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -418,7 +418,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
public void a(boolean flag, boolean flag1, boolean flag2) {

View File

@ -1,4 +1,4 @@
From 37a00bc03a7f768aeb1c8367299b0fe5963e5495 Mon Sep 17 00:00:00 2001
From e3e9ae6049bbf07548dec7210caccbd90a29883a Mon Sep 17 00:00:00 2001
From: Yariv Livay <yarivlivay@gmail.com>
Date: Tue, 26 Feb 2013 20:14:34 +0200
Subject: [PATCH] BUKKIT-3668 Fix wrong block in BlockDispenseEvent when

View File

@ -1,61 +0,0 @@
From 751dab285d5f6ad4253afdfe4f427a609517fbbd Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 24 Feb 2013 20:45:20 +1100
Subject: [PATCH] Enable Improved ping sending
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 410148f..0c36785 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -51,6 +51,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public int newLevel = 0;
public int newTotalExp = 0;
public boolean keepLevel = false;
+ public int lastPing = -1; // Spigot
// CraftBukkit end
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, PlayerInteractManager playerinteractmanager) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index da7ad33..eb3e7a4 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -715,7 +715,23 @@ public abstract class PlayerList {
this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.ping));
}
// CraftBukkit end */
+ // Spigot start
+ if (this.players.size() == 0 || !org.bukkit.craftbukkit.Spigot.tabPing) {
+ return;
+ }
+ int index = MinecraftServer.currentTick % this.players.size();
+ EntityPlayer player = (EntityPlayer) this.players.get(index);
+ if (player.lastPing == -1 || Math.abs(player.ping - player.lastPing) > 20) {
+ Packet packet = new Packet201PlayerInfo(player.listName, true, player.ping);
+ for (EntityPlayer splayer : (List<EntityPlayer>) this.players) {
+ if (splayer.getBukkitEntity().canSee(player.getBukkitEntity())) {
+ splayer.playerConnection.sendPacket(packet);
+ }
+ }
+ player.lastPing = player.ping;
+ }
}
+ // Spigot end
public void sendAll(Packet packet) {
for (int i = 0; i < this.players.size(); ++i) {
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index a62ba24..8fa8c7a 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -31,6 +31,7 @@ settings:
command-complete: true
spam-exclusions:
- /skill
+ tab-ping: false
timeout-time: 30
restart-on-crash: false
restart-script-location: /path/to/server/start.sh
--
1.8.2.1

View File

@ -1,4 +1,4 @@
From cef07032eb0f842a3bf3eca993c1e2e96577d1b9 Mon Sep 17 00:00:00 2001
From 04a504fe30ba197d5a30793c803fc9c7b76e854e Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 4 Mar 2013 18:45:52 +1100
Subject: [PATCH] PlayerItemDamageEvent

View File

@ -1,4 +1,4 @@
From 70a96d7f8788457918d0589525e52ae25150f14b Mon Sep 17 00:00:00 2001
From 4142700c0a04df9c84ecaf0f0335b21007738d3c Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 17 Mar 2013 19:02:50 +1100
Subject: [PATCH] Faster UUID for entities
@ -6,7 +6,7 @@ Subject: [PATCH] Faster UUID for entities
It is overkill to create a new SecureRandom on each entity create and then use it to make a new Entity ID for every entity instance created. Instead we will just use a pseudo random UUID based off the random instance we already have.
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 4ea11ef..aafaf17 100644
index f5203bc..c40cf71 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -153,7 +153,7 @@ public abstract class Entity {

View File

@ -1,4 +1,4 @@
From d5554a2530aeb3d902568c8322958ebd5682bd29 Mon Sep 17 00:00:00 2001
From ad179d783354fc275ce6179baa4f3aee87bce151 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 18 Mar 2013 20:01:44 +1100
Subject: [PATCH] Prevent NPE in CraftSign

View File

@ -1,4 +1,4 @@
From a29d0342ea74fe128d8426b2c921d91d5d9c67c2 Mon Sep 17 00:00:00 2001
From 3116090aeb1eba119fb6d7e88b8e5ce4c00bb572 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 21 Mar 2013 17:00:54 +1100
Subject: [PATCH] Stage DataWatcher & WatchableObject.

View File

@ -1,4 +1,4 @@
From bb5b98566ebcbdd63ca9d1729d66767922eb4210 Mon Sep 17 00:00:00 2001
From fa5bc82c34335eb448068696234cb65abd6062cc Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Feb 2013 11:58:47 -0500
Subject: [PATCH] Entity Tracking Ranges
@ -12,7 +12,7 @@ This has multiple benefits:
4) Less client lag - Not trying to render distant item frames and paintings and entities will reduce entity count on the client, which is major for shop/town worlds which may use tons of item frames.
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index db62084..32ce51d 100644
index d7efe3e..f6f1ab0 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -90,6 +90,7 @@ public class EntityTracker {
@ -113,10 +113,10 @@ index ac99395..92259e5 100644
+ }
}
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index 8fa8c7a..35056d9 100644
index a62ba24..1a36f67 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -53,6 +53,11 @@ world-settings:
@@ -52,6 +52,11 @@ world-settings:
entity-activation-range-animals: 32
entity-activation-range-monsters: 32
entity-activation-range-misc: 16

View File

@ -1,4 +1,4 @@
From c309d1fe6d2ecd6340605ecc218bc7937ec4a329 Mon Sep 17 00:00:00 2001
From d2a26e33dd6a08ef8da132d4d60c3dfe99f4155f Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 11:15:11 +1100
Subject: [PATCH] BungeeCord Support
@ -48,10 +48,10 @@ index 92259e5..b5953ce 100644
if (metrics == null) {
try {
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index 35056d9..df8dfaa 100644
index 1a36f67..968ab97 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -35,6 +35,8 @@ settings:
@@ -34,6 +34,8 @@ settings:
timeout-time: 30
restart-on-crash: false
restart-script-location: /path/to/server/start.sh

View File

@ -1,4 +1,4 @@
From 48f767873e99e1669e5a416a5ab4e10868310637 Mon Sep 17 00:00:00 2001
From 19e13ebce6d8cc9e1303a1d46d8dddcfa57227c9 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 13:04:45 +1100
Subject: [PATCH] Texture Pack Resolutions
@ -6,7 +6,7 @@ Subject: [PATCH] Texture Pack Resolutions
Fix issues when specifiying a server texture pack URL with resolution != 16.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4a9d711..8e02ca4 100644
index 65a4e9f..a1d77ad 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1075,7 +1075,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
@ -39,7 +39,7 @@ index b5953ce..504bd8b 100644
if (metrics == null) {
try {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index a913a1c..10bfb8b 100644
index 0b5ea21..f959fdf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -830,7 +830,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -52,10 +52,10 @@ index a913a1c..10bfb8b 100644
getHandle().playerConnection.sendPacket(new Packet250CustomPayload("MC|TPack", message));
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index df8dfaa..bc0b044 100644
index 968ab97..e440750 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -37,6 +37,7 @@ settings:
@@ -36,6 +36,7 @@ settings:
restart-script-location: /path/to/server/start.sh
bungee-proxies:
- 127.0.0.1

View File

@ -1,4 +1,4 @@
From 9b5abad12b525d3b0b7789e60e6b9fa26fca6ebf Mon Sep 17 00:00:00 2001
From 261bd1cb05e24f975cc4234f4b123fe7fc8a0f4a Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 19:08:41 +1100
Subject: [PATCH] Limit Custom Map Rendering

View File

@ -1,4 +1,4 @@
From 9f52a3d9490dbec19402662bbb36b262ad48d954 Mon Sep 17 00:00:00 2001
From 3f50b9cd6da196000d90c68ecf71cde67217680f Mon Sep 17 00:00:00 2001
From: Hudson <hudson@mydomain.com>
Date: Wed, 3 Apr 2013 02:16:56 -0500
Subject: [PATCH] Revert "Throw exception for disabled plugin tasks. Fixes

View File

@ -1,4 +1,4 @@
From cd7f57fb8f8b9f58801788e557b80a45c61cd882 Mon Sep 17 00:00:00 2001
From 86d1ac609f40c5005125e48b86fa2cd6b8621c77 Mon Sep 17 00:00:00 2001
From: Tyler Blair <hidendra@griefcraft.com>
Date: Tue, 9 Apr 2013 17:55:15 -0300
Subject: [PATCH] InventoryClickEvent now can return if the click was a double

View File

@ -1,23 +0,0 @@
From 8bb196c53f5128685dcbc47266ccb6b920a34271 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 13:31:23 +1100
Subject: [PATCH] Entity Tracking Intervals
Send boats at the same speed as their player to remove the illusion of lag / jerkiness.
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 32ce51d..7cd2c26 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -58,7 +58,7 @@ public class EntityTracker {
} else if (entity instanceof EntityMinecartAbstract) {
this.addEntity(entity, 80, 3, true);
} else if (entity instanceof EntityBoat) {
- this.addEntity(entity, 80, 3, true);
+ this.addEntity(entity, 80, 2, true); // Spigot - send at same speed as player
} else if (entity instanceof EntitySquid) {
this.addEntity(entity, 64, 3, true);
} else if (entity instanceof EntityWither) {
--
1.8.2.1

View File

@ -1,22 +0,0 @@
From 61037af4ec77e980df5cd7eba2e3af253da713bf Mon Sep 17 00:00:00 2001
From: Benjamin James Harrison-Sims <tehrainbowguy@gmail.com>
Date: Fri, 5 Apr 2013 18:13:35 +0100
Subject: [PATCH] Boat dupe fix.
diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java
index 8839a45..953e86c 100644
--- a/src/main/java/net/minecraft/server/EntityBoat.java
+++ b/src/main/java/net/minecraft/server/EntityBoat.java
@@ -294,7 +294,7 @@ public class EntityBoat extends Entity {
this.move(this.motX, this.motY, this.motZ);
if (this.positionChanged && d3 > 0.2D) {
- if (!this.world.isStatic) {
+ if (!this.world.isStatic && !this.dead) { // Spigot - Boat dupe fix
// CraftBukkit start
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
VehicleDestroyEvent destroyEvent = new VehicleDestroyEvent(vehicle, null);
--
1.8.2.1

View File

@ -1,22 +0,0 @@
From ca336d318f06163f3aeeb47fa2ae28c31a459c7d Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 29 Mar 2013 13:56:36 +1000
Subject: [PATCH] Anvil Exploit Fix
diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java
index a1d930c..540b2dc 100644
--- a/src/main/java/net/minecraft/server/Container.java
+++ b/src/main/java/net/minecraft/server/Container.java
@@ -337,7 +337,7 @@ public abstract class Container {
}
} else if (k == 4 && playerinventory.getCarried() == null && i >= 0) {
slot2 = (Slot) this.c.get(i);
- if (slot2 != null && slot2.d()) {
+ if (slot2 != null && slot2.d() && slot2.a(entityhuman)) { // Spigot
itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count);
slot2.a(entityhuman, itemstack1);
entityhuman.drop(itemstack1);
--
1.8.2.1