Round 1 of Spigot.yml / Spigot Rewrite / Spigot Cleanup is complete!

This commit is contained in:
md_5 2013-06-20 19:44:06 +10:00
parent 4e5ba04a5b
commit 8def048446
23 changed files with 155 additions and 285 deletions

View file

@ -1,4 +1,4 @@
From cdea9e85e90d8ad08e7391db9ef20b362a0d3965 Mon Sep 17 00:00:00 2001
From 9b13c53b9a7779891bd61377204d8d743c890839 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,68 +0,0 @@
From 169434d1db9c1d520028cbe61fb5a386db115c72 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
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 d197f06..e348ac5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1076,7 +1076,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
}
public int S() {
- return 16;
+ return org.bukkit.craftbukkit.Spigot.textureResolution; // Spigot
}
public abstract boolean T();
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index dd92087..99020e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -56,6 +56,7 @@ public class Spigot {
public static boolean tabPing = false;
private static Metrics metrics;
public static List<String> bungeeIPs;
+ public static int textureResolution = 16;
public static void initialize(CraftServer server, SimpleCommandMap commandMap, YamlConfiguration configuration) {
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
@@ -93,6 +94,7 @@ public class Spigot {
tabPing = configuration.getBoolean("settings.tab-ping", tabPing);
bungeeIPs = configuration.getStringList("settings.bungee-proxies");
+ textureResolution = configuration.getInt("settings.texture-resolution", textureResolution);
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 d70c110..3d39d07 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 {
public void setTexturePack(String url) {
Validate.notNull(url, "Texture pack URL cannot be null");
- byte[] message = (url + "\0" + "16").getBytes();
+ byte[] message = (url + "\0" + org.bukkit.craftbukkit.Spigot.textureResolution).getBytes(); // Spigot
Validate.isTrue(message.length <= Messenger.MAX_MESSAGE_SIZE, "Texture pack URL is too long");
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 2e3b242..4334b20 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -39,6 +39,7 @@ settings:
restart-script-location: /path/to/server/start.sh
bungee-proxies:
- 127.0.0.1
+ texture-resolution: 16
world-settings:
default:
growth-chunks-per-tick: 650
--
1.8.1.2

View file

@ -1,4 +1,4 @@
From bc47d2f19f661d565fa5a5836ae12611ca919b41 Mon Sep 17 00:00:00 2001
From 46f2ad93239b4f6c92b8187f4e6b54c6d19e9aa3 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 ce0a432bfc7a8c6d84276172bb03c4641a4fdf1f Mon Sep 17 00:00:00 2001
From 40640764e8461fdc97f93fad90d081b1ef8975f1 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
@ -20,7 +20,7 @@ index 9925d1b..5fa0b05 100644
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 e6e9295..d5387f3 100644
index e9b4c18..c61e959 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -724,7 +724,23 @@ public abstract class PlayerList {
@ -47,18 +47,6 @@ index e6e9295..d5387f3 100644
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 4334b20..5d2ef1f 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -34,6 +34,7 @@ settings:
spam-exclusions:
- /skill
filter-unsafe-ips: false
+ tab-ping: false
timeout-time: 30
restart-on-crash: false
restart-script-location: /path/to/server/start.sh
--
1.8.1.2

View file

@ -0,0 +1,27 @@
From ae91a14ab631e23dfaa70e8e5db25ce04e633421 Mon Sep 17 00:00:00 2001
From: Benjamin James Harrison-Sims <tehrainbowguy@gmail.com>
Date: Sun, 14 Apr 2013 21:19:57 +0500
Subject: [PATCH] Prevent handshake spam from invalid names.
diff --git a/src/main/java/net/minecraft/server/Packet2Handshake.java b/src/main/java/net/minecraft/server/Packet2Handshake.java
index 343af93..26de0b5 100644
--- a/src/main/java/net/minecraft/server/Packet2Handshake.java
+++ b/src/main/java/net/minecraft/server/Packet2Handshake.java
@@ -14,11 +14,13 @@ public class Packet2Handshake extends Packet {
public Packet2Handshake() {}
+ public static final java.util.regex.Pattern validName = java.util.regex.Pattern.compile("^[a-zA-Z0-9_-]{2,16}$");
public void a(DataInputStream datainputstream) throws IOException { // CraftBukkit - throws IOException
this.a = datainputstream.readByte();
this.b = a(datainputstream, 16);
this.c = a(datainputstream, 255);
this.d = datainputstream.readInt();
+ if(!validName.matcher(this.b).matches()) throw new IOException("Invalid name!"); // Spigot
}
public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException
--
1.8.1.2

View file

@ -1,60 +0,0 @@
From c1dcecdd3cca81c750580a70b1125012481fca7c Mon Sep 17 00:00:00 2001
From: Benjamin James Harrison-Sims <tehrainbowguy@gmail.com>
Date: Sun, 14 Apr 2013 21:19:57 +0500
Subject: [PATCH] Prevent handshake spam from invalid names.
diff --git a/src/main/java/net/minecraft/server/Packet2Handshake.java b/src/main/java/net/minecraft/server/Packet2Handshake.java
index 343af93..aa6609b 100644
--- a/src/main/java/net/minecraft/server/Packet2Handshake.java
+++ b/src/main/java/net/minecraft/server/Packet2Handshake.java
@@ -1,5 +1,7 @@
package net.minecraft.server;
+import org.bukkit.craftbukkit.Spigot;
+
import java.io.DataInputStream;
import java.io.DataOutputStream;
@@ -19,6 +21,7 @@ public class Packet2Handshake extends Packet {
this.b = a(datainputstream, 16);
this.c = a(datainputstream, 255);
this.d = datainputstream.readInt();
+ if(!Spigot.validName.matcher(this.b).matches()) throw new IOException("Invalid name!"); // Spigot
}
public void a(DataOutputStream dataoutputstream) throws IOException { // CraftBukkit - throws IOException
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index 99020e7..c7ef0e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -6,6 +6,7 @@ import java.net.InetAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
+import java.util.regex.Pattern;
import net.minecraft.server.AxisAlignedBB;
import net.minecraft.server.Chunk;
import net.minecraft.server.Entity;
@@ -57,6 +58,7 @@ public class Spigot {
private static Metrics metrics;
public static List<String> bungeeIPs;
public static int textureResolution = 16;
+ public static final Pattern validName = Pattern.compile("^[a-zA-Z0-9_-]{2,16}$");
public static void initialize(CraftServer server, SimpleCommandMap commandMap, YamlConfiguration configuration) {
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
@@ -384,7 +386,9 @@ public class Spigot {
}
/**
- * Gets the range an entity should be 'tracked' by players and visible in the client.
+ * Gets the range an entity should be 'tracked' by players and visible in
+ * the client.
+ *
* @param entity
* @param defaultRange Default range defined by Mojang
* @return
--
1.8.1.2

View file

@ -1,4 +1,4 @@
From 47715338fc2fd1041950cdcf86997d977d596b3d Mon Sep 17 00:00:00 2001
From a581070d4f85e5c3983652d21685db6369c2115d Mon Sep 17 00:00:00 2001
From: Ammar Askar <ammar@ammaraskar.com>
Date: Sat, 20 Apr 2013 12:26:20 +0500
Subject: [PATCH] Save entity counts for randomly spawned creatures to avoid

View file

@ -1,4 +1,4 @@
From 7ec562c76eba6f4ad566e41199e27c93d47d1399 Mon Sep 17 00:00:00 2001
From 8ebad61b5d641b61b642ad178ee8c9abfde0d53e Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 23 Apr 2013 11:50:27 +1000
Subject: [PATCH] Thread Naming and Tweaks
@ -6,7 +6,7 @@ Subject: [PATCH] Thread Naming and Tweaks
Removes the sleep forever thread and adds useful names for debugging to all staged thread files.
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index e4f1cbe..048196e 100644
index b2a4229..2a6250d 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -34,7 +34,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -31,7 +31,7 @@ index 489e184..bfd219c 100644
}
diff --git a/src/main/java/net/minecraft/server/ThreadLoginVerifier.java b/src/main/java/net/minecraft/server/ThreadLoginVerifier.java
index fb4ec7b..c15efc5 100644
index a4eae65..496cfe4 100644
--- a/src/main/java/net/minecraft/server/ThreadLoginVerifier.java
+++ b/src/main/java/net/minecraft/server/ThreadLoginVerifier.java
@@ -21,6 +21,7 @@ class ThreadLoginVerifier extends Thread {

View file

@ -1,4 +1,4 @@
From 7c270c3974b72f4338387b224b1bc3683062e721 Mon Sep 17 00:00:00 2001
From 93a348f809ef9fa14ea5276b433ee93d55e640a9 Mon Sep 17 00:00:00 2001
From: Antony Riley <antony@cyberiantiger.org>
Date: Wed, 27 Mar 2013 01:41:54 +0200
Subject: [PATCH] Close Unloaded World's Save Files
@ -18,7 +18,7 @@ index 900ed68..829f4a3 100644
public static synchronized RegionFile a(File file1, int i, int j) {
File file2 = new File(file1, "region");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2485ef9..b6fe332 100644
index 7f5f3ea..3b58d23 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -37,6 +37,8 @@ import net.minecraft.server.MinecraftServer;
@ -30,7 +30,7 @@ index 2485ef9..b6fe332 100644
import net.minecraft.server.ServerNBTManager;
import net.minecraft.server.WorldLoaderServer;
import net.minecraft.server.WorldManager;
@@ -831,6 +833,30 @@ public final class CraftServer implements Server {
@@ -809,6 +811,30 @@ public final class CraftServer implements Server {
worlds.remove(world.getName().toLowerCase());
console.worlds.remove(console.worlds.indexOf(handle));

View file

@ -1,4 +1,4 @@
From 74f1a8847b7ddcd2384478a03bec9f0bced13808 Mon Sep 17 00:00:00 2001
From 72faab2a4b5943d65aa75c3b746b2306c85a32d0 Mon Sep 17 00:00:00 2001
From: snowleo <schneeleo@gmail.com>
Date: Wed, 8 May 2013 12:09:45 +1000
Subject: [PATCH] Optimized version of LocaleLanguage

View file

@ -1,4 +1,4 @@
From 6ea72294e723e6676db69b32f206f029b2833210 Mon Sep 17 00:00:00 2001
From 9531eb712fffefc655e0e254b93d671019da2bdd Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Wed, 24 Apr 2013 01:43:33 -0500
Subject: [PATCH] Improve next-tick-list performance on chunk unloads, large
@ -19,7 +19,7 @@ index 52a70a1..08a4240 100644
public NextTickListEntry a(long i) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 7b8e70c..93e7b9b 100644
index 69d955f..7cdb549 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -25,8 +25,8 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@ -41,9 +41,9 @@ index 7b8e70c..93e7b9b 100644
+ private ArrayList<NextTickListEntry> pendingTickEntries = new ArrayList<NextTickListEntry>(); // Spigot
+ private int nextPendingTickEntry; // Spigot
private IntHashMap entitiesById;
private int aggregateTicks = 1; // Spigot
@@ -54,13 +55,15 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
// CraftBukkit start
@@ -53,13 +54,15 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
this.entitiesById = new IntHashMap();
}
@ -63,7 +63,7 @@ index 7b8e70c..93e7b9b 100644
this.P = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
this.scoreboard = new ScoreboardServer(minecraftserver);
@@ -446,9 +449,16 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -441,9 +444,16 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
}
public boolean a(int i, int j, int k, int l) {
@ -83,7 +83,7 @@ index 7b8e70c..93e7b9b 100644
}
public void a(int i, int j, int k, int l, int i1) {
@@ -481,10 +491,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -476,10 +486,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
nextticklistentry.a(j1);
}
@ -97,7 +97,7 @@ index 7b8e70c..93e7b9b 100644
}
}
@@ -496,10 +505,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -491,10 +500,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
nextticklistentry.a((long) i1 + this.worldData.getTime());
}
@ -111,7 +111,7 @@ index 7b8e70c..93e7b9b 100644
}
public void tickEntities() {
@@ -519,11 +527,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -514,11 +522,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
}
public boolean a(boolean flag) {
@ -128,7 +128,7 @@ index 7b8e70c..93e7b9b 100644
if (i > 1000) {
// CraftBukkit start - If the server has too much to process over time, try to alleviate that
if (i > 20 * 1000) {
@@ -539,23 +548,24 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -534,23 +543,24 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
NextTickListEntry nextticklistentry;
for (int j = 0; j < i; ++j) {
@ -162,7 +162,7 @@ index 7b8e70c..93e7b9b 100644
byte b0 = 0;
if (this.e(nextticklistentry.a - b0, nextticklistentry.b - b0, nextticklistentry.c - b0, nextticklistentry.a + b0, nextticklistentry.b + b0, nextticklistentry.c + b0)) {
@@ -586,52 +596,18 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -581,52 +591,18 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
}
this.methodProfiler.b();
@ -224,7 +224,7 @@ index 7b8e70c..93e7b9b 100644
}
public void entityJoinedWorld(Entity entity, boolean flag) {
@@ -708,13 +684,15 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -703,13 +679,15 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
this.entitiesById = new IntHashMap();
}
@ -244,7 +244,7 @@ index 7b8e70c..93e7b9b 100644
this.b(worldsettings);
super.a(worldsettings);
@@ -1001,4 +979,62 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
@@ -996,4 +974,62 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
return this.setTypeIdAndData(x, y, z, typeId, data, 3);
}
// CraftBukkit end

View file

@ -1,4 +1,4 @@
From cd7d8ce5ba9c942a20b7c740075824f042a4a5a2 Mon Sep 17 00:00:00 2001
From 375ef52cac5e16e1375dc9428262dd691dc3c034 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 19 May 2013 18:29:48 +1000
Subject: [PATCH] Remove -o Option

View file

@ -1,4 +1,4 @@
From 447a2540b8e5a301acf27915d2423d9b2ff98a49 Mon Sep 17 00:00:00 2001
From 42746263ae062c4cfe850bdda0cf2118e722e0dc Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 1 Jun 2013 16:34:38 +1000
Subject: [PATCH] Recipe Deconstruction

View file

@ -1,4 +1,4 @@
From 56451612f8d3f8100ddecca4f72ed97c69b20be1 Mon Sep 17 00:00:00 2001
From be8e4ab02339079e2041fb9c48e8f209865d374b Mon Sep 17 00:00:00 2001
From: Nick Minkler <sleaker@gmail.com>
Date: Sun, 2 Jun 2013 14:54:11 +1000
Subject: [PATCH] Fix Health Scaling

View file

@ -1,4 +1,4 @@
From b4cca3cf71f2fe61f71edfdacded8a751ccab99e Mon Sep 17 00:00:00 2001
From 55a0a124577e32e4dfb70ae447c9ddd8568075cd Mon Sep 17 00:00:00 2001
From: Nick Minkler <sleaker@gmail.com>
Date: Sun, 2 Jun 2013 15:04:37 +1000
Subject: [PATCH] Fix EntityShootBowEvent with Skeletons

View file

@ -1,4 +1,4 @@
From fd7a9cd07230c70af60b51327a2dc29657e3b64d Mon Sep 17 00:00:00 2001
From d255de2f39d158f0e7ecb8039c9f976d03baddcb Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:16:05 +1000
Subject: [PATCH] Implement Arrow API

View file

@ -1,4 +1,4 @@
From 4fde28828a4820deccf067f854ecae8e3eb8996b Mon Sep 17 00:00:00 2001
From b15953996bfacb57262151924528753e9ebd5099 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 16:14:30 +1000
Subject: [PATCH] Particle API
@ -43,10 +43,10 @@ index 7de0de5..7eca388 100644
datavalue = 0;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 4439ebc..56d3d32 100644
index edc59b1..0778a66 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -885,31 +885,21 @@ public class CraftWorld implements World {
@@ -766,31 +766,21 @@ public class CraftWorld implements World {
} else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
}
@ -88,7 +88,7 @@ index 4439ebc..56d3d32 100644
public <T extends Entity> T spawn(Location location, Class<T> clazz) throws IllegalArgumentException {
return spawn(location, clazz, SpawnReason.CUSTOM);
}
@@ -1388,6 +1378,62 @@ public class CraftWorld implements World {
@@ -1269,6 +1259,62 @@ public class CraftWorld implements World {
// Spigot start
private final Spigot spigot = new Spigot()
{
@ -152,7 +152,7 @@ index 4439ebc..56d3d32 100644
public Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3d39d07..8ee2c3b 100644
index d70c110..43e953e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -266,13 +266,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -236,5 +236,5 @@ index 3d39d07..8ee2c3b 100644
public Spigot spigot()
--
1.8.3
1.8.1.2

View file

@ -0,0 +1,86 @@
From 36772025aed5f5fdbac6cdee69450f411ee4f462 Mon Sep 17 00:00:00 2001
From: DerFlash <bte@freenet.de>
Date: Sun, 2 Jun 2013 16:23:46 +1000
Subject: [PATCH] Hopper Cooldowns
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index f6d269d..1f69c7b 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -181,16 +181,19 @@ public class TileEntityHopper extends TileEntity implements IHopper {
boolean flag = this.u() | suckInItems(this);
if (flag) {
- this.c(8);
+ this.c(world.spigotConfig.hopperTransfer); // Spigot
this.update();
return true;
}
}
-
- return false;
- } else {
- return false;
}
+ // Spigot start
+ if ( this.c == 0 )
+ {
+ this.c( world.spigotConfig.hopperCheck );
+ }
+ // Spigot end
+ return false;
}
private boolean u() {
@@ -217,7 +220,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
this.getWorld().getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
this.setItem(i, itemstack);
- this.c(8); // Delay hopper checks
+ this.c(world.spigotConfig.hopperTransfer); // Spigot
return false;
}
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.c(this.p())]);
@@ -298,9 +301,9 @@ public class TileEntityHopper extends TileEntity implements IHopper {
iinventory.setItem(i, itemstack1);
if (ihopper instanceof TileEntityHopper) {
- ((TileEntityHopper) ihopper).c(8); // Delay hopper checks
+ ((TileEntityHopper) ihopper).c(ihopper.getWorld().spigotConfig.hopperTransfer); // Spigot
} else if (ihopper instanceof EntityMinecartHopper) {
- ((EntityMinecartHopper) ihopper).n(4); // Delay hopper minecart checks
+ ((EntityMinecartHopper) ihopper).n(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot
}
return false;
@@ -404,7 +407,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (flag) {
if (iinventory instanceof TileEntityHopper) {
- ((TileEntityHopper) iinventory).c(8);
+ ((TileEntityHopper) iinventory).c(((TileEntityHopper) iinventory).world.spigotConfig.hopperTransfer); // Spigot
}
iinventory.update();
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 86d6939..9cc89a3 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -183,4 +183,13 @@ public class SpigotWorldConfig
maxTrackingRange = getInt( "entity-tracking-range.other", maxTrackingRange );
log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + maxTrackingRange );
}
+
+ public int hopperTransfer = 8;
+ public int hopperCheck = 8;
+ private void hoppers()
+ {
+ hopperCheck = getInt( "ticks-per.hopper-check", hopperCheck );
+ hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer );
+ log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck );
+ }
}
--
1.8.1.2

View file

@ -1,103 +0,0 @@
From eb047d75ceeb8a7efd65347ced86047bb40205e7 Mon Sep 17 00:00:00 2001
From: DerFlash <bte@freenet.de>
Date: Sun, 2 Jun 2013 16:23:46 +1000
Subject: [PATCH] Hopper Cooldowns
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index f6d269d..88b2cb0 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -181,16 +181,19 @@ public class TileEntityHopper extends TileEntity implements IHopper {
boolean flag = this.u() | suckInItems(this);
if (flag) {
- this.c(8);
+ this.c(org.bukkit.craftbukkit.Spigot.hopperTransferCooldown); // Spigot
this.update();
return true;
}
}
-
- return false;
- } else {
- return false;
}
+ // Spigot start
+ if ( this.c == 0 )
+ {
+ this.c( org.bukkit.craftbukkit.Spigot.hopperCheckCooldown );
+ }
+ // Spigot end
+ return false;
}
private boolean u() {
@@ -217,7 +220,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
this.getWorld().getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
this.setItem(i, itemstack);
- this.c(8); // Delay hopper checks
+ this.c(org.bukkit.craftbukkit.Spigot.hopperTransferCooldown); // Spigot
return false;
}
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), Facing.OPPOSITE_FACING[BlockHopper.c(this.p())]);
@@ -298,9 +301,9 @@ public class TileEntityHopper extends TileEntity implements IHopper {
iinventory.setItem(i, itemstack1);
if (ihopper instanceof TileEntityHopper) {
- ((TileEntityHopper) ihopper).c(8); // Delay hopper checks
+ ((TileEntityHopper) ihopper).c(org.bukkit.craftbukkit.Spigot.hopperTransferCooldown); // Spigot
} else if (ihopper instanceof EntityMinecartHopper) {
- ((EntityMinecartHopper) ihopper).n(4); // Delay hopper minecart checks
+ ((EntityMinecartHopper) ihopper).n(org.bukkit.craftbukkit.Spigot.hopperTransferCooldown / 2); // Spigot
}
return false;
@@ -404,7 +407,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (flag) {
if (iinventory instanceof TileEntityHopper) {
- ((TileEntityHopper) iinventory).c(8);
+ ((TileEntityHopper) iinventory).c(org.bukkit.craftbukkit.Spigot.hopperTransferCooldown); // Spigot
}
iinventory.update();
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index c7ef0e1..bbfcd97 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -59,6 +59,8 @@ public class Spigot {
public static List<String> bungeeIPs;
public static int textureResolution = 16;
public static final Pattern validName = Pattern.compile("^[a-zA-Z0-9_-]{2,16}$");
+ public static int hopperTransferCooldown = 8;
+ public static int hopperCheckCooldown = 8;
public static void initialize(CraftServer server, SimpleCommandMap commandMap, YamlConfiguration configuration) {
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
@@ -97,6 +99,8 @@ public class Spigot {
tabPing = configuration.getBoolean("settings.tab-ping", tabPing);
bungeeIPs = configuration.getStringList("settings.bungee-proxies");
textureResolution = configuration.getInt("settings.texture-resolution", textureResolution);
+ hopperTransferCooldown = configuration.getInt("ticks-per.hopper-transfer", hopperTransferCooldown);
+ hopperCheckCooldown = configuration.getInt("ticks-per.hopper-check", hopperCheckCooldown);
if (metrics == null) {
try {
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index 5d2ef1f..c056762 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -83,6 +83,8 @@ ticks-per:
animal-spawns: 400
monster-spawns: 1
autosave: 0
+ hopper-transfer: 8
+ hopper-check: 8
auto-updater:
enabled: true
on-broken: [warn-console, warn-ops]
--
1.8.1.2

View file

@ -1,4 +1,4 @@
From 88c21014a866791f3be6e9b2c8778eb6dda3d506 Mon Sep 17 00:00:00 2001
From fdd4ba069b61f6dde73fbf37852dc2e5b99a09ee Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 11 Jun 2013 11:54:32 +1000
Subject: [PATCH] Prevent Shutdown Hang
@ -6,7 +6,7 @@ Subject: [PATCH] Prevent Shutdown Hang
Prevents server hanging if players disconnect during the shutdown sequence.
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index d5387f3..e5d2710 100644
index c61e959..8b58243 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -1071,7 +1071,14 @@ public abstract class PlayerList {

View file

@ -1,4 +1,4 @@
From 7166f5c5d632bd3598ae824985e27a73a9befd2c Mon Sep 17 00:00:00 2001
From c8083dfc6564728b5f536ca9696add3be6b6c246 Mon Sep 17 00:00:00 2001
From: Andy Shulman <andy.shulman@hotmail.com>
Date: Mon, 15 Apr 2013 20:06:37 -0500
Subject: [PATCH] Implement SpawnerSpawnEvent.

View file

@ -1,4 +1,4 @@
From 6eb432158c3fde080bddf7a8e643b5c355bd023e Mon Sep 17 00:00:00 2001
From 28e3a04e9578daab00bac557fb9f8ec7246b35af Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 15 Jun 2013 21:34:48 +1000
Subject: [PATCH] Firework Meta Crash Fix

View file

@ -1,4 +1,4 @@
From f0c3892e80dc22f3fb93e7ee8177da61c7c54204 Mon Sep 17 00:00:00 2001
From 73b733afa224073a9ea2f64bafcc94db3230e8e0 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 16 Jun 2013 08:20:26 +1000
Subject: [PATCH] Do Not Search for Offline Players
@ -6,10 +6,10 @@ Subject: [PATCH] Do Not Search for Offline Players
By default we do not want to search as this leads to massive load times for plugins wanting to do mass data lookups.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b6fe332..76659bc 100644
index 3b58d23..71643cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1108,7 +1108,7 @@ public final class CraftServer implements Server {
@@ -1086,7 +1086,7 @@ public final class CraftServer implements Server {
}
public OfflinePlayer getOfflinePlayer(String name) {