Update to Minecraft 1.9

This commit is contained in:
md_5 2016-03-01 08:33:06 +11:00 committed by Zach Brown
parent f41e8a3d0a
commit adb92a86db
194 changed files with 2408 additions and 4577 deletions

View File

@ -1,11 +1,11 @@
From 43ea4b8812178c2ba6431f28b9b492138335538e Mon Sep 17 00:00:00 2001
From a583c578d388bff0e1deb7c3aafd935cd9d1dbb5 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 10:36:24 +1000
Subject: [PATCH] POM Changes
diff --git a/pom.xml b/pom.xml
index a2bdfbc..70d5ff8 100644
index c893bd2..a633a78 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,14 +9,14 @@
@ -16,7 +16,7 @@ index a2bdfbc..70d5ff8 100644
- <artifactId>bukkit</artifactId>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<version>1.9-SNAPSHOT</version>
<packaging>jar</packaging>
- <name>Bukkit</name>
@ -29,5 +29,5 @@ index a2bdfbc..70d5ff8 100644
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From ec04cd369a98a9016ae00a8237a9b5b5835528ab Mon Sep 17 00:00:00 2001
From 307267c4b0b17ad241ae7ad8f8baf106a3408002 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 2 Jun 2013 10:42:57 +1000
Subject: [PATCH] Spigot Timings
@ -8,10 +8,10 @@ Adds performance tracking timings all around the Minecraft Server, and improves
Plugins can track their own timings with CustomTimingsHandler
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index d7b88d6..818bfd4 100644
index 2ace8c1..e61e50b 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -542,6 +542,7 @@ public final class Bukkit {
@@ -546,6 +546,7 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@ -19,7 +19,7 @@ index d7b88d6..818bfd4 100644
}
/**
@@ -1138,4 +1139,9 @@ public final class Bukkit {
@@ -1156,4 +1157,9 @@ public final class Bukkit {
public static UnsafeValues getUnsafe() {
return server.getUnsafe();
}
@ -30,10 +30,10 @@ index d7b88d6..818bfd4 100644
+ }
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c2f5de4..f4aa4a8 100644
index 60bcec8..5ca4321 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -932,4 +932,15 @@ public interface Server extends PluginMessageRecipient {
@@ -948,4 +948,15 @@ public interface Server extends PluginMessageRecipient {
*/
@Deprecated
UnsafeValues getUnsafe();
@ -264,7 +264,7 @@ index a39ea5d..fc59aa3 100644
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index e51658d..1a61ad3 100644
index 5a9e50d..c9d23d6 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -295,6 +295,7 @@ public final class SimplePluginManager implements PluginManager {
@ -496,5 +496,5 @@ index 0000000..8d98297
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 2d16a2bd0871f1eb71f53b0f2949a99269f0dbda Mon Sep 17 00:00:00 2001
From 654acca108839b65a772cce9154c6f177249256b Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 4 Mar 2013 18:31:20 +1100
Subject: [PATCH] Add PlayerItemDamageEvent
@ -65,5 +65,5 @@ index 0000000..38a72ab
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,18 +1,17 @@
From b351cd2f9562eff94b8a32f0f3cf1c066cd48690 Mon Sep 17 00:00:00 2001
From 8f696725c1b35a064cd4fed84209f226b342b3f7 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:20:49 +1000
Subject: [PATCH] BungeeCord Support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1b54b48..ced2d6b 100644
index 723464b..6444fdf 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1076,4 +1076,23 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1272,4 +1272,22 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
*/
@Deprecated
public void resetTitle();
+
public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data);
+ // Spigot start
+ public class Spigot extends Entity.Spigot
+ {
@ -99,5 +98,5 @@ index 68834dd..4bc024f 100644
* Gets the current result of the login, as an enum
*
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 5a6f3e6ac8d2c3b6a5600e89231a293af7ce03c8 Mon Sep 17 00:00:00 2001
From 52741b1442b0a31830c4fc0fed12941f4952e1ff Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:08:24 +1000
Subject: [PATCH] Add Arrow API
@ -30,5 +30,5 @@ index e49eef0..e7a32f7 100644
+ Spigot spigot();
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From b46e9679728dcaa4782c6ce491897cfc8c978ab2 Mon Sep 17 00:00:00 2001
From b7f4ea781b3c25795d0e7634b088c70265d6d0cc Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:57:09 +1000
Subject: [PATCH] Add Particle API
@ -271,10 +271,10 @@ index 2474a2d..37f29e2 100644
+ public enum Type {SOUND, VISUAL, PARTICLE}
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 127ad9d..6613286 100644
index 5cc1fec..5ce8f05 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1183,6 +1183,56 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -1159,6 +1159,56 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public boolean isGameRule(String rule);
@ -332,10 +332,10 @@ index 127ad9d..6613286 100644
* Gets the world border for this world.
*
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index ced2d6b..c136208 100644
index 6444fdf..77ddf68 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1091,6 +1091,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1286,6 +1286,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -365,5 +365,5 @@ index 08aa71d..5217aec 100644
}
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From e982d761707c7b217a88c4f9238feeaeaba4858d Mon Sep 17 00:00:00 2001
From 04ee5f8788f7610f2486fe64de77113c126dbba1 Mon Sep 17 00:00:00 2001
From: Andy Shulman <andy.shulman@hotmail.com>
Date: Mon, 15 Apr 2013 20:06:01 -0500
Subject: [PATCH] Define EntitySpawnEvent and SpawnerSpawnEvent
@ -6,11 +6,11 @@ Subject: [PATCH] Define EntitySpawnEvent and SpawnerSpawnEvent
Defines EntitySpawnEvent and SpawnerSpawnEvent. Adds BUKKIT-267 and BUKKIT-1559
diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index 288e98b..8883157 100644
index c035b37..9dd8ef1 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -4,17 +4,13 @@ import org.bukkit.Location;
import org.bukkit.entity.CreatureType;
@@ -3,17 +3,13 @@ package org.bukkit.event.entity;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
-import org.bukkit.event.Cancellable;
@ -28,8 +28,8 @@ index 288e98b..8883157 100644
private final SpawnReason spawnReason;
public CreatureSpawnEvent(final LivingEntity spawnee, final SpawnReason spawnReason) {
@@ -28,29 +24,12 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
spawnReason = reason;
@@ -21,29 +17,12 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
this.spawnReason = spawnReason;
}
- public boolean isCancelled() {
@ -55,10 +55,10 @@ index 288e98b..8883157 100644
- }
-
- /**
* Gets the type of creature being spawned.
* Gets the reason for why the creature is being spawned.
*
* @return A CreatureType value detailing the type of creature being
@@ -72,15 +51,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
* @return A SpawnReason value detailing the reason for the creature being
@@ -53,15 +32,6 @@ public class CreatureSpawnEvent extends EntityEvent implements Cancellable {
return spawnReason;
}
@ -216,5 +216,5 @@ index 0000000..1acb3c4
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 246b47b22a286b0e8bd36082f636a6edeb3d7284 Mon Sep 17 00:00:00 2001
From a9eaefd368301b5c4864045a44fa1342ae68268f Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 2 Jul 2013 20:32:53 +1000
Subject: [PATCH] Entity Mount and Dismount Events
@ -108,5 +108,5 @@ index 0000000..16aa2a7
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 8a80ebccc9555a300c001caf8a8984f12a86f326 Mon Sep 17 00:00:00 2001
From 079a3005be2ade43d449b78816220b755c8e2d10 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 7 Jul 2013 10:32:05 -0400
Subject: [PATCH] InventoryClickEvent getClickedInventory
@ -50,5 +50,5 @@ index 28198b8..3313d91 100644
*
* @return the slot type
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 0244c6a138d2d14eebedef0b3fa06570d1772e87 Mon Sep 17 00:00:00 2001
From 80ef0d7b1087f5fe6f649ae203c725955572e767 Mon Sep 17 00:00:00 2001
From: Alex Bennett <alex.eugene.bennett@gmail.com>
Date: Thu, 11 Jul 2013 15:31:32 -0500
Subject: [PATCH] Added getAllSessionData() to the Conversation API.
@ -24,5 +24,5 @@ index 4f33ff4..7390a77 100644
* this as a way to pass data through each Prompt as the conversation
* develops.
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From f58f3bf04a2bb21880cc76e09196a57eddc44c6d Mon Sep 17 00:00:00 2001
From 2a5b8a50c4a4f099b3c55f04fb67aa7167a0ab17 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 22 Jul 2013 19:09:43 +1000
Subject: [PATCH] Catch Conversation API Errors
@ -30,5 +30,5 @@ index d4c1f6d..46912c8 100644
/**
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 6cac32aab7e7270acc0c3a3802a833007301a755 Mon Sep 17 00:00:00 2001
From 44dd38e7430e311b08d019670af02ba95edd264e Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:20:50 +1000
Subject: [PATCH] Player Collision API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index c136208..2d054ba 100644
index 77ddf68..146fbd4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1096,6 +1096,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1291,6 +1291,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -37,5 +37,5 @@ index c136208..2d054ba 100644
Spigot spigot();
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From cbb9593827fba7ecf040fab1fc0a0794a78345c2 Mon Sep 17 00:00:00 2001
From 038d1beb08ab34c9ca9e184dec9fdc83887bb0f0 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:42:16 +1000
Subject: [PATCH] Expand Boolean Prompt Values
@ -24,5 +24,5 @@ index 3f2c97f..81ef78c 100644
}
--
2.1.4
2.5.0

View File

@ -1,17 +1,17 @@
From 3058e4ccec6de64c7c0a94fefecebaf76cae104c Mon Sep 17 00:00:00 2001
From d5ab308d68818daf36befd871e7e2ace01d23479 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:49:36 +1000
Subject: [PATCH] Add Getter for Entity Invulnerability
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index de7815f..7fb08af 100644
index 6dc7076..9f4d48b 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -342,4 +342,22 @@ public interface Entity extends Metadatable, CommandSender {
* @return if the custom name is displayed
@@ -356,4 +356,22 @@ public interface Entity extends Metadatable, CommandSender {
* @return whether the entity is glowing
*/
public boolean isCustomNameVisible();
boolean isGlowing();
+
+ // Spigot Start
+ public class Spigot
@ -32,5 +32,5 @@ index de7815f..7fb08af 100644
+ // Spigot End
}
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 76c4f71d40ca15b885666c5425f5b3c8a6269b26 Mon Sep 17 00:00:00 2001
From 23765cfe217052f421684a8ba05260245d33b2ec Mon Sep 17 00:00:00 2001
From: ninja- <xninja@openmailbox.org>
Date: Tue, 8 Oct 2013 14:35:58 +0200
Subject: [PATCH] Add respawn API.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2d054ba..b7f4e9e 100644
index 146fbd4..a9bdfde 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1117,6 +1117,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1312,6 +1312,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -24,5 +24,5 @@ index 2d054ba..b7f4e9e 100644
Spigot spigot();
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 32283d1dd78f712e95675f00ae2241651ec87068 Mon Sep 17 00:00:00 2001
From f0c7705947c6a451e14395327a4a99a8d410daf4 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 19 Oct 2013 12:59:42 +1100
Subject: [PATCH] Fix Plugin Message API Disconnects
@ -26,5 +26,5 @@ index a906f8d..4c171e8 100644
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From baf98de9c6282b4a8d61b2c853fd2fb070b9a180 Mon Sep 17 00:00:00 2001
From c29cf606489a4e59e68a6c93e17200afe054c25d Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 24 Dec 2013 10:14:25 +1100
Subject: [PATCH] Fix Tab Completion for Some Commands
@ -81,5 +81,5 @@ index 7e5494d..e168b49 100644
+ // Spigot End
}
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 32427451524d58b5096de3be5a98c1a9041dcacd Mon Sep 17 00:00:00 2001
From ab2d9521139e82f956683828c60f506fdf6a0da2 Mon Sep 17 00:00:00 2001
From: Smove <jan@lavasurvival.net>
Date: Sat, 1 Feb 2014 18:10:49 +1100
Subject: [PATCH] Implement Locale Getter for Players
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b7f4e9e..41b7b3c 100644
index a9bdfde..43ef5b1 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1125,6 +1125,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1320,6 +1320,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -26,5 +26,5 @@ index b7f4e9e..41b7b3c 100644
Spigot spigot();
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From ced760bab62605d3cccbf4886a70d3d9f0e272a5 Mon Sep 17 00:00:00 2001
From c5fe30d39567423a3ad99602b7b16e9fea60de23 Mon Sep 17 00:00:00 2001
From: Tux <write@imaginarycode.com>
Date: Sun, 9 Feb 2014 14:02:11 -0500
Subject: [PATCH] Add support for fetching hidden players
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 41b7b3c..0f59c07 100644
index 43ef5b1..eb5084b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1135,6 +1135,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1330,6 +1330,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -26,5 +26,5 @@ index 41b7b3c..0f59c07 100644
Spigot spigot();
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From b7f82738214b66303a80cf45d071c43cefce2e4c Mon Sep 17 00:00:00 2001
From 9a96f7e60f3b3f14e8b93ced586c7dd7382aa18d Mon Sep 17 00:00:00 2001
From: drXor <mcyoungsota@gmail.com>
Date: Sun, 23 Feb 2014 16:16:29 -0400
Subject: [PATCH] Silenceable Lightning API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6613286..2772b09 100644
index 5ce8f05..4125633 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1228,6 +1228,30 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -1204,6 +1204,30 @@ public interface World extends PluginMessageRecipient, Metadatable {
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -66,5 +66,5 @@ index c8b5154..1ed4ac9 100644
+ Spigot spigot();
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 986a5a9ab066bf672dfba0e657c47830768bc5a9 Mon Sep 17 00:00:00 2001
From f539a053099a090b756663ea24cb1138e398501a Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 30 Mar 2014 15:58:22 +1100
Subject: [PATCH] Remove deprecation on some player lookup methods
@ -6,10 +6,10 @@ Subject: [PATCH] Remove deprecation on some player lookup methods
Most of these methods still have plenty of use given that only one player with each name can exist at a time. Deprecating these methods renders even basic functionality such as /msg <name> impossible without causing compiler warnings. We will maintain this API and it should be considered safe and appropriate for most use cases.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 818bfd4..584fe11 100644
index e61e50b..dc2c9d1 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -373,12 +373,9 @@ public final class Bukkit {
@@ -377,12 +377,9 @@ public final class Bukkit {
* <p>
* This method may not return objects for offline players.
*
@ -22,7 +22,7 @@ index 818bfd4..584fe11 100644
public static Player getPlayer(String name) {
return server.getPlayer(name);
}
@@ -386,12 +383,9 @@ public final class Bukkit {
@@ -390,12 +387,9 @@ public final class Bukkit {
/**
* Gets the player with the exact given name, case insensitive.
*
@ -35,7 +35,7 @@ index 818bfd4..584fe11 100644
public static Player getPlayerExact(String name) {
return server.getPlayerExact(name);
}
@@ -403,12 +397,9 @@ public final class Bukkit {
@@ -407,12 +401,9 @@ public final class Bukkit {
* This list is not sorted in any particular order. If an exact match is
* found, the returned list will only contain a single result.
*
@ -49,10 +49,10 @@ index 818bfd4..584fe11 100644
return server.matchPlayer(name);
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f4aa4a8..65bf845 100644
index 5ca4321..cdccaf3 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -309,23 +309,17 @@ public interface Server extends PluginMessageRecipient {
@@ -313,23 +313,17 @@ public interface Server extends PluginMessageRecipient {
* <p>
* This method may not return objects for offline players.
*
@ -76,7 +76,7 @@ index f4aa4a8..65bf845 100644
public Player getPlayerExact(String name);
/**
@@ -335,12 +329,9 @@ public interface Server extends PluginMessageRecipient {
@@ -339,12 +333,9 @@ public interface Server extends PluginMessageRecipient {
* This list is not sorted in any particular order. If an exact match is
* found, the returned list will only contain a single result.
*
@ -90,5 +90,5 @@ index f4aa4a8..65bf845 100644
/**
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From e9305a7a4988acd7f73e0c444d1237409bb51db4 Mon Sep 17 00:00:00 2001
From d16c4523a2ceb4982d61f4ab9de0de7c8365e36b Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Thu, 17 Apr 2014 19:35:13 +1000
Subject: [PATCH] Add Score.isScoreSet()Z API.
@ -27,5 +27,5 @@ index 4c10346..2410cbd 100644
* Gets the scoreboard for the associated objective.
*
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 5a4a84f14e3fc0cb1b60b6d8d9e5b65055e107a9 Mon Sep 17 00:00:00 2001
From d4bf4914fbad3a515eee90f86b75c1ed0c4a6897 Mon Sep 17 00:00:00 2001
From: ninja <xninja@openmailbox.org>
Date: Tue, 8 Apr 2014 14:01:32 +0200
Subject: [PATCH] Add PlayerSpawnLocationEvent.
@ -61,5 +61,5 @@ index 0000000..dd3f58c
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 39d5351db6c384a64b5de29d3ebc45ceb4fbcee7 Mon Sep 17 00:00:00 2001
From 0c39657113b2d277479e3d54af0d629adb382b64 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 16 Jul 2014 17:24:21 +1000
Subject: [PATCH] Ease ClassLoader Deadlocks Where Possible
@ -63,5 +63,5 @@ index 13f8633..4cffa13 100644
super(new URL[] {file.toURI().toURL()}, parent);
Validate.notNull(loader, "Loader cannot be null");
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From f68a6b171088758dfab21917b1028246fcbfd6af Mon Sep 17 00:00:00 2001
From f0d5641078f99b04e23d73e262a8c333a738ec35 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 22 Jul 2014 21:01:32 +1000
Subject: [PATCH] Fix slow tab complete for some commands.
@ -19,5 +19,5 @@ index 92de43c..855f560 100644
if (StringUtil.startsWithIgnoreCase(name, args[1]) && !player.isWhitelisted()) {
completions.add(name);
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 9cb8116240b7afad0bf933eae153b6c61daf6921 Mon Sep 17 00:00:00 2001
From 00c7ee3cabfe5725c8a1b466cca6cdf7a6e61f01 Mon Sep 17 00:00:00 2001
From: drXor <mcyoung@mit.edu>
Date: Wed, 23 Jul 2014 15:50:36 -0400
Subject: [PATCH] Undeprecate Player#updateInventory()V
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0f59c07..d429074 100644
index eb5084b..a89df18 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -333,10 +333,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -334,10 +334,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
/**
* Forces an update of the player's entire inventory.
*
@ -21,5 +21,5 @@ index 0f59c07..d429074 100644
/**
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From d4f00fcaa6e46a323a4e5a11427fd76ff80df8e2 Mon Sep 17 00:00:00 2001
From f36cbb4943bd6515cb4b1192c6243223a3d3290f Mon Sep 17 00:00:00 2001
From: libraryaddict <redwarfare@live.com>
Date: Fri, 22 Aug 2014 05:31:04 -0400
Subject: [PATCH] Added isUnbreakable and setUnbreakable to ItemMeta
@ -42,5 +42,5 @@ index 459e09c..d8cc821 100644
+ // Spigot end
}
--
2.1.4
2.5.0

View File

@ -1,11 +1,11 @@
From 7aea279e8606e39d6d025b915de7d6d1ef01358f Mon Sep 17 00:00:00 2001
From d67111c349697a604e4f0d42987c1f2cf6f54d2c Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sat, 13 Dec 2014 12:59:14 +1100
Subject: [PATCH] BungeeCord Chat API
diff --git a/pom.xml b/pom.xml
index 70d5ff8..cb142f2 100644
index 0a4aa07..bad3e43 100644
--- a/pom.xml
+++ b/pom.xml
@@ -83,6 +83,14 @@
@ -268,10 +268,10 @@ index b8872b4..adbae51 100644
* Gets the char value associated with this color
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 65bf845..7aa374f 100644
index cdccaf3..1ae5e96 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -931,6 +931,24 @@ public interface Server extends PluginMessageRecipient {
@@ -947,6 +947,24 @@ public interface Server extends PluginMessageRecipient {
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -297,10 +297,10 @@ index 65bf845..7aa374f 100644
Spigot spigot();
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d429074..9508e84 100644
index a89df18..dc58bea 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1143,6 +1143,24 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -1338,6 +1338,24 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}
@ -326,5 +326,5 @@ index d429074..9508e84 100644
Spigot spigot();
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 948e11f2b713bbda226ef75d98763a488ffeaecb Mon Sep 17 00:00:00 2001
From aec4742c4696be1fb949189ddd4c02fd20bdaa00 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 13 Jul 2015 19:10:15 +1000
Subject: [PATCH] Add restart API.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7aa374f..169008a 100644
index 1ae5e96..69720e9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -949,6 +949,13 @@ public interface Server extends PluginMessageRecipient {
@@ -965,6 +965,13 @@ public interface Server extends PluginMessageRecipient {
public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
@ -23,5 +23,5 @@ index 7aa374f..169008a 100644
Spigot spigot();
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 2bb58d91916cf4390bef54569377f5623dbead53 Mon Sep 17 00:00:00 2001
From efc8adeba61da66aec88152cd8b7b4a740bc632c Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 2 Jul 2013 13:07:39 +1000
Subject: [PATCH] POM Changes
@ -6,7 +6,7 @@ Subject: [PATCH] POM Changes
Basic changes to the build system which mark the artifact as Spigot, and the necessary code changes to ensure proper functionality. Also disables the auto updater provided by CraftBukkit as it is useless to us.
diff --git a/pom.xml b/pom.xml
index f1fb28f..91627ff 100644
index 5afb2b8..953cdbc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,12 @@
@ -18,7 +18,7 @@ index f1fb28f..91627ff 100644
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot</artifactId>
<packaging>jar</packaging>
<version>1.8.8-R0.1-SNAPSHOT</version>
<version>1.9-SNAPSHOT</version>
- <name>CraftBukkit</name>
- <url>http://www.bukkit.org</url>
+ <name>Spigot</name>
@ -26,7 +26,7 @@ index f1fb28f..91627ff 100644
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -20,10 +20,22 @@
@@ -19,10 +19,17 @@
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
@ -41,24 +41,24 @@ index f1fb28f..91627ff 100644
<dependency>
- <groupId>org.bukkit</groupId>
- <artifactId>bukkit</artifactId>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
@@ -56,6 +63,11 @@
<version>5.1.37</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>net.sf.trove4j</groupId>
+ <artifactId>trove4j</artifactId>
+ <version>3.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
@@ -88,17 +100,32 @@
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
<build>
- <defaultGoal>clean install</defaultGoal>
+ <defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<!-- testing -->
<dependency>
<groupId>junit</groupId>
@@ -86,11 +98,26 @@
<groupId>net.md-5</groupId>
<artifactId>scriptus</artifactId>
<version>0.2</version>
@ -88,7 +88,7 @@ index f1fb28f..91627ff 100644
<phase>initialize</phase>
<goals>
<goal>describe</goal>
@@ -115,7 +142,7 @@
@@ -107,7 +134,7 @@
<manifestEntries>
<Main-Class>org.bukkit.craftbukkit.Main</Main-Class>
<Implementation-Title>CraftBukkit</Implementation-Title>
@ -111,5 +111,5 @@ index f905d17..9304637 100644
if (stream != null) {
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 3d3e6d4cc0b9781591c399fdd5a187fb21f06348 Mon Sep 17 00:00:00 2001
From 13ab33d4e7852bc53e1c51bac7a312b25e041503 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:10:56 +1000
Subject: [PATCH] Skeleton API Implementations
@ -6,10 +6,10 @@ Subject: [PATCH] Skeleton API Implementations
This contains the basic, empty implementations for some Spigot-API extensions. They are included early in the patching progress so that compilation will still succeed midway despite the APIs only being provided by subsequent patches.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 82a41b0..5377181 100644
index d330226..6b37266 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1642,4 +1642,14 @@ public final class CraftServer implements Server {
@@ -1653,4 +1653,14 @@ public final class CraftServer implements Server {
public UnsafeValues getUnsafe() {
return CraftMagicNumbers.INSTANCE;
}
@ -25,10 +25,10 @@ index 82a41b0..5377181 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 2bbbdd3..ff01a2d 100644
index 45b5de6..3777f40 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1380,4 +1380,14 @@ public class CraftWorld implements World {
@@ -1451,4 +1451,14 @@ public class CraftWorld implements World {
cps.queueUnload(chunk.locX, chunk.locZ);
}
}
@ -64,12 +64,12 @@ index dca8520..bf48e6e 100644
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 5693e3a..4c0ac67 100644
index 22d08a2..97dfc54 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -538,4 +538,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public void setOp(boolean value) {
perm.setOp(value);
@@ -555,4 +555,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isGlowing() {
return getHandle().glowing;
}
+
+ // Spigot start
@ -104,12 +104,12 @@ index 64e346d..243e8e5 100644
+ // Spigot end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 40f52f1..e823f72 100644
index fb81a28..2c3ee37 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1340,4 +1340,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
PacketPlayOutTitle packetReset = new PacketPlayOutTitle(EnumTitleAction.RESET, null);
getHandle().playerConnection.sendPacket(packetReset);
@@ -1406,4 +1406,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().playerConnection.sendPacket(packetplayoutworldparticles);
}
+
+ // Spigot start
@ -161,5 +161,5 @@ index d3ae91b..0b71b53 100644
+ // Spigot end
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From c32e02f99891c045b408e3b5b922fa1bda94b672 Mon Sep 17 00:00:00 2001
From 81c785f55dd68fa4b55c1626e3a2ab08e3776f7f Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 14 Apr 2014 10:38:04 +1000
Subject: [PATCH] Obfuscation Helpers
@ -6,22 +6,22 @@ Subject: [PATCH] Obfuscation Helpers
Provides several friendly named methods which map to a obfuscated method. Obfuscated methods which are used frequently should be added to this file to ease with updates to new Minecraft versions.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 352409d..b79a2e7 100644
index bf1678d..f965592 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1287,6 +1287,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -1263,6 +1263,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
+ // Spigot Start
+ public ServerConnection getServerConnection()
+ {
+ return this.q;
+ return this.p;
+ }
+ // Spigot End
public ServerConnection aq() {
return this.q;
public ServerConnection am() {
return this.p;
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 2c218e85d6a9ae48159aa7e90c9911de9dd64fac Mon Sep 17 00:00:00 2001
From 92394ce4c8727ef50ae51c9090a6c8cdaaa29d73 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 7 Jul 2013 09:32:53 +1000
Subject: [PATCH] Spigot Configuration
@ -6,11 +6,11 @@ Subject: [PATCH] Spigot Configuration
Provides the basic infrastructure to load and save the Spigot configuration file, spigot.yml
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 5402532..187d2f4 100644
index c0aff53..53b5e87 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -162,6 +162,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
if (this.R() < 0) {
@@ -165,6 +165,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
if (this.P() < 0) {
this.setPort(this.propertyManager.getInt("server-port", 25565));
}
+ // Spigot start
@ -21,7 +21,7 @@ index 5402532..187d2f4 100644
DedicatedServer.LOGGER.info("Generating keypair");
this.a(MinecraftEncryption.b());
@@ -176,7 +181,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -179,7 +184,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
return false;
}
@ -35,10 +35,10 @@ index 5402532..187d2f4 100644
if (!this.getOnlineMode()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f7c913d..1638081 100644
index bb8fd66..bdedeee 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -102,6 +102,7 @@ public abstract class World implements IBlockAccess {
@@ -97,6 +97,7 @@ public abstract class World implements IBlockAccess {
public long ticksPerMonsterSpawns;
public boolean populating;
private int tickPosition;
@ -46,7 +46,7 @@ index f7c913d..1638081 100644
public CraftWorld getWorld() {
return this.world;
@@ -116,6 +117,7 @@ public abstract class World implements IBlockAccess {
@@ -111,6 +112,7 @@ public abstract class World implements IBlockAccess {
}
protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) {
@ -55,10 +55,10 @@ index f7c913d..1638081 100644
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 5377181..d296924 100644
index 6b37266..91965c0 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -248,8 +248,10 @@ public final class CraftServer implements Server {
@@ -252,8 +252,10 @@ public final class CraftServer implements Server {
chunkGCLoadThresh = configuration.getInt("chunk-gc.load-threshold");
loadIcon();
@ -71,7 +71,7 @@ index 5377181..d296924 100644
}
public boolean getCommandBlockOverride(String command) {
@@ -670,6 +672,7 @@ public final class CraftServer implements Server {
@@ -674,6 +676,7 @@ public final class CraftServer implements Server {
logger.log(Level.WARNING, "Failed to load banned-players.json, " + ex.getMessage());
}
@ -79,7 +79,7 @@ index 5377181..d296924 100644
for (WorldServer world : console.worlds) {
world.worldData.setDifficulty(difficulty);
world.setSpawnFlags(monsters, animals);
@@ -684,11 +687,14 @@ public final class CraftServer implements Server {
@@ -688,11 +691,14 @@ public final class CraftServer implements Server {
} else {
world.ticksPerMonsterSpawns = this.getTicksPerMonsterSpawns();
}
@ -336,5 +336,5 @@ index 0000000..961ddb4
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,196 +0,0 @@
From 426206c162bab9cdffb452562b8ec8f608e76655 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 11 Jun 2013 12:56:02 +1000
Subject: [PATCH] Better Chunk Tick Selection
An optimized chunk ticking algorithm which better selects chunks around players which are active on the server.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1638081..5cb66a5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -68,7 +68,7 @@ public abstract class World implements IBlockAccess {
public Scoreboard scoreboard = new Scoreboard(); // CraftBukkit - public
public final boolean isClientSide;
// CraftBukkit - longhashset
- protected LongHashSet chunkTickList = new LongHashSet();
+ // protected LongHashSet chunkTickList = new LongHashSet(); // Spigot
private int L;
public boolean allowMonsters; // CraftBukkit - public
public boolean allowAnimals; // CraftBukkit - public
@@ -102,6 +102,31 @@ public abstract class World implements IBlockAccess {
public long ticksPerMonsterSpawns;
public boolean populating;
private int tickPosition;
+
+ // Spigot start
+ protected final gnu.trove.map.hash.TLongShortHashMap chunkTickList;
+ protected float growthOdds = 100;
+ protected float modifiedOdds = 100;
+ private final byte chunkTickRadius;
+
+ public static long chunkToKey(int x, int z)
+ {
+ long k = ( ( ( (long) x ) & 0xFFFF0000L ) << 16 ) | ( ( ( (long) x ) & 0x0000FFFFL ) << 0 );
+ k |= ( ( ( (long) z ) & 0xFFFF0000L ) << 32 ) | ( ( ( (long) z ) & 0x0000FFFFL ) << 16 );
+ return k;
+ }
+
+ public static int keyToX(long k)
+ {
+ return (int) ( ( ( k >> 16 ) & 0xFFFF0000 ) | ( k & 0x0000FFFF ) );
+ }
+
+ public static int keyToZ(long k)
+ {
+ return (int) ( ( ( k >> 32 ) & 0xFFFF0000L ) | ( ( k >> 16 ) & 0x0000FFFF ) );
+ }
+ // Spigot end
+
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
public CraftWorld getWorld() {
@@ -123,6 +148,12 @@ public abstract class World implements IBlockAccess {
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit
// CraftBukkit end
+ // Spigot start
+ this.chunkTickRadius = (byte) ( ( this.getServer().getViewDistance() < 7 ) ? this.getServer().getViewDistance() : 7 );
+ this.chunkTickList = new gnu.trove.map.hash.TLongShortHashMap( spigotConfig.chunksPerTick * 5, 0.7f, Long.MIN_VALUE, Short.MIN_VALUE );
+ this.chunkTickList.setAutoCompactionFactor( 0 );
+ // Spigot end
+
this.L = this.random.nextInt(12000);
this.allowMonsters = true;
this.allowAnimals = true;
@@ -1964,18 +1995,43 @@ public abstract class World implements IBlockAccess {
int k;
int l;
+ // Spigot start
+ int optimalChunks = spigotConfig.chunksPerTick;
+ // Quick conditions to allow us to exist early
+ if ( optimalChunks > 0 ) {
+ // Keep chunks with growth inside of the optimal chunk range
+ int chunksPerPlayer = Math.min( 200, Math.max( 1, (int) ( ( ( optimalChunks - players.size() ) / (double) players.size() ) + 0.5 ) ) );
+ int randRange = 3 + chunksPerPlayer / 30;
+ // Limit to normal tick radius - including view distance
+ randRange = ( randRange > chunkTickRadius ) ? chunkTickRadius : randRange;
+ // odds of growth happening vs growth happening in vanilla
+ this.growthOdds = this.modifiedOdds = Math.max( 35, Math.min( 100, ( ( chunksPerPlayer + 1 ) * 100F ) / 15F ) );
+ // Spigot end
for (i = 0; i < this.players.size(); ++i) {
entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX / 16.0D);
k = MathHelper.floor(entityhuman.locZ / 16.0D);
l = this.q();
- for (int i1 = -l; i1 <= l; ++i1) {
- for (int j1 = -l; j1 <= l; ++j1) {
- this.chunkTickList.add(org.bukkit.craftbukkit.util.LongHash.toLong(i1 + j, j1 + k));
+ // Spigot start - Always update the chunk the player is on
+ long key = chunkToKey( j, k );
+ int existingPlayers = Math.max( 0, chunkTickList.get( key ) ); // filter out -1
+ chunkTickList.put( key, (short) ( existingPlayers + 1 ) );
+
+ // Check and see if we update the chunks surrounding the player this tick
+ for ( int chunk = 0; chunk < chunksPerPlayer; chunk++ )
+ {
+ int dx = ( random.nextBoolean() ? 1 : -1 ) * random.nextInt( randRange );
+ int dz = ( random.nextBoolean() ? 1 : -1 ) * random.nextInt( randRange );
+ long hash = chunkToKey( dx + j, dz + k );
+ if ( !chunkTickList.contains( hash ) && this.chunkProvider.isChunkLoaded(dx + j, dz + k ) )
+ {
+ chunkTickList.put( hash, (short) -1 ); // no players
}
}
}
+ // Spigot End
+ }
this.methodProfiler.b();
if (this.L > 0) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index d27aa67..690e7dc 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -357,12 +357,15 @@ public class WorldServer extends World implements IAsyncTaskHandler {
protected void h() {
super.h();
if (this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
- Iterator iterator = this.chunkTickList.iterator();
+ // Spigot start
+ gnu.trove.iterator.TLongShortIterator iterator = this.chunkTickList.iterator();
while (iterator.hasNext()) {
- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next();
+ iterator.advance();
+ long chunkCoord = iterator.key();
- this.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z).b(false);
+ this.getChunkAt(World.keyToX( chunkCoord ), World.keyToZ( chunkCoord )).b(false);
+ // Spigot end
}
} else {
@@ -374,9 +377,21 @@ public class WorldServer extends World implements IAsyncTaskHandler {
// ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair) iterator1.next();
// int k = chunkcoordintpair1.x * 16;
// int l = chunkcoordintpair1.z * 16;
- for (long chunkCoord : chunkTickList.popAll()) {
- int chunkX = LongHash.msw(chunkCoord);
- int chunkZ = LongHash.lsw(chunkCoord);
+ // Spigot start
+ for (gnu.trove.iterator.TLongShortIterator iter = chunkTickList.iterator(); iter.hasNext(); )
+ {
+ iter.advance();
+ long chunkCoord = iter.key();
+ int chunkX = World.keyToX( chunkCoord );
+ int chunkZ = World.keyToZ( chunkCoord );
+ // If unloaded, or in procedd of being unloaded, drop it
+ if ( ( !this.chunkProvider.isChunkLoaded( chunkX, chunkZ ) ) || ( this.chunkProviderServer.unloadQueue.contains( chunkX, chunkZ ) ) )
+ {
+ iter.remove();
+ continue;
+ }
+ // Spigot end
+ // ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next();
int k = chunkX * 16;
int l = chunkZ * 16;
@@ -470,6 +485,12 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
}
+ // Spigot Start
+ if ( spigotConfig.clearChunksOnTick )
+ {
+ chunkTickList.clear();
+ }
+ // Spigot End
}
protected BlockPosition a(BlockPosition blockposition) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 961ddb4..90a227f 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -68,4 +68,15 @@ public class SpigotWorldConfig
config.addDefault( "world-settings.default." + path, def );
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
}
+
+ public int chunksPerTick;
+ public boolean clearChunksOnTick;
+ private void chunksPerTick()
+ {
+ chunksPerTick = getInt( "chunks-per-tick", 650 );
+ log( "Chunks to Grow per Tick: " + chunksPerTick );
+
+ clearChunksOnTick = getBoolean( "clear-tick-list", false );
+ log( "Clear tick list: " + clearChunksOnTick );
+ }
}
--
2.1.4

View File

@ -1,4 +1,4 @@
From ceea89b9500f590905200814f6e7310c7a7fd2e3 Mon Sep 17 00:00:00 2001
From 0f544805062834e55ff56f0cde813c693dbcc85d Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 17:17:20 +1000
Subject: [PATCH] Crop Growth Rates
@ -6,13 +6,13 @@ Subject: [PATCH] Crop Growth Rates
Allows configuring the growth rates of crops as a percentage of their normal growth rate.
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index 4923f8b..6b02059 100644
index 57f3981..12589d6 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -1009,4 +1009,16 @@ public class Block {
return 0;
@@ -857,4 +857,16 @@ public class Block {
private static void a(int i, String s, Block block) {
a(i, new MinecraftKey(s), block);
}
// CraftBukkit end
+
+ // Spigot start
+ public static float range(float min, float value, float max) {
@ -27,130 +27,103 @@ index 4923f8b..6b02059 100644
+ // Spigot end
}
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 7f5e5ca..488e5c2 100644
index f4b90e1..862075d 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -29,7 +29,7 @@ public class BlockCactus extends Block {
@@ -31,7 +31,7 @@ public class BlockCactus extends Block {
if (i < 3) {
int j = ((Integer) iblockdata.get(BlockCactus.AGE)).intValue();
- if (j == 15) {
+ if (j >= (byte) range(3, (world.growthOdds / world.spigotConfig.cactusModifier * 15) + 0.5F, 15)) { // Spigot
+ if (j >= (byte) range(3, (world.spigotConfig.cactusModifier / 100 * 15) + 0.5F, 15)) { // Spigot
// world.setTypeUpdate(blockposition1, this.getBlockData()); // CraftBukkit
IBlockData iblockdata1 = iblockdata.set(BlockCactus.AGE, Integer.valueOf(0));
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
index e3e898e..b91b220 100644
index 062f769..d545d1a 100644
--- a/src/main/java/net/minecraft/server/BlockCrops.java
+++ b/src/main/java/net/minecraft/server/BlockCrops.java
@@ -32,8 +32,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement
if (i < 7) {
@@ -54,7 +54,7 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement
if (i < this.g()) {
float f = a((Block) this, world, blockposition);
- if (random.nextInt((int) (25.0F / f) + 1) == 0) {
- // CraftBukkit start
+ if (random.nextInt((int) (world.growthOdds / world.spigotConfig.wheatModifier * (25.0F / f)) + 1) == 0) { // Spigot // CraftBukkit start
IBlockData data = iblockdata.set(AGE, Integer.valueOf(i + 1));
+ if (random.nextInt((int) (world.spigotConfig.wheatModifier / 100 * (25.0F / f)) + 1) == 0) { // Spigot // CraftBukkit start
// CraftBukkit start
IBlockData data = this.setAge(i + 1);
CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(data));
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
index 147fb1f..844ad30 100644
--- a/src/main/java/net/minecraft/server/BlockGrass.java
+++ b/src/main/java/net/minecraft/server/BlockGrass.java
@@ -45,7 +45,7 @@ public class BlockGrass extends Block implements IBlockFragilePlantElement {
// CraftBukkit end
} else {
if (world.getLightLevel(blockposition.up()) >= 9) {
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < Math.min(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); ++i) { // Spigot
BlockPosition blockposition1 = blockposition.a(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
Block block = world.getType(blockposition1.up()).getBlock();
IBlockData iblockdata1 = world.getType(blockposition1);
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java
index 160a063..7cf7a08 100644
index fa7919e..e069252 100644
--- a/src/main/java/net/minecraft/server/BlockMushroom.java
+++ b/src/main/java/net/minecraft/server/BlockMushroom.java
@@ -20,7 +20,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme
@@ -23,7 +23,7 @@ public class BlockMushroom extends BlockPlant implements IBlockFragilePlantEleme
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
final int sourceX = blockposition.getX(), sourceY = blockposition.getY(), sourceZ = blockposition.getZ(); // CraftBukkit
- if (random.nextInt(25) == 0) {
+ if (random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.mushroomModifier * 25)) == 0) { // Spigot int i = 5;
+ if (random.nextInt(Math.max(1, (int) world.spigotConfig.mushroomModifier / 100 * 25)) == 0) { // Spigot
int i = 5;
boolean flag = true;
Iterator iterator = BlockPosition.b(blockposition.a(-4, -1, -4), blockposition.a(4, 1, 4)).iterator();
diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java
index 70405d5..d2bd4dd 100644
--- a/src/main/java/net/minecraft/server/BlockMycel.java
+++ b/src/main/java/net/minecraft/server/BlockMycel.java
@@ -44,7 +44,7 @@ public class BlockMycel extends Block {
// CraftBukkit end
} else {
if (world.getLightLevel(blockposition.up()) >= 9) {
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < Math.min(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); ++i) { // Spigot
BlockPosition blockposition1 = blockposition.a(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
IBlockData iblockdata1 = world.getType(blockposition1);
Block block = world.getType(blockposition1.up()).getBlock();
diff --git a/src/main/java/net/minecraft/server/BlockNetherWart.java b/src/main/java/net/minecraft/server/BlockNetherWart.java
index 1bb8015..374f06c 100644
index b2ca55f..9cd8bd8 100644
--- a/src/main/java/net/minecraft/server/BlockNetherWart.java
+++ b/src/main/java/net/minecraft/server/BlockNetherWart.java
@@ -27,7 +27,7 @@ public class BlockNetherWart extends BlockPlant {
@@ -29,7 +29,7 @@ public class BlockNetherWart extends BlockPlant {
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
int i = ((Integer) iblockdata.get(BlockNetherWart.AGE)).intValue();
- if (i < 3 && random.nextInt(10) == 0) {
+ if (i < 3 && random.nextInt(Math.max(1, (int) world.growthOdds / world.spigotConfig.wartModifier * 10)) == 0) { // Spigot
+ if (i < 3 && random.nextInt(Math.max(1, (int) world.spigotConfig.wartModifier / 100 * 10)) == 0) { // Spigot
iblockdata = iblockdata.set(BlockNetherWart.AGE, Integer.valueOf(i + 1));
// world.setTypeAndData(blockposition, iblockdata, 2); // CraftBukkit
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this, toLegacyData(iblockdata)); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index fae75fa..d00067d 100644
index f507b83..b8c36a7 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -28,7 +28,7 @@ public class BlockReed extends Block {
@@ -30,7 +30,7 @@ public class BlockReed extends Block {
if (i < 3) {
int j = ((Integer) iblockdata.get(BlockReed.AGE)).intValue();
- if (j == 15) {
+ if (j >= (byte) range(3, (world.growthOdds / world.spigotConfig.caneModifier * 15) + 0.5F, 15)) { // Spigot
+ if (j >= (byte) range(3, (world.spigotConfig.caneModifier /100 * 15) + 0.5F, 15)) { // Spigot
// CraftBukkit start
// world.setTypeUpdate(blockposition.up(), this.getBlockData()); // CraftBukkit
BlockPosition upPos = blockposition.up();
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
index a2667d9..45fbf5c 100644
index a2691a5..a60a7f8 100644
--- a/src/main/java/net/minecraft/server/BlockSapling.java
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
@@ -32,7 +32,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen
@@ -34,7 +34,7 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen
public void b(World world, BlockPosition blockposition, IBlockData iblockdata, Random random) {
if (!world.isClientSide) {
super.b(world, blockposition, iblockdata, random);
- if (world.getLightLevel(blockposition.up()) >= 9 && random.nextInt(7) == 0) {
+ if (world.getLightLevel(blockposition.up()) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds / world.spigotConfig.saplingModifier * 7) + 0.5F))) == 0)) { // Spigot) {
+ if (world.getLightLevel(blockposition.up()) >= 9 && (random.nextInt(Math.max(2, (int) ((world.spigotConfig.saplingModifier / 100 * 7) + 0.5F))) == 0)) { // Spigot) {
// CraftBukkit start
world.captureTreeGeneration = true;
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
index 2ff1a6b..2618c40 100644
index 41200fa..53d99aa 100644
--- a/src/main/java/net/minecraft/server/BlockStem.java
+++ b/src/main/java/net/minecraft/server/BlockStem.java
@@ -55,7 +55,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
@@ -50,7 +50,7 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement {
if (world.getLightLevel(blockposition.up()) >= 9) {
float f = BlockCrops.a((Block) this, world, blockposition);
- if (random.nextInt((int) (25.0F / f) + 1) == 0) {
+ if (random.nextInt((int) (world.growthOdds / (this == Blocks.PUMPKIN_STEM? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) * (25.0F / f)) + 1) == 0) { // Spigot
+ if (random.nextInt((int) ((this == Blocks.PUMPKIN_STEM? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier) / 100 * (25.0F / f)) + 1) == 0) { // Spigot
int i = ((Integer) iblockdata.get(BlockStem.AGE)).intValue();
if (i < 7) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 90a227f..5749a45 100644
index 961ddb4..8860a96 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -79,4 +79,37 @@ public class SpigotWorldConfig
clearChunksOnTick = getBoolean( "clear-tick-list", false );
log( "Clear tick list: " + clearChunksOnTick );
@@ -68,4 +68,37 @@ public class SpigotWorldConfig
config.addDefault( "world-settings.default." + path, def );
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
}
+
+ // Crop growth rates
@ -187,5 +160,5 @@ index 90a227f..5749a45 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 132c9f128e9b958ba9161738329c811f68553833 Mon Sep 17 00:00:00 2001
From ce110c7a6c2873311e74cc6391cdf8ebe7022b52 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,13 +6,13 @@ 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 1eda0ef..8b7cd86 100644
index 6009cac..7ea1150 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -122,7 +122,10 @@ public class EntityItem extends Entity {
@@ -123,7 +123,10 @@ public class EntityItem extends Entity {
}
private void w() {
private void x() {
- Iterator iterator = this.world.a(EntityItem.class, this.getBoundingBox().grow(0.5D, 0.0D, 0.5D)).iterator();
+ // Spigot start
+ double radius = world.spigotConfig.itemMerge;
@ -21,7 +21,7 @@ index 1eda0ef..8b7cd86 100644
while (iterator.hasNext()) {
EntityItem entityitem = (EntityItem) iterator.next();
@@ -156,12 +159,14 @@ public class EntityItem extends Entity {
@@ -157,12 +160,14 @@ public class EntityItem extends Entity {
} else if (itemstack1.count + itemstack.count > itemstack1.getMaxStackSize()) {
return false;
} else {
@ -43,10 +43,10 @@ index 1eda0ef..8b7cd86 100644
}
} else {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 5cb66a5..75d335f 100644
index bdedeee..a7c1afe 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -970,6 +970,23 @@ public abstract class World implements IBlockAccess {
@@ -898,6 +898,23 @@ public abstract class World implements IBlockAccess {
// Not all projectiles extend EntityProjectile, so check for Bukkit interface instead
event = CraftEventFactory.callProjectileLaunchEvent(entity);
}
@ -71,10 +71,10 @@ index 5cb66a5..75d335f 100644
if (event != null && (event.isCancelled() || entity.dead)) {
entity.dead = true;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 5749a45..7322703 100644
index 8860a96..d4fb83c 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -112,4 +112,18 @@ public class SpigotWorldConfig
@@ -101,4 +101,18 @@ public class SpigotWorldConfig
wheatModifier = getAndValidateGrowth( "Wheat" );
wartModifier = getAndValidateGrowth( "NetherWart" );
}
@ -94,5 +94,5 @@ index 5749a45..7322703 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 4465c430d6b6e15762957e595385cc4fd7e7dbc2 Mon Sep 17 00:00:00 2001
From dc01590bc8e5a48fa1bb790e2570e9a27c748ee0 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 25 Mar 2014 16:10:01 +1100
Subject: [PATCH] Async Operation Catching
@ -6,10 +6,10 @@ 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/Block.java b/src/main/java/net/minecraft/server/Block.java
index 6b02059..66e099f 100644
index 12589d6..1d2f580 100644
--- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java
@@ -309,9 +309,13 @@ public class Block {
@@ -274,9 +274,13 @@ public class Block {
return 10;
}
@ -26,10 +26,10 @@ index 6b02059..66e099f 100644
public int a(Random random) {
return 1;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index ca28b72..8125cb9 100644
index f832dc7..d5bfef5 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -570,6 +570,7 @@ public abstract class EntityLiving extends Entity {
@@ -618,6 +618,7 @@ public abstract class EntityLiving extends Entity {
}
public void addEffect(MobEffect mobeffect) {
@ -38,18 +38,18 @@ index ca28b72..8125cb9 100644
if (isTickingEffects) {
effectsToProcess.add(mobeffect);
diff --git a/src/main/java/net/minecraft/server/EntityTracker.java b/src/main/java/net/minecraft/server/EntityTracker.java
index 7a76dd0..e1ff4f0 100644
index ed9b0e5..0c19e5a 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -94,6 +94,7 @@ public class EntityTracker {
@@ -102,6 +102,7 @@ public class EntityTracker {
}
public void addEntity(Entity entity, int i, final int j, boolean flag) {
+ org.spigotmc.AsyncCatcher.catchOp( "entity track"); // Spigot
if (i > this.e) {
i = this.e;
}
@@ -144,6 +145,7 @@ public class EntityTracker {
try {
if (this.trackedEntities.b(entity.getId())) {
throw new IllegalStateException("Entity is already tracked!");
@@ -146,6 +147,7 @@ public class EntityTracker {
}
public void untrackEntity(Entity entity) {
@ -58,10 +58,10 @@ index 7a76dd0..e1ff4f0 100644
EntityPlayer entityplayer = (EntityPlayer) entity;
Iterator iterator = this.c.iterator();
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index 89422ea..f0149bf 100644
index 8b38bd2..f8570a8 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -310,6 +310,7 @@ public class EntityTrackerEntry {
@@ -324,6 +324,7 @@ public class EntityTrackerEntry {
}
public void updatePlayer(EntityPlayer entityplayer) {
@ -69,19 +69,19 @@ index 89422ea..f0149bf 100644
if (entityplayer != this.tracker) {
if (this.c(entityplayer)) {
if (!this.trackedPlayers.contains(entityplayer) && (this.e(entityplayer) || this.tracker.attachedToPlayer)) {
@@ -540,6 +541,7 @@ public class EntityTrackerEntry {
@@ -558,6 +559,7 @@ public class EntityTrackerEntry {
}
public void clear(EntityPlayer entityplayer) {
+ org.spigotmc.AsyncCatcher.catchOp( "player tracker clear"); // Spigot
if (this.trackedPlayers.contains(entityplayer)) {
this.trackedPlayers.remove(entityplayer);
entityplayer.d(this.tracker);
this.tracker.c(entityplayer);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 75d335f..61db17c 100644
index a7c1afe..010374f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -940,6 +940,7 @@ public abstract class World implements IBlockAccess {
@@ -868,6 +868,7 @@ public abstract class World implements IBlockAccess {
}
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
@ -89,27 +89,27 @@ index 75d335f..61db17c 100644
if (entity == null) return false;
// CraftBukkit end
int i = MathHelper.floor(entity.locX / 16.0D);
@@ -1047,6 +1048,7 @@ public abstract class World implements IBlockAccess {
@@ -974,6 +975,7 @@ public abstract class World implements IBlockAccess {
}
public void removeEntity(Entity entity) {
+ org.spigotmc.AsyncCatcher.catchOp( "entity remove"); // Spigot
entity.b(false);
entity.die();
if (entity instanceof EntityHuman) {
this.players.remove(entity);
@@ -2491,6 +2493,7 @@ public abstract class World implements IBlockAccess {
@@ -2417,6 +2419,7 @@ public abstract class World implements IBlockAccess {
}
public void b(Collection<Entity> collection) {
public void a(Collection<Entity> collection) {
+ org.spigotmc.AsyncCatcher.catchOp( "entity world add"); // Spigot
// CraftBukkit start
// this.entityList.addAll(collection);
Iterator iterator = collection.iterator();
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e3db8e1..07d1ee4 100644
index 3777f40..eedf49b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -167,6 +167,7 @@ public class CraftWorld implements World {
@@ -166,6 +166,7 @@ public class CraftWorld implements World {
}
public boolean unloadChunkRequest(int x, int z, boolean safe) {
@ -117,7 +117,7 @@ index e3db8e1..07d1ee4 100644
if (safe && isChunkInUse(x, z)) {
return false;
}
@@ -177,6 +178,7 @@ public class CraftWorld implements World {
@@ -176,6 +177,7 @@ public class CraftWorld implements World {
}
public boolean unloadChunk(int x, int z, boolean save, boolean safe) {
@ -125,7 +125,7 @@ index e3db8e1..07d1ee4 100644
if (safe && isChunkInUse(x, z)) {
return false;
}
@@ -244,6 +246,7 @@ public class CraftWorld implements World {
@@ -239,6 +241,7 @@ public class CraftWorld implements World {
}
public boolean loadChunk(int x, int z, boolean generate) {
@ -134,10 +134,10 @@ index e3db8e1..07d1ee4 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 e823f72..d4d6259 100644
index 2c3ee37..cd51b41 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -210,6 +210,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -211,6 +211,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void kickPlayer(String message) {
@ -146,7 +146,7 @@ index e823f72..d4d6259 100644
getHandle().playerConnection.disconnect(message == null ? "" : message);
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
index 197086e..fbea5db 100644
index db4c1db..12768ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
@@ -42,6 +42,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
@ -181,5 +181,5 @@ index 0000000..4b3aa85
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From f738cff112c9dc5e25b93334c91f953914a805b0 Mon Sep 17 00:00:00 2001
From 64c0667e827ec6dc583a7b346be5601838c4dd51 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 09:52:41 +1100
Subject: [PATCH] View Distance
@ -6,11 +6,11 @@ Subject: [PATCH] View Distance
This commit allows the user to select per world view distances, and view distances below 3. Be wary of the issues selecting a view distance of 1 or 2 may cause!
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
index 688d6f0..abb24c8 100644
index 13d47d7..8ef7eb2 100644
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
@@ -28,9 +28,9 @@ public class PlayerChunkMap {
private final int[][] i = new int[][] { { 1, 0}, { 0, 1}, { -1, 0}, { 0, -1}};
@@ -49,9 +49,9 @@ public class PlayerChunkMap {
private boolean m = true;
private boolean wasNotEmpty; // CraftBukkit - add field
- public PlayerChunkMap(WorldServer worldserver) {
@ -20,25 +20,25 @@ index 688d6f0..abb24c8 100644
+ this.a(viewDistance); // Spigot
}
public WorldServer a() {
public WorldServer getWorld() {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 690e7dc..9c0bcfe 100644
index c65e557..59b78bb 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -62,7 +62,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -57,7 +57,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
// CraftBukkit end
this.server = minecraftserver;
this.tracker = new EntityTracker(this);
- this.manager = new PlayerChunkMap(this);
+ this.manager = new PlayerChunkMap(this, spigotConfig.viewDistance); // Spigot
this.worldProvider.a(this);
this.chunkProvider = this.k();
this.Q = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
this.worldProvider.a((World) this);
this.chunkProvider = this.n();
this.portalTravelAgent = new org.bukkit.craftbukkit.CraftTravelAgent(this); // CraftBukkit
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 7322703..a3255eb 100644
index d4fb83c..86300d6 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -126,4 +126,11 @@ public class SpigotWorldConfig
@@ -115,4 +115,11 @@ public class SpigotWorldConfig
expMerge = getDouble("merge-radius.exp", 3.0 );
log( "Experience Merge Radius: " + expMerge );
}
@ -51,5 +51,5 @@ index 7322703..a3255eb 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From aeb61b3275fa914e67e52712e4ef290120fb2226 Mon Sep 17 00:00:00 2001
From b0bfccd96c4591deba5aa0f8a356cd2ee69f2775 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 10 Jan 2013 00:18:11 -0500
Subject: [PATCH] Spigot Timings
@ -6,60 +6,50 @@ Subject: [PATCH] Spigot Timings
Overhauls the Timings System adding performance tracking all around the Minecraft Server
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 1b68736..7e7aa11 100644
index 582e684..8345e87 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -901,6 +901,7 @@ public class Chunk {
@@ -834,6 +834,7 @@ public class Chunk {
}
public void loadNearby(IChunkProvider ichunkprovider, IChunkProvider ichunkprovider1, int i, int j) {
public void loadNearby(IChunkProvider ichunkprovider, ChunkGenerator chunkgenerator) {
+ world.timings.syncChunkLoadPostTimer.startTiming(); // Spigot
boolean flag = ichunkprovider.isChunkLoaded(i, j - 1);
boolean flag1 = ichunkprovider.isChunkLoaded(i + 1, j);
boolean flag2 = ichunkprovider.isChunkLoaded(i, j + 1);
@@ -947,6 +948,7 @@ public class Chunk {
}
Chunk chunk = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ - 1);
Chunk chunk1 = ichunkprovider.getLoadedChunkAt(this.locX + 1, this.locZ);
Chunk chunk2 = ichunkprovider.getLoadedChunkAt(this.locX, this.locZ + 1);
@@ -895,6 +896,7 @@ public class Chunk {
this.e();
}
+ world.timings.syncChunkLoadPostTimer.stopTiming(); // Spigot
}
public BlockPosition h(BlockPosition blockposition) {
public BlockPosition f(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index 0ae736d..af77eef 100644
index 38b9d16..8f3cd56 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -132,6 +132,7 @@ public class ChunkProviderServer implements IChunkProvider {
@@ -148,6 +148,7 @@ public class ChunkProviderServer implements IChunkProvider {
// CraftBukkit end
if (chunk == null) {
+ world.timings.syncChunkLoadTimer.startTiming(); // Spigot
long k = ChunkCoordIntPair.a(i, j);
chunk = this.loadChunk(i, j);
if (chunk == null) {
if (this.chunkProvider == null) {
@@ -183,6 +184,7 @@ public class ChunkProviderServer implements IChunkProvider {
@@ -196,6 +197,7 @@ public class ChunkProviderServer implements IChunkProvider {
}
// CraftBukkit end
chunk.loadNearby(this, this, i, j);
chunk.loadNearby(this, this.chunkGenerator);
+ world.timings.syncChunkLoadTimer.stopTiming(); // Spigot
}
return chunk;
@@ -217,7 +219,9 @@ public class ChunkProviderServer implements IChunkProvider {
if (chunk != null) {
chunk.setLastSaved(this.world.getTime());
if (this.chunkProvider != null) {
+ world.timings.syncChunkLoadStructuresTimer.startTiming(); // Spigot
this.chunkProvider.recreateStructures(chunk, i, j);
+ world.timings.syncChunkLoadStructuresTimer.stopTiming(); // Spigot
}
}
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 706d976..206e3aa 100644
index c8a89ed..c1b1e1a 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -42,7 +42,9 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@@ -44,7 +44,9 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
// CraftBukkit start - Add async variant, provide compatibility
public Chunk a(World world, int i, int j) throws IOException {
@ -69,7 +59,7 @@ index 706d976..206e3aa 100644
if (data != null) {
Chunk chunk = (Chunk) data[0];
NBTTagCompound nbttagcompound = (NBTTagCompound) data[1];
@@ -392,7 +394,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@@ -347,7 +349,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
public void loadEntities(Chunk chunk, NBTTagCompound nbttagcompound, World world) {
// CraftBukkit end
@ -78,8 +68,8 @@ index 706d976..206e3aa 100644
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
if (nbttaglist1 != null) {
@@ -418,7 +420,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
}
@@ -358,7 +360,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
chunk.g(true);
}
}
-
@ -88,7 +78,7 @@ index 706d976..206e3aa 100644
NBTTagList nbttaglist2 = nbttagcompound.getList("TileEntities", 10);
if (nbttaglist2 != null) {
@@ -431,6 +434,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@@ -371,6 +374,8 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
}
}
}
@ -97,7 +87,7 @@ index 706d976..206e3aa 100644
if (nbttagcompound.hasKeyOfType("TileTicks", 9)) {
NBTTagList nbttaglist3 = nbttagcompound.getList("TileTicks", 10);
@@ -450,6 +455,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
@@ -390,6 +395,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
}
}
}
@ -106,10 +96,10 @@ index 706d976..206e3aa 100644
// return chunk; // CraftBukkit
}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 7240af0..da295f3 100644
index 53b5e87..92dd207 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -20,6 +20,7 @@ import java.io.PrintStream;
@@ -22,6 +22,7 @@ import java.io.PrintStream;
import org.apache.logging.log4j.Level;
import org.bukkit.craftbukkit.LoggerOutputStream;
@ -117,44 +107,43 @@ index 7240af0..da295f3 100644
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.server.RemoteServerCommandEvent;
@@ -368,6 +369,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -394,6 +395,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
public void aO() {
public void aL() {
+ SpigotTimings.serverCommandTimer.startTiming(); // Spigot
while (!this.l.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.l.remove(0);
while (!this.serverCommandQueue.isEmpty()) {
ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0);
@@ -382,6 +384,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -407,6 +409,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
// CraftBukkit end
}
+ SpigotTimings.serverCommandTimer.stopTiming(); // Spigot
}
public boolean ae() {
public boolean aa() {
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 914e3f3..dd1005a 100644
index 4f0098f..63cc105 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -16,6 +16,7 @@ import org.bukkit.entity.Hanging;
@@ -24,6 +24,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.Hanging;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Painting;
import org.bukkit.entity.Vehicle;
+import org.spigotmc.CustomTimingsHandler; // Spigot
import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
@@ -115,6 +116,8 @@ public abstract class Entity implements ICommandListener {
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
@@ -139,6 +140,7 @@ public abstract class Entity implements ICommandListener {
public boolean valid; // CraftBukkit
public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
+ public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot
+
public int getId() {
return this.id;
}
@@ -381,6 +384,7 @@ public abstract class Entity implements ICommandListener {
public Entity(World world) {
this.id = Entity.entityCount++;
@@ -447,6 +449,7 @@ public abstract class Entity implements ICommandListener {
}
public void move(double d0, double d1, double d2) {
@ -162,20 +151,20 @@ index 914e3f3..dd1005a 100644
if (this.noclip) {
this.a(this.getBoundingBox().c(d0, d1, d2));
this.recalcPosition();
@@ -717,6 +721,7 @@ public abstract class Entity implements ICommandListener {
@@ -787,6 +790,7 @@ public abstract class Entity implements ICommandListener {
this.world.methodProfiler.b();
}
+ org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
}
private void recalcPosition() {
public void recalcPosition() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 360d2ee..b8920fd 100644
index 218dc63..3ca9a07 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -23,6 +23,8 @@ import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.vehicle.VehicleExitEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
// CraftBukkit end
+import org.bukkit.craftbukkit.SpigotTimings; // Spigot
@ -183,41 +172,41 @@ index 360d2ee..b8920fd 100644
public abstract class EntityLiving extends Entity {
private static final UUID a = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
@@ -1435,6 +1437,7 @@ public abstract class EntityLiving extends Entity {
@@ -1673,6 +1675,7 @@ public abstract class EntityLiving extends Entity {
}
public void t_() {
public void m() {
+ SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
super.t_();
super.m();
this.cu();
if (!this.world.isClientSide) {
int i = this.bv();
@@ -1473,7 +1476,9 @@ public abstract class EntityLiving extends Entity {
@@ -1745,7 +1748,9 @@ public abstract class EntityLiving extends Entity {
}
}
+ SpigotTimings.timerEntityBaseTick.stopTiming(); // Spigot
this.m();
this.n();
+ SpigotTimings.timerEntityTickRest.startTiming(); // Spigot
double d0 = this.locX - this.lastX;
double d1 = this.locZ - this.lastZ;
float f = (float) (d0 * d0 + d1 * d1);
@@ -1538,6 +1543,7 @@ public abstract class EntityLiving extends Entity {
@@ -1815,6 +1820,7 @@ public abstract class EntityLiving extends Entity {
this.bo = 0;
}
this.world.methodProfiler.b();
this.aT += f2;
+ SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
}
protected float h(float f, float f1) {
@@ -1602,6 +1608,7 @@ public abstract class EntityLiving extends Entity {
@@ -1879,6 +1885,7 @@ public abstract class EntityLiving extends Entity {
}
this.world.methodProfiler.a("ai");
+ SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.bD()) {
this.aY = false;
this.aZ = 0.0F;
@@ -1612,6 +1619,7 @@ public abstract class EntityLiving extends Entity {
if (this.cf()) {
this.bc = false;
this.bd = 0.0F;
@@ -1889,6 +1896,7 @@ public abstract class EntityLiving extends Entity {
this.doTick();
this.world.methodProfiler.b();
}
@ -225,43 +214,42 @@ index 360d2ee..b8920fd 100644
this.world.methodProfiler.b();
this.world.methodProfiler.a("jump");
@@ -1633,11 +1641,15 @@ public abstract class EntityLiving extends Entity {
this.aZ *= 0.98F;
this.ba *= 0.98F;
this.bb *= 0.9F;
@@ -1911,10 +1919,14 @@ public abstract class EntityLiving extends Entity {
this.be *= 0.98F;
this.bf *= 0.9F;
this.r();
+ SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
this.g(this.aZ, this.ba);
this.g(this.bd, this.be);
+ SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.methodProfiler.b();
this.world.methodProfiler.a("push");
if (!this.world.isClientSide) {
+ SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
this.bL();
+ SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
}
+ SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
this.cn();
+ SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.methodProfiler.b();
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b79a2e7..5d1aa0b 100644
index f965592..9061ff2 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -45,6 +45,7 @@ import jline.console.ConsoleReader;
import joptsimple.OptionSet;
@@ -45,6 +45,7 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.Main;
+import org.bukkit.craftbukkit.SpigotTimings; // Spigot
// CraftBukkit start
// CraftBukkit end
+import org.bukkit.craftbukkit.SpigotTimings; // Spigot
public abstract class MinecraftServer implements Runnable, ICommandListener, IAsyncTaskHandler, IMojangStatistics {
@@ -616,6 +617,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
protected void z() {}
protected void A() throws ExceptionWorldConflict { // CraftBukkit - added throws
@@ -617,6 +618,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
protected void B() {}
protected void C() throws ExceptionWorldConflict { // CraftBukkit - added throws
+ SpigotTimings.serverTickTimer.startTiming(); // Spigot
long i = System.nanoTime();
++this.ticks;
@@ -642,10 +644,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -643,10 +645,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit
@ -274,7 +262,7 @@ index b79a2e7..5d1aa0b 100644
}
this.methodProfiler.a("tallying");
@@ -662,6 +666,8 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -663,6 +667,8 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
this.methodProfiler.b();
@ -282,8 +270,8 @@ index b79a2e7..5d1aa0b 100644
+ org.spigotmc.CustomTimingsHandler.tick(); // Spigot
}
public void B() {
@@ -676,16 +682,23 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
public void D() {
@@ -677,16 +683,23 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.c("levels");
@ -307,7 +295,7 @@ index b79a2e7..5d1aa0b 100644
// Send time updates to everyone, it will get the right time from the world the player is in.
if (this.ticks % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -693,6 +706,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -694,6 +707,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(entityplayer.world.getTime(), entityplayer.getPlayerTime(), entityplayer.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time
}
}
@ -315,7 +303,7 @@ index b79a2e7..5d1aa0b 100644
int i;
@@ -716,7 +730,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -717,7 +731,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
CrashReport crashreport;
try {
@ -325,7 +313,7 @@ index b79a2e7..5d1aa0b 100644
} catch (Throwable throwable) {
crashreport = CrashReport.a(throwable, "Exception ticking world");
worldserver.a(crashreport);
@@ -724,7 +740,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -725,7 +741,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
try {
@ -335,7 +323,7 @@ index b79a2e7..5d1aa0b 100644
} catch (Throwable throwable1) {
crashreport = CrashReport.a(throwable1, "Exception ticking world entities");
worldserver.a(crashreport);
@@ -733,7 +751,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -734,7 +752,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
this.methodProfiler.a("tracker");
@ -345,12 +333,12 @@ index b79a2e7..5d1aa0b 100644
this.methodProfiler.b();
this.methodProfiler.b();
// } // CraftBukkit
@@ -742,14 +762,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -743,14 +763,20 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
this.methodProfiler.c("connection");
+ SpigotTimings.connectionTimer.startTiming(); // Spigot
this.aq().c();
this.am().c();
+ SpigotTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players");
+ SpigotTimings.playerListTimer.startTiming(); // Spigot
@ -359,26 +347,26 @@ index b79a2e7..5d1aa0b 100644
this.methodProfiler.c("tickables");
+ SpigotTimings.tickablesTimer.startTiming(); // Spigot
for (i = 0; i < this.p.size(); ++i) {
((IUpdatePlayerListBox) this.p.get(i)).c();
for (i = 0; i < this.o.size(); ++i) {
((ITickable) this.o.get(i)).c();
}
+ SpigotTimings.tickablesTimer.stopTiming(); // Spigot
this.methodProfiler.b();
}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 1ee1abf..10e5032 100644
index d39d2fe..212c576 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1090,6 +1090,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
@@ -1234,6 +1234,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
// CraftBukkit end
private void handleCommand(String s) {
+ org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot
// CraftBukkit start - whole method
this.c.info(this.player.getName() + " issued server command: " + s);
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
@@ -1099,18 +1100,22 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
@@ -1243,18 +1244,22 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
this.server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
@ -402,7 +390,7 @@ index 1ee1abf..10e5032 100644
// CraftBukkit end
}
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 513712d..b8d0961 100644
index baf1d73..8bbdc11 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -6,10 +6,12 @@ import java.util.concurrent.Callable;
@ -419,19 +407,19 @@ index 513712d..b8d0961 100644
private static Map<String, Class<? extends TileEntity>> f = Maps.newHashMap();
private static Map<Class<? extends TileEntity>, String> g = Maps.newHashMap();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 61db17c..e34964f 100644
index 010374f..b2305d9 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -21,6 +21,7 @@ import org.bukkit.Bukkit;
@@ -18,6 +18,7 @@ import com.google.common.collect.Maps;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.craftbukkit.util.LongHashSet;
+import org.bukkit.craftbukkit.SpigotTimings; // Spigot
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
@@ -129,6 +130,8 @@ public abstract class World implements IBlockAccess {
import org.bukkit.craftbukkit.event.CraftEventFactory;
@@ -99,6 +100,8 @@ public abstract class World implements IBlockAccess {
private int tickPosition;
public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot
+ public final SpigotTimings.WorldTimingsHandler timings; // Spigot
@ -439,51 +427,49 @@ index 61db17c..e34964f 100644
public CraftWorld getWorld() {
return this.world;
}
@@ -193,6 +196,7 @@ public abstract class World implements IBlockAccess {
});
this.getServer().addWorld(this.world);
// CraftBukkit end
+ timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings
@@ -131,6 +134,7 @@ public abstract class World implements IBlockAccess {
this.isClientSide = flag;
this.N = worldprovider.getWorldBorder();
this.getServer().addWorld(this.world); // CraftBukkit
+ timings = new SpigotTimings.WorldTimingsHandler(this); // Spigot - code below can generate new world and access timings
}
public World b() {
@@ -1302,6 +1306,7 @@ public abstract class World implements IBlockAccess {
this.g.clear();
this.methodProfiler.c("regular");
@@ -1303,6 +1307,7 @@ public abstract class World implements IBlockAccess {
CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1;
+ timings.entityTick.startTiming(); // Spigot
// CraftBukkit start - Use field for loop variable
for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) {
entity = (Entity) this.entityList.get(this.tickPosition);
@@ -1318,7 +1323,9 @@ public abstract class World implements IBlockAccess {
@@ -1320,7 +1325,9 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.a("tick");
if (!entity.dead) {
if (!entity.dead && !(entity instanceof EntityPlayer)) {
try {
+ SpigotTimings.tickEntityTimer.startTiming(); // Spigot
this.g(entity);
+ SpigotTimings.tickEntityTimer.stopTiming(); // Spigot
} catch (Throwable throwable1) {
crashreport = CrashReport.a(throwable1, "Ticking entity");
crashreportsystemdetails = crashreport.a("Entity being ticked");
@@ -1343,7 +1350,9 @@ public abstract class World implements IBlockAccess {
crashreport1 = CrashReport.a(throwable1, "Ticking entity");
crashreportsystemdetails1 = crashreport1.a("Entity being ticked");
@@ -1346,6 +1353,7 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.b();
}
+ timings.entityTick.stopTiming(); // Spigot
this.methodProfiler.c("blockEntities");
+ timings.tileEntityTick.startTiming(); // Spigot
this.M = true;
// CraftBukkit start - From below, clean up tile entities before ticking them
if (!this.c.isEmpty()) {
@@ -1362,6 +1371,7 @@ public abstract class World implements IBlockAccess {
@@ -1366,6 +1374,7 @@ public abstract class World implements IBlockAccess {
if (this.isLoaded(blockposition) && this.N.a(blockposition)) {
try {
this.methodProfiler.a(tileentity.getClass().getSimpleName());
+ tileentity.tickTimer.startTiming(); // Spigot
((IUpdatePlayerListBox) tileentity).c();
((ITickable) tileentity).c();
this.methodProfiler.b();
} catch (Throwable throwable2) {
CrashReport crashreport1 = CrashReport.a(throwable2, "Ticking block entity");
@@ -1370,6 +1380,11 @@ public abstract class World implements IBlockAccess {
@@ -1374,6 +1383,11 @@ public abstract class World implements IBlockAccess {
tileentity.a(crashreportsystemdetails1);
throw new ReportedException(crashreport1);
}
@ -495,7 +481,7 @@ index 61db17c..e34964f 100644
}
}
@@ -1382,6 +1397,8 @@ public abstract class World implements IBlockAccess {
@@ -1386,6 +1400,8 @@ public abstract class World implements IBlockAccess {
}
}
@ -503,8 +489,8 @@ index 61db17c..e34964f 100644
+ timings.tileEntityPending.startTiming(); // Spigot
this.M = false;
/* CraftBukkit start - Moved up
if (!this.c.isEmpty()) {
@@ -1414,6 +1431,7 @@ public abstract class World implements IBlockAccess {
if (!this.tileEntityListUnload.isEmpty()) {
@@ -1420,6 +1436,7 @@ public abstract class World implements IBlockAccess {
this.b.clear();
}
@ -512,15 +498,15 @@ index 61db17c..e34964f 100644
this.methodProfiler.b();
this.methodProfiler.b();
}
@@ -1458,6 +1476,7 @@ public abstract class World implements IBlockAccess {
@@ -1463,6 +1480,7 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - Use neighbor cache instead of looking up
Chunk startingChunk = this.getChunkIfLoaded(i >> 4, j >> 4);
if (!flag || (startingChunk != null && startingChunk.areNeighborsLoaded(2)) /* this.isAreaLoaded(i - b0, 0, j - b0, i + b0, 0, j + b0) */) {
+ entity.tickTimer.startTiming(); // Spigot
// CraftBukkit end
entity.P = entity.locX;
entity.Q = entity.locY;
@@ -1521,6 +1540,7 @@ public abstract class World implements IBlockAccess {
entity.M = entity.locX;
entity.N = entity.locY;
@@ -1530,6 +1548,7 @@ public abstract class World implements IBlockAccess {
}
}
@ -529,25 +515,24 @@ index 61db17c..e34964f 100644
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index bb0e146..f300850 100644
index 59b78bb..f8a2195 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -223,10 +223,13 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -219,10 +219,13 @@ public class WorldServer extends World implements IAsyncTaskHandler {
// CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals
long time = this.worldData.getTime();
if (this.getGameRules().getBoolean("doMobSpawning") && this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) {
+ timings.mobSpawn.startTiming(); // Spigot
this.R.a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L), this.worldData.getTime() % 400L == 0L);
this.spawnerCreature.a(this, this.allowMonsters && (this.ticksPerMonsterSpawns != 0 && time % this.ticksPerMonsterSpawns == 0L), this.allowAnimals && (this.ticksPerAnimalSpawns != 0 && time % this.ticksPerAnimalSpawns == 0L), this.worldData.getTime() % 400L == 0L);
+ timings.mobSpawn.stopTiming(); // Spigot
// CraftBukkit end
}
-
+ // CraftBukkit end
+ timings.doChunkUnload.startTiming(); // Spigot
this.methodProfiler.c("chunkSource");
this.chunkProvider.unloadChunks();
int j = this.a(1.0F);
@@ -240,21 +243,34 @@ public class WorldServer extends World implements IAsyncTaskHandler {
@@ -236,21 +239,35 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.worldData.setDayTime(this.worldData.getDayTime() + 1L);
}
@ -558,7 +543,7 @@ index bb0e146..f300850 100644
+ timings.doTickPending.stopTiming(); // Spigot
this.methodProfiler.c("tickBlocks");
+ timings.doTickTiles.startTiming(); // Spigot
this.h();
this.j();
+ timings.doTickTiles.stopTiming(); // Spigot
this.methodProfiler.c("chunkMap");
+ timings.doChunkMap.startTiming(); // Spigot
@ -571,11 +556,12 @@ index bb0e146..f300850 100644
+ timings.doVillages.stopTiming(); // Spigot
this.methodProfiler.c("portalForcer");
+ timings.doPortalForcer.startTiming(); // Spigot
this.Q.a(this.getTime());
this.portalTravelAgent.a(this.getTime());
+ timings.doPortalForcer.stopTiming(); // Spigot
this.methodProfiler.b();
+ timings.doSounds.startTiming(); // Spigot
this.ak();
this.ao();
+ timings.doSounds.stopTiming(); // Spigot
this.getWorld().processChunkGC(); // CraftBukkit
+ timings.doChunkGC.stopTiming(); // Spigot
@ -583,10 +569,10 @@ index bb0e146..f300850 100644
public BiomeBase.BiomeMeta a(EnumCreatureType enumcreaturetype, BlockPosition blockposition) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d296924..a8a8e64 100644
index 91965c0..261b423 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1652,6 +1652,11 @@ public final class CraftServer implements Server {
@@ -1663,6 +1663,11 @@ public final class CraftServer implements Server {
private final Spigot spigot = new Spigot()
{
@ -599,17 +585,15 @@ index d296924..a8a8e64 100644
public Spigot spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index dc06dcb..59eb83e 100644
index eedf49b..2b6928f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -257,9 +257,11 @@ public class CraftWorld implements World {
net.minecraft.server.Chunk chunk = world.chunkProviderServer.chunks.get(LongHash.toLong(x, z));
@@ -252,7 +252,9 @@ public class CraftWorld implements World {
net.minecraft.server.Chunk chunk = world.getChunkProviderServer().chunks.get(LongHash.toLong(x, z));
if (chunk == null) {
+ world.timings.syncChunkLoadTimer.startTiming(); // Spigot
chunk = world.chunkProviderServer.loadChunk(x, z);
chunkLoadPostProcess(chunk, x, z);
chunk = world.getChunkProviderServer().getOrLoadChunkAt(x, z);
+ world.timings.syncChunkLoadTimer.stopTiming(); // Spigot
}
return chunk != null;
@ -791,15 +775,15 @@ index 0000000..558574f
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
index c31f17f..1178ad7 100644
index 6dfef44..482af17 100644
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
@@ -49,7 +49,9 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
@@ -45,7 +45,9 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
chunk.addEntities();
if (queuedChunk.provider.chunkProvider != null) {
if (queuedChunk.provider.chunkGenerator != null) {
+ queuedChunk.provider.world.timings.syncChunkLoadStructuresTimer.startTiming(); // Spigot
queuedChunk.provider.chunkProvider.recreateStructures(chunk, queuedChunk.x, queuedChunk.z);
queuedChunk.provider.chunkGenerator.recreateStructures(chunk, queuedChunk.x, queuedChunk.z);
+ queuedChunk.provider.world.timings.syncChunkLoadStructuresTimer.stopTiming(); // Spigot
}
@ -888,5 +872,5 @@ index 55db3ff..220e39a 100644
+ // Spigot end
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From cd53964e04b6f576d5feb91e0bc36759ec14b750 Mon Sep 17 00:00:00 2001
From df5eaaafd25ed43b37cbc8073538fa9a362616e6 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 17:29:54 +1000
Subject: [PATCH] Fix Mob Spawning Relative to View Distance
@ -8,20 +8,20 @@ Changes the mob spawning algorithm to properly account for view distance and the
Needs better documentation.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 7e7aa11..746cbce 100644
index 8345e87..e4725b0 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -42,6 +42,7 @@ public class Chunk {
private long u;
private int v;
private ConcurrentLinkedQueue<BlockPosition> w;
@@ -43,6 +43,7 @@ public class Chunk {
private long v;
private int w;
private ConcurrentLinkedQueue<BlockPosition> x;
+ protected gnu.trove.map.hash.TObjectIntHashMap<Class> entityCount = new gnu.trove.map.hash.TObjectIntHashMap<Class>(); // Spigot
// CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking
private int neighbors = 0x1 << 12;
@@ -674,6 +675,22 @@ public class Chunk {
entity.af = k;
entity.ag = this.locZ;
@@ -606,6 +607,22 @@ public class Chunk {
entity.ac = k;
entity.ad = this.locZ;
this.entitySlices[k].add(entity);
+ // Spigot start - increment creature type count
+ // Keep this synced up with World.a(Class)
@ -42,7 +42,7 @@ index 7e7aa11..746cbce 100644
}
public void b(Entity entity) {
@@ -690,6 +707,22 @@ public class Chunk {
@@ -622,6 +639,22 @@ public class Chunk {
}
this.entitySlices[i].remove(entity);
@ -64,12 +64,12 @@ index 7e7aa11..746cbce 100644
+ // Spigot end
}
public boolean d(BlockPosition blockposition) {
public boolean c(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index cc1b347..3964e3f 100644
index b3cb8bb..9e19dfd 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -19,6 +19,25 @@ public final class SpawnerCreature {
@@ -17,6 +17,25 @@ public final class SpawnerCreature {
public SpawnerCreature() {}
@ -83,7 +83,7 @@ index cc1b347..3964e3f 100644
+ Long coord = it.next();
+ int x = LongHash.msw( coord );
+ int z = LongHash.lsw( coord );
+ if ( !server.chunkProviderServer.unloadQueue.contains( coord ) && server.isChunkLoaded( x, z, true ) )
+ if ( !((ChunkProviderServer)server.chunkProvider).unloadQueue.contains( coord ) && server.isChunkLoaded( x, z, true ) )
+ {
+ i += server.getChunkAt( x, z ).entityCount.get( oClass );
+ }
@ -95,7 +95,7 @@ index cc1b347..3964e3f 100644
public int a(WorldServer worldserver, boolean flag, boolean flag1, boolean flag2) {
if (!flag && !flag1) {
return 0;
@@ -38,6 +57,11 @@ public final class SpawnerCreature {
@@ -36,6 +55,11 @@ public final class SpawnerCreature {
j = MathHelper.floor(entityhuman.locZ / 16.0D);
byte b0 = 8;
@ -107,7 +107,7 @@ index cc1b347..3964e3f 100644
for (int i1 = -b0; i1 <= b0; ++i1) {
for (k = -b0; k <= b0; ++k) {
@@ -87,17 +111,19 @@ public final class SpawnerCreature {
@@ -89,18 +113,20 @@ public final class SpawnerCreature {
if (limit == 0) {
continue;
}
@ -120,34 +120,33 @@ index cc1b347..3964e3f 100644
- if (k <= l1) {
+ if ((mobcnt = getEntityCount(worldserver, enumcreaturetype.a())) <= limit * i / 256) {
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
Iterator iterator1 = this.b.iterator();
+ int moblimit = (limit * i / 256) - mobcnt + 1; // Spigot - up to 1 more than limit
label115:
label120:
- while (iterator1.hasNext()) {
+ while (iterator1.hasNext() && (moblimit > 0)) { // Spigot - while more allowed
// CraftBukkit start = use LongHash and LongObjectHashMap
long key = ((Long) iterator1.next()).longValue();
BlockPosition blockposition1 = getRandomPosition(worldserver, LongHash.msw(key), LongHash.lsw(key));
@@ -156,6 +182,13 @@ public final class SpawnerCreature {
worldserver.addEntity(entityinsentient, SpawnReason.NATURAL); // CraftBukkit - Added a reason for spawning this creature
@@ -162,7 +188,10 @@ public final class SpawnerCreature {
entityinsentient.die();
}
- if (l2 >= entityinsentient.cJ()) {
+ // Spigot start
+ if ( --moblimit <= 0 )
+ {
+ if ( --moblimit <= 0 ) {
+ // If we're past limit, stop spawn
+ continue label115;
+ }
+ // Spigot end
if (l2 >= entityinsentient.bV()) {
continue label115;
+ // Spigot end
continue label120;
}
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index a3255eb..a85800d 100644
index 86300d6..cacb8fc 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -133,4 +133,11 @@ public class SpigotWorldConfig
@@ -122,4 +122,11 @@ public class SpigotWorldConfig
viewDistance = getInt( "view-distance", Bukkit.getViewDistance() );
log( "View Distance: " + viewDistance );
}
@ -160,5 +159,5 @@ index a3255eb..a85800d 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 5846865ec3ebf4fcc2d6c35617cc6dddc6bc18a2 Mon Sep 17 00:00:00 2001
From c3f267cdf3016e997fe73dff2eeb4434dd8486ad 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] Handle Null Tile Entities
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e34964f..275856f 100644
index b2305d9..ee249b6 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1365,6 +1365,13 @@ public abstract class World implements IBlockAccess {
@@ -1367,6 +1367,13 @@ public abstract class World implements IBlockAccess {
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
@ -23,5 +23,5 @@ index e34964f..275856f 100644
if (!tileentity.x() && tileentity.t()) {
BlockPosition blockposition = tileentity.getPosition();
--
2.1.4
2.5.0

View File

@ -1,29 +1,29 @@
From c2bf94e9b17ef38629028376bce393386400fe09 Mon Sep 17 00:00:00 2001
From 9d325174af031a978b6485c0cd5d980cc12cfdb9 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 22 Sep 2013 19:10:53 +1000
Subject: [PATCH] Item Despawn Rate
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index b80801a..abd85b0 100644
index 7ea1150..eb0f8eb 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -108,7 +108,7 @@ public class EntityItem extends Entity {
@@ -109,7 +109,7 @@ public class EntityItem extends Entity {
// Craftbukkit end */
this.W();
this.aj();
- if (!this.world.isClientSide && this.age >= 6000) {
+ if (!this.world.isClientSide && this.age >= world.spigotConfig.itemDespawnRate) { // Spigot
// CraftBukkit start - fire ItemDespawnEvent
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
this.age = 0;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 15cb6b4..efbfa2e 100644
index cacb8fc..ca888fc 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -200,4 +200,11 @@ public class SpigotWorldConfig
log( "*** WARNING *** Please use this option with caution, SpigotMC is not responsible for any issues this option may cause in the future!" );
}
@@ -129,4 +129,11 @@ public class SpigotWorldConfig
mobSpawnRange = (byte) getInt( "mob-spawn-range", 4 );
log( "Mob Spawn Range: " + mobSpawnRange );
}
+
+ public int itemDespawnRate;
@ -34,5 +34,5 @@ index 15cb6b4..efbfa2e 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From e1f60c92d7fecfb32ad0a17e038abe5bbfca92f4 Mon Sep 17 00:00:00 2001
From c71914cc83d2736d7ea1c2d8a44b5e93653f3f92 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,44 +9,35 @@ 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 dd1005a..2f386ac 100644
index 63cc105..1817e6d 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -89,14 +89,14 @@ public abstract class Entity implements ICommandListener {
@@ -107,7 +107,7 @@ public abstract class Entity implements ICommandListener {
public int ticksLived;
public int maxFireTicks;
public int fireTicks;
- protected boolean inWater;
- public boolean inWater;
+ public boolean inWater; // Spigot - protected -> public // PAIL
public int noDamageTicks;
protected boolean justCreated;
protected boolean fireProof;
protected DataWatcher datawatcher;
private double ar;
private double as;
- public boolean ad;
+ public boolean ad; public boolean isAddedToChunk() { return ad; } // Spigot // PAIL
public int ae;
public int af;
public int ag;
@@ -116,7 +116,13 @@ public abstract class Entity implements ICommandListener {
@@ -141,6 +141,12 @@ public abstract class Entity implements ICommandListener {
public org.bukkit.projectiles.ProjectileSource projectileSource; // CraftBukkit - For projectiles only
public boolean forceExplosionKnockback; // CraftBukkit - SPIGOT-949
+ // Spigot start
public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot
+ // Spigot start
+ public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
+ public final boolean defaultActivationState;
+ public long activatedTick = Integer.MIN_VALUE;
+ public void inactiveTick() { }
+ // Spigot end
public int getId() {
return this.id;
@@ -146,7 +152,12 @@ public abstract class Entity implements ICommandListener {
public Entity(World world) {
this.id = Entity.entityCount++;
@@ -160,7 +166,12 @@ public abstract class Entity implements ICommandListener {
this.setPosition(0.0D, 0.0D, 0.0D);
if (world != null) {
this.dimension = world.worldProvider.getDimension();
this.dimension = world.worldProvider.getDimensionManager().getDimensionID();
+ // Spigot start
+ this.defaultActivationState = org.spigotmc.ActivationRange.initializeEntityActivationState(this, world.spigotConfig);
+ } else {
@ -55,14 +46,14 @@ index dd1005a..2f386ac 100644
+ // Spigot end
this.datawatcher = new DataWatcher(this);
this.datawatcher.a(0, Byte.valueOf((byte) 0));
this.datawatcher.register(Entity.ax, Byte.valueOf((byte) 0));
diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java
index 8a74059..09d4335 100644
index e4a02bc..dbede68 100644
--- a/src/main/java/net/minecraft/server/EntityAgeable.java
+++ b/src/main/java/net/minecraft/server/EntityAgeable.java
@@ -9,6 +9,31 @@ public abstract class EntityAgeable extends EntityCreature {
private float bn;
public boolean ageLocked = false; // CraftBukkit
@@ -10,6 +10,31 @@ public abstract class EntityAgeable extends EntityCreature {
private float bx;
public boolean ageLocked; // CraftBukkit
+ // Spigot start
+ @Override
@ -93,20 +84,20 @@ index 8a74059..09d4335 100644
super(world);
}
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 04863b3..3359160 100644
index 1cda4e6..a40f3ec 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -15,7 +15,7 @@ public class EntityArrow extends Entity implements IProjectile {
private int f = -1;
private Block g;
private int h;
- private boolean inGround;
+ public boolean inGround = false; // Spigot - private -> public
public int fromPlayer;
@@ -27,7 +27,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
private int at;
private Block au;
private int av;
- protected boolean inGround;
+ public boolean inGround; // Spigot - protected -> public
protected int b;
public EntityArrow.PickupStatus fromPlayer;
public int shake;
public Entity shooter;
@@ -24,6 +24,18 @@ public class EntityArrow extends Entity implements IProjectile {
private double damage = 2.0D;
@@ -37,6 +37,18 @@ public abstract class EntityArrow extends Entity implements IProjectile {
private double damage;
public int knockbackStrength;
+ // Spigot Start
@ -115,7 +106,7 @@ index 04863b3..3359160 100644
+ {
+ if ( this.inGround )
+ {
+ this.ar += 1; // Despawn counter. First int after shooter
+ this.aw += 1; // Despawn counter. First int after shooter
+ }
+ super.inactiveTick();
+ }
@ -123,32 +114,31 @@ index 04863b3..3359160 100644
+
public EntityArrow(World world) {
super(world);
this.j = 10.0D;
this.h = -1;
diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java
index 34820c5..d7be6c2 100644
index 7454fde..ff44aa4 100644
--- a/src/main/java/net/minecraft/server/EntityFireworks.java
+++ b/src/main/java/net/minecraft/server/EntityFireworks.java
@@ -5,6 +5,15 @@ public class EntityFireworks extends Entity {
private int ticksFlown;
public int expectedLifespan;
@@ -13,6 +13,14 @@ public class EntityFireworks extends Entity {
this.setSize(0.25F, 0.25F);
}
+ // Spigot Start
+ @Override
+ public void inactiveTick()
+ {
+ public void inactiveTick() {
+ this.ticksFlown += 1;
+ super.inactiveTick();
+ }
+ // Spigot End
+
public EntityFireworks(World world) {
super(world);
this.setSize(0.25F, 0.25F);
protected void i() {
this.datawatcher.register(EntityFireworks.FIREWORK_ITEM, Optional.absent());
}
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index 8b7cd86..fe9a000 100644
index eb0f8eb..39af5d5 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -121,6 +121,28 @@ public class EntityItem extends Entity {
@@ -122,6 +122,28 @@ public class EntityItem extends Entity {
}
}
@ -174,16 +164,16 @@ index 8b7cd86..fe9a000 100644
+ }
+ // Spigot end
+
private void w() {
private void x() {
// Spigot start
double radius = world.spigotConfig.itemMerge;
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index b8920fd..bd30895 100644
index e5704fd..1ed0400 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -89,6 +89,13 @@ public abstract class EntityLiving extends Entity {
public int maxAirTicks = 300;
ArrayList<org.bukkit.inventory.ItemStack> drops = null;
@@ -102,6 +102,13 @@ public abstract class EntityLiving extends Entity {
ArrayList<org.bukkit.inventory.ItemStack> drops;
public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
// CraftBukkit end
+ // Spigot start
+ public void inactiveTick()
@ -193,21 +183,21 @@ index b8920fd..bd30895 100644
+ }
+ // Spigot end
public void G() {
public void Q() {
this.damageEntity(DamageSource.OUT_OF_WORLD, Float.MAX_VALUE);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 275856f..b959a79 100644
index ee249b6..2eaa1cb 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1306,6 +1306,7 @@ public abstract class World implements IBlockAccess {
this.g.clear();
this.methodProfiler.c("regular");
@@ -1307,6 +1307,7 @@ public abstract class World implements IBlockAccess {
CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1;
+ org.spigotmc.ActivationRange.activateEntities(this); // Spigot
timings.entityTick.startTiming(); // Spigot
// CraftBukkit start - Use field for loop variable
for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) {
@@ -1480,9 +1481,11 @@ public abstract class World implements IBlockAccess {
@@ -1484,9 +1485,11 @@ public abstract class World implements IBlockAccess {
int j = MathHelper.floor(entity.locZ);
byte b0 = 32;
@ -221,7 +211,7 @@ index 275856f..b959a79 100644
+ } else {
entity.tickTimer.startTiming(); // Spigot
// CraftBukkit end
entity.P = entity.locX;
entity.M = entity.locX;
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
index 558574f..41d2d87 100644
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
@ -238,14 +228,12 @@ index 558574f..41d2d87 100644
public static final HashMap<String, CustomTimingsHandler> pluginTaskTimingMap = new HashMap<String, CustomTimingsHandler>();
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
new file mode 100644
index 0000000..3da76ff
index 0000000..70d8ab1
--- /dev/null
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -0,0 +1,289 @@
@@ -0,0 +1,286 @@
+package org.spigotmc;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import net.minecraft.server.AxisAlignedBB;
+import net.minecraft.server.Chunk;
@ -275,15 +263,14 @@ index 0000000..3da76ff
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.World;
+import org.bukkit.craftbukkit.SpigotTimings;
+import org.bukkit.entity.Creeper;
+
+public class ActivationRange
+{
+
+ static AxisAlignedBB maxBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB miscBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB animalBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB monsterBB = AxisAlignedBB.a( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB maxBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB miscBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB animalBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 );
+ static AxisAlignedBB monsterBB = new AxisAlignedBB( 0, 0, 0, 0, 0, 0 );
+
+ /**
+ * Initializes an entities type on construction to specify what group this
@ -352,7 +339,7 @@ index 0000000..3da76ff
+ maxRange = Math.max( maxRange, miscActivationRange );
+ maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange );
+
+ for ( Entity player : (List<Entity>) world.players )
+ for ( EntityHuman player : world.players )
+ {
+
+ player.activatedTick = MinecraftServer.currentTick;
@ -434,14 +421,13 @@ index 0000000..3da76ff
+ public static boolean checkEntityImmunities(Entity entity)
+ {
+ // quick checks.
+ if ( entity.inWater /* isInWater */ || entity.fireTicks > 0 )
+ if ( entity.inWater || entity.fireTicks > 0 )
+ {
+ return true;
+ }
+ if ( !( entity instanceof EntityArrow ) )
+ {
+ if ( !entity.onGround || entity.passenger != null
+ || entity.vehicle != null )
+ if ( !entity.onGround || !entity.passengers.isEmpty() || entity.getVehicle()!= null )
+ {
+ return true;
+ }
@ -461,14 +447,14 @@ index 0000000..3da76ff
+ {
+ return true;
+ }
+ if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).ck() /* Getter for first boolean */ )
+ if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).da() /* Getter for first boolean */ )
+ {
+ return true;
+ }
+ if ( entity instanceof EntityAnimal )
+ {
+ EntityAnimal animal = (EntityAnimal) entity;
+ if ( animal.isBaby() || animal.cp() /*love*/ )
+ if ( animal.isBaby() || animal.isInLove() )
+ {
+ return true;
+ }
@ -477,7 +463,7 @@ index 0000000..3da76ff
+ return true;
+ }
+ }
+ if (entity instanceof EntityCreeper && ((EntityCreeper) entity).cn()) { // isExplosive
+ if (entity instanceof EntityCreeper && ((EntityCreeper) entity).isIgnited()) { // isExplosive
+ return true;
+ }
+ }
@ -494,7 +480,8 @@ index 0000000..3da76ff
+ {
+ SpigotTimings.checkIfActiveTimer.startTiming();
+ // Never safe to skip fireworks or entities not yet added to chunk
+ if ( !entity.isAddedToChunk() || entity instanceof EntityFireworks ) {
+ // PAIL: inChunk
+ if ( !entity.aa || entity instanceof EntityFireworks ) {
+ SpigotTimings.checkIfActiveTimer.stopTiming();
+ return true;
+ }
@ -532,12 +519,12 @@ index 0000000..3da76ff
+ }
+}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index a85800d..da8563b 100644
index ca888fc..92dbe54 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -140,4 +140,15 @@ public class SpigotWorldConfig
mobSpawnRange = (byte) getInt( "mob-spawn-range", 4 );
log( "Mob Spawn Range: " + mobSpawnRange );
@@ -136,4 +136,15 @@ public class SpigotWorldConfig
itemDespawnRate = getInt( "item-despawn-rate", 6000 );
log( "Item Despawn Rate: " + itemDespawnRate );
}
+
+ public int animalActivationRange = 32;
@ -552,5 +539,5 @@ index a85800d..da8563b 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From c5caf2c18d39f621e699a03c53e2e6d64d5ad5cb Mon Sep 17 00:00:00 2001
From 4b8c1087a9000829b757e6d26a03637efe538dd1 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
@ -687,5 +687,5 @@ index cb88089..dcca493 100644
static void readConfig(Class<?> clazz, Object instance)
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 927b1e1f6463fc52c8718735deb38f5b315c7260 Mon Sep 17 00:00:00 2001
From 1083cb33e05d7bcf0b099fd46c68f1c361093bd1 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
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 2821afa..b722be5 100644
index 32d9fd4..acc5bd2 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -339,6 +339,11 @@ public final class ItemStack {
@@ -335,6 +335,11 @@ public final class ItemStack {
}
public boolean isDamaged(int i, Random random) {
@ -20,7 +20,7 @@ index 2821afa..b722be5 100644
if (!this.e()) {
return false;
} else {
@@ -353,7 +358,16 @@ public final class ItemStack {
@@ -349,7 +354,16 @@ public final class ItemStack {
}
i -= k;
@ -38,15 +38,15 @@ index 2821afa..b722be5 100644
return false;
}
}
@@ -366,7 +380,7 @@ public final class ItemStack {
@@ -362,7 +376,7 @@ public final class ItemStack {
public void damage(int i, EntityLiving entityliving) {
if (!(entityliving instanceof EntityHuman) || !((EntityHuman) entityliving).abilities.canInstantlyBuild) {
if (this.e()) {
- if (this.isDamaged(i, entityliving.bc())) {
+ if (this.isDamaged(i, entityliving.bc(), entityliving)) { // Spigot
- if (this.isDamaged(i, entityliving.getRandom())) {
+ if (this.isDamaged(i, entityliving.getRandom(), entityliving)) { // Spigot
entityliving.b(this);
--this.count;
if (entityliving instanceof EntityHuman) {
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 6c4714ec822f04f5edd10bd57cc8db50df6d3b17 Mon Sep 17 00:00:00 2001
From e8ad8786c6328c9a01462f0dd6c3c1b03473bfd1 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
@ -23,5 +23,5 @@ index 42a6f9a..43adfcc 100644
System.arraycopy(revertComponents(sign.lines), 0, lines, 0, lines.length);
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 9af363974598c5f5b89a7ca2c88232b2941b5330 Mon Sep 17 00:00:00 2001
From 4cf6a4c069827b34e5d1ee8007baa6c62848352c 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,61 +12,22 @@ 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 e1ff4f0..cb72b36 100644
index 0c19e5a..3773bb1 100644
--- a/src/main/java/net/minecraft/server/EntityTracker.java
+++ b/src/main/java/net/minecraft/server/EntityTracker.java
@@ -95,6 +95,7 @@ public class EntityTracker {
@@ -103,6 +103,7 @@ public class EntityTracker {
public void addEntity(Entity entity, int i, final int j, boolean flag) {
org.spigotmc.AsyncCatcher.catchOp( "entity track"); // Spigot
+ i = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, i); // Spigot
if (i > this.e) {
i = this.e;
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 3da76ff..ccf6d93 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -108,7 +108,7 @@ public class ActivationRange
maxRange = Math.max( maxRange, miscActivationRange );
maxRange = Math.min( ( world.spigotConfig.viewDistance << 4 ) - 8, maxRange );
- for ( Entity player : (List<Entity>) world.players )
+ for ( Entity player : (List<Entity>) (List) world.players )
{
player.activatedTick = MinecraftServer.currentTick;
@@ -190,7 +190,7 @@ public class ActivationRange
public static boolean checkEntityImmunities(Entity entity)
{
// quick checks.
- if ( entity.inWater /* isInWater */ || entity.fireTicks > 0 )
+ if ( entity.inWater || entity.fireTicks > 0 )
{
return true;
}
@@ -217,14 +217,14 @@ public class ActivationRange
{
return true;
}
- if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).ck() /* Getter for first boolean */ )
+ if ( entity instanceof EntityVillager && ( (EntityVillager) entity ).cm() /* Getter for first boolean */ )
{
return true;
}
if ( entity instanceof EntityAnimal )
{
EntityAnimal animal = (EntityAnimal) entity;
- if ( animal.isBaby() || animal.cp() /*love*/ )
+ if ( animal.isBaby() || animal.isInLove() )
{
return true;
}
try {
if (this.trackedEntities.b(entity.getId())) {
throw new IllegalStateException("Entity is already tracked!");
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index da8563b..3d4896b 100644
index 92dbe54..1369657 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -151,4 +151,19 @@ public class SpigotWorldConfig
@@ -147,4 +147,19 @@ public class SpigotWorldConfig
miscActivationRange = getInt( "entity-activation-range.misc", miscActivationRange );
log( "Entity Activation Range: An " + animalActivationRange + " / Mo " + monsterActivationRange + " / Mi " + miscActivationRange );
}
@ -144,5 +105,5 @@ index 0000000..4bf4d2a
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 11b631871b5943607fc15ec70a841a8af7020aa9 Mon Sep 17 00:00:00 2001
From 8ff8b8fec0b8f1f483ba928a405ed0946ef4a6a3 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
@ -19,5 +19,5 @@ index 8442ecb..93d8d42 100644
private CraftAsyncDebugger debugTail = debugHead;
private static final int RECENT_TICKS;
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 621d8db4243864d2a6c265877e56ad14dd54d57f Mon Sep 17 00:00:00 2001
From 5f99873d4186a6be4ce9bbf25c86328c2135edb7 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 Save Files
@ -18,10 +18,10 @@ index b07e7d5..5528019 100644
public static synchronized RegionFile a(File file, int i, int j) {
File file1 = new File(file, "region");
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a8a8e64..9e9435e 100644
index 261b423..f906f60 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -962,6 +962,31 @@ public final class CraftServer implements Server {
@@ -966,6 +966,31 @@ public final class CraftServer implements Server {
worlds.remove(world.getName().toLowerCase());
console.worlds.remove(console.worlds.indexOf(handle));
@ -54,5 +54,5 @@ index a8a8e64..9e9435e 100644
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 561aaac2d5dc20515d3b4161fa880b9ba70962b0 Mon Sep 17 00:00:00 2001
From 8a37308b1c8dd725d5662048b005bc6f1b163a37 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
@ -6,7 +6,7 @@ Subject: [PATCH] Remove -o Option
Serves no purpose other than to confuse users.
diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java
index 856ae39..0ee7fe8 100644
index 8ee534b..80ec702 100644
--- a/src/main/java/net/minecraft/server/PropertyManager.java
+++ b/src/main/java/net/minecraft/server/PropertyManager.java
@@ -54,7 +54,7 @@ public class PropertyManager {
@ -19,5 +19,5 @@ index 856ae39..0ee7fe8 100644
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 40711de0bf9bd0111c07ac647f806bf899992af5 Mon Sep 17 00:00:00 2001
From 25813993ae1e7b40a6b58c7fde1ce61cb71e9108 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
@ -6,7 +6,7 @@ Subject: [PATCH] Recipe Deconstruction
Some non API methods contributed by Asphodan to allow recipe deconstruction.
diff --git a/src/main/java/net/minecraft/server/IRecipe.java b/src/main/java/net/minecraft/server/IRecipe.java
index babf604..e7aba17 100644
index f963104..ffc65a2 100644
--- a/src/main/java/net/minecraft/server/IRecipe.java
+++ b/src/main/java/net/minecraft/server/IRecipe.java
@@ -13,4 +13,6 @@ public interface IRecipe {
@ -17,7 +17,7 @@ index babf604..e7aba17 100644
+ java.util.List<ItemStack> getIngredients(); // Spigot
}
diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java
index a387e2d..825b6d9 100644
index 28adcdb..cac2e78 100644
--- a/src/main/java/net/minecraft/server/ShapedRecipes.java
+++ b/src/main/java/net/minecraft/server/ShapedRecipes.java
@@ -10,7 +10,7 @@ public class ShapedRecipes implements IRecipe {
@ -42,7 +42,7 @@ index a387e2d..825b6d9 100644
+ // Spigot end
}
diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java
index b13dcb7..aa0e9aa 100644
index 8570889..e9934f9 100644
--- a/src/main/java/net/minecraft/server/ShapelessRecipes.java
+++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java
@@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe;
@ -67,5 +67,5 @@ index b13dcb7..aa0e9aa 100644
+ // Spigot end
}
--
2.1.4
2.5.0

View File

@ -1,11 +1,11 @@
From b362f88b396a1220b9e55a48ec6ee08fb400db39 Mon Sep 17 00:00:00 2001
From 9b4f5137f204ffb2f3eeeeca0787ae133fdc8257 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
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
index bf48e6e..ad489cc 100644
index bf48e6e..2a3482c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
@@ -75,6 +75,17 @@ public class CraftArrow extends AbstractProjectile implements Arrow {
@ -15,17 +15,17 @@ index bf48e6e..ad489cc 100644
+ @Override
+ public double getDamage()
+ {
+ return getHandle().j();
+ return getHandle().k();
+ }
+
+ @Override
+ public void setDamage(double damage)
+ {
+ getHandle().b( damage );
+ getHandle().c( damage );
+ }
};
public Arrow.Spigot spigot()
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From f0d8e184d3c543840e50a775dd7aebc5b733eaba Mon Sep 17 00:00:00 2001
From 68ce95ca445ea5500f1ef9e7ab0cfdf910b51e2d Mon Sep 17 00:00:00 2001
From: erocs <github@erocs.org>
Date: Sun, 8 Sep 2013 12:06:15 -0700
Subject: [PATCH] Hopper Customisations
@ -6,15 +6,15 @@ Subject: [PATCH] Hopper Customisations
Allows editing hopper cooldowns and amount transferred per tick.
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 8f771af..6785b71 100644
index 7b00f6a..c01acb9 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -194,12 +194,11 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -174,12 +174,11 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
}
if (flag) {
- this.d(8);
+ this.d(world.spigotConfig.hopperTransfer); // Spigot
- this.setCooldown(8);
+ this.setCooldown(world.spigotConfig.hopperTransfer); // Spigot
this.update();
return true;
}
@ -23,7 +23,7 @@ index 8f771af..6785b71 100644
return false;
} else {
return false;
@@ -253,7 +252,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -233,7 +232,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
// ItemStack itemstack1 = addItem(iinventory, this.splitStack(i, 1), enumdirection);
// CraftBukkit start - Call event when pushing items into other inventories
@ -32,19 +32,19 @@ index 8f771af..6785b71 100644
Inventory destinationInventory;
// Have to special case large chests as they work oddly
@@ -267,9 +266,10 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -247,9 +246,10 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
this.getWorld().getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
this.setItem(i, itemstack);
- this.d(8); // Delay hopper checks
+ this.d(world.spigotConfig.hopperTransfer); // Spigot
- this.setCooldown(8); // Delay hopper checks
+ this.setCooldown(world.spigotConfig.hopperTransfer); // Spigot
return false;
}
+ int origCount = event.getItem().getAmount(); // Spigot
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection);
if (itemstack1 == null || itemstack1.count == 0) {
@@ -281,7 +281,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -261,7 +261,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
// CraftBukkit end
return true;
}
@ -53,7 +53,7 @@ index 8f771af..6785b71 100644
this.setItem(i, itemstack);
}
}
@@ -391,7 +391,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -371,7 +371,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
ItemStack itemstack1 = itemstack.cloneItemStack();
// ItemStack itemstack2 = addItem(ihopper, iinventory.splitStack(i, 1), (EnumDirection) null);
// CraftBukkit start - Call event on collection of items from inventories into the hopper
@ -62,15 +62,15 @@ index 8f771af..6785b71 100644
Inventory sourceInventory;
// Have to special case large chests as they work oddly
@@ -408,13 +408,13 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -388,13 +388,13 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
iinventory.setItem(i, itemstack1);
if (ihopper instanceof TileEntityHopper) {
- ((TileEntityHopper) ihopper).d(8); // Delay hopper checks
+ ((TileEntityHopper) ihopper).d(ihopper.getWorld().spigotConfig.hopperTransfer); // Spigot
- ((TileEntityHopper) ihopper).setCooldown(8); // Delay hopper checks
+ ((TileEntityHopper) ihopper).setCooldown(ihopper.getWorld().spigotConfig.hopperTransfer); // Spigot
} else if (ihopper instanceof EntityMinecartHopper) {
- ((EntityMinecartHopper) ihopper).m(4); // Delay hopper minecart checks
+ ((EntityMinecartHopper) ihopper).m(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot
- ((EntityMinecartHopper) ihopper).setCooldown(4); // Delay hopper minecart checks
+ ((EntityMinecartHopper) ihopper).setCooldown(ihopper.getWorld().spigotConfig.hopperTransfer / 2); // Spigot
}
-
return false;
@ -79,7 +79,7 @@ index 8f771af..6785b71 100644
ItemStack itemstack2 = addItem(ihopper, CraftItemStack.asNMSCopy(event.getItem()), null);
if (itemstack2 == null || itemstack2.count == 0) {
@@ -426,6 +426,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -406,6 +406,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
// CraftBukkit end
return true;
}
@ -87,20 +87,20 @@ index 8f771af..6785b71 100644
iinventory.setItem(i, itemstack1);
}
@@ -515,7 +516,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
@@ -495,7 +496,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
TileEntityHopper tileentityhopper = (TileEntityHopper) iinventory;
if (tileentityhopper.o()) {
- tileentityhopper.d(8);
+ tileentityhopper.d(tileentityhopper.world.spigotConfig.hopperTransfer); // Spigot
if (tileentityhopper.p()) {
- tileentityhopper.setCooldown(8);
+ tileentityhopper.setCooldown(tileentityhopper.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 3d4896b..f0e3b97 100644
index 1369657..4de0a98 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -166,4 +166,19 @@ public class SpigotWorldConfig
@@ -162,4 +162,19 @@ public class SpigotWorldConfig
otherTrackingRange = getInt( "entity-tracking-range.other", otherTrackingRange );
log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + otherTrackingRange );
}
@ -121,5 +121,5 @@ index 3d4896b..f0e3b97 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 7de3bb97d2030311993a14f4e59c30569956d16e Mon Sep 17 00:00:00 2001
From d5fcc142f5bdb75438c67490e1293e89cb2194ab 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
@ -27,5 +27,5 @@ index 0f7da6b..5a409ae 100644
}
--
2.1.4
2.5.0

View File

@ -1,103 +0,0 @@
From 69d3535e743af676c4b77b3f2af1781062ae1216 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.
Adds BUKKIT-267
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 7b10821..35ed213 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -4,7 +4,11 @@ import com.google.common.collect.Lists;
import java.util.Iterator;
import java.util.List;
-import org.bukkit.event.entity.CreatureSpawnEvent; // CraftBukkit
+// CraftBukkit start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.SpawnerSpawnEvent;
+// CraftBukkit end
public abstract class MobSpawnerAbstract {
@@ -136,7 +140,12 @@ public abstract class MobSpawnerAbstract {
entity.f(nbttagcompound);
if (entity.world != null && flag) {
- entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
+ // CraftBukkit start - call SpawnerSpawnEvent, abort if cancelled
+ SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ());
+ if (!event.isCancelled()) {
+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
+ }
+ // CraftBukkit end
}
NBTTagCompound nbttagcompound1;
@@ -160,6 +169,11 @@ public abstract class MobSpawnerAbstract {
entity2.f(nbttagcompound2);
entity2.setPositionRotation(entity1.locX, entity1.locY, entity1.locZ, entity1.yaw, entity1.pitch);
+ // CraftBukkit start - call SpawnerSpawnEvent, skip if cancelled
+ SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity2, this.b().getX(), this.b().getY(), this.b().getZ());
+ if (event.isCancelled()) {
+ continue;
+ }
if (entity.world != null && flag) {
entity.world.addEntity(entity2, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
}
@@ -173,8 +187,12 @@ public abstract class MobSpawnerAbstract {
if (entity instanceof EntityInsentient) {
((EntityInsentient) entity).prepare(entity.world.E(new BlockPosition(entity)), (GroupDataEntity) null);
}
-
- entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
+ // Spigot start - call SpawnerSpawnEvent, abort if cancelled
+ SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ());
+ if (!event.isCancelled()) {
+ entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
+ }
+ // Spigot end
}
return entity;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f0d3f75..2771b28 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -18,6 +18,7 @@ import org.bukkit.Statistic.Type;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState;
+import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftStatistic;
import org.bukkit.craftbukkit.CraftWorld;
@@ -129,6 +130,22 @@ public class CraftEventFactory {
}
/**
+ * Mob spawner event
+ */
+ public static SpawnerSpawnEvent callSpawnerSpawnEvent(Entity spawnee, int spawnerX, int spawnerY, int spawnerZ) {
+ org.bukkit.craftbukkit.entity.CraftEntity entity = spawnee.getBukkitEntity();
+ BlockState state = entity.getWorld().getBlockAt(spawnerX, spawnerY, spawnerZ).getState();
+
+ if (!(state instanceof CreatureSpawner)) {
+ state = null;
+ }
+
+ SpawnerSpawnEvent event = new SpawnerSpawnEvent(entity, (CreatureSpawner) state);
+ entity.getServer().getPluginManager().callEvent(event);
+ return event;
+ }
+
+ /**
* Bucket methods
*/
public static PlayerBucketEmptyEvent callPlayerBucketEmptyEvent(EntityHuman who, int clickedX, int clickedY, int clickedZ, EnumDirection clickedFace, ItemStack itemInHand) {
--
2.1.4

View File

@ -1,19 +1,19 @@
From b33bb999524e6ccfbfdc394517e9ce7f55bc3a8c Mon Sep 17 00:00:00 2001
From fd54e0852c6b1ce70392ce2596a2f93c493c9349 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 18:01:29 +1000
Subject: [PATCH] Allow Disabling of Command Logging
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 10e5032..9ff5828 100644
index 212c576..c13a2be 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1092,6 +1092,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
@@ -1236,6 +1236,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private void handleCommand(String s) {
org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.startTiming(); // Spigot
// CraftBukkit start - whole method
+ if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
this.c.info(this.player.getName() + " issued server command: " + s);
this.LOGGER.info(this.player.getName() + " issued server command: " + s);
CraftPlayer player = this.getPlayer();
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
@ -32,5 +32,5 @@ index dcca493..3999f5b 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From aa91333687133d4f19f3659526a058d970366de1 Mon Sep 17 00:00:00 2001
From 1ecd0d2095dc90232d8d4ece718453ed83ea336e Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 18:05:54 +1000
Subject: [PATCH] Allow Disabling of Command TabComplete
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9e9435e..5ef5f5a 100644
index f906f60..fa21527 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1566,6 +1566,13 @@ public final class CraftServer implements Server {
@@ -1572,6 +1572,13 @@ public final class CraftServer implements Server {
}
public List<String> tabCompleteCommand(Player player, String message) {
@ -49,5 +49,5 @@ index 3999f5b..ca001e9 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,32 +1,32 @@
From 172258793066b82c106ae96b396420d0872326cb Mon Sep 17 00:00:00 2001
From 9eef4f3b94672d8e232be0ff3474a93514dd5faf Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 19:21:58 +1000
Subject: [PATCH] Configurable Messages
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
index 2d937c1..a1cae86 100644
index 37c13c5..ee987b9 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -62,11 +62,11 @@ public class HandshakeListener implements PacketHandshakingInListener {
// CraftBukkit end
if (packethandshakinginsetprotocol.b() > 47) {
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.8.8");
+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), "1.8.8" ) ); // Spigot
this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
if (packethandshakinginsetprotocol.b() > 107) {
- chatcomponenttext = new ChatComponentText("Outdated server! I\'m still on 1.9");
+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedServerMessage.replaceAll("'", "''"), "1.9" ) ); // Spigot
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
this.b.close(chatcomponenttext);
} else if (packethandshakinginsetprotocol.b() < 47) {
- chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.8.8");
+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), "1.8.8" ) ); // Spigot
this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
} else if (packethandshakinginsetprotocol.b() < 107) {
- chatcomponenttext = new ChatComponentText("Outdated client! Please use 1.9");
+ chatcomponenttext = new ChatComponentText( java.text.MessageFormat.format( org.spigotmc.SpigotConfig.outdatedClientMessage.replaceAll("'", "''"), "1.9" ) ); // Spigot
this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
this.b.close(chatcomponenttext);
} else {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index dd3ccd9..4050dba 100644
index 2095242..b21a5b7 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -418,7 +418,7 @@ public abstract class PlayerList {
@@ -466,7 +466,7 @@ public abstract class PlayerList {
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s);
} else if (!this.isWhitelisted(gameprofile)) {
// return "You are not white-listed on this server!";
@ -35,7 +35,7 @@ index dd3ccd9..4050dba 100644
} else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) {
IpBanEntry ipbanentry = this.l.get(socketaddress);
@@ -432,7 +432,7 @@ public abstract class PlayerList {
@@ -480,7 +480,7 @@ public abstract class PlayerList {
} else {
// return this.players.size() >= this.maxPlayers && !this.f(gameprofile) ? "The server is full!" : null;
if (this.players.size() >= this.maxPlayers && !this.f(gameprofile)) {
@ -45,10 +45,10 @@ index dd3ccd9..4050dba 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3be88a3..c0f1d3c 100644
index fa21527..7cdba38 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -623,11 +623,7 @@ public final class CraftServer implements Server {
@@ -627,11 +627,7 @@ public final class CraftServer implements Server {
return true;
}

View File

@ -1,40 +1,40 @@
From 28575eda69652a901509418b5b274bc58756bb36 Mon Sep 17 00:00:00 2001
From 9d14fa9c9d1a1748c38afef3f9350807b4373e66 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 22 Jun 2013 16:12:02 +1000
Subject: [PATCH] Allow Disabling of Random Lighting Updates
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 746cbce..155bccf 100644
index e4725b0..20b945c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1019,7 +1019,7 @@ public class Chunk {
@@ -967,7 +967,7 @@ public class Chunk {
}
this.p = true;
this.q = true;
- if (!this.lit && this.done) {
+ if (!this.lit && this.done && this.world.spigotConfig.randomLightUpdates) { // Spigot - also use random light updates setting to determine if we should relight
this.n();
this.o();
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index b959a79..b07b3db 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2088,7 +2088,7 @@ public abstract class World implements IBlockAccess {
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index f8a2195..7823174 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -373,7 +373,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
protected void i() {
this.methodProfiler.a("playerCheckLight");
- if (!this.players.isEmpty()) {
+ if (spigotConfig.randomLightUpdates && !this.players.isEmpty()) { // Spigot
i = this.random.nextInt(this.players.size());
entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
int i = this.random.nextInt(this.players.size());
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
int j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index f0e3b97..2b98acb 100644
index 4de0a98..c2452d6 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -181,4 +181,11 @@ public class SpigotWorldConfig
@@ -177,4 +177,11 @@ public class SpigotWorldConfig
hopperAmount = getInt( "hopper-amount", 1 );
log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck + " Hopper Amount: " + hopperAmount );
}
@ -47,5 +47,5 @@ index f0e3b97..2b98acb 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From e67e56dcd5be50fa323dbb6c5e5111238295acaa Mon Sep 17 00:00:00 2001
From 846fc496d915908dcc67a043e0261ade0b4f82ff Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 27 Jun 2013 17:26:09 +1000
Subject: [PATCH] Properly Close Inventories
@ -6,10 +6,10 @@ Subject: [PATCH] Properly Close Inventories
Properly close inventories when unloading and switching worlds.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 155bccf..6460ab1 100644
index 20b945c..f68abb4 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -828,6 +828,18 @@ public class Chunk {
@@ -761,6 +761,18 @@ public class Chunk {
while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next();
@ -28,7 +28,7 @@ index 155bccf..6460ab1 100644
this.world.b(tileentity);
}
@@ -838,6 +850,18 @@ public class Chunk {
@@ -771,6 +783,18 @@ public class Chunk {
java.util.Iterator<Entity> iter = newList.iterator();
while (iter.hasNext()) {
Entity entity = iter.next();
@ -47,23 +47,6 @@ index 155bccf..6460ab1 100644
// Do not pass along players, as doing so can get them stuck outside of time.
// (which for example disables inventory icon updates and prevents block breaking)
diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java
index 712018a..17b5714 100644
--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java
+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java
@@ -127,6 +127,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp
}
public void c(int i) {
+ // Spigot Start
+ for ( HumanEntity human : new java.util.ArrayList<HumanEntity>( transaction ) )
+ {
+ human.closeInventory();
+ }
+ // Spigot End
this.b = false;
super.c(i);
}
--
2.1.4
2.5.0

View File

@ -1,15 +1,15 @@
From 416a5d8363e7e87d07ceff5d97e61f547e87cf86 Mon Sep 17 00:00:00 2001
From 7f19d7e7e7ded0f3a6287ce0587e62ad5bfeb544 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 28 Jun 2013 19:52:54 +1000
Subject: [PATCH] Disallow Interaction With Self
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 9ff5828..8d6d3c7 100644
index c13a2be..f785d9f 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1227,6 +1227,13 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u());
@@ -1397,6 +1397,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
if (this.player.dead) return; // CraftBukkit
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
Entity entity = packetplayinuseentity.a((World) worldserver);
+ // Spigot Start
@ -23,5 +23,5 @@ index 9ff5828..8d6d3c7 100644
this.player.resetIdleTimer();
if (entity != null) {
--
2.1.4
2.5.0

View File

@ -0,0 +1,35 @@
From dff771cb23a66e9f7681e33108bcc7c7be1e9be9 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sat, 27 Feb 2016 10:07:58 +1100
Subject: [PATCH] Entity Mount and Dismount Events
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 1817e6d..1eec160 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1679,6 +1679,13 @@ public abstract class Entity implements ICommandListener {
}
}
// CraftBukkit end
+ // Spigot start
+ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent(this.getBukkitEntity(), entity.getBukkitEntity());
+ Bukkit.getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ return;
+ }
+ // Spigot end
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.bt() instanceof EntityHuman)) {
this.passengers.add(0, entity);
} else {
@@ -1708,6 +1715,7 @@ public abstract class Entity implements ICommandListener {
}
}
// CraftBukkit end
+ Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), entity.getBukkitEntity() ) ); // Spigot
this.passengers.remove(entity);
entity.j = 60;
}
--
2.5.0

View File

@ -1,52 +0,0 @@
From 0f04f35d6d781efc9d91d42c47c05ba41598de43 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 2 Jul 2013 20:32:49 +1000
Subject: [PATCH] Entity Mount and Dismount Events
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 2f386ac..bf3ce15 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1541,6 +1541,7 @@ public abstract class Entity implements ICommandListener {
}
}
// CraftBukkit end
+ pluginManager.callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
this.setPositionRotation(this.vehicle.locX, this.vehicle.getBoundingBox().b + (double) this.vehicle.length, this.vehicle.locZ, this.yaw, this.pitch);
this.vehicle.passenger = null;
}
@@ -1575,6 +1576,18 @@ public abstract class Entity implements ICommandListener {
}
}
// CraftBukkit end
+ // Spigot Start
+ if ( entity.world.isChunkLoaded( (int) entity.locX >> 4, (int) entity.locZ >> 4, true ) )
+ {
+ org.spigotmc.event.entity.EntityMountEvent event = new org.spigotmc.event.entity.EntityMountEvent( this.getBukkitEntity(), entity.getBukkitEntity() );
+ pluginManager.callEvent( event );
+ if ( event.isCancelled() )
+ {
+ return;
+ }
+ }
+ // Spigot End
+
if (this.vehicle != null) {
this.vehicle.passenger = null;
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index bd30895..b42cd36 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1709,6 +1709,7 @@ public abstract class EntityLiving extends Entity {
}
}
// CraftBukkit end
+ org.bukkit.Bukkit.getPluginManager().callEvent( new org.spigotmc.event.entity.EntityDismountEvent( this.getBukkitEntity(), this.vehicle.getBukkitEntity() ) ); // Spigot
if (!this.world.isClientSide) {
this.q(this.vehicle);
--
2.6.2

View File

@ -1,4 +1,4 @@
From d828c679ff0cacc857fe380616c5e9753e3f9b32 Mon Sep 17 00:00:00 2001
From 9c1352075b542d480fa211a8f80e3a3f4fbebf40 Mon Sep 17 00:00:00 2001
From: Alex Ciuba <alexciuba@gmail.com>
Date: Tue, 11 Jun 2013 15:23:03 -0400
Subject: [PATCH] Prevent Ghost Players Caused by Plugins
@ -6,10 +6,10 @@ Subject: [PATCH] Prevent Ghost Players Caused by Plugins
Check if the player is still connected after firing event. Fixes BUKKIT-4327
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 49b908d..747d708 100644
index b21a5b7..f878dfc 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -548,6 +548,11 @@ public abstract class PlayerList {
@@ -605,6 +605,11 @@ public abstract class PlayerList {
Player respawnPlayer = cserver.getPlayer(entityplayer1);
PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn);
cserver.getPluginManager().callEvent(respawnEvent);
@ -22,5 +22,5 @@ index 49b908d..747d708 100644
location = respawnEvent.getRespawnLocation();
entityplayer.reset();
--
2.1.4
2.5.0

View File

@ -1,22 +1,22 @@
From fc446e6747d22f32433ee0fcd83002cd7b16968b Mon Sep 17 00:00:00 2001
From 5d3bb1f3aa738f787b50eeca611e901225094f43 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:02:59 +1000
Subject: [PATCH] Plug World Unload Memory Leak
diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
index 125cefe..6a7e7b3 100644
index c6c0ab2..b4d1741 100644
--- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
+++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java
@@ -10,7 +10,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit
public class BlockRedstoneTorch extends BlockTorch {
- private static Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> b = Maps.newHashMap();
+ private static Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> b = new java.util.WeakHashMap(); // Spigot
- private static Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> g = Maps.newHashMap();
+ private static Map<World, List<BlockRedstoneTorch.RedstoneUpdateInfo>> g = new java.util.WeakHashMap(); // Spigot
private final boolean isOn;
private boolean a(World world, BlockPosition blockposition, boolean flag) {
--
2.1.4
2.5.0

View File

@ -1,23 +1,23 @@
From 3fe39dbb7f7395a69b32f2a1055eadd08f930f3a Mon Sep 17 00:00:00 2001
From 5b1adb577f1517f238a6330131d4b7153db07132 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 3 Aug 2013 19:27:07 +1000
Subject: [PATCH] Player Collision API
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index ab4373a..f571649 100644
index 95bf165..b7355b0 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -427,6 +427,7 @@ public abstract class EntityHuman extends EntityLiving {
@@ -376,6 +376,7 @@ public abstract class EntityHuman extends EntityLiving {
List list = this.world.getEntities(this, axisalignedbb);
+ if (this.ae()) { // Spigot: Add this.ae() condition (second !this.isDead near bottom of EntityLiving)
+ if (this.isCollidable()) { // Spigot: Add isCollidable() condition (second !this.isDead near bottom of EntityLiving)
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
@@ -434,6 +435,7 @@ public abstract class EntityHuman extends EntityLiving {
this.d(entity);
@@ -383,6 +384,7 @@ public abstract class EntityHuman extends EntityLiving {
this.c(entity);
}
}
+ } // Spigot
@ -25,23 +25,23 @@ index ab4373a..f571649 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index bd30895..6d1a743 100644
index aba9047..b78b273 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1675,7 +1675,7 @@ public abstract class EntityLiving extends Entity {
}
}));
@@ -1966,7 +1966,7 @@ public abstract class EntityLiving extends Entity {
protected void cn() {
List list = this.world.a((Entity) this, this.getBoundingBox(), IEntitySelector.a(this));
- if (!list.isEmpty()) {
+ if (this.ad() && !list.isEmpty()) { // Spigot: Add this.ad() condition
+ if (this.isInteractable() && !list.isEmpty()) { // Spigot: Add isInteractable() condition
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
// TODO better check now?
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index a7a0516..4a415f6 100644
index 846566e..6cda7b9 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -62,6 +62,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@@ -65,6 +65,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public double maxHealthCache;
public boolean joining = true;
// CraftBukkit end
@ -49,25 +49,25 @@ index a7a0516..4a415f6 100644
+ public boolean collidesWithEntities = true;
+
+ @Override
+ public boolean ad()
+ public boolean isInteractable()
+ {
+ return this.collidesWithEntities && super.ad(); // (first !this.isDead near bottom of EntityLiving)
+ return this.collidesWithEntities && super.isInteractable(); // (first !this.isDead near bottom of EntityLiving)
+ }
+
+ @Override
+ public boolean ae()
+ public boolean isCollidable()
+ {
+ return this.collidesWithEntities && super.ae(); // (second !this.isDead near bottom of EntityLiving)
+ return this.collidesWithEntities && super.isCollidable(); // (second !this.isDead near bottom of EntityLiving)
+ }
+ // Spigot end
public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) {
super(worldserver, gameprofile);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d4d6259..3a07a7b 100644
index cd51b41..17a074a 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1345,6 +1345,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1411,6 +1411,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
// Spigot start
private final Player.Spigot spigot = new Player.Spigot()
{
@ -82,11 +82,11 @@ index d4d6259..3a07a7b 100644
+ public void setCollidesWithEntities(boolean collides)
+ {
+ getHandle().collidesWithEntities = collides;
+ getHandle().k = collides; // First boolean of Entity
+ getHandle().i = collides; // First boolean of Entity
+ }
};
public Player.Spigot spigot()
--
2.1.4
2.5.0

View File

@ -1,27 +1,27 @@
From fd42204f5757b7af9451bdc9dcf68d7eafa22901 Mon Sep 17 00:00:00 2001
From accd1742de8b965b819198e95f1edf8599be21b1 Mon Sep 17 00:00:00 2001
From: agentk20 <agentkid20@gmail.com>
Date: Sat, 3 Aug 2013 19:28:48 +1000
Subject: [PATCH] Fully Disable Snooper When Not Required
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5d1aa0b..2acf3bd 100644
index 9061ff2..ea7e0bd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -656,11 +656,11 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -657,11 +657,11 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.h[this.ticks % 100] = System.nanoTime() - i;
this.methodProfiler.b();
this.methodProfiler.a("snooper");
- if (!this.n.d() && this.ticks > 100) {
+ if (getSnooperEnabled() && !this.n.d() && this.ticks > 100) { // Spigot
this.n.a();
- if (!this.m.d() && this.ticks > 100) {
+ if (getSnooperEnabled() && !this.m.d() && this.ticks > 100) { // Spigot
this.m.a();
}
- if (this.ticks % 6000 == 0) {
+ if (getSnooperEnabled() && this.ticks % 6000 == 0) { // Spigot
this.n.b();
this.m.b();
}
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From e5bb74a1c2832936bc46cb42915f39abebc51a94 Mon Sep 17 00:00:00 2001
From 01364dbf67a69279c652d89160b45a96b7bb1470 Mon Sep 17 00:00:00 2001
From: DerFlash <bte@freenet.de>
Date: Sat, 3 Aug 2013 19:53:48 +1000
Subject: [PATCH] Add Getter for Entity Invulnerability
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 4c0ac67..0234fe3 100644
index 97dfc54..1e51d4c 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -542,6 +542,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -559,6 +559,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
// Spigot start
private final Spigot spigot = new Spigot()
{
@ -21,5 +21,5 @@ index 4c0ac67..0234fe3 100644
public Spigot spigot()
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From aae347ac688cad34a2bf4684deb4b14a185fde1b Mon Sep 17 00:00:00 2001
From be15a2a5088b43317c26933b1645cdbd40ae76eb Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 5 Aug 2013 20:17:20 +1000
Subject: [PATCH] Cap Minimum Player Speed
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 3a07a7b..9d240c9 100644
index 17a074a..b20ccc1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1178,7 +1178,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1179,7 +1179,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setFlySpeed(float value) {
validateSpeed(value);
EntityPlayer player = getHandle();
@ -17,7 +17,7 @@ index 3a07a7b..9d240c9 100644
player.updateAbilities();
}
@@ -1187,7 +1187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1188,7 +1188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setWalkSpeed(float value) {
validateSpeed(value);
EntityPlayer player = getHandle();
@ -27,5 +27,5 @@ index 3a07a7b..9d240c9 100644
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 4b13a7bb4f86b86b104d512f730b058734df7ff4 Mon Sep 17 00:00:00 2001
From 56a850636f2d5ea0d5bb4632a26e662d119be4b7 Mon Sep 17 00:00:00 2001
From: BlackHole <black-hole@live.com>
Date: Tue, 16 Jul 2013 22:34:50 +0200
Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT
@ -6,10 +6,10 @@ Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT
Adds BUKKIT-4355
diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java
index f15b199..40c0a87 100644
index 54140f7..f794167 100644
--- a/src/main/java/net/minecraft/server/BlockTNT.java
+++ b/src/main/java/net/minecraft/server/BlockTNT.java
@@ -77,6 +77,11 @@ public class BlockTNT extends Block {
@@ -73,6 +73,11 @@ public class BlockTNT extends Block {
EntityArrow entityarrow = (EntityArrow) entity;
if (entityarrow.isBurning()) {
@ -22,5 +22,5 @@ index f15b199..40c0a87 100644
world.setAir(blockposition);
}
--
2.1.4
2.5.0

View File

@ -1,34 +1,33 @@
From b61bd159a881d8e31de9c8d640815e720420a77c Mon Sep 17 00:00:00 2001
From 82fbb6298f22d11a2ed1c53d3f47c21f7e7e3e78 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 21 Sep 2013 12:33:09 +1000
Subject: [PATCH] Allow Disabling of 1.6.3 Structure Saving
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index 0bced98..bb1a11e 100644
index dacba33..4a4d2af 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -195,7 +195,15 @@ public abstract class StructureGenerator extends WorldGenBase {
@@ -197,7 +197,13 @@ public abstract class StructureGenerator extends WorldGenBase {
private void a(World world) {
if (this.d == null) {
protected void a(World world) {
if (this.a == null) {
- this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a());
+ // Spigot Start
+ if ( world.spigotConfig.saveStructureInfo )
+ {
this.d = (PersistentStructure) world.a(PersistentStructure.class, this.a());
+ } else
+ {
+ this.d = new PersistentStructure( this.a() );
+ if (world.spigotConfig.saveStructureInfo) {
+ this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a());
+ } else {
+ this.a = new PersistentStructure(this.a());
+ }
+ // Spigot End
if (this.d == null) {
this.d = new PersistentStructure(this.a());
world.a(this.a(), (PersistentBase) this.d);
if (this.a == null) {
this.a = new PersistentStructure(this.a());
world.a(this.a(), (PersistentBase) this.a);
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 2b98acb..15cb6b4 100644
index c2452d6..89f9bc3 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -188,4 +188,16 @@ public class SpigotWorldConfig
@@ -184,4 +184,16 @@ public class SpigotWorldConfig
randomLightUpdates = getBoolean( "random-light-updates", false );
log( "Random Lighting Updates: " + randomLightUpdates );
}
@ -46,5 +45,5 @@ index 2b98acb..15cb6b4 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,24 +0,0 @@
From 4a01fe5baa2c8bc6ff8b4ddabe047dde8f3231e0 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 14 Sep 2013 10:16:38 +1000
Subject: [PATCH] Update Inventory and Health for PlayerConsumeItemEvent
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index c93a5da..17c9f64 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -300,6 +300,10 @@ public abstract class EntityHuman extends EntityLiving {
// Update client
if (this instanceof EntityPlayer) {
((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.getSlot((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.g));
+ // Spigot Start
+ ((EntityPlayer) this).getBukkitEntity().updateInventory();
+ ((EntityPlayer) this).getBukkitEntity().updateScaledHealth();
+ // Spigot End
}
return;
}
--
2.1.4

View File

@ -1,14 +1,14 @@
From acbb89c50b0a24da787bd49dd472f57ac885f45c Mon Sep 17 00:00:00 2001
From f5f87701e5a6ab0f80580fb892c7f5c52ee40e06 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 6 Oct 2013 17:36:28 +1100
Subject: [PATCH] Don't Special Case X Move Value
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 8d6d3c7..36f0684 100644
index f785d9f..83a4551 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -112,6 +112,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
@@ -124,6 +124,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
private float lastPitch = Float.MAX_VALUE;
private float lastYaw = Float.MAX_VALUE;
private boolean justTeleported = false;
@ -16,8 +16,8 @@ index 8d6d3c7..36f0684 100644
public CraftPlayer getPlayer() {
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
@@ -223,6 +224,18 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
}
@@ -324,6 +325,18 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
// CraftBukkit start - fire PlayerMoveEvent
Player player = this.getPlayer();
+ // Spigot Start
@ -35,7 +35,7 @@ index 8d6d3c7..36f0684 100644
Location from = new Location(player.getWorld(), lastPosX, lastPosY, lastPosZ, lastYaw, lastPitch); // Get the Players previous Event location.
Location to = player.getLocation().clone(); // Start off the To location as the Players current location.
@@ -251,7 +264,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
@@ -349,7 +362,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
this.lastPitch = to.getPitch();
// Skip the first time we do this
@ -45,5 +45,5 @@ index 8d6d3c7..36f0684 100644
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.server.getPluginManager().callEvent(event);
--
2.1.4
2.5.0

View File

@ -1,16 +1,16 @@
From abebbbac98d7d10cdd59763777a847de2eb81b3b Mon Sep 17 00:00:00 2001
From a823d20f36d8f9b643f84546223db8a75205b5ef Mon Sep 17 00:00:00 2001
From: ninja- <xninja@openmailbox.org>
Date: Tue, 8 Oct 2013 14:34:49 +0200
Subject: [PATCH] Implement respawn API.
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 9d240c9..6c1a092 100644
index b20ccc1..d62cc5b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1358,6 +1358,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1424,6 +1424,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
getHandle().collidesWithEntities = collides;
getHandle().k = collides; // First boolean of Entity
getHandle().i = collides; // First boolean of Entity
}
+
+ @Override
@ -25,5 +25,5 @@ index 9d240c9..6c1a092 100644
public Player.Spigot spigot()
--
2.1.4
2.5.0

View File

@ -1,29 +1,29 @@
From 2d9a2afdc3d508a398d1d274597aa22a3b8740cd Mon Sep 17 00:00:00 2001
From f52d6627b4e07c0c661637dc166311f3db6432e1 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 14 Oct 2013 19:20:10 +1100
Subject: [PATCH] Arrow Despawn Rate
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 3359160..3a80776 100644
index a40f3ec..e40642f 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -155,7 +155,7 @@ public class EntityArrow extends Entity implements IProjectile {
@@ -144,7 +144,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
if (block == this.g && i == this.h) {
++this.ar;
- if (this.ar >= 1200) {
+ if (this.ar >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter
if (block == this.au && i == this.av) {
++this.aw;
- if (this.aw >= 1200) {
+ if (this.aw >= world.spigotConfig.arrowDespawnRate) { // Spigot - First int after shooter
this.die();
}
} else {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index efbfa2e..d8433ac 100644
index 89f9bc3..28643c5 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -207,4 +207,11 @@ public class SpigotWorldConfig
itemDespawnRate = getInt( "item-despawn-rate", 6000 );
log( "Item Despawn Rate: " + itemDespawnRate );
@@ -196,4 +196,11 @@ public class SpigotWorldConfig
log( "*** WARNING *** Please use this option with caution, SpigotMC is not responsible for any issues this option may cause in the future!" );
}
}
+
+ public int arrowDespawnRate;
@ -34,5 +34,5 @@ index efbfa2e..d8433ac 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,27 +1,27 @@
From d80a8985f88927ef527f5959f32ec1d2c47ab765 Mon Sep 17 00:00:00 2001
From fc6573b98957b800678afa46130eac7c5493fab4 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 5 Aug 2014 17:20:19 +0100
Subject: [PATCH] Watchdog Thread.
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index da295f3..113049a 100644
index 92dd207..93ace97 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -270,7 +270,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -276,7 +276,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
// CraftBukkit end
- if (this.aS() > 0L) {
+ if (false && this.aS() > 0L) { // Spigot - disable
- if (this.aP() > 0L) {
+ if (false && this.aP() > 0L) { // Spigot - disable
Thread thread1 = new Thread(new ThreadWatchdog(this));
thread1.setName("Server Watchdog");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2acf3bd..d5f58f1 100644
index ea7e0bd..04c36fe 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -566,6 +566,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -563,6 +563,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.a(crashreport);
} finally {
try {
@ -29,7 +29,7 @@ index 2acf3bd..d5f58f1 100644
this.isStopped = true;
this.stop();
} catch (Throwable throwable1) {
@@ -666,6 +667,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -667,6 +668,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.methodProfiler.b();
this.methodProfiler.b();
@ -38,10 +38,10 @@ index 2acf3bd..d5f58f1 100644
org.spigotmc.CustomTimingsHandler.tick(); // Spigot
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index ff60351..63b5d67 100644
index 7cdba38..72e1e2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1685,6 +1685,11 @@ public final class CraftServer implements Server {
@@ -1696,6 +1696,11 @@ public final class CraftServer implements Server {
{
return org.spigotmc.SpigotConfig.config;
}
@ -330,5 +330,5 @@ index 0000000..de08ad6
+ }
+}
--
2.1.4
2.5.0

View File

@ -1,18 +1,18 @@
From 4780ccafe1a89c999b2be1124c3a08edfa190041 Mon Sep 17 00:00:00 2001
From 12d2f54389e8f6303e5e98cc11d08701efc9a2bc Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Mon, 2 Dec 2013 23:42:09 +0000
Subject: [PATCH] Fix some chunks not being sent to the client
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 6460ab1..f461f50 100644
index f68abb4..47ef0db 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1061,7 +1061,15 @@ public class Chunk {
@@ -1009,7 +1009,15 @@ public class Chunk {
}
public boolean isReady() {
- return this.p && this.done && this.lit;
- return this.q && this.done && this.lit;
+ // Spigot Start
+ /*
+ * As of 1.7, Mojang added a check to make sure that only chunks which have been lit are sent to the client.
@ -24,7 +24,7 @@ index 6460ab1..f461f50 100644
+ // Spigot End
}
public ChunkCoordIntPair j() {
public boolean j() {
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From cc4c9041be7f3626120940a3d403c5266c101f91 Mon Sep 17 00:00:00 2001
From 88078807067fbb7644b68ed4cba439069f8eba0d Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 5 Dec 2013 13:55:53 +1100
Subject: [PATCH] Fix Broken Async Chat
@ -35,5 +35,5 @@ index 0ab90f3..18358b4 100644
}
--
2.1.4
2.5.0

View File

@ -1,11 +1,11 @@
From 6b1f5316e3a221a450333e195178f5e29e84381d Mon Sep 17 00:00:00 2001
From b2e96c15b5a2e7d0230b712608d26d883ad2a850 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 18 Dec 2013 13:32:10 +1100
Subject: [PATCH] Fire PreLogin Events in Offline Mode
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 97c88ea..1fa9626 100644
index 3cca9ff..71d24b2 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -13,6 +13,7 @@ import java.util.Arrays;
@ -16,7 +16,7 @@ index 97c88ea..1fa9626 100644
import javax.crypto.SecretKey;
import org.apache.commons.lang3.Validate;
import org.apache.logging.log4j.LogManager;
@@ -80,10 +81,23 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
@@ -80,10 +81,23 @@ public class LoginListener implements PacketLoginInListener, ITickable {
}
@ -40,29 +40,36 @@ index 97c88ea..1fa9626 100644
// CraftBukkit start - fire PlayerLoginEvent
EntityPlayer s = this.server.getPlayerList().attemptLogin(this, this.i, hostname);
@@ -133,7 +147,15 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
@@ -133,7 +147,22 @@ public class LoginListener implements PacketLoginInListener, ITickable {
this.g = LoginListener.EnumProtocolState.KEY;
this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.Q().getPublic(), this.e));
this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin(this.j, this.server.O().getPublic(), this.e));
} else {
- this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
+ // Spigot start
+ try {
+ initUUID();
+ new LoginHandler().fireEvents();
+ } catch (Exception ex) {
+ disconnect("Failed to verify username!");
+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex);
+ }
+ new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) {
+
+ @Override
+ public void run() {
+ try {
+ initUUID();
+ new LoginHandler().fireEvents();
+ LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
+ } catch (Exception ex) {
+ disconnect("Failed to verify username!");
+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex);
+ }
+ }
+ }.start();
+ // Spigot end
}
}
@@ -162,6 +184,40 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
@@ -162,6 +191,39 @@ public class LoginListener implements PacketLoginInListener, ITickable {
return;
}
+ new LoginHandler().fireEvents();
+ } else if (LoginListener.this.server.T()) {
+ } else if (LoginListener.this.server.R()) {
+ LoginListener.c.warn("Failed to verify username but will let them in anyway!");
+ LoginListener.this.i = LoginListener.this.a(gameprofile);
+ LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@ -71,7 +78,7 @@ index 97c88ea..1fa9626 100644
+ LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer
+ }
+ } catch (AuthenticationUnavailableException authenticationunavailableexception) {
+ if (LoginListener.this.server.T()) {
+ if (LoginListener.this.server.R()) {
+ LoginListener.c.warn("Authentication servers are down but will let them in anyway!");
+ LoginListener.this.i = LoginListener.this.a(gameprofile);
+ LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@ -85,7 +92,6 @@ index 97c88ea..1fa9626 100644
+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + gameprofile.getName(), exception);
+ // CraftBukkit end
+ }
+
+ }
+ }).start();
+ }
@ -98,11 +104,11 @@ index 97c88ea..1fa9626 100644
String playerName = i.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress();
java.util.UUID uniqueId = i.getId();
@@ -196,34 +252,9 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
@@ -196,34 +258,9 @@ public class LoginListener implements PacketLoginInListener, ITickable {
// CraftBukkit end
LoginListener.c.info("UUID of player " + LoginListener.this.i.getName() + " is " + LoginListener.this.i.getId());
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
- } else if (LoginListener.this.server.T()) {
- } else if (LoginListener.this.server.R()) {
- LoginListener.c.warn("Failed to verify username but will let them in anyway!");
- LoginListener.this.i = LoginListener.this.a(gameprofile);
- LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@ -111,7 +117,7 @@ index 97c88ea..1fa9626 100644
- LoginListener.c.error("Username \'" + gameprofile.getName() + "\' tried to join with an invalid session"); // CraftBukkit - fix null pointer
- }
- } catch (AuthenticationUnavailableException authenticationunavailableexception) {
- if (LoginListener.this.server.T()) {
- if (LoginListener.this.server.R()) {
- LoginListener.c.warn("Authentication servers are down but will let them in anyway!");
- LoginListener.this.i = LoginListener.this.a(gameprofile);
- LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
@ -126,14 +132,14 @@ index 97c88ea..1fa9626 100644
- // CraftBukkit end
- }
-
- }
}
- }).start();
}
}
- }
+ // Spigot end
protected GameProfile a(GameProfile gameprofile) {
UUID uuid = UUID.nameUUIDFromBytes(("OfflinePlayer:" + gameprofile.getName()).getBytes(Charsets.UTF_8));
--
2.1.4
2.5.0

View File

@ -1,38 +0,0 @@
From f0d250f577da79657fec78fcdc267d3b4b221653 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 1 Dec 2013 17:52:14 +1100
Subject: [PATCH] Fix packed ice generation
diff --git a/src/main/java/net/minecraft/server/WorldGenPackedIce2.java b/src/main/java/net/minecraft/server/WorldGenPackedIce2.java
index dcd085a..3d08a82 100644
--- a/src/main/java/net/minecraft/server/WorldGenPackedIce2.java
+++ b/src/main/java/net/minecraft/server/WorldGenPackedIce2.java
@@ -40,13 +40,13 @@ public class WorldGenPackedIce2 extends WorldGenerator {
Block block = world.getType(blockposition.a(i1, k, j1)).getBlock();
if (block.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) {
- this.a(world, blockposition.a(i1, k, j1), Blocks.PACKED_ICE.getBlockData());
+ world.setTypeUpdate(blockposition.a(i1, k, j1), Blocks.PACKED_ICE.getBlockData()); // Spigot
}
if (k != 0 && l > 1) {
block = world.getType(blockposition.a(i1, -k, j1)).getBlock();
if (block.getMaterial() == Material.AIR || block == Blocks.DIRT || block == Blocks.SNOW || block == Blocks.ICE) {
- this.a(world, blockposition.a(i1, -k, j1), Blocks.PACKED_ICE.getBlockData());
+ world.setTypeUpdate(blockposition.a(i1, -k, j1), Blocks.PACKED_ICE.getBlockData()); // Spigot
}
}
}
@@ -77,7 +77,7 @@ public class WorldGenPackedIce2 extends WorldGenerator {
Block block1 = world.getType(blockposition1).getBlock();
if (block1.getMaterial() == Material.AIR || block1 == Blocks.DIRT || block1 == Blocks.SNOW || block1 == Blocks.ICE || block1 == Blocks.PACKED_ICE) {
- this.a(world, blockposition1, Blocks.PACKED_ICE.getBlockData());
+ world.setTypeUpdate(blockposition1, Blocks.PACKED_ICE.getBlockData()); // Spigot
blockposition1 = blockposition1.down();
--l1;
if (l1 <= 0) {
--
2.1.4

View File

@ -1,4 +1,4 @@
From 179f4c4ec3ac77456f264ce16885fe01257c24c4 Mon Sep 17 00:00:00 2001
From cbc5ee4521288a2da2b9aeae62759f7e324f9652 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 1 Dec 2013 18:18:41 +1100
Subject: [PATCH] BungeeCord Support
@ -6,7 +6,7 @@ Subject: [PATCH] BungeeCord Support
Provides support for IP forwarding via BungeeCord.
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
index 53823c6..64f6a9b 100644
index 8ee721e..4fd9995 100644
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
@@ -7,6 +7,7 @@ import java.util.HashMap;
@ -20,7 +20,7 @@ index 53823c6..64f6a9b 100644
@@ -71,6 +72,26 @@ public class HandshakeListener implements PacketHandshakingInListener {
this.b.close(chatcomponenttext);
} else {
this.b.a((PacketListener) (new LoginListener(this.a, this.b)));
this.b.setPacketListener(new LoginListener(this.a, this.b));
+ // Spigot Start
+ if (org.spigotmc.SpigotConfig.bungee) {
+ String[] split = packethandshakinginsetprotocol.hostname.split("\00");
@ -31,7 +31,7 @@ index 53823c6..64f6a9b 100644
+ } else
+ {
+ chatcomponenttext = new ChatComponentText("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!");
+ this.b.handle(new PacketLoginOutDisconnect(chatcomponenttext));
+ this.b.sendPacket(new PacketLoginOutDisconnect(chatcomponenttext));
+ this.b.close(chatcomponenttext);
+ return;
+ }
@ -41,14 +41,14 @@ index 53823c6..64f6a9b 100644
+ }
+ }
+ // Spigot End
((LoginListener) this.b.getPacketListener()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname
((LoginListener) this.b.i()).hostname = packethandshakinginsetprotocol.hostname + ":" + packethandshakinginsetprotocol.port; // CraftBukkit - set hostname
}
break;
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
index 1fa9626..541cec7 100644
index 71d24b2..efa785f 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -84,9 +84,24 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
@@ -84,9 +84,24 @@ public class LoginListener implements PacketLoginInListener, ITickable {
// Spigot start
public void initUUID()
{
@ -74,38 +74,11 @@ index 1fa9626..541cec7 100644
}
// Spigot end
@@ -148,13 +163,19 @@ public class LoginListener implements PacketLoginInListener, IUpdatePlayerListBo
this.networkManager.handle(new PacketLoginOutEncryptionBegin(this.j, this.server.Q().getPublic(), this.e));
} else {
// Spigot start
- try {
- initUUID();
- new LoginHandler().fireEvents();
- } catch (Exception ex) {
- disconnect("Failed to verify username!");
- server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex);
- }
+ initUUID();
+ new Thread(new Runnable() {
+
+ @Override
+ public void run() {
+ try{
+ new LoginHandler().fireEvents();
+ } catch (Exception ex) {
+ disconnect("Failed to verify username!");
+ server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + i.getName(), ex);
+ }
+ }
+ }).start();
// Spigot end
}
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 7623b42..7959242 100644
index 5ed2c96..c3ff6c2 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -64,7 +64,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> {
@@ -64,7 +64,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
private final Queue<NetworkManager.QueuedPacket> i = Queues.newConcurrentLinkedQueue();
private final ReentrantReadWriteLock j = new ReentrantReadWriteLock();
public Channel channel;
@ -118,7 +91,7 @@ index 7623b42..7959242 100644
private PacketListener m;
private IChatBaseComponent n;
private boolean o;
@@ -322,4 +326,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet> {
@@ -323,4 +327,11 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
this.b = agenericfuturelistener;
}
}
@ -131,23 +104,23 @@ index 7623b42..7959242 100644
+ // Spigot End
}
diff --git a/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java b/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java
index 9c7b691..fba8bba 100644
index 86f1be7..e6ab607 100644
--- a/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java
+++ b/src/main/java/net/minecraft/server/PacketHandshakingInSetProtocol.java
@@ -13,7 +13,7 @@ public class PacketHandshakingInSetProtocol implements Packet<PacketHandshakingI
public void a(PacketDataSerializer packetdataserializer) throws IOException {
this.a = packetdataserializer.e();
this.a = packetdataserializer.g();
- this.hostname = packetdataserializer.c(255);
+ this.hostname = packetdataserializer.c(Short.MAX_VALUE); // Spigot
this.port = packetdataserializer.readUnsignedShort();
this.d = EnumProtocol.a(packetdataserializer.e());
this.d = EnumProtocol.a(packetdataserializer.g());
}
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 747d708..3e9a4ef 100644
index f878dfc..eb9375d 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -403,7 +403,7 @@ public abstract class PlayerList {
@@ -451,7 +451,7 @@ public abstract class PlayerList {
EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), gameprofile, new PlayerInteractManager(server.getWorldServer(0)));
Player player = entity.getBukkitEntity();
@ -157,10 +130,10 @@ index 747d708..3e9a4ef 100644
if (getProfileBans().isBanned(gameprofile) && !getProfileBans().get(gameprofile).hasExpired()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 63b5d67..4c4a090 100644
index 72e1e2f..1a5f14d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -556,7 +556,13 @@ public final class CraftServer implements Server {
@@ -560,7 +560,13 @@ public final class CraftServer implements Server {
@Override
public long getConnectionThrottle() {
@ -176,10 +149,10 @@ index 63b5d67..4c4a090 100644
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 6c1a092..39a73bd 100644
index d62cc5b..1f11c9d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1347,6 +1347,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1413,6 +1413,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
{
@Override
@ -212,5 +185,5 @@ index 34def7b..824ba7a 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From fbb22dc472ea7bfda18094d280c5b7d8ae371d98 Mon Sep 17 00:00:00 2001
From 71376d91cdd5045cccb79238998187f706a4a5e1 Mon Sep 17 00:00:00 2001
From: Dylan Xaldin <Puremin0rez515@gmail.com>
Date: Thu, 12 Dec 2013 18:05:03 -0600
Subject: [PATCH] Allow Disabling Zombie Villager Aggression
@ -6,31 +6,25 @@ Subject: [PATCH] Allow Disabling Zombie Villager Aggression
Ability to configure if Zombies will be aggressive towards Villagers.
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 91bb046..1a8d3d8 100644
index d5f508b..ba2f12f 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -38,12 +38,12 @@ public class EntityZombie extends EntityMonster {
}
protected void n() {
- this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityVillager.class, 1.0D, true));
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityVillager.class, 1.0D, true)); // Spigot
this.goalSelector.a(4, new PathfinderGoalMeleeAttack(this, EntityIronGolem.class, 1.0D, true));
@@ -46,7 +46,7 @@ public class EntityZombie extends EntityMonster {
this.goalSelector.a(6, new PathfinderGoalMoveThroughVillage(this, 1.0D, false));
this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, true, new Class[] { EntityPigZombie.class}));
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, true));
- this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false));
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot
this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true));
- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false));
+ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityVillager.class, false)); // Spigot
this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget(this, EntityIronGolem.class, true));
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 5d2b755..f6fc0a2 100644
index 28643c5..6df2186 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -247,4 +247,11 @@ public class SpigotWorldConfig
antiXrayInstance = new AntiXray( this );
@@ -203,4 +203,11 @@ public class SpigotWorldConfig
arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 );
log( "Arrow Despawn Rate: " + arrowDespawnRate );
}
+
+ public boolean zombieAggressiveTowardsVillager;
@ -41,5 +35,5 @@ index 5d2b755..f6fc0a2 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,21 +0,0 @@
From 89eb6b05e7135406df9ca8300dd018432b763e27 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 3 Dec 2013 11:07:48 +1100
Subject: [PATCH] Clear Flower Pot on Drop
diff --git a/src/main/java/net/minecraft/server/BlockFlowerPot.java b/src/main/java/net/minecraft/server/BlockFlowerPot.java
index fd77047..ce46138 100644
--- a/src/main/java/net/minecraft/server/BlockFlowerPot.java
+++ b/src/main/java/net/minecraft/server/BlockFlowerPot.java
@@ -95,6 +95,7 @@ public class BlockFlowerPot extends BlockContainer {
if (tileentityflowerpot != null && tileentityflowerpot.b() != null) {
a(world, blockposition, new ItemStack(tileentityflowerpot.b(), 1, tileentityflowerpot.c()));
+ tileentityflowerpot.a( null, 0 ); // Spigot
}
super.remove(world, blockposition, iblockdata);
--
2.1.4

View File

@ -1,4 +1,4 @@
From 8d59cbbb21000192b238c74addd28a4a625cf65e Mon Sep 17 00:00:00 2001
From 37d742e73b2e9e710633315d64fdae33abd658e6 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 11:58:58 +1100
Subject: [PATCH] Configurable Amount of Netty Threads
@ -6,36 +6,36 @@ Subject: [PATCH] Configurable Amount of Netty Threads
This brings back the option that the Spigot version of netty saw. By default Netty will try and use cores*2 threads, however if running multiple servers on the same machine, this can be too many threads. Additionally some people have 16 core servers. If 32 Netty threads are allowed in this setup, then the lock contention, and thus blocking between threads becomes much greater, leading to decreased performance.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d5f58f1..cdf7e0a 100644
index 04c36fe..8602ac6 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -59,7 +59,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
private final List<IUpdatePlayerListBox> p = Lists.newArrayList();
@@ -57,7 +57,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
private final List<ITickable> o = Lists.newArrayList();
protected final ICommandHandler b;
public final MethodProfiler methodProfiler = new MethodProfiler();
- private final ServerConnection q;
+ private ServerConnection q; // Spigot
private final ServerPing r = new ServerPing();
private final Random s = new Random();
private String serverIp;
@@ -121,7 +121,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.e = proxy;
MinecraftServer.l = this;
- private final ServerConnection p;
+ private ServerConnection p; // Spigot
private final ServerPing q = new ServerPing();
private final Random r = new Random();
private final DataConverterManager dataConverterManager;
@@ -122,7 +122,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.W = gameprofilerepository;
this.X = usercache;
// this.universe = file; // CraftBukkit
- this.q = new ServerConnection(this);
+ // this.q = new ServerConnection(this); // Spigot
this.Z = new UserCache(this, file1);
this.b = this.h();
- this.p = new ServerConnection(this);
+ // this.p = new ServerConnection(this); // Spigot
this.b = this.i();
// this.convertable = new WorldLoaderServer(file); // CraftBukkit - moved to DedicatedServer.init
@@ -1322,7 +1322,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
this.dataConverterManager = dataconvertermanager;
@@ -1298,7 +1298,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
// Spigot End
public ServerConnection aq() {
- return this.q;
+ return this.q == null ? this.q = new ServerConnection(this) : this.q; // Spigot
public ServerConnection am() {
- return this.p;
+ return this.p == null ? this.p = new ServerConnection(this) : this.p; // Spigot
}
public boolean as() {
public boolean ao() {
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 824ba7a..a306266 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
@ -53,5 +53,5 @@ index 824ba7a..a306266 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -0,0 +1,22 @@
From d1c933de9b89ebda7e58a6c6d717f8af7ef8cd0c Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 15:21:02 +1100
Subject: [PATCH] Prevent Mineshaft Saving
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index 4a4d2af..22d96e9 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -198,7 +198,7 @@ public abstract class StructureGenerator extends WorldGenBase {
protected void a(World world) {
if (this.a == null) {
// Spigot Start
- if (world.spigotConfig.saveStructureInfo) {
+ if (world.spigotConfig.saveStructureInfo && !this.a().equals( "Mineshaft" )) {
this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a());
} else {
this.a = new PersistentStructure(this.a());
--
2.5.0

View File

@ -1,14 +1,14 @@
From 6a7da9b465c656b8c77602d8180a707c5e3349c6 Mon Sep 17 00:00:00 2001
From 2a2925c6b015c6423b77e307fde7646c5d3012c0 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 18 Dec 2013 13:39:14 +1100
Subject: [PATCH] Log Cause of Unexpected Exceptions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index cdf7e0a..0637df9 100644
index 8602ac6..0aab39b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -547,6 +547,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -544,6 +544,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}
} catch (Throwable throwable) {
MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable);
@ -22,5 +22,5 @@ index cdf7e0a..0637df9 100644
if (throwable instanceof ReportedException) {
--
2.1.4
2.5.0

View File

@ -1,414 +0,0 @@
From e298bca4fcf0fbf6cf2f63ca2b43e4815b72bce5 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 16 May 2013 18:51:05 +1000
Subject: [PATCH] Orebfuscator
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 9e0d5ad..ce91553 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -60,6 +60,7 @@ public class EntityFallingBlock extends Entity {
blockposition = new BlockPosition(this);
if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.AIR, 0).isCancelled()) {
this.world.setAir(blockposition);
+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot
} else if (!this.world.isClientSide) {
this.die();
return;
@@ -85,6 +86,7 @@ public class EntityFallingBlock extends Entity {
return;
}
this.world.setTypeAndData(blockposition, this.block, 3);
+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot
// CraftBukkit end
if (block instanceof BlockFalling) {
((BlockFalling) block).a_(this.world, blockposition);
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index 23f852e..c41b911 100644
--- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -211,6 +211,7 @@ public class Explosion {
blockposition = (BlockPosition) iterator.next();
Block block = this.world.getType(blockposition).getBlock();
+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot
if (flag) {
double d0 = (double) ((float) blockposition.getX() + this.world.random.nextFloat());
double d1 = (double) ((float) blockposition.getY() + this.world.random.nextFloat());
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
index 6e368f5..58c0275 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java
@@ -19,6 +19,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> {
this.b = chunk.locZ;
this.d = flag;
this.c = a(chunk, flag, !chunk.getWorld().worldProvider.o(), i);
+ chunk.world.spigotConfig.antiXrayInstance.obfuscateSync(chunk.locX, chunk.locZ, c.b, c.a, chunk.world);
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java
index 63b90f7..10c0e34 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunkBulk.java
@@ -9,6 +9,7 @@ public class PacketPlayOutMapChunkBulk implements Packet<PacketListenerPlayOut>
private int[] b;
private PacketPlayOutMapChunk.ChunkMap[] c;
private boolean d;
+ private World world; // Spigot
public PacketPlayOutMapChunkBulk() {}
@@ -28,7 +29,8 @@ public class PacketPlayOutMapChunkBulk implements Packet<PacketListenerPlayOut>
this.b[j] = chunk.locZ;
this.c[j] = packetplayoutmapchunk_chunkmap;
}
-
+
+ world = ((Chunk) list.get(0)).getWorld(); // Spigot
}
public void a(PacketDataSerializer packetdataserializer) throws IOException {
@@ -68,6 +70,7 @@ public class PacketPlayOutMapChunkBulk implements Packet<PacketListenerPlayOut>
}
for (i = 0; i < this.a.length; ++i) {
+ world.spigotConfig.antiXrayInstance.obfuscate(this.a[i], this.b[i], this.c[i].b, this.c[i].a, world); // Spigot
packetdataserializer.writeBytes(this.c[i].a);
}
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index 58fd07d..33a0a09 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -197,6 +197,7 @@ public class PlayerInteractManager {
}
}
+ world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot
}
public void a(BlockPosition blockposition) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index b07b3db..2c5c6b0 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -497,6 +497,7 @@ public abstract class World implements IBlockAccess {
this.d(blockposition.up(), block);
this.d(blockposition.north(), block);
this.d(blockposition.south(), block);
+ spigotConfig.antiXrayInstance.updateNearbyBlocks(this, blockposition); // Spigot
}
public void a(BlockPosition blockposition, Block block, EnumDirection enumdirection) {
@@ -722,9 +723,16 @@ public abstract class World implements IBlockAccess {
return this.worldProvider.p()[this.getLightLevel(blockposition)];
}
- public IBlockData getType(BlockPosition blockposition) {
+ // Spigot start
+ public IBlockData getType(BlockPosition blockposition)
+ {
+ return getType( blockposition, true );
+ }
+
+ public IBlockData getType(BlockPosition blockposition, boolean useCaptured) {
// CraftBukkit start - tree generation
- if (captureTreeGeneration) {
+ if (captureTreeGeneration && useCaptured) {
+ // Spigot end
Iterator<BlockState> it = capturedBlockStates.iterator();
while (it.hasNext()) {
BlockState previous = it.next();
diff --git a/src/main/java/org/spigotmc/AntiXray.java b/src/main/java/org/spigotmc/AntiXray.java
new file mode 100644
index 0000000..7221b50
--- /dev/null
+++ b/src/main/java/org/spigotmc/AntiXray.java
@@ -0,0 +1,234 @@
+package org.spigotmc;
+
+import gnu.trove.set.TByteSet;
+import gnu.trove.set.hash.TByteHashSet;
+import net.minecraft.server.Block;
+import net.minecraft.server.BlockPosition;
+import net.minecraft.server.Blocks;
+import net.minecraft.server.World;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
+
+public class AntiXray
+{
+
+ private static final CustomTimingsHandler update = new CustomTimingsHandler( "xray - update" );
+ private static final CustomTimingsHandler obfuscate = new CustomTimingsHandler( "xray - obfuscate" );
+ /*========================================================================*/
+ // Used to keep track of which blocks to obfuscate
+ private final boolean[] obfuscateBlocks = new boolean[ Short.MAX_VALUE ];
+ // Used to select a random replacement ore
+ private final byte[] replacementOres;
+
+ public AntiXray(SpigotWorldConfig config)
+ {
+ // Set all listed blocks as true to be obfuscated
+ for ( int id : ( config.engineMode == 1 ) ? config.hiddenBlocks : config.replaceBlocks )
+ {
+ obfuscateBlocks[id] = true;
+ }
+
+ // For every block
+ TByteSet blocks = new TByteHashSet();
+ for ( Integer i : config.hiddenBlocks )
+ {
+ Block block = Block.getById( i );
+ // Check it exists and is not a tile entity
+ if ( block != null && !block.isTileEntity() )
+ {
+ // Add it to the set of replacement blocks
+ blocks.add( (byte) (int) i );
+ }
+ }
+ // Bake it to a flat array of replacements
+ replacementOres = blocks.toArray();
+ }
+
+ /**
+ * Starts the timings handler, then updates all blocks within the set radius
+ * of the given coordinate, revealing them if they are hidden ores.
+ */
+ public void updateNearbyBlocks(World world, BlockPosition position)
+ {
+ if ( world.spigotConfig.antiXray )
+ {
+ update.startTiming();
+ updateNearbyBlocks( world, position, 2, false ); // 2 is the radius, we shouldn't change it as that would make it exponentially slower
+ update.stopTiming();
+ }
+ }
+
+ /**
+ * Starts the timings handler, and then removes all non exposed ores from
+ * the chunk buffer.
+ */
+ public void obfuscateSync(int chunkX, int chunkY, int bitmask, byte[] buffer, World world)
+ {
+ if ( world.spigotConfig.antiXray )
+ {
+ obfuscate.startTiming();
+ obfuscate( chunkX, chunkY, bitmask, buffer, world );
+ obfuscate.stopTiming();
+ }
+ }
+
+ /**
+ * Removes all non exposed ores from the chunk buffer.
+ */
+ public void obfuscate(int chunkX, int chunkY, int bitmask, byte[] buffer, World world)
+ {
+ // If the world is marked as obfuscated
+ if ( world.spigotConfig.antiXray )
+ {
+ // Initial radius to search around for air
+ int initialRadius = 1;
+ // Which block in the buffer we are looking at, anywhere from 0 to 16^4
+ int index = 0;
+ // The iterator marking which random ore we should use next
+ int randomOre = 0;
+
+ // Chunk corner X and Z blocks
+ int startX = chunkX << 4;
+ int startZ = chunkY << 4;
+
+ byte replaceWithTypeId;
+ switch ( world.getWorld().getEnvironment() )
+ {
+ case NETHER:
+ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.NETHERRACK);
+ break;
+ case THE_END:
+ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.END_STONE);
+ break;
+ default:
+ replaceWithTypeId = (byte) CraftMagicNumbers.getId(Blocks.STONE);
+ break;
+ }
+
+ // Chunks can have up to 16 sections
+ for ( int i = 0; i < 16; i++ )
+ {
+ // If the bitmask indicates this chunk is sent...
+ if ( ( bitmask & 1 << i ) != 0 )
+ {
+ // Work through all blocks in the chunk, y,z,x
+ for ( int y = 0; y < 16; y++ )
+ {
+ for ( int z = 0; z < 16; z++ )
+ {
+ for ( int x = 0; x < 16; x++ )
+ {
+ // For some reason we can get too far ahead of ourselves (concurrent modification on bulk chunks?) so if we do, just abort and move on
+ if ( index >= buffer.length )
+ {
+ index++;
+ continue;
+ }
+ // Grab the block ID in the buffer.
+ // TODO: extended IDs are not yet supported
+ int blockId = (buffer[index << 1] & 0xFF)
+ | ((buffer[(index << 1) + 1] & 0xFF) << 8);
+ blockId >>>= 4;
+ // Check if the block should be obfuscated
+ if ( obfuscateBlocks[blockId] )
+ {
+ // The world isn't loaded, bail out
+ if ( !isLoaded( world, new BlockPosition( startX + x, ( i << 4 ) + y, startZ + z ), initialRadius ) )
+ {
+ index++;
+ continue;
+ }
+ // On the otherhand, if radius is 0, or the nearby blocks are all non air, we can obfuscate
+ if ( !hasTransparentBlockAdjacent( world, new BlockPosition( startX + x, ( i << 4 ) + y, startZ + z ), initialRadius ) )
+ {
+ int newId = blockId;
+ switch ( world.spigotConfig.engineMode )
+ {
+ case 1:
+ // Replace with replacement material
+ newId = replaceWithTypeId & 0xFF;
+ break;
+ case 2:
+ // Replace with random ore.
+ if ( randomOre >= replacementOres.length )
+ {
+ randomOre = 0;
+ }
+ newId = replacementOres[randomOre++] & 0xFF;
+ break;
+ }
+ newId <<= 4;
+ buffer[index << 1] = (byte) (newId & 0xFF);
+ buffer[(index << 1) + 1] = (byte) ((newId >> 8) & 0xFF);
+ }
+ }
+
+ index++;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void updateNearbyBlocks(World world, BlockPosition position, int radius, boolean updateSelf)
+ {
+ // If the block in question is loaded
+ if ( world.isLoaded( position ) )
+ {
+ // Get block id
+ Block block = world.getType(position).getBlock();
+
+ // See if it needs update
+ if ( updateSelf && obfuscateBlocks[Block.getId( block )] )
+ {
+ // Send the update
+ world.notify( position );
+ }
+
+ // Check other blocks for updates
+ if ( radius > 0 )
+ {
+ updateNearbyBlocks( world, position.east(), radius - 1, true );
+ updateNearbyBlocks( world, position.west(), radius - 1, true );
+ updateNearbyBlocks( world, position.up(), radius - 1, true );
+ updateNearbyBlocks( world, position.down(), radius - 1, true );
+ updateNearbyBlocks( world, position.south(), radius - 1, true );
+ updateNearbyBlocks( world, position.north(), radius - 1, true );
+ }
+ }
+ }
+
+ private static boolean isLoaded(World world, BlockPosition position, int radius)
+ {
+ return world.isLoaded( position )
+ && ( radius == 0 ||
+ ( isLoaded( world, position.east(), radius - 1 )
+ && isLoaded( world, position.west(), radius - 1 )
+ && isLoaded( world, position.up(), radius - 1 )
+ && isLoaded( world, position.down(), radius - 1 )
+ && isLoaded( world, position.south(), radius - 1 )
+ && isLoaded( world, position.north(), radius - 1 ) ) );
+ }
+
+ private static boolean hasTransparentBlockAdjacent(World world, BlockPosition position, int radius)
+ {
+ return !isSolidBlock(world.getType(position, false).getBlock()) /* isSolidBlock */
+ || ( radius > 0
+ && ( hasTransparentBlockAdjacent( world, position.east(), radius - 1 )
+ || hasTransparentBlockAdjacent( world, position.west(), radius - 1 )
+ || hasTransparentBlockAdjacent( world, position.up(), radius - 1 )
+ || hasTransparentBlockAdjacent( world, position.down(), radius - 1 )
+ || hasTransparentBlockAdjacent( world, position.south(), radius - 1 )
+ || hasTransparentBlockAdjacent( world, position.north(), radius - 1 ) ) );
+ }
+
+ private static boolean isSolidBlock(Block block) {
+ // Mob spawners are treated as solid blocks as far as the
+ // game is concerned for lighting and other tasks but for
+ // rendering they can be seen through therefor we special
+ // case them so that the antixray doesn't show the fake
+ // blocks around them.
+ return block.isOccluding() && block != Blocks.MOB_SPAWNER && block != Blocks.BARRIER;
+ }
+}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index d8433ac..5d2b755 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -1,5 +1,6 @@
package org.spigotmc;
+import java.util.Arrays;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -214,4 +215,36 @@ public class SpigotWorldConfig
arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 );
log( "Arrow Despawn Rate: " + arrowDespawnRate );
}
+
+ public boolean antiXray;
+ public int engineMode;
+ public List<Integer> hiddenBlocks;
+ public List<Integer> replaceBlocks;
+ public AntiXray antiXrayInstance;
+ private void antiXray()
+ {
+ antiXray = getBoolean( "anti-xray.enabled", true );
+ log( "Anti X-Ray: " + antiXray );
+
+ engineMode = getInt( "anti-xray.engine-mode", 1 );
+ log( "\tEngine Mode: " + engineMode );
+
+ if ( SpigotConfig.version < 5 )
+ {
+ set( "anti-xray.blocks", null );
+ }
+ hiddenBlocks = getList( "anti-xray.hide-blocks", Arrays.asList( new Integer[]
+ {
+ 14, 15, 16, 21, 48, 49, 54, 56, 73, 74, 82, 129, 130
+ } ) );
+ log( "\tHidden Blocks: " + hiddenBlocks );
+
+ replaceBlocks = getList( "anti-xray.replace-blocks", Arrays.asList( new Integer[]
+ {
+ 1, 5
+ } ) );
+ log( "\tReplace Blocks: " + replaceBlocks );
+
+ antiXrayInstance = new AntiXray( this );
+ }
}
--
2.1.4

View File

@ -1,137 +0,0 @@
From 4e418f9a238858b1c13a6290ff5b667331073cb0 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 11:45:47 +1100
Subject: [PATCH] Optimize DataWatcher
Use primitive orientated collections, as well as more effective copies across collections.
diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java
index 2bf9196..aa46c28 100644
--- a/src/main/java/net/minecraft/server/DataWatcher.java
+++ b/src/main/java/net/minecraft/server/DataWatcher.java
@@ -15,8 +15,13 @@ public class DataWatcher {
private final Entity a;
private boolean b = true;
- private static final Map<Class<?>, Integer> c = Maps.newHashMap();
- private final Map<Integer, DataWatcher.WatchableObject> d = Maps.newHashMap();
+ // Spigot Start
+ private static final gnu.trove.map.TObjectIntMap classToId = new gnu.trove.map.hash.TObjectIntHashMap( 10, 0.5f, -1 );
+ private final gnu.trove.map.TIntObjectMap dataValues = new gnu.trove.map.hash.TIntObjectHashMap( 10, 0.5f, -1 );
+ // These exist as an attempt at backwards compatability for (broken) NMS plugins
+ private static final Map<Class<?>, Integer> c = gnu.trove.TDecorators.wrap( classToId );
+ private final Map<Integer, DataWatcher.WatchableObject> d = gnu.trove.TDecorators.wrap( dataValues );
+ // Spigot End
private boolean e;
private ReadWriteLock f = new ReentrantReadWriteLock();
@@ -25,19 +30,19 @@ public class DataWatcher {
}
public <T> void a(int i, T t0) {
- Integer integer = (Integer) DataWatcher.c.get(t0.getClass());
+ int integer = classToId.get(t0.getClass()); // Spigot
- if (integer == null) {
+ if (integer == -1) { // Spigot
throw new IllegalArgumentException("Unknown data type: " + t0.getClass());
} else if (i > 31) {
throw new IllegalArgumentException("Data value id is too big with " + i + "! (Max is " + 31 + ")");
- } else if (this.d.containsKey(Integer.valueOf(i))) {
+ } else if (this.dataValues.containsKey(i)) { // Spigot
throw new IllegalArgumentException("Duplicate id value for " + i + "!");
} else {
- DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(integer.intValue(), i, t0);
+ DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(integer, i, t0); // Spigot
this.f.writeLock().lock();
- this.d.put(Integer.valueOf(i), datawatcher_watchableobject);
+ this.dataValues.put(i, datawatcher_watchableobject); // Spigot
this.f.writeLock().unlock();
this.b = false;
}
@@ -47,7 +52,7 @@ public class DataWatcher {
DataWatcher.WatchableObject datawatcher_watchableobject = new DataWatcher.WatchableObject(j, i, (Object) null);
this.f.writeLock().lock();
- this.d.put(Integer.valueOf(i), datawatcher_watchableobject);
+ this.dataValues.put(i, datawatcher_watchableobject); // Spigot
this.f.writeLock().unlock();
this.b = false;
}
@@ -82,7 +87,7 @@ public class DataWatcher {
DataWatcher.WatchableObject datawatcher_watchableobject;
try {
- datawatcher_watchableobject = (DataWatcher.WatchableObject) this.d.get(Integer.valueOf(i));
+ datawatcher_watchableobject = (DataWatcher.WatchableObject) this.dataValues.get(i); // Spigot
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Getting synched entity data");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Synched entity data");
@@ -139,7 +144,7 @@ public class DataWatcher {
if (this.e) {
this.f.readLock().lock();
- Iterator iterator = this.d.values().iterator();
+ Iterator iterator = this.dataValues.valueCollection().iterator(); // Spigot
while (iterator.hasNext()) {
DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next();
@@ -163,7 +168,7 @@ public class DataWatcher {
public void a(PacketDataSerializer packetdataserializer) throws IOException {
this.f.readLock().lock();
- Iterator iterator = this.d.values().iterator();
+ Iterator iterator = this.dataValues.valueCollection().iterator(); // Spigot
while (iterator.hasNext()) {
DataWatcher.WatchableObject datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next();
@@ -176,18 +181,11 @@ public class DataWatcher {
}
public List<DataWatcher.WatchableObject> c() {
- ArrayList arraylist = null;
+ ArrayList arraylist = Lists.newArrayList(); // Spigot
this.f.readLock().lock();
- DataWatcher.WatchableObject datawatcher_watchableobject;
-
- for (Iterator iterator = this.d.values().iterator(); iterator.hasNext(); arraylist.add(datawatcher_watchableobject)) {
- datawatcher_watchableobject = (DataWatcher.WatchableObject) iterator.next();
- if (arraylist == null) {
- arraylist = Lists.newArrayList();
- }
- }
+ arraylist.addAll(this.dataValues.valueCollection()); // Spigot
this.f.readLock().unlock();
return arraylist;
@@ -310,14 +308,16 @@ public class DataWatcher {
}
static {
- DataWatcher.c.put(Byte.class, Integer.valueOf(0));
- DataWatcher.c.put(Short.class, Integer.valueOf(1));
- DataWatcher.c.put(Integer.class, Integer.valueOf(2));
- DataWatcher.c.put(Float.class, Integer.valueOf(3));
- DataWatcher.c.put(String.class, Integer.valueOf(4));
- DataWatcher.c.put(ItemStack.class, Integer.valueOf(5));
- DataWatcher.c.put(BlockPosition.class, Integer.valueOf(6));
- DataWatcher.c.put(Vector3f.class, Integer.valueOf(7));
+ // Spigot Start - remove valueOf
+ classToId.put(Byte.class, 0);
+ classToId.put(Short.class, 1);
+ classToId.put(Integer.class, 2);
+ classToId.put(Float.class, 3);
+ classToId.put(String.class, 4);
+ classToId.put(ItemStack.class, 5);
+ classToId.put(BlockPosition.class, 6);
+ classToId.put(Vector3f.class, 7);
+ // Spigot End
}
public static class WatchableObject {
--
2.1.4

View File

@ -1,4 +1,4 @@
From bf78106f695dd8d9f1c06e7af4eb466e3350220a Mon Sep 17 00:00:00 2001
From d2d688e7e76a2711493cef900b44f251875f6692 Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Fri, 20 Dec 2013 21:36:06 +0000
Subject: [PATCH] Particle API
@ -19,10 +19,10 @@ index 7de0de5..13f9e9d 100644
datavalue = 0;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index fc2a1ab..20e2416 100644
index 2b6928f..84b6e41 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -836,28 +836,18 @@ public class CraftWorld implements World {
@@ -828,28 +828,18 @@ public class CraftWorld implements World {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
}
@ -60,7 +60,7 @@ index fc2a1ab..20e2416 100644
}
public <T extends Entity> T spawn(Location location, Class<T> clazz) throws IllegalArgumentException {
@@ -1388,6 +1378,70 @@ public class CraftWorld implements World {
@@ -1459,6 +1449,70 @@ public class CraftWorld implements World {
// Spigot start
private final Spigot spigot = new Spigot()
{
@ -132,10 +132,10 @@ index fc2a1ab..20e2416 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 39a73bd..499c6d2 100644
index 1f11c9d..30cef72 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -318,9 +318,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -319,9 +319,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void playEffect(Location loc, Effect effect, int data) {
if (getHandle().playerConnection == null) return;
@ -146,7 +146,7 @@ index 39a73bd..499c6d2 100644
}
@Override
@@ -1373,6 +1371,63 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1439,6 +1437,63 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
server.getServer().getPlayerList().moveToWorld( getHandle(), 0, false );
}
}
@ -211,5 +211,5 @@ index 39a73bd..499c6d2 100644
public Player.Spigot spigot()
--
2.1.4
2.5.0

View File

@ -1,22 +1,22 @@
From 2952e571862ec9c07862a9bab3409cad2493f4ea Mon Sep 17 00:00:00 2001
From f788b71da021723020948f5fc4bf3f4607f16570 Mon Sep 17 00:00:00 2001
From: DerFlash <bte@freenet.de>
Date: Tue, 9 Jul 2013 00:11:12 +0200
Subject: [PATCH] Save ticks lived to nbttag
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index bf3ce15..b96c6d6 100644
index 1eec160..5955732 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1192,6 +1192,7 @@ public abstract class Entity implements ICommandListener {
@@ -1292,6 +1292,7 @@ public abstract class Entity implements ICommandListener {
nbttagcompound.setLong("WorldUUIDLeast", this.world.getDataManager().getUUID().getLeastSignificantBits());
nbttagcompound.setLong("WorldUUIDMost", this.world.getDataManager().getUUID().getMostSignificantBits());
nbttagcompound.setInt("Bukkit.updateLevel", CURRENT_LEVEL);
+ nbttagcompound.setInt("Spigot.ticksLived", this.ticksLived);
// CraftBukkit end
if (this.getCustomName() != null && this.getCustomName().length() > 0) {
if (this.getCustomName() != null && !this.getCustomName().isEmpty()) {
nbttagcompound.setString("CustomName", this.getCustomName());
@@ -1283,6 +1284,8 @@ public abstract class Entity implements ICommandListener {
@@ -1428,6 +1429,8 @@ public abstract class Entity implements ICommandListener {
if (this instanceof EntityLiving) {
EntityLiving entity = (EntityLiving) this;
@ -26,5 +26,5 @@ index bf3ce15..b96c6d6 100644
if (entity instanceof EntityTameableAnimal && !isLevelAtLeast(nbttagcompound, 2) && !nbttagcompound.getBoolean("PersistenceRequired")) {
EntityInsentient entityinsentient = (EntityInsentient) entity;
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 3f74786e9e903c56de3e8cde33ae1a7bf1f14707 Mon Sep 17 00:00:00 2001
From f5654f47ab5ba129f0337f5e00bc5f5e46beeb29 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 2 Feb 2014 16:55:46 +0000
Subject: [PATCH] Add Option to Nerf Mobs from Spawner's
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index b96c6d6..027b1f1 100644
index 5955732..eb552e2 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -121,6 +121,7 @@ public abstract class Entity implements ICommandListener {
@@ -145,6 +145,7 @@ public abstract class Entity implements ICommandListener {
public final byte activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this);
public final boolean defaultActivationState;
public long activatedTick = Integer.MIN_VALUE;
@ -17,12 +17,12 @@ index b96c6d6..027b1f1 100644
// Spigot end
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index 0608c3f..a8a327d 100644
index ba69133..7d4bb9f 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -457,6 +457,12 @@ public abstract class EntityInsentient extends EntityLiving {
@@ -626,6 +626,12 @@ public abstract class EntityInsentient extends EntityLiving {
this.world.methodProfiler.a("checkDespawn");
this.D();
this.L();
this.world.methodProfiler.b();
+ // Spigot Start
+ if ( this.fromMobSpawner )
@ -31,43 +31,31 @@ index 0608c3f..a8a327d 100644
+ }
+ // Spigot End
this.world.methodProfiler.a("sensing");
this.bk.a();
this.bu.a();
this.world.methodProfiler.b();
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 35ed213..6004e23 100644
index 01cbd71..efe792b 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -144,6 +144,12 @@ public abstract class MobSpawnerAbstract {
SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ());
if (!event.isCancelled()) {
entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
+ // Spigot Start
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
+ {
+ entity.fromMobSpawner = true;
+ }
+ // Spigot End
}
// CraftBukkit end
}
@@ -191,6 +197,12 @@ public abstract class MobSpawnerAbstract {
SpawnerSpawnEvent event = CraftEventFactory.callSpawnerSpawnEvent(entity, this.b().getX(), this.b().getY(), this.b().getZ());
if (!event.isCancelled()) {
entity.world.addEntity(entity, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
@@ -94,7 +94,12 @@ public abstract class MobSpawnerAbstract {
if (this.spawnData.b().d() == 1 && this.spawnData.b().hasKeyOfType("id", 8) && entity instanceof EntityInsentient) {
((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null);
}
-
+ // Spigot Start
+ if ( entity.world.spigotConfig.nerfSpawnerMobs )
+ {
+ entity.fromMobSpawner = true;
+ }
+ // Spigot End
}
// Spigot end
}
ChunkRegionLoader.a(entity, world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
world.triggerEffect(2004, blockposition, 0);
if (entityinsentient != null) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index f6fc0a2..20800ed 100644
index 6df2186..3854195 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -254,4 +254,11 @@ public class SpigotWorldConfig
@@ -210,4 +210,11 @@ public class SpigotWorldConfig
zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true );
log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager );
}
@ -80,5 +68,5 @@ index f6fc0a2..20800ed 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From fffa67446ecf4048eb314ed7abd8758a7287daa4 Mon Sep 17 00:00:00 2001
From fdb8e3f808c10f65cb25429e7885b742becc6582 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 23 Dec 2013 14:07:41 +1100
Subject: [PATCH] Warn if PermGen may be insufficient
@ -32,5 +32,5 @@ index aca0d97..337aa29 100644
MinecraftServer.main(options);
} catch (Throwable t) {
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 9bacce598c5544cba0339a9ff3da446c4a8d4a3c Mon Sep 17 00:00:00 2001
From 92ea11e122a121b244220db0d91cbfbfac386e20 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Mon, 23 Dec 2013 15:57:57 +1100
Subject: [PATCH] Disable Connected Check on setScoreboard
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 499c6d2..9998ed8 100644
index 30cef72..7c9f8e2 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1237,7 +1237,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1238,7 +1238,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
throw new IllegalStateException("Cannot set scoreboard yet");
}
if (playerConnection.isDisconnected()) {
@ -18,5 +18,5 @@ index 499c6d2..9998ed8 100644
this.server.getScoreboardManager().setPlayerBoard(this, scoreboard);
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From ab7f3c1ab5d1c13a9f0a95e347bd9be9b499af54 Mon Sep 17 00:00:00 2001
From 07a28ec70f33b9e7b16d76f412bf06d060c8f191 Mon Sep 17 00:00:00 2001
From: slide23 <me@slide.ws>
Date: Fri, 20 Dec 2013 20:15:33 -0600
Subject: [PATCH] Add Late Bind Option
@ -6,18 +6,18 @@ Subject: [PATCH] Add Late Bind Option
Add late-bind config option to delay binding until loading is done.
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index be30d17..8801164 100644
index 93ace97..852f8b4 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -173,6 +173,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -176,6 +176,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
this.a(MinecraftEncryption.b());
DedicatedServer.LOGGER.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.R());
DedicatedServer.LOGGER.info("Starting Minecraft server on " + (this.getServerIp().isEmpty() ? "*" : this.getServerIp()) + ":" + this.P());
+ if (!org.spigotmc.SpigotConfig.lateBind) {
try {
this.aq().a(inetaddress, this.R());
this.am().a(inetaddress, this.P());
} catch (IOException ioexception) {
@@ -181,6 +182,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -184,6 +185,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
DedicatedServer.LOGGER.warn("Perhaps a server is already running on that port?");
return false;
}
@ -25,13 +25,13 @@ index be30d17..8801164 100644
// Spigot Start - Move DedicatedPlayerList up and bring plugin loading from CraftServer to here
// this.a((PlayerList) (new DedicatedPlayerList(this))); // CraftBukkit
@@ -270,6 +272,17 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -276,6 +278,17 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
}
// CraftBukkit end
+ if (org.spigotmc.SpigotConfig.lateBind) {
+ try {
+ this.aq().a(inetaddress, this.R());
+ this.am().a(inetaddress, this.P());
+ } catch (IOException ioexception) {
+ DedicatedServer.LOGGER.warn("**** FAILED TO BIND TO PORT!");
+ DedicatedServer.LOGGER.warn("The exception was: {}", new Object[] { ioexception.toString()});
@ -40,7 +40,7 @@ index be30d17..8801164 100644
+ }
+ }
+
if (false && this.aS() > 0L) { // Spigot - disable
if (false && this.aP() > 0L) { // Spigot - disable
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
@ -58,5 +58,5 @@ index a306266..4edc6af 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,22 +0,0 @@
From 352eba0eb3c150efd3233443ec6eb2d5deaa9d83 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 13 Dec 2013 15:21:02 +1100
Subject: [PATCH] Prevent Mineshaft Saving
diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java
index bb1a11e..0f8211a 100644
--- a/src/main/java/net/minecraft/server/StructureGenerator.java
+++ b/src/main/java/net/minecraft/server/StructureGenerator.java
@@ -196,7 +196,7 @@ public abstract class StructureGenerator extends WorldGenBase {
private void a(World world) {
if (this.d == null) {
// Spigot Start
- if ( world.spigotConfig.saveStructureInfo )
+ if ( world.spigotConfig.saveStructureInfo && !this.a().equals( "Mineshaft" ) )
{
this.d = (PersistentStructure) world.a(PersistentStructure.class, this.a());
} else
--
2.1.4

View File

@ -1,11 +1,11 @@
From d3e32f4d2fa2684eb2942b93b4bcfb237056915b Mon Sep 17 00:00:00 2001
From c15db6fb5a3859e3b1423257eb673310e2a6e7a3 Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thethinkofdeath@gmail.com>
Date: Tue, 7 Jan 2014 15:56:26 +0000
Subject: [PATCH] Allow statistics to be disabled/forced
diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java
index 46845cd..22c2ffd 100644
index 76bd9c1..a08eb77 100644
--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java
+++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java
@@ -31,6 +31,14 @@ public class ServerStatisticManager extends StatisticManager {
@ -89,5 +89,5 @@ index 4edc6af..a2be9df 100644
+ }
}
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From 3133f7ad7c02420bd68fbc080d70da3144d506cb Mon Sep 17 00:00:00 2001
From dae46463bd9260d31d69fd7f581933bd54aa7c41 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Fri, 10 Jan 2014 15:15:50 +1100
Subject: [PATCH] Fix ItemStack Unbreakable Code
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index b722be5..6808a46 100644
index acc5bd2..3d02391 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -287,7 +287,13 @@ public final class ItemStack {
@@ -283,7 +283,13 @@ public final class ItemStack {
}
public boolean e() {
@ -24,5 +24,5 @@ index b722be5..6808a46 100644
public boolean usesData() {
--
2.1.4
2.5.0

View File

@ -1,14 +1,14 @@
From bf215730a200db2cd4d457d58b1d310e72174209 Mon Sep 17 00:00:00 2001
From b48d48b32f53d99a57e02f5c1f01a4a55a3036d2 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 12 Jan 2014 20:56:41 +1100
Subject: [PATCH] Try and Debug Crash Reports Crashing
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0637df9..db360fb 100644
index 0aab39b..49524b1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -742,7 +742,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -743,7 +743,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
worldserver.doTick();
worldserver.timings.doTick.stopTiming(); // Spigot
} catch (Throwable throwable) {
@ -22,7 +22,7 @@ index 0637df9..db360fb 100644
worldserver.a(crashreport);
throw new ReportedException(crashreport);
}
@@ -752,7 +758,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -753,7 +759,13 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
worldserver.tickEntities();
worldserver.timings.tickEntities.stopTiming(); // Spigot
} catch (Throwable throwable1) {
@ -37,5 +37,5 @@ index 0637df9..db360fb 100644
throw new ReportedException(crashreport);
}
--
2.1.4
2.5.0

View File

@ -1,4 +1,4 @@
From 5d9662a42d3dfafe3ee455e83fdfc8cd6530d9f4 Mon Sep 17 00:00:00 2001
From a80d57a9e6782a14b839f6fab8908a18377440f7 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 12 Jan 2014 21:07:18 +1100
Subject: [PATCH] Improve AutoSave Mechanism
@ -11,23 +11,23 @@ Instead we will mimic the save-all command in its behaviour, which is both safe
Also, only save modified chunks, or chunks with entities after 4 auto save passes
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index f461f50..994903f 100644
index 47ef0db..277a6ad 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -942,7 +942,7 @@ public class Chunk {
if (this.r && this.world.getTime() != this.lastSaved || this.q) {
@@ -875,7 +875,7 @@ public class Chunk {
if (this.s && this.world.getTime() != this.lastSaved || this.r) {
return true;
}
- } else if (this.r && this.world.getTime() >= this.lastSaved + 600L) {
+ } else if (this.r && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification
- } else if (this.s && this.world.getTime() >= this.lastSaved + 600L) {
+ } else if (this.s && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification
return true;
}
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index af77eef..975d666 100644
index 8f3cd56..fd3f457 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -323,7 +323,7 @@ public class ChunkProviderServer implements IChunkProvider {
@@ -257,7 +257,7 @@ public class ChunkProviderServer implements IChunkProvider {
this.saveChunk(chunk);
chunk.f(false);
++i;
@ -37,10 +37,10 @@ index af77eef..975d666 100644
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index db360fb..b7ba79a 100644
index 49524b1..254e4bd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -654,7 +654,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
@@ -655,7 +655,17 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
SpigotTimings.worldSaveTimer.startTiming(); // Spigot
this.methodProfiler.a("save");
this.v.savePlayers();
@ -60,10 +60,10 @@ index db360fb..b7ba79a 100644
SpigotTimings.worldSaveTimer.stopTiming(); // Spigot
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index e0d2bfb..70912d6 100644
index 84b6e41..2063185 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -740,12 +740,17 @@ public class CraftWorld implements World {
@@ -732,12 +732,17 @@ public class CraftWorld implements World {
}
public void save() {
@ -83,5 +83,5 @@ index e0d2bfb..70912d6 100644
world.savingDisabled = oldSave;
} catch (ExceptionWorldConflict ex) {
--
2.1.4
2.5.0

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