Phase 1 of MC 1.5 update. No this is not meant to compile, don't get your hopes up :p

This commit is contained in:
md_5 2013-03-16 08:35:56 +11:00
parent 67dd91ffe6
commit 6e1c16aed8
29 changed files with 323 additions and 1063 deletions

View file

@ -1,4 +1,4 @@
From 6657d4637da53ca67b7cf5fac814381313b7e869 Mon Sep 17 00:00:00 2001 From 5891b8019b304be3fbd27dd62dee1661b2ed6b90 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 09:44:24 +1100 Date: Sun, 3 Feb 2013 09:44:24 +1100
Subject: [PATCH] POM Changes. Subject: [PATCH] POM Changes.
@ -8,7 +8,7 @@ Subject: [PATCH] POM Changes.
1 file changed, 32 insertions(+), 37 deletions(-) 1 file changed, 32 insertions(+), 37 deletions(-)
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
index d697ca1..a92e73d 100644 index 5a74ee9..e04acf9 100644
--- a/pom.xml --- a/pom.xml
+++ b/pom.xml +++ b/pom.xml
@@ -1,12 +1,20 @@ @@ -1,12 +1,20 @@
@ -28,7 +28,7 @@ index d697ca1..a92e73d 100644
+ <groupId>org.spigotmc</groupId> + <groupId>org.spigotmc</groupId>
+ <artifactId>spigot</artifactId> + <artifactId>spigot</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.4.7-R1.1-SNAPSHOT</version> <version>1.5-R0.1-SNAPSHOT</version>
- <name>CraftBukkit</name> - <name>CraftBukkit</name>
- <url>http://www.bukkit.org</url> - <url>http://www.bukkit.org</url>
+ <name>Spigot</name> + <name>Spigot</name>
@ -37,7 +37,7 @@ index d697ca1..a92e73d 100644
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -16,25 +24,6 @@ @@ -16,25 +24,6 @@
<minecraft_version>1_4_R1</minecraft_version> <minecraft_version>1_5_R1</minecraft_version>
</properties> </properties>
- <scm> - <scm>

View file

@ -1,4 +1,4 @@
From 39ee91305fceb9c3c57cfb73471b0e760af3af80 Mon Sep 17 00:00:00 2001 From 87633bb351c719a15ec38bf63155fcffa7c89000 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 11:47:02 +1100 Date: Sat, 23 Feb 2013 11:47:02 +1100
Subject: [PATCH] Spigot changes. Subject: [PATCH] Spigot changes.
@ -15,16 +15,16 @@ Subject: [PATCH] Spigot changes.
.../java/net/minecraft/server/BlockSapling.java | 2 +- .../java/net/minecraft/server/BlockSapling.java | 2 +-
src/main/java/net/minecraft/server/BlockStem.java | 2 +- src/main/java/net/minecraft/server/BlockStem.java | 2 +-
.../net/minecraft/server/ChunkRegionLoader.java | 35 +++-- .../net/minecraft/server/ChunkRegionLoader.java | 35 +++--
.../java/net/minecraft/server/ChunkSection.java | 31 +++- .../java/net/minecraft/server/ChunkSection.java | 31 ++++-
src/main/java/net/minecraft/server/EntityItem.java | 3 +- src/main/java/net/minecraft/server/EntityItem.java | 3 +-
.../java/net/minecraft/server/EntitySquid.java | 4 - .../java/net/minecraft/server/EntitySquid.java | 4 -
.../net/minecraft/server/PlayerConnection.java | 18 ++- .../net/minecraft/server/PlayerConnection.java | 18 ++-
src/main/java/net/minecraft/server/PlayerList.java | 10 +- src/main/java/net/minecraft/server/PlayerList.java | 10 +-
.../net/minecraft/server/ThreadLoginVerifier.java | 23 +++ .../net/minecraft/server/ThreadLoginVerifier.java | 23 ++++
src/main/java/net/minecraft/server/World.java | 161 ++++++++++++++++++--- src/main/java/net/minecraft/server/World.java | 152 ++++++++++++++++++---
.../java/net/minecraft/server/WorldServer.java | 121 +++++++++++++--- .../java/net/minecraft/server/WorldServer.java | 128 +++++++++++++----
.../java/org/bukkit/craftbukkit/CraftServer.java | 45 +++--- .../java/org/bukkit/craftbukkit/CraftServer.java | 45 +++---
.../java/org/bukkit/craftbukkit/CraftWorld.java | 76 +++++++++- .../java/org/bukkit/craftbukkit/CraftWorld.java | 76 ++++++++++-
src/main/java/org/bukkit/craftbukkit/Spigot.java | 20 +++ src/main/java/org/bukkit/craftbukkit/Spigot.java | 20 +++
.../craftbukkit/chunkio/ChunkIOProvider.java | 2 +- .../craftbukkit/chunkio/ChunkIOProvider.java | 2 +-
.../org/bukkit/craftbukkit/entity/CraftPlayer.java | 7 + .../org/bukkit/craftbukkit/entity/CraftPlayer.java | 7 +
@ -32,7 +32,7 @@ Subject: [PATCH] Spigot changes.
.../org/bukkit/craftbukkit/util/LongHashSet.java | 11 +- .../org/bukkit/craftbukkit/util/LongHashSet.java | 11 +-
.../bukkit/craftbukkit/util/LongObjectHashMap.java | 5 + .../bukkit/craftbukkit/util/LongObjectHashMap.java | 5 +
src/main/resources/configurations/bukkit.yml | 27 ++++ src/main/resources/configurations/bukkit.yml | 27 ++++
28 files changed, 564 insertions(+), 99 deletions(-) 28 files changed, 562 insertions(+), 99 deletions(-)
create mode 100644 src/main/java/org/bukkit/craftbukkit/Spigot.java create mode 100644 src/main/java/org/bukkit/craftbukkit/Spigot.java
create mode 100644 src/main/java/org/bukkit/craftbukkit/util/FlatMap.java create mode 100644 src/main/java/org/bukkit/craftbukkit/util/FlatMap.java
@ -48,10 +48,10 @@ index a689360..b97a549 100644
+/dependency-reduced-pom.xml +/dependency-reduced-pom.xml
\ No newline at end of file \ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
index f29eace..202bd19 100644 index 4392cb2..8e041c2 100644
--- a/src/main/java/net/minecraft/server/Block.java --- a/src/main/java/net/minecraft/server/Block.java
+++ b/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java
@@ -753,4 +753,16 @@ public class Block { @@ -768,4 +768,16 @@ public class Block {
return 0; return 0;
} }
// CraftBukkit end // CraftBukkit end
@ -69,7 +69,7 @@ index f29eace..202bd19 100644
+ // Spigot end + // Spigot end
} }
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index dd68020..1cb89fa 100644 index 83cc09d..4fb2d87 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java --- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -23,7 +23,7 @@ public class BlockCactus extends Block { @@ -23,7 +23,7 @@ public class BlockCactus extends Block {
@ -79,15 +79,15 @@ index dd68020..1cb89fa 100644
- if (i1 == 15) { - if (i1 == 15) {
+ if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().cactusGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot + if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().cactusGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0); world.setData(i, j, k, 0, 4);
} else { this.doPhysics(world, i, j + 1, k, this.id);
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
index a2ce8f9..4d3b448 100644 index 14a1c3b..0c6ec6d 100644
--- a/src/main/java/net/minecraft/server/BlockCrops.java --- a/src/main/java/net/minecraft/server/BlockCrops.java
+++ b/src/main/java/net/minecraft/server/BlockCrops.java +++ b/src/main/java/net/minecraft/server/BlockCrops.java
@@ -30,7 +30,7 @@ public class BlockCrops extends BlockFlower { @@ -28,7 +28,7 @@ public class BlockCrops extends BlockFlower {
if (l < 7) { if (l < 7) {
float f = this.l(world, i, j, k); float f = this.k(world, i, j, k);
- if (random.nextInt((int) (25.0F / f) + 1) == 0) { - if (random.nextInt((int) (25.0F / f) + 1) == 0) {
+ if (random.nextInt((int) ((world.growthOdds * 100 / world.getWorld().wheatGrowthModifier / 25.0F) / f) + 1) == 0) { // Spigot + if (random.nextInt((int) ((world.growthOdds * 100 / world.getWorld().wheatGrowthModifier / 25.0F) / f) + 1) == 0) { // Spigot
@ -95,10 +95,10 @@ index a2ce8f9..4d3b448 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
index 79a007c..0bc7882 100644 index 6f9301d..c78a934 100644
--- a/src/main/java/net/minecraft/server/BlockGrass.java --- a/src/main/java/net/minecraft/server/BlockGrass.java
+++ b/src/main/java/net/minecraft/server/BlockGrass.java +++ b/src/main/java/net/minecraft/server/BlockGrass.java
@@ -37,7 +37,7 @@ public class BlockGrass extends Block { @@ -32,7 +32,7 @@ public class BlockGrass extends Block {
} }
// CraftBukkit end // CraftBukkit end
} else if (world.getLightLevel(i, j + 1, k) >= 9) { } else if (world.getLightLevel(i, j + 1, k) >= 9) {
@ -108,12 +108,12 @@ index 79a007c..0bc7882 100644
int j1 = j + random.nextInt(5) - 3; int j1 = j + random.nextInt(5) - 3;
int k1 = k + random.nextInt(3) - 1; int k1 = k + random.nextInt(3) - 1;
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java
index db90874..9647bb2 100644 index 872ad00..aedcf62 100644
--- a/src/main/java/net/minecraft/server/BlockMushroom.java --- a/src/main/java/net/minecraft/server/BlockMushroom.java
+++ b/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java
@@ -24,7 +24,7 @@ public class BlockMushroom extends BlockFlower { @@ -27,7 +27,7 @@ public class BlockMushroom extends BlockFlower {
public void b(World world, int i, int j, int k, Random random) { public void a(World world, int i, int j, int k, Random random) {
final int sourceX = i, sourceY = j, sourceZ = k; // CraftBukkit final int sourceX = i, sourceY = j, sourceZ = k; // CraftBukkit
- if (random.nextInt(25) == 0) { - if (random.nextInt(25) == 0) {
+ if (random.nextInt((int) (world.growthOdds * 100 / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot + if (random.nextInt((int) (world.growthOdds * 100 / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot
@ -121,10 +121,10 @@ index db90874..9647bb2 100644
int l = 5; int l = 5;
diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java
index 6dbf49f..afef94d 100644 index 1de8c83..522d317 100644
--- a/src/main/java/net/minecraft/server/BlockMycel.java --- a/src/main/java/net/minecraft/server/BlockMycel.java
+++ b/src/main/java/net/minecraft/server/BlockMycel.java +++ b/src/main/java/net/minecraft/server/BlockMycel.java
@@ -37,7 +37,7 @@ public class BlockMycel extends Block { @@ -32,7 +32,7 @@ public class BlockMycel extends Block {
} }
// CraftBukkit end // CraftBukkit end
} else if (world.getLightLevel(i, j + 1, k) >= 9) { } else if (world.getLightLevel(i, j + 1, k) >= 9) {
@ -134,38 +134,38 @@ index 6dbf49f..afef94d 100644
int j1 = j + random.nextInt(5) - 3; int j1 = j + random.nextInt(5) - 3;
int k1 = k + random.nextInt(3) - 1; int k1 = k + random.nextInt(3) - 1;
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 399050a..66ad508 100644 index 8657860..def38e9 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java --- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java +++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -24,7 +24,7 @@ public class BlockReed extends Block { @@ -23,7 +23,7 @@ public class BlockReed extends Block {
if (l < 3) { if (l < 3) {
int i1 = world.getData(i, j, k); int i1 = world.getData(i, j, k);
- if (i1 == 15) { - if (i1 == 15) {
+ if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().sugarGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot + if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().sugarGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0); world.setData(i, j, k, 0, 4);
} else { } else {
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
index 9c94399..e8b0f96 100644 index 4264630..402647d 100644
--- a/src/main/java/net/minecraft/server/BlockSapling.java --- a/src/main/java/net/minecraft/server/BlockSapling.java
+++ b/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java
@@ -27,7 +27,7 @@ public class BlockSapling extends BlockFlower { @@ -25,7 +25,7 @@ public class BlockSapling extends BlockFlower {
if (world.getLightLevel(i, j + 1, k) >= 9 && random.nextInt(7) == 0) { public void a(World world, int i, int j, int k, Random random) {
int l = world.getData(i, j, k); if (!world.isStatic) {
super.a(world, i, j, k, random);
- if ((l & 8) == 0) { - if (world.getLightLevel(i, j + 1, k) >= 9 && random.nextInt(7) == 0) {
+ if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds * 100 / world.getWorld().treeGrowthModifier * 7 / 100F) + 0.5F))) == 0)) { // Spigot + if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds * 100 / world.getWorld().treeGrowthModifier * 7 / 100F) + 0.5F))) == 0)) { // Spigot
world.setData(i, j, k, l | 8); this.grow(world, i, j, k, random, false, null, null); // CraftBukkit - added bonemeal, player and itemstack
} else { }
this.grow(world, i, j, k, random, false, null, null); // CraftBukkit - added bonemeal, player and itemstack }
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
index ff1b89f..dfaf45d 100644 index 8339a35..a945ee4 100644
--- a/src/main/java/net/minecraft/server/BlockStem.java --- a/src/main/java/net/minecraft/server/BlockStem.java
+++ b/src/main/java/net/minecraft/server/BlockStem.java +++ b/src/main/java/net/minecraft/server/BlockStem.java
@@ -27,7 +27,7 @@ public class BlockStem extends BlockFlower { @@ -27,7 +27,7 @@ public class BlockStem extends BlockFlower {
if (world.getLightLevel(i, j + 1, k) >= 9) { if (world.getLightLevel(i, j + 1, k) >= 9) {
float f = this.n(world, i, j, k); float f = this.m(world, i, j, k);
- if (random.nextInt((int) (25.0F / f) + 1) == 0) { - if (random.nextInt((int) (25.0F / f) + 1) == 0) {
+ if (random.nextInt((int) ((world.growthOdds * 100 / ((this.id == Block.PUMPKIN_STEM.id) ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) / 25.0F) / f) + 1) == 0) { // Spigot + if (random.nextInt((int) ((world.growthOdds * 100 / ((this.id == Block.PUMPKIN_STEM.id) ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) / 25.0F) / f) + 1) == 0) { // Spigot
@ -173,7 +173,7 @@ index ff1b89f..dfaf45d 100644
if (l < 7) { if (l < 7) {
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index 88c33d0..e5e60a9 100644 index 8f37333..c1f5cc2 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -13,8 +13,7 @@ import java.util.Set; @@ -13,8 +13,7 @@ import java.util.Set;
@ -326,7 +326,7 @@ index 90e0636..051cf6d 100644
+ // Spigot end + // Spigot end
} }
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index b8b6d52..a7baa0f 100644 index ee775bf..aa8d83f 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java --- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -61,6 +61,7 @@ public class EntityItem extends Entity { @@ -61,6 +61,7 @@ public class EntityItem extends Entity {
@ -347,14 +347,14 @@ index b8b6d52..a7baa0f 100644
if (!this.world.isStatic && this.age >= 6000) { if (!this.world.isStatic && this.age >= 6000) {
// CraftBukkit start // CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
index 961d83a..188d477 100644 index 30259de..af42142 100644
--- a/src/main/java/net/minecraft/server/EntitySquid.java --- a/src/main/java/net/minecraft/server/EntitySquid.java
+++ b/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java
@@ -63,10 +63,6 @@ public class EntitySquid extends EntityWaterAnimal { @@ -63,10 +63,6 @@ public class EntitySquid extends EntityWaterAnimal {
// CraftBukkit end // CraftBukkit end
} }
- public boolean H() { - public boolean G() {
- return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, (Entity) this); - return this.world.a(this.boundingBox.grow(0.0D, -0.6000000238418579D, 0.0D), Material.WATER, (Entity) this);
- } - }
- -
@ -362,10 +362,10 @@ index 961d83a..188d477 100644
super.c(); super.c();
this.e = this.d; this.e = this.d;
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index fac9ea5..43a24f5 100644 index aeca924..b3ff786 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -852,8 +852,19 @@ public class PlayerConnection extends Connection { @@ -839,8 +839,19 @@ public class PlayerConnection extends Connection {
this.chat(s, packet3chat.a_()); this.chat(s, packet3chat.a_());
@ -386,16 +386,16 @@ index fac9ea5..43a24f5 100644
// CraftBukkit start // CraftBukkit start
if (packet3chat.a_()) { if (packet3chat.a_()) {
Waitable waitable = new Waitable() { Waitable waitable = new Waitable() {
@@ -976,7 +987,7 @@ public class PlayerConnection extends Connection { @@ -963,7 +974,7 @@ public class PlayerConnection extends Connection {
} }
try { try {
- logger.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // CraftBukkit - this.minecraftServer.getLogger().info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // CraftBukkit
+ if (server.logCommands) logger.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // Spigot + if (server.logCommands) this.minecraftServer.getLogger().info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // Spigot
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
return; return;
} }
@@ -1353,8 +1364,9 @@ public class PlayerConnection extends Connection { @@ -1340,8 +1351,9 @@ public class PlayerConnection extends Connection {
flag = false; flag = false;
} else { } else {
for (i = 0; i < packet130updatesign.lines[j].length(); ++i) { for (i = 0; i < packet130updatesign.lines[j].length(); ++i) {
@ -407,10 +407,10 @@ index fac9ea5..43a24f5 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index e857612..d13fa19 100644 index 585595d..224c57f 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -253,7 +253,7 @@ public abstract class PlayerList { @@ -303,7 +303,7 @@ public abstract class PlayerList {
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s1); event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s1);
} else if (!this.isWhitelisted(s)) { } else if (!this.isWhitelisted(s)) {
@ -419,7 +419,7 @@ index e857612..d13fa19 100644
} else { } else {
String s2 = socketaddress.toString(); String s2 = socketaddress.toString();
@@ -924,7 +924,13 @@ public abstract class PlayerList { @@ -1044,7 +1044,13 @@ public abstract class PlayerList {
public void r() { public void r() {
while (!this.players.isEmpty()) { while (!this.players.isEmpty()) {
@ -469,10 +469,10 @@ index 0686ba0..58d30eb 100644
URL url = new URL("http://session.minecraft.net/game/checkserver.jsp?user=" + URLEncoder.encode(PendingConnection.d(this.pendingConnection), "UTF-8") + "&serverId=" + URLEncoder.encode(s, "UTF-8")); URL url = new URL("http://session.minecraft.net/game/checkserver.jsp?user=" + URLEncoder.encode(PendingConnection.d(this.pendingConnection), "UTF-8") + "&serverId=" + URLEncoder.encode(s, "UTF-8"));
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(url.openStream())); BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(url.openStream()));
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c3dc4a4..6c9857b 100644 index 9c39815..14df580 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -65,7 +65,7 @@ public abstract class World implements IBlockAccess { @@ -67,14 +67,27 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - public, longhashset // CraftBukkit start - public, longhashset
public boolean allowMonsters = true; public boolean allowMonsters = true;
public boolean allowAnimals = true; public boolean allowAnimals = true;
@ -481,9 +481,8 @@ index c3dc4a4..6c9857b 100644
public long ticksPerAnimalSpawns; public long ticksPerAnimalSpawns;
public long ticksPerMonsterSpawns; public long ticksPerMonsterSpawns;
// CraftBukkit end // CraftBukkit end
@@ -73,7 +73,20 @@ public abstract class World implements IBlockAccess { private int O;
int[] H; int[] H;
private List O;
public boolean isStatic; public boolean isStatic;
+ // Spigot start + // Spigot start
@ -502,7 +501,7 @@ index c3dc4a4..6c9857b 100644
public BiomeBase getBiome(int i, int j) { public BiomeBase getBiome(int i, int j) {
if (this.isLoaded(i, 0, j)) { if (this.isLoaded(i, 0, j)) {
Chunk chunk = this.getChunkAtWorldCoords(i, j); Chunk chunk = this.getChunkAtWorldCoords(i, j);
@@ -99,6 +112,7 @@ public abstract class World implements IBlockAccess { @@ -100,6 +113,7 @@ public abstract class World implements IBlockAccess {
int lastXAccessed = Integer.MIN_VALUE; int lastXAccessed = Integer.MIN_VALUE;
int lastZAccessed = Integer.MIN_VALUE; int lastZAccessed = Integer.MIN_VALUE;
final Object chunkLock = new Object(); final Object chunkLock = new Object();
@ -510,9 +509,9 @@ index c3dc4a4..6c9857b 100644
public CraftWorld getWorld() { public CraftWorld getWorld() {
return this.world; return this.world;
@@ -111,11 +125,18 @@ public abstract class World implements IBlockAccess { @@ -112,11 +126,18 @@ public abstract class World implements IBlockAccess {
// Changed signature // Changed signature
public World(IDataManager idatamanager, String s, WorldSettings worldsettings, WorldProvider worldprovider, MethodProfiler methodprofiler, ChunkGenerator gen, org.bukkit.World.Environment env) { public World(IDataManager idatamanager, String s, WorldSettings worldsettings, WorldProvider worldprovider, MethodProfiler methodprofiler, IConsoleLogManager iconsolelogmanager, ChunkGenerator gen, org.bukkit.World.Environment env) {
this.generator = gen; this.generator = gen;
+ this.worldData = idatamanager.getWorldData(); // Spigot + this.worldData = idatamanager.getWorldData(); // Spigot
this.world = new CraftWorld((WorldServer) this, gen, env); this.world = new CraftWorld((WorldServer) this, gen, env);
@ -526,19 +525,19 @@ index c3dc4a4..6c9857b 100644
+ chunkTickList.setAutoCompactionFactor(0.0F); + chunkTickList.setAutoCompactionFactor(0.0F);
+ // Spigot end + // Spigot end
+ +
this.N = this.random.nextInt(12000); this.O = this.random.nextInt(12000);
this.H = new int['\u8000']; this.H = new int['\u8000'];
this.O = new UnsafeList(); // CraftBukkit - ArrayList -> UnsafeList this.isStatic = false;
@@ -123,7 +144,7 @@ public abstract class World implements IBlockAccess { @@ -124,7 +145,7 @@ public abstract class World implements IBlockAccess {
this.dataManager = idatamanager;
this.methodProfiler = methodprofiler; this.methodProfiler = methodprofiler;
this.worldMaps = new WorldMapCollection(idatamanager); this.worldMaps = new WorldMapCollection(idatamanager);
this.logAgent = iconsolelogmanager;
- this.worldData = idatamanager.getWorldData(); - this.worldData = idatamanager.getWorldData();
+ // this.worldData = idatamanager.getWorldData(); Moved up + // this.worldData = idatamanager.getWorldData(); Moved up
if (worldprovider != null) { if (worldprovider != null) {
this.worldProvider = worldprovider; this.worldProvider = worldprovider;
} else if (this.worldData != null && this.worldData.j() != 0) { } else if (this.worldData != null && this.worldData.j() != 0) {
@@ -901,6 +922,47 @@ public abstract class World implements IBlockAccess { @@ -925,6 +946,47 @@ public abstract class World implements IBlockAccess {
event = CraftEventFactory.callCreatureSpawnEvent((EntityLiving) entity, spawnReason); event = CraftEventFactory.callCreatureSpawnEvent((EntityLiving) entity, spawnReason);
} else if (entity instanceof EntityItem) { } else if (entity instanceof EntityItem) {
event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity); event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity);
@ -586,7 +585,7 @@ index c3dc4a4..6c9857b 100644
} else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Projectile) { } else if (entity.getBukkitEntity() instanceof org.bukkit.entity.Projectile) {
// Not all projectiles extend EntityProjectile, so check for Bukkit interface instead // Not all projectiles extend EntityProjectile, so check for Bukkit interface instead
event = CraftEventFactory.callProjectileLaunchEvent(entity); event = CraftEventFactory.callProjectileLaunchEvent(entity);
@@ -993,6 +1055,39 @@ public abstract class World implements IBlockAccess { @@ -1017,6 +1079,39 @@ public abstract class World implements IBlockAccess {
int i1 = MathHelper.floor(axisalignedbb.c); int i1 = MathHelper.floor(axisalignedbb.c);
int j1 = MathHelper.floor(axisalignedbb.f + 1.0D); int j1 = MathHelper.floor(axisalignedbb.f + 1.0D);
@ -626,7 +625,7 @@ index c3dc4a4..6c9857b 100644
for (int k1 = i; k1 < j; ++k1) { for (int k1 = i; k1 < j; ++k1) {
for (int l1 = i1; l1 < j1; ++l1) { for (int l1 = i1; l1 < j1; ++l1) {
if (this.isLoaded(k1, 64, l1)) { if (this.isLoaded(k1, 64, l1)) {
@@ -1006,6 +1101,7 @@ public abstract class World implements IBlockAccess { @@ -1030,6 +1125,7 @@ public abstract class World implements IBlockAccess {
} }
} }
} }
@ -634,7 +633,7 @@ index c3dc4a4..6c9857b 100644
double d0 = 0.25D; double d0 = 0.25D;
List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0)); List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0));
@@ -1894,6 +1990,11 @@ public abstract class World implements IBlockAccess { @@ -1942,6 +2038,11 @@ public abstract class World implements IBlockAccess {
this.worldData.setWeatherDuration(1); this.worldData.setWeatherDuration(1);
} }
@ -643,10 +642,10 @@ index c3dc4a4..6c9857b 100644
+ protected float modifiedOdds = 100F; + protected float modifiedOdds = 100F;
+ public float growthOdds = 100F; + public float growthOdds = 100F;
+ +
protected void z() { protected void A() {
// this.chunkTickList.clear(); // CraftBukkit - removed // this.chunkTickList.clear(); // CraftBukkit - removed
this.methodProfiler.a("buildList"); this.methodProfiler.a("buildList");
@@ -1903,25 +2004,42 @@ public abstract class World implements IBlockAccess { @@ -1951,25 +2052,42 @@ public abstract class World implements IBlockAccess {
int j; int j;
int k; int k;
@ -702,8 +701,8 @@ index c3dc4a4..6c9857b 100644
+ // Spigot End + // Spigot End
this.methodProfiler.b(); this.methodProfiler.b();
if (this.N > 0) { if (this.O > 0) {
@@ -1929,7 +2047,7 @@ public abstract class World implements IBlockAccess { @@ -1977,7 +2095,7 @@ public abstract class World implements IBlockAccess {
} }
this.methodProfiler.a("playerCheckLight"); this.methodProfiler.a("playerCheckLight");
@ -712,35 +711,8 @@ index c3dc4a4..6c9857b 100644
i = this.random.nextInt(this.players.size()); i = this.random.nextInt(this.players.size());
entityhuman = (EntityHuman) this.players.get(i); entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5; j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
@@ -2308,7 +2426,10 @@ public abstract class World implements IBlockAccess {
}
public List getEntities(Entity entity, AxisAlignedBB axisalignedbb) {
- this.O.clear();
+ // Spigot start
+ // this.O.clear();
+ ArrayList<?> entities = new ArrayList();
+ // Spigot end
int i = MathHelper.floor((axisalignedbb.a - 2.0D) / 16.0D);
int j = MathHelper.floor((axisalignedbb.d + 2.0D) / 16.0D);
int k = MathHelper.floor((axisalignedbb.c - 2.0D) / 16.0D);
@@ -2317,12 +2438,12 @@ public abstract class World implements IBlockAccess {
for (int i1 = i; i1 <= j; ++i1) {
for (int j1 = k; j1 <= l; ++j1) {
if (this.isChunkLoaded(i1, j1)) {
- this.getChunkAt(i1, j1).a(entity, axisalignedbb, this.O);
+ this.getChunkAt(i1, j1).a(entity, axisalignedbb, entities); // Spigot
}
}
}
- return this.O;
+ return entities; // Spigot
}
public List a(Class oclass, AxisAlignedBB axisalignedbb) {
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 3f73ef9..7032c61 100644 index d99b6a3..f7c1b87 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -1,5 +1,7 @@ @@ -1,5 +1,7 @@
@ -768,7 +740,7 @@ index 3f73ef9..7032c61 100644
private TreeSet M; private TreeSet M;
public ChunkProviderServer chunkProviderServer; public ChunkProviderServer chunkProviderServer;
public boolean savingDisabled; public boolean savingDisabled;
@@ -52,7 +55,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -53,7 +56,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
} }
if (this.L == null) { if (this.L == null) {
@ -777,7 +749,7 @@ index 3f73ef9..7032c61 100644
} }
if (this.M == null) { if (this.M == null) {
@@ -267,15 +270,31 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -277,15 +280,31 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
} }
protected void g() { protected void g() {
@ -813,10 +785,11 @@ index 3f73ef9..7032c61 100644
// ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next(); // ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator.next();
int k = chunkX * 16; int k = chunkX * 16;
int l = chunkZ * 16; int l = chunkZ * 16;
@@ -373,6 +392,14 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -383,7 +402,17 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
if (block != null && block.isTicking()) { if (block != null && block.isTicking()) {
++i; ++i;
- block.a(this, k2 + k, i3 + chunksection.d(), l2 + l, this.random);
+ // Spigot start + // Spigot start
+ if (players < 1) { + if (players < 1) {
+ //grow fast if no players are in this chunk + //grow fast if no players are in this chunk
@ -824,11 +797,14 @@ index 3f73ef9..7032c61 100644
+ } else { + } else {
+ this.growthOdds = 100; + this.growthOdds = 100;
+ } + }
+ for (int i = 0; i < getWorld().aggregateTicks; i++) {
+ block.a(this, k2 + k, i3 + chunksection.d(), l2 + l, this.random);
+ }
+ // Spigot end + // Spigot end
block.b(this, k2 + k, i3 + chunksection.d(), l2 + l, this.random);
} }
} }
@@ -413,10 +440,11 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate }
@@ -429,10 +458,11 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
nextticklistentry.a(j1); nextticklistentry.a(j1);
} }
@ -844,7 +820,7 @@ index 3f73ef9..7032c61 100644
} }
} }
@@ -427,10 +455,11 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -444,10 +474,11 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
nextticklistentry.a((long) i1 + this.worldData.getTime()); nextticklistentry.a((long) i1 + this.worldData.getTime());
} }
@ -860,7 +836,7 @@ index 3f73ef9..7032c61 100644
} }
public void tickEntities() { public void tickEntities() {
@@ -452,9 +481,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -469,9 +500,9 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
public boolean a(boolean flag) { public boolean a(boolean flag) {
int i = this.M.size(); int i = this.M.size();
@ -873,23 +849,26 @@ index 3f73ef9..7032c61 100644
if (i > 1000) { if (i > 1000) {
// CraftBukkit start - if the server has too much to process over time, try to alleviate that // CraftBukkit start - if the server has too much to process over time, try to alleviate that
if (i > 20 * 1000) { if (i > 20 * 1000) {
@@ -472,8 +501,11 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -492,10 +523,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
break; break;
} }
- this.M.remove(nextticklistentry); - this.M.remove(nextticklistentry);
- this.L.remove(nextticklistentry); - this.L.remove(nextticklistentry);
- this.T.add(nextticklistentry);
- }
+ // Spigot start + // Spigot start
+ //this.M.remove(nextticklistentry); + //this.M.remove(nextticklistentry);
+ //this.L.remove(nextticklistentry); + //this.L.remove(nextticklistentry);
+ this.removeNextTickIfNeeded(nextticklistentry); + this.removeNextTickIfNeeded(nextticklistentry);
+ // Spigot end + // Spigot end
byte b0 = 8; + byte b0 = 8;
if (this.d(nextticklistentry.a - b0, nextticklistentry.b - b0, nextticklistentry.c - b0, nextticklistentry.a + b0, nextticklistentry.b + b0, nextticklistentry.c + b0)) {
@@ -502,10 +534,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
}
this.methodProfiler.b();
this.methodProfiler.a("ticking");
@@ -536,10 +569,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
this.methodProfiler.b();
this.T.clear();
return !this.M.isEmpty(); return !this.M.isEmpty();
- } - }
+ // } // Spigot + // } // Spigot
@ -900,8 +879,8 @@ index 3f73ef9..7032c61 100644
+ /* Spigot start + /* Spigot start
ArrayList arraylist = null; ArrayList arraylist = null;
ChunkCoordIntPair chunkcoordintpair = chunk.l(); ChunkCoordIntPair chunkcoordintpair = chunk.l();
int i = chunkcoordintpair.x << 4; int i = (chunkcoordintpair.x << 4) - 2;
@@ -532,6 +566,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -578,6 +613,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
} }
return arraylist; return arraylist;
@ -909,7 +888,7 @@ index 3f73ef9..7032c61 100644
} }
public void entityJoinedWorld(Entity entity, boolean flag) { public void entityJoinedWorld(Entity entity, boolean flag) {
@@ -610,7 +645,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -648,7 +684,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
} }
if (this.L == null) { if (this.L == null) {
@ -918,10 +897,10 @@ index 3f73ef9..7032c61 100644
} }
if (this.M == null) { if (this.M == null) {
@@ -883,4 +918,48 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -934,4 +970,48 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
public PortalTravelAgent s() { return this.setTypeIdAndData(x, y, z, typeId, data, 3);
return this.P;
} }
// CraftBukkit end
+ +
+ // Spigot start + // Spigot start
+ private void addNextTickIfNeeded(NextTickListEntry ent) { + private void addNextTickIfNeeded(NextTickListEntry ent) {
@ -968,7 +947,7 @@ index 3f73ef9..7032c61 100644
+ // Spigot end + // Spigot end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index e7c0760..257497e 100644 index 3775022..8f65601 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -146,7 +146,7 @@ public final class CraftServer implements Server { @@ -146,7 +146,7 @@ public final class CraftServer implements Server {
@ -1093,7 +1072,7 @@ index e7c0760..257497e 100644
player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command"); player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to tab-complete this command");
getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex); getLogger().log(Level.SEVERE, "Exception when " + player.getName() + " attempted to tab complete " + message, ex);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 6e364b1..45217cd 100644 index 9218f07..fdef910 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -75,7 +75,81 @@ public class CraftWorld implements World { @@ -75,7 +75,81 @@ public class CraftWorld implements World {

View file

@ -1,4 +1,4 @@
From 7c1be72b82a1dc2af199e0184fea60dd6fad252d Mon Sep 17 00:00:00 2001 From bfc5f88c1e7d5fbe91a141aa18e6491fafd2fd92 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com> From: md_5 <md_5@bigpond.com>
Date: Sun, 23 Dec 2012 17:09:40 +1100 Date: Sun, 23 Dec 2012 17:09:40 +1100
Subject: [PATCH] Address BUKKIT-3286 by firing the inventory close event when Subject: [PATCH] Address BUKKIT-3286 by firing the inventory close event when
@ -10,10 +10,10 @@ Subject: [PATCH] Address BUKKIT-3286 by firing the inventory close event when
1 file changed, 6 insertions(+) 1 file changed, 6 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index ce0715b..028ba0c 100644 index bfcb6ce..552a013 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java --- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -4,11 +4,13 @@ import java.util.Iterator; @@ -5,11 +5,13 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
// CraftBukkit start // CraftBukkit start
@ -27,7 +27,7 @@ index ce0715b..028ba0c 100644
import org.bukkit.event.player.PlayerBedEnterEvent; import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerBedLeaveEvent; import org.bukkit.event.player.PlayerBedLeaveEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
@@ -911,6 +913,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen @@ -941,6 +943,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
super.die(); super.die();
this.defaultContainer.b(this); this.defaultContainer.b(this);
if (this.activeContainer != null) { if (this.activeContainer != null) {

View file

@ -1,4 +1,4 @@
From 5c745b48d2a4917947844408f63a581d5f626fb0 Mon Sep 17 00:00:00 2001 From 2e93b88a60c6455d3c3754c75c788cc705e5b7b3 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com> From: md_5 <md_5@bigpond.com>
Date: Sun, 23 Dec 2012 17:51:07 +1100 Date: Sun, 23 Dec 2012 17:51:07 +1100
Subject: [PATCH] Update item merge logic Subject: [PATCH] Update item merge logic
@ -8,10 +8,10 @@ Subject: [PATCH] Update item merge logic
1 file changed, 7 insertions(+), 8 deletions(-) 1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 9906b9e..1e36467 100644 index 14df580..d1fe36f 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -924,6 +924,7 @@ public abstract class World implements IBlockAccess { @@ -948,6 +948,7 @@ public abstract class World implements IBlockAccess {
event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity); event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity);
// Spigot start // Spigot start
ItemStack item = ((EntityItem) entity).getItemStack(); ItemStack item = ((EntityItem) entity).getItemStack();
@ -19,7 +19,7 @@ index 9906b9e..1e36467 100644
int maxSize = item.getMaxStackSize(); int maxSize = item.getMaxStackSize();
if (item.count < maxSize) { if (item.count < maxSize) {
double radius = this.getWorld().itemMergeRadius; double radius = this.getWorld().itemMergeRadius;
@@ -933,14 +934,12 @@ public abstract class World implements IBlockAccess { @@ -957,14 +958,12 @@ public abstract class World implements IBlockAccess {
if (e instanceof EntityItem) { if (e instanceof EntityItem) {
EntityItem loopItem = (EntityItem) e; EntityItem loopItem = (EntityItem) e;
ItemStack loopStack = loopItem.getItemStack(); ItemStack loopStack = loopItem.getItemStack();

View file

@ -1,4 +1,4 @@
From 8a6dee291c36ec103e28624da71583f6eb863dde Mon Sep 17 00:00:00 2001 From 037685772e9421d9f819da76728cd90ef63f3741 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com> From: md_5 <md_5@bigpond.com>
Date: Sat, 12 Jan 2013 19:57:45 +1100 Date: Sat, 12 Jan 2013 19:57:45 +1100
Subject: [PATCH] Per world view distance. Subject: [PATCH] Per world view distance.
@ -10,10 +10,10 @@ Subject: [PATCH] Per world view distance.
3 files changed, 7 insertions(+), 1 deletion(-) 3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 7032c61..4aa2a19 100644 index f7c1b87..2407bc6 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -49,7 +49,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -50,7 +50,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
// CraftBukkit end // CraftBukkit end
this.server = minecraftserver; this.server = minecraftserver;
this.tracker = new EntityTracker(this); this.tracker = new EntityTracker(this);
@ -23,7 +23,7 @@ index 7032c61..4aa2a19 100644
this.entitiesById = new IntHashMap(); this.entitiesById = new IntHashMap();
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 45217cd..94e07fe 100644 index fdef910..359f065 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -116,6 +116,9 @@ public class CraftWorld implements World { @@ -116,6 +116,9 @@ public class CraftWorld implements World {

View file

@ -1,4 +1,4 @@
From b5b44a60c5a1f64ba4ce828bb5fa112e1552cd72 Mon Sep 17 00:00:00 2001 From 07d43f2d51a94bbe84912b1f13353185f7089f27 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Fri, 11 Jan 2013 11:08:45 -0500 Date: Fri, 11 Jan 2013 11:08:45 -0500
Subject: [PATCH] Fix various crop growth modifier formula issues Subject: [PATCH] Fix various crop growth modifier formula issues
@ -10,12 +10,11 @@ Subject: [PATCH] Fix various crop growth modifier formula issues
src/main/java/net/minecraft/server/BlockMushroom.java | 2 +- src/main/java/net/minecraft/server/BlockMushroom.java | 2 +-
src/main/java/net/minecraft/server/BlockMycel.java | 3 ++- src/main/java/net/minecraft/server/BlockMycel.java | 3 ++-
src/main/java/net/minecraft/server/BlockReed.java | 2 +- src/main/java/net/minecraft/server/BlockReed.java | 2 +-
src/main/java/net/minecraft/server/BlockSapling.java | 2 +-
src/main/java/net/minecraft/server/BlockStem.java | 2 +- src/main/java/net/minecraft/server/BlockStem.java | 2 +-
8 files changed, 10 insertions(+), 8 deletions(-) 7 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 1cb89fa..57bedfc 100644 index 4fb2d87..eed8ded 100644
--- a/src/main/java/net/minecraft/server/BlockCactus.java --- a/src/main/java/net/minecraft/server/BlockCactus.java
+++ b/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java
@@ -23,7 +23,7 @@ public class BlockCactus extends Block { @@ -23,7 +23,7 @@ public class BlockCactus extends Block {
@ -25,15 +24,15 @@ index 1cb89fa..57bedfc 100644
- if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().cactusGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot - if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().cactusGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot
+ if (i1 >= (byte) range(3, (world.growthOdds / world.getWorld().cactusGrowthModifier * 15) + 0.5F, 15)) { // Spigot + if (i1 >= (byte) range(3, (world.growthOdds / world.getWorld().cactusGrowthModifier * 15) + 0.5F, 15)) { // Spigot
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0); world.setData(i, j, k, 0, 4);
} else { this.doPhysics(world, i, j + 1, k, this.id);
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
index 4d3b448..b9d35ff 100644 index 0c6ec6d..0aee7af 100644
--- a/src/main/java/net/minecraft/server/BlockCrops.java --- a/src/main/java/net/minecraft/server/BlockCrops.java
+++ b/src/main/java/net/minecraft/server/BlockCrops.java +++ b/src/main/java/net/minecraft/server/BlockCrops.java
@@ -30,7 +30,7 @@ public class BlockCrops extends BlockFlower { @@ -28,7 +28,7 @@ public class BlockCrops extends BlockFlower {
if (l < 7) { if (l < 7) {
float f = this.l(world, i, j, k); float f = this.k(world, i, j, k);
- if (random.nextInt((int) ((world.growthOdds * 100 / world.getWorld().wheatGrowthModifier / 25.0F) / f) + 1) == 0) { // Spigot - if (random.nextInt((int) ((world.growthOdds * 100 / world.getWorld().wheatGrowthModifier / 25.0F) / f) + 1) == 0) { // Spigot
+ if (random.nextInt((int) (world.growthOdds / world.getWorld().wheatGrowthModifier * (25.0F / f)) + 1) == 0) { // Spigot + if (random.nextInt((int) (world.growthOdds / world.getWorld().wheatGrowthModifier * (25.0F / f)) + 1) == 0) { // Spigot
@ -41,10 +40,10 @@ index 4d3b448..b9d35ff 100644
} }
} }
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
index 0bc7882..bf117bc 100644 index c78a934..2ccc0b8 100644
--- a/src/main/java/net/minecraft/server/BlockGrass.java --- a/src/main/java/net/minecraft/server/BlockGrass.java
+++ b/src/main/java/net/minecraft/server/BlockGrass.java +++ b/src/main/java/net/minecraft/server/BlockGrass.java
@@ -37,7 +37,8 @@ public class BlockGrass extends Block { @@ -32,7 +32,8 @@ public class BlockGrass extends Block {
} }
// CraftBukkit end // CraftBukkit end
} else if (world.getLightLevel(i, j + 1, k) >= 9) { } else if (world.getLightLevel(i, j + 1, k) >= 9) {
@ -55,12 +54,12 @@ index 0bc7882..bf117bc 100644
int j1 = j + random.nextInt(5) - 3; int j1 = j + random.nextInt(5) - 3;
int k1 = k + random.nextInt(3) - 1; int k1 = k + random.nextInt(3) - 1;
diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java
index 9647bb2..ffe9778 100644 index aedcf62..6e135a4 100644
--- a/src/main/java/net/minecraft/server/BlockMushroom.java --- a/src/main/java/net/minecraft/server/BlockMushroom.java
+++ b/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java
@@ -24,7 +24,7 @@ public class BlockMushroom extends BlockFlower { @@ -27,7 +27,7 @@ public class BlockMushroom extends BlockFlower {
public void b(World world, int i, int j, int k, Random random) { public void a(World world, int i, int j, int k, Random random) {
final int sourceX = i, sourceY = j, sourceZ = k; // CraftBukkit final int sourceX = i, sourceY = j, sourceZ = k; // CraftBukkit
- if (random.nextInt((int) (world.growthOdds * 100 / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot - if (random.nextInt((int) (world.growthOdds * 100 / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot
+ if (random.nextInt(Math.max(1, (int) world.growthOdds / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot + if (random.nextInt(Math.max(1, (int) world.growthOdds / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot
@ -68,10 +67,10 @@ index 9647bb2..ffe9778 100644
int l = 5; int l = 5;
diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java
index afef94d..b7cfa69 100644 index 522d317..fa11d1c 100644
--- a/src/main/java/net/minecraft/server/BlockMycel.java --- a/src/main/java/net/minecraft/server/BlockMycel.java
+++ b/src/main/java/net/minecraft/server/BlockMycel.java +++ b/src/main/java/net/minecraft/server/BlockMycel.java
@@ -37,7 +37,8 @@ public class BlockMycel extends Block { @@ -32,7 +32,8 @@ public class BlockMycel extends Block {
} }
// CraftBukkit end // CraftBukkit end
} else if (world.getLightLevel(i, j + 1, k) >= 9) { } else if (world.getLightLevel(i, j + 1, k) >= 9) {
@ -82,38 +81,25 @@ index afef94d..b7cfa69 100644
int j1 = j + random.nextInt(5) - 3; int j1 = j + random.nextInt(5) - 3;
int k1 = k + random.nextInt(3) - 1; int k1 = k + random.nextInt(3) - 1;
diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java diff --git a/src/main/java/net/minecraft/server/BlockReed.java b/src/main/java/net/minecraft/server/BlockReed.java
index 66ad508..c5a8d8a 100644 index def38e9..50c5200 100644
--- a/src/main/java/net/minecraft/server/BlockReed.java --- a/src/main/java/net/minecraft/server/BlockReed.java
+++ b/src/main/java/net/minecraft/server/BlockReed.java +++ b/src/main/java/net/minecraft/server/BlockReed.java
@@ -24,7 +24,7 @@ public class BlockReed extends Block { @@ -23,7 +23,7 @@ public class BlockReed extends Block {
if (l < 3) { if (l < 3) {
int i1 = world.getData(i, j, k); int i1 = world.getData(i, j, k);
- if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().sugarGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot - if (i1 >= (byte) range(3, (world.growthOdds * 100 / world.getWorld().sugarGrowthModifier * 15 / 100F) + 0.5F, 15)) { // Spigot
+ if (i1 >= (byte) range(3, (world.growthOdds / world.getWorld().sugarGrowthModifier * 15) + 0.5F, 15)) { // Spigot + if (i1 >= (byte) range(3, (world.growthOdds / world.getWorld().sugarGrowthModifier * 15) + 0.5F, 15)) { // Spigot
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0); world.setData(i, j, k, 0, 4);
} else { } else {
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java
index e8b0f96..d30fe65 100644
--- a/src/main/java/net/minecraft/server/BlockSapling.java
+++ b/src/main/java/net/minecraft/server/BlockSapling.java
@@ -27,7 +27,7 @@ public class BlockSapling extends BlockFlower {
if (world.getLightLevel(i, j + 1, k) >= 9 && random.nextInt(7) == 0) {
int l = world.getData(i, j, k);
- if (world.getLightLevel(i, j + 1, k) >= 9 && (random.nextInt(Math.max(2, (int) ((world.growthOdds * 100 / world.getWorld().treeGrowthModifier * 7 / 100F) + 0.5F))) == 0)) { // Spigot
+ if (random.nextInt(Math.max(2, (int) ((world.growthOdds / world.getWorld().treeGrowthModifier * 7) + 0.5F))) == 0) { // Spigot
world.setData(i, j, k, l | 8);
} else {
this.grow(world, i, j, k, random, false, null, null); // CraftBukkit - added bonemeal, player and itemstack
diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java
index dfaf45d..86e7bba 100644 index a945ee4..c17ce36 100644
--- a/src/main/java/net/minecraft/server/BlockStem.java --- a/src/main/java/net/minecraft/server/BlockStem.java
+++ b/src/main/java/net/minecraft/server/BlockStem.java +++ b/src/main/java/net/minecraft/server/BlockStem.java
@@ -27,7 +27,7 @@ public class BlockStem extends BlockFlower { @@ -27,7 +27,7 @@ public class BlockStem extends BlockFlower {
if (world.getLightLevel(i, j + 1, k) >= 9) { if (world.getLightLevel(i, j + 1, k) >= 9) {
float f = this.n(world, i, j, k); float f = this.m(world, i, j, k);
- if (random.nextInt((int) ((world.growthOdds * 100 / ((this.id == Block.PUMPKIN_STEM.id) ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) / 25.0F) / f) + 1) == 0) { // Spigot - if (random.nextInt((int) ((world.growthOdds * 100 / ((this.id == Block.PUMPKIN_STEM.id) ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) / 25.0F) / f) + 1) == 0) { // Spigot
+ if (random.nextInt((int) (world.growthOdds / (this.id == Block.PUMPKIN_STEM.id ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) * (25.0F / f)) + 1) == 0) { // Spigot + if (random.nextInt((int) (world.growthOdds / (this.id == Block.PUMPKIN_STEM.id ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) * (25.0F / f)) + 1) == 0) { // Spigot

View file

@ -1,4 +1,4 @@
From e82bcce15b5b93aaaf2eb09c47f44db1d735ff51 Mon Sep 17 00:00:00 2001 From b27c7c335908980afecc8fcb517c4dc5db2fa2f7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sat, 19 Jan 2013 01:11:30 -0500 Date: Sat, 19 Jan 2013 01:11:30 -0500
Subject: [PATCH] Skip entity.move() if we are not moving anywhere. Subject: [PATCH] Skip entity.move() if we are not moving anywhere.
@ -8,15 +8,15 @@ Subject: [PATCH] Skip entity.move() if we are not moving anywhere.
1 file changed, 1 insertion(+) 1 file changed, 1 insertion(+)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 71707ed..d0a58f8 100644 index b9667a0..0dc65e6 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -423,6 +423,7 @@ public abstract class Entity { @@ -430,6 +430,7 @@ public abstract class Entity {
} }
public void move(double d0, double d1, double d2) { public void move(double d0, double d1, double d2) {
+ if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot + if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot
if (this.Y) { if (this.Z) {
this.boundingBox.d(d0, d1, d2); this.boundingBox.d(d0, d1, d2);
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D; this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
-- --

View file

@ -1,4 +1,4 @@
From 66bf9228164154e0da57d1a8dbabc6837b2da2f8 Mon Sep 17 00:00:00 2001 From c247b6e15e2155da6e60e7993db6f297675d67bb Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com> From: Mike Primm <mike@primmhome.com>
Date: Wed, 16 Jan 2013 15:27:22 -0600 Date: Wed, 16 Jan 2013 15:27:22 -0600
Subject: [PATCH] Alternate, sync-free-but-safe chunk reference cache Subject: [PATCH] Alternate, sync-free-but-safe chunk reference cache
@ -8,10 +8,10 @@ Subject: [PATCH] Alternate, sync-free-but-safe chunk reference cache
1 file changed, 6 insertions(+), 8 deletions(-) 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index b1dd29e..41f4f31 100644 index d1fe36f..c398268 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -297,15 +297,13 @@ public abstract class World implements IBlockAccess { @@ -294,15 +294,13 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start // CraftBukkit start
public Chunk getChunkAt(int i, int j) { public Chunk getChunkAt(int i, int j) {

View file

@ -1,4 +1,4 @@
From fa1eeb2d804ba81c94d259d60df735627eae989f Mon Sep 17 00:00:00 2001 From 7d3399651d3d92f03b2b87f3a67c6ab97e52bb72 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 12:28:17 +1100 Date: Sun, 3 Feb 2013 12:28:17 +1100
Subject: [PATCH] Tick loop optimization - sleep for as long as possible. Subject: [PATCH] Tick loop optimization - sleep for as long as possible.
@ -11,10 +11,10 @@ Subject: [PATCH] Tick loop optimization - sleep for as long as possible.
create mode 100644 src/main/java/org/bukkit/craftbukkit/command/TicksPerSecondCommand.java create mode 100644 src/main/java/org/bukkit/craftbukkit/command/TicksPerSecondCommand.java
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4bdf8aa..128016f 100644 index d3f3f86..36acefb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -86,6 +86,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -85,6 +85,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
// CraftBukkit end // CraftBukkit end
@ -26,26 +26,26 @@ index 4bdf8aa..128016f 100644
+ // Spigot end + // Spigot end
public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet public MinecraftServer(OptionSet options) { // CraftBukkit - signature file -> OptionSet
l = this; k = this;
@@ -397,39 +403,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -379,39 +385,23 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
public void run() { public void run() {
try { try {
if (this.init()) { if (this.init()) {
- long i = System.currentTimeMillis(); - long i = System.currentTimeMillis();
- -
- for (long j = 0L; this.isRunning; this.Q = true) { - for (long j = 0L; this.isRunning; this.P = true) {
- long k = System.currentTimeMillis(); - long k = System.currentTimeMillis();
- long l = k - i; - long l = k - i;
- -
- if (l > 2000L && i - this.R >= 15000L) { - if (l > 2000L && i - this.Q >= 15000L) {
- if (this.server.getWarnOnOverload()) // CraftBukkit - Added option to suppress warning messages - if (this.server.getWarnOnOverload()) // CraftBukkit - Added option to suppress warning messages
- log.warning("Can\'t keep up! Did the system time change, or is the server overloaded?"); - this.getLogger().warning("Can\'t keep up! Did the system time change, or is the server overloaded?");
- l = 2000L; - l = 2000L;
- this.R = i; - this.Q = i;
- } - }
- -
- if (l < 0L) { - if (l < 0L) {
- log.warning("Time ran backwards! Did the system time change?"); - this.getLogger().warning("Time ran backwards! Did the system time change?");
- l = 0L; - l = 0L;
- } - }
- -
@ -136,5 +136,5 @@ index 0000000..f114a31
+ } + }
+} +}
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 37c0d29448613da381e0fafccefd8e1792e2cbfe Mon Sep 17 00:00:00 2001 From ca107d374660de533a321bbe1fb550b097cd1b03 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Thu, 10 Jan 2013 00:18:11 -0500 Date: Thu, 10 Jan 2013 00:18:11 -0500
Subject: [PATCH] Improved Timings System Subject: [PATCH] Improved Timings System
@ -19,7 +19,7 @@ Tracks nearly every point of minecraft internals and plugin events to give a goo
create mode 100644 src/main/java/org/bukkit/craftbukkit/SpigotTimings.java create mode 100644 src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
index c0bab0f..5772932 100644 index d5887a9..3772ad8 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
@@ -103,6 +103,7 @@ public class ChunkProviderServer implements IChunkProvider { @@ -103,6 +103,7 @@ public class ChunkProviderServer implements IChunkProvider {
@ -39,10 +39,10 @@ index c0bab0f..5772932 100644
// CraftBukkit start - If we didn't need to load the chunk run the callback now // CraftBukkit start - If we didn't need to load the chunk run the callback now
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index d0a58f8..bf9108a 100644 index 0dc65e6..c68e9cf 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -15,6 +15,7 @@ import org.bukkit.block.BlockFace; @@ -14,6 +14,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Painting; import org.bukkit.entity.Painting;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
@ -51,7 +51,7 @@ index d0a58f8..bf9108a 100644
import org.bukkit.event.painting.PaintingBreakByEntityEvent; import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
@@ -111,6 +112,8 @@ public abstract class Entity { @@ -111,6 +112,8 @@ public abstract class Entity {
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit public EnumEntitySize at;
public boolean valid = false; // CraftBukkit public boolean valid = false; // CraftBukkit
+ public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot + public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getEntityTimings(this); // Spigot
@ -59,35 +59,35 @@ index d0a58f8..bf9108a 100644
public Entity(World world) { public Entity(World world) {
this.id = entityCount++; this.id = entityCount++;
this.l = 1.0D; this.l = 1.0D;
@@ -424,6 +427,7 @@ public abstract class Entity { @@ -431,6 +434,7 @@ public abstract class Entity {
public void move(double d0, double d1, double d2) { public void move(double d0, double d1, double d2) {
if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot if (d0 == 0 && d1 == 0 && d2 == 0) { return; } // Spigot
+ org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.startTiming(); // Spigot
if (this.Y) { if (this.Z) {
this.boundingBox.d(d0, d1, d2); this.boundingBox.d(d0, d1, d2);
this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D; this.locX = (this.boundingBox.a + this.boundingBox.d) / 2.0D;
@@ -729,6 +733,7 @@ public abstract class Entity { @@ -730,6 +734,7 @@ public abstract class Entity {
this.world.methodProfiler.b(); this.world.methodProfiler.b();
} }
+ org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot
} }
protected void D() { protected void C() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 7d2e633..bd1aeaa 100644 index ae180c2..89ce129 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -505,6 +505,7 @@ public abstract class EntityLiving extends Entity { @@ -512,6 +512,7 @@ public abstract class EntityLiving extends Entity {
} }
public void j_() { public void l_() {
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot
super.j_(); super.l_();
if (!this.world.isStatic) { if (!this.world.isStatic) {
int i; int i;
@@ -531,7 +532,9 @@ public abstract class EntityLiving extends Entity { @@ -538,7 +539,9 @@ public abstract class EntityLiving extends Entity {
} }
} }
@ -97,55 +97,55 @@ index 7d2e633..bd1aeaa 100644
double d0 = this.locX - this.lastX; double d0 = this.locX - this.lastX;
double d1 = this.locZ - this.lastZ; double d1 = this.locZ - this.lastZ;
float f = (float) (d0 * d0 + d1 * d1); float f = (float) (d0 * d0 + d1 * d1);
@@ -622,6 +625,7 @@ public abstract class EntityLiving extends Entity { @@ -629,6 +632,7 @@ public abstract class EntityLiving extends Entity {
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.aD += f2; this.aE += f2;
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot
} }
// CraftBukkit start - delegate so we can handle providing a reason for health being regained // CraftBukkit start - delegate so we can handle providing a reason for health being regained
@@ -1228,6 +1232,7 @@ public abstract class EntityLiving extends Entity { @@ -1264,6 +1268,7 @@ public abstract class EntityLiving extends Entity {
} }
public void c() { public void c() {
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityAI.startTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityAI.startTiming(); // Spigot
if (this.bV > 0) { if (this.bX > 0) {
--this.bV; --this.bX;
} }
@@ -1279,6 +1284,7 @@ public abstract class EntityLiving extends Entity { @@ -1315,6 +1320,7 @@ public abstract class EntityLiving extends Entity {
this.az = this.yaw; this.aA = this.yaw;
} }
} }
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityAI.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityAI.stopTiming(); // Spigot
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.world.methodProfiler.a("jump"); this.world.methodProfiler.a("jump");
@@ -1297,6 +1303,7 @@ public abstract class EntityLiving extends Entity { @@ -1333,6 +1339,7 @@ public abstract class EntityLiving extends Entity {
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.world.methodProfiler.a("travel"); this.world.methodProfiler.a("travel");
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityAIMove.startTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityAIMove.startTiming(); // Spigot
this.bC *= 0.98F;
this.bD *= 0.98F; this.bD *= 0.98F;
this.bE *= 0.9F; this.bE *= 0.98F;
@@ -1305,11 +1312,14 @@ public abstract class EntityLiving extends Entity { this.bF *= 0.9F;
this.aN *= this.bB(); @@ -1341,11 +1348,14 @@ public abstract class EntityLiving extends Entity {
this.e(this.bC, this.bD); this.aO *= this.bE();
this.aN = f; this.e(this.bD, this.bE);
this.aO = f;
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.world.methodProfiler.a("push"); this.world.methodProfiler.a("push");
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityAICollision.startTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityAICollision.startTiming(); // Spigot
if (!this.world.isStatic) { if (!this.world.isStatic) {
this.bd(); this.bg();
} }
+ org.bukkit.craftbukkit.SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot
this.world.methodProfiler.b(); this.world.methodProfiler.b();
this.world.methodProfiler.a("looting"); this.world.methodProfiler.a("looting");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 128016f..aa6a14a 100644 index 36acefb..e8620d5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -6,7 +6,6 @@ import java.security.KeyPair; @@ -6,7 +6,6 @@ import java.security.KeyPair;
@ -164,7 +164,7 @@ index 128016f..aa6a14a 100644
import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.craftbukkit.util.Waitable;
import org.bukkit.event.server.RemoteServerCommandEvent; import org.bukkit.event.server.RemoteServerCommandEvent;
import org.bukkit.event.world.WorldSaveEvent; import org.bukkit.event.world.WorldSaveEvent;
@@ -417,7 +417,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -399,7 +399,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
currentTPS = (currentTPS * 0.95) + (1E9 / (curTime - lastTick) * 0.05); currentTPS = (currentTPS * 0.95) + (1E9 / (curTime - lastTick) * 0.05);
lastTick = curTime; lastTick = curTime;
MinecraftServer.currentTick++; MinecraftServer.currentTick++;
@ -175,7 +175,7 @@ index 128016f..aa6a14a 100644
} }
// Spigot end // Spigot end
} else { } else {
@@ -517,6 +520,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -499,6 +502,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.methodProfiler.a("levels"); this.methodProfiler.a("levels");
// CraftBukkit start - only send timeupdates to the people in that world // CraftBukkit start - only send timeupdates to the people in that world
@ -183,7 +183,7 @@ index 128016f..aa6a14a 100644
this.server.getScheduler().mainThreadHeartbeat(this.ticks); this.server.getScheduler().mainThreadHeartbeat(this.ticks);
// Run tasks that are waiting on processing // Run tasks that are waiting on processing
@@ -524,7 +528,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -506,7 +510,10 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
processQueue.remove().run(); processQueue.remove().run();
} }
@ -194,7 +194,7 @@ index 128016f..aa6a14a 100644
// Send timeupdates to everyone, it will get the right time from the world the player is in. // Send timeupdates to everyone, it will get the right time from the world the player is in.
if (this.ticks % 20 == 0) { if (this.ticks % 20 == 0) {
@@ -576,7 +583,9 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -558,7 +565,9 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.methodProfiler.b(); this.methodProfiler.b();
this.methodProfiler.a("tracker"); this.methodProfiler.a("tracker");
@ -204,7 +204,7 @@ index 128016f..aa6a14a 100644
this.methodProfiler.b(); this.methodProfiler.b();
this.methodProfiler.b(); this.methodProfiler.b();
// } // CraftBukkit // } // CraftBukkit
@@ -585,14 +594,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -567,14 +576,20 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
} }
this.methodProfiler.c("connection"); this.methodProfiler.c("connection");
@ -213,23 +213,23 @@ index 128016f..aa6a14a 100644
+ SpigotTimings.connectionTimer.stopTiming(); // Spigot + SpigotTimings.connectionTimer.stopTiming(); // Spigot
this.methodProfiler.c("players"); this.methodProfiler.c("players");
+ SpigotTimings.playerListTimer.startTiming(); // Spigot + SpigotTimings.playerListTimer.startTiming(); // Spigot
this.t.tick(); this.s.tick();
+ SpigotTimings.playerListTimer.stopTiming(); // Spigot + SpigotTimings.playerListTimer.stopTiming(); // Spigot
this.methodProfiler.c("tickables"); this.methodProfiler.c("tickables");
+ SpigotTimings.tickablesTimer.startTiming(); // Spigot + SpigotTimings.tickablesTimer.startTiming(); // Spigot
for (i = 0; i < this.p.size(); ++i) { for (i = 0; i < this.o.size(); ++i) {
((IUpdatePlayerListBox) this.p.get(i)).a(); ((IUpdatePlayerListBox) this.o.get(i)).a();
} }
+ SpigotTimings.tickablesTimer.stopTiming(); // Spigot + SpigotTimings.tickablesTimer.stopTiming(); // Spigot
this.methodProfiler.b(); this.methodProfiler.b();
} }
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 43a24f5..d2c2305 100644 index b3ff786..6fbec1e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -976,6 +976,7 @@ public class PlayerConnection extends Connection { @@ -963,6 +963,7 @@ public class PlayerConnection extends Connection {
// CraftBukkit end // CraftBukkit end
private void handleCommand(String s) { private void handleCommand(String s) {
@ -237,7 +237,7 @@ index 43a24f5..d2c2305 100644
// CraftBukkit start // CraftBukkit start
CraftPlayer player = this.getPlayer(); CraftPlayer player = this.getPlayer();
@@ -983,19 +984,23 @@ public class PlayerConnection extends Connection { @@ -970,19 +971,23 @@ public class PlayerConnection extends Connection {
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@ -246,14 +246,14 @@ index 43a24f5..d2c2305 100644
} }
try { try {
if (server.logCommands) logger.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // Spigot if (server.logCommands) this.minecraftServer.getLogger().info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // Spigot
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
+ org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
return; return;
} }
} catch (org.bukkit.command.CommandException ex) { } catch (org.bukkit.command.CommandException ex) {
player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command"); player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command");
Logger.getLogger(PlayerConnection.class.getName()).log(Level.SEVERE, null, ex); java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(Level.SEVERE, null, ex);
+ org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot + org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
return; return;
} }
@ -262,7 +262,7 @@ index 43a24f5..d2c2305 100644
/* CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above. /* CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above.
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index d8eb6b9..b6b0d5f 100644 index db3fc42..174546d 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java --- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -4,10 +4,12 @@ import java.util.HashMap; @@ -4,10 +4,12 @@ import java.util.HashMap;
@ -277,9 +277,9 @@ index d8eb6b9..b6b0d5f 100644
+ public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot + public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
private static Map a = new HashMap(); private static Map a = new HashMap();
private static Map b = new HashMap(); private static Map b = new HashMap();
public World world; // CraftBukkit - protected -> public protected World world;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 41f4f31..ec1a08f 100644 index c398268..d1be7c3 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -13,6 +13,7 @@ import java.util.concurrent.Callable; @@ -13,6 +13,7 @@ import java.util.concurrent.Callable;
@ -290,7 +290,7 @@ index 41f4f31..ec1a08f 100644
import org.bukkit.craftbukkit.util.UnsafeList; import org.bukkit.craftbukkit.util.UnsafeList;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
@@ -114,6 +115,8 @@ public abstract class World implements IBlockAccess { @@ -115,6 +116,8 @@ public abstract class World implements IBlockAccess {
final Object chunkLock = new Object(); final Object chunkLock = new Object();
private byte chunkTickRadius; private byte chunkTickRadius;
@ -299,7 +299,7 @@ index 41f4f31..ec1a08f 100644
public CraftWorld getWorld() { public CraftWorld getWorld() {
return this.world; return this.world;
} }
@@ -193,6 +196,7 @@ public abstract class World implements IBlockAccess { @@ -194,6 +197,7 @@ public abstract class World implements IBlockAccess {
this.a(); this.a();
this.getServer().addWorld(this.world); // CraftBukkit this.getServer().addWorld(this.world); // CraftBukkit
@ -307,7 +307,7 @@ index 41f4f31..ec1a08f 100644
} }
protected abstract IChunkProvider j(); protected abstract IChunkProvider j();
@@ -1259,6 +1263,7 @@ public abstract class World implements IBlockAccess { @@ -1293,6 +1297,7 @@ public abstract class World implements IBlockAccess {
this.f.clear(); this.f.clear();
this.methodProfiler.c("regular"); this.methodProfiler.c("regular");
@ -315,7 +315,7 @@ index 41f4f31..ec1a08f 100644
for (i = 0; i < this.entityList.size(); ++i) { for (i = 0; i < this.entityList.size(); ++i) {
entity = (Entity) this.entityList.get(i); entity = (Entity) this.entityList.get(i);
@@ -1281,7 +1286,9 @@ public abstract class World implements IBlockAccess { @@ -1315,7 +1320,9 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.a("tick"); this.methodProfiler.a("tick");
if (!entity.dead) { if (!entity.dead) {
try { try {
@ -325,38 +325,38 @@ index 41f4f31..ec1a08f 100644
} catch (Throwable throwable1) { } catch (Throwable throwable1) {
crashreport = CrashReport.a(throwable1, "Ticking entity"); crashreport = CrashReport.a(throwable1, "Ticking entity");
crashreportsystemdetails = crashreport.a("Entity being ticked"); crashreportsystemdetails = crashreport.a("Entity being ticked");
@@ -1311,7 +1318,9 @@ public abstract class World implements IBlockAccess { @@ -1340,7 +1347,9 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.b(); this.methodProfiler.b();
} }
+ timings.entityTick.stopTiming(); // Spigot + timings.entityTick.stopTiming(); // Spigot
this.methodProfiler.c("tileEntities"); this.methodProfiler.c("tileEntities");
+ timings.tileEntityTick.startTiming(); // Spigot + timings.tileEntityTick.startTiming(); // Spigot
this.M = true; this.N = true;
Iterator iterator = this.tileEntityList.iterator(); Iterator iterator = this.tileEntityList.iterator();
@@ -1326,8 +1335,11 @@ public abstract class World implements IBlockAccess { @@ -1355,8 +1364,11 @@ public abstract class World implements IBlockAccess {
if (!tileentity.r() && tileentity.o() && this.isLoaded(tileentity.x, tileentity.y, tileentity.z)) { if (!tileentity.r() && tileentity.o() && this.isLoaded(tileentity.x, tileentity.y, tileentity.z)) {
try { try {
+ tileentity.tickTimer.startTiming(); // Spigot + tileentity.tickTimer.startTiming(); // Spigot
tileentity.g(); tileentity.h();
+ tileentity.tickTimer.stopTiming(); // Spigot + tileentity.tickTimer.stopTiming(); // Spigot
} catch (Throwable throwable2) { } catch (Throwable throwable2) {
+ tileentity.tickTimer.stopTiming(); // Spigot + tileentity.tickTimer.stopTiming(); // Spigot
crashreport = CrashReport.a(throwable2, "Ticking tile entity"); crashreport = CrashReport.a(throwable2, "Ticking tile entity");
crashreportsystemdetails = crashreport.a("Tile entity being ticked"); crashreportsystemdetails = crashreport.a("Tile entity being ticked");
if (tileentity == null) { tileentity.a(crashreportsystemdetails);
@@ -1352,6 +1364,8 @@ public abstract class World implements IBlockAccess { @@ -1376,6 +1388,8 @@ public abstract class World implements IBlockAccess {
} }
} }
+ timings.tileEntityTick.stopTiming(); // Spigot + timings.tileEntityTick.stopTiming(); // Spigot
+ timings.tileEntityPending.startTiming(); // Spigot + timings.tileEntityPending.startTiming(); // Spigot
this.M = false; this.N = false;
if (!this.b.isEmpty()) { if (!this.b.isEmpty()) {
this.tileEntityList.removeAll(this.b); this.tileEntityList.removeAll(this.b);
@@ -1390,6 +1404,7 @@ public abstract class World implements IBlockAccess { @@ -1414,6 +1428,7 @@ public abstract class World implements IBlockAccess {
this.a.clear(); this.a.clear();
} }
@ -364,15 +364,15 @@ index 41f4f31..ec1a08f 100644
this.methodProfiler.b(); this.methodProfiler.b();
this.methodProfiler.b(); this.methodProfiler.b();
} }
@@ -1412,6 +1427,7 @@ public abstract class World implements IBlockAccess { @@ -1436,6 +1451,7 @@ public abstract class World implements IBlockAccess {
byte b0 = 32; byte b0 = 32;
if (!flag || this.d(i - b0, 0, j - b0, i + b0, 0, j + b0)) { if (!flag || this.e(i - b0, 0, j - b0, i + b0, 0, j + b0)) {
+ entity.tickTimer.startTiming(); // Spigot + entity.tickTimer.startTiming(); // Spigot
entity.T = entity.locX; entity.U = entity.locX;
entity.U = entity.locY; entity.V = entity.locY;
entity.V = entity.locZ; entity.W = entity.locZ;
@@ -1473,6 +1489,7 @@ public abstract class World implements IBlockAccess { @@ -1497,6 +1513,7 @@ public abstract class World implements IBlockAccess {
entity.passenger = null; entity.passenger = null;
} }
} }
@ -381,10 +381,10 @@ index 41f4f31..ec1a08f 100644
} }
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 4aa2a19..6cb3e24 100644 index 2407bc6..6ade608 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -157,9 +157,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -168,9 +168,12 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
// CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals // CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals
long time = this.worldData.getTime(); long time = this.worldData.getTime();
if (this.getGameRules().getBoolean("doMobSpawning") && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) { if (this.getGameRules().getBoolean("doMobSpawning") && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) {
@ -397,8 +397,8 @@ index 4aa2a19..6cb3e24 100644
this.methodProfiler.c("chunkSource"); this.methodProfiler.c("chunkSource");
this.chunkProvider.unloadChunks(); this.chunkProvider.unloadChunks();
int j = this.a(1.0F); int j = this.a(1.0F);
@@ -186,6 +189,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -196,6 +199,7 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
this.V(); this.Y();
this.getWorld().processChunkGC(); // CraftBukkit this.getWorld().processChunkGC(); // CraftBukkit
+ timings.doTickRest.stopTiming(); // Spigot + timings.doTickRest.stopTiming(); // Spigot

View file

@ -1,4 +1,4 @@
From a21753931b6180bc32da505ed261fce5ea0461c9 Mon Sep 17 00:00:00 2001 From 8379b6c5ada2d27070c6dc223accf351f190a3a6 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Fri, 25 Jan 2013 18:24:54 +1100 Date: Fri, 25 Jan 2013 18:24:54 +1100
Subject: [PATCH] Better + more flexible itemstack merging Subject: [PATCH] Better + more flexible itemstack merging
@ -9,7 +9,7 @@ Subject: [PATCH] Better + more flexible itemstack merging
2 files changed, 11 insertions(+), 33 deletions(-) 2 files changed, 11 insertions(+), 33 deletions(-)
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index a7baa0f..5e3ac84 100644 index aa8d83f..bc69f5d 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java --- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -114,7 +114,8 @@ public class EntityItem extends Entity { @@ -114,7 +114,8 @@ public class EntityItem extends Entity {
@ -40,10 +40,10 @@ index a7baa0f..5e3ac84 100644
} }
} else { } else {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index ec1a08f..2fe9b1d 100644 index d1be7c3..5cf6bc6 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -924,31 +924,8 @@ public abstract class World implements IBlockAccess { @@ -948,31 +948,8 @@ public abstract class World implements IBlockAccess {
event = CraftEventFactory.callCreatureSpawnEvent((EntityLiving) entity, spawnReason); event = CraftEventFactory.callCreatureSpawnEvent((EntityLiving) entity, spawnReason);
} else if (entity instanceof EntityItem) { } else if (entity instanceof EntityItem) {
event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity); event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity);
@ -77,7 +77,7 @@ index ec1a08f..2fe9b1d 100644
EntityExperienceOrb xp = (EntityExperienceOrb) entity; EntityExperienceOrb xp = (EntityExperienceOrb) entity;
double radius = this.getWorld().expMergeRadius; double radius = this.getWorld().expMergeRadius;
if (radius > 0) { if (radius > 0) {
@@ -963,8 +940,8 @@ public abstract class World implements IBlockAccess { @@ -987,8 +964,8 @@ public abstract class World implements IBlockAccess {
} }
} }
} }
@ -89,5 +89,5 @@ index ec1a08f..2fe9b1d 100644
event = CraftEventFactory.callProjectileLaunchEvent(entity); event = CraftEventFactory.callProjectileLaunchEvent(entity);
} }
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 57dc2265b21dba57997f39f0ba07f6ca8a1fff5d Mon Sep 17 00:00:00 2001 From fc7910a8c0bf1545518682ad89e434bfe09e594e Mon Sep 17 00:00:00 2001
From: lishid <lishid@gmail.com> From: lishid <lishid@gmail.com>
Date: Sat, 16 Feb 2013 10:05:25 +1100 Date: Sat, 16 Feb 2013 10:05:25 +1100
Subject: [PATCH] Add oreobfuscator for Spigot. Subject: [PATCH] Add oreobfuscator for Spigot.
@ -18,19 +18,19 @@ Subject: [PATCH] Add oreobfuscator for Spigot.
create mode 100644 src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java create mode 100644 src/main/java/org/bukkit/craftbukkit/OrebfuscatorManager.java
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index ea440dc..e86b10f 100644 index 96120d8..0707d23 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -103,6 +103,7 @@ public class EntityFallingBlock extends Entity { @@ -94,6 +94,7 @@ public class EntityFallingBlock extends Entity {
// CraftBukkit end }
this.world.setTypeId(i, j, k, 0); this.world.setAir(i, j, k);
+ org.bukkit.craftbukkit.OrebfuscatorManager.updateNearbyBlocks(world, i, j, k); // Spigot (Orebfuscator) + org.bukkit.craftbukkit.OrebfuscatorManager.updateNearbyBlocks(world, i, j, k); // Spigot (Orebfuscator)
} }
if (this.onGround) { if (this.onGround) {
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
index ba2f88f..8d5b1d8 100644 index aa3ae58..2d0aaa3 100644
--- a/src/main/java/net/minecraft/server/Explosion.java --- a/src/main/java/net/minecraft/server/Explosion.java
+++ b/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java
@@ -240,6 +240,7 @@ public class Explosion { @@ -240,6 +240,7 @@ public class Explosion {
@ -107,7 +107,7 @@ index 867ebd3..9d5cee7 100644
deflater.reset(); deflater.reset();
deflater.setInput(this.buildBuffer); deflater.setInput(this.buildBuffer);
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index 5faee12..55f9ffa 100644 index 92e68be..62df1a3 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -291,6 +291,11 @@ public class PlayerInteractManager { @@ -291,6 +291,11 @@ public class PlayerInteractManager {
@ -123,7 +123,7 @@ index 5faee12..55f9ffa 100644
if (false) { // Never trigger if (false) { // Never trigger
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 257497e..1a3cc03 100644 index 8f65601..16460b6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -163,6 +163,12 @@ public final class CraftServer implements Server { @@ -163,6 +163,12 @@ public final class CraftServer implements Server {
@ -140,7 +140,7 @@ index 257497e..1a3cc03 100644
private boolean value = true; private boolean value = true;
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 94e07fe..21bd64a 100644 index 359f065..449f3e1 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -119,6 +119,8 @@ public class CraftWorld implements World { @@ -119,6 +119,8 @@ public class CraftWorld implements World {
@ -354,5 +354,5 @@ index 0c92b66..78e9a66 100644
+ disabled-worlds: + disabled-worlds:
+ - world_the_end + - world_the_end
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From a9525c7ac96f2692c584fcbd9c6469271e226364 Mon Sep 17 00:00:00 2001 From 5cf1d81fb59b7d6941a6b5e502dcbcb7211fb32f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Fri, 18 Jan 2013 19:31:14 -0500 Date: Fri, 18 Jan 2013 19:31:14 -0500
Subject: [PATCH] Reduce number of LivingEntity collision checks. Subject: [PATCH] Reduce number of LivingEntity collision checks.
@ -8,13 +8,13 @@ Subject: [PATCH] Reduce number of LivingEntity collision checks.
1 file changed, 8 insertions(+) 1 file changed, 8 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index bd1aeaa..01b16ac 100644 index 89ce129..86a0b6d 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1391,12 +1391,20 @@ public abstract class EntityLiving extends Entity { @@ -1427,12 +1427,20 @@ public abstract class EntityLiving extends Entity {
} }
protected void bd() { protected void bg() {
+ // Spigot start + // Spigot start
+ boolean skip = false; + boolean skip = false;
+ if (!(this instanceof EntityPlayer) && this.ticksLived % 2 != 0) { + if (!(this instanceof EntityPlayer) && this.ticksLived % 2 != 0) {
@ -29,9 +29,9 @@ index bd1aeaa..01b16ac 100644
Entity entity = (Entity) list.get(i); Entity entity = (Entity) list.get(i);
+ if (entity instanceof EntityLiving && skip) { continue; } // Spigot + if (entity instanceof EntityLiving && skip) { continue; } // Spigot
if (entity.M()) { if (entity.L()) {
this.o(entity); this.o(entity);
} }
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 0699ed06c2f350269703b4f2c62a268c80e1d9d2 Mon Sep 17 00:00:00 2001 From 2d146ed5859c06f1b74d68a256a9b2a72d7445a5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Tue, 29 Jan 2013 13:25:53 -0500 Date: Tue, 29 Jan 2013 13:25:53 -0500
Subject: [PATCH] Only count entities in chunks being processed for the spawn Subject: [PATCH] Only count entities in chunks being processed for the spawn
@ -9,7 +9,7 @@ Subject: [PATCH] Only count entities in chunks being processed for the spawn
1 file changed, 43 insertions(+), 3 deletions(-) 1 file changed, 43 insertions(+), 3 deletions(-)
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 9b3e262..2173af7 100644 index 2d1a372..de8f065 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java --- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -16,6 +16,7 @@ public final class SpawnerCreature { @@ -16,6 +16,7 @@ public final class SpawnerCreature {
@ -101,9 +101,9 @@ index 9b3e262..2173af7 100644
+ continue label110; + continue label110;
+ } + }
+ // Spigot end + // Spigot end
if (j2 >= entityliving.bv()) { if (j2 >= entityliving.by()) {
continue label110; continue label110;
} }
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 14f2f48d062b71bdd20a50cb8bbd3a7a8a0d3621 Mon Sep 17 00:00:00 2001 From 8aef49550dffe98eab42122dda445d090f7770cb Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Tue, 19 Feb 2013 17:26:20 -0500 Date: Tue, 19 Feb 2013 17:26:20 -0500
Subject: [PATCH] Only send maps in item frames upon tracking Subject: [PATCH] Only send maps in item frames upon tracking
@ -15,7 +15,7 @@ This means cursors will not dynamically update, but the map data should refresh
1 file changed, 19 insertions(+), 6 deletions(-) 1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
index a026c4c..75c146d 100644 index 4948f23..45e469a 100644
--- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java
+++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java
@@ -36,6 +36,7 @@ public class EntityTrackerEntry { @@ -36,6 +36,7 @@ public class EntityTrackerEntry {
@ -58,7 +58,7 @@ index a026c4c..75c146d 100644
} }
} }
} }
@@ -329,6 +330,17 @@ public class EntityTrackerEntry { @@ -330,6 +331,17 @@ public class EntityTrackerEntry {
} }
} }
@ -76,7 +76,7 @@ index a026c4c..75c146d 100644
if (this.tracker instanceof EntityHuman) { if (this.tracker instanceof EntityHuman) {
EntityHuman entityhuman = (EntityHuman) this.tracker; EntityHuman entityhuman = (EntityHuman) this.tracker;
@@ -355,6 +367,7 @@ public class EntityTrackerEntry { @@ -356,6 +368,7 @@ public class EntityTrackerEntry {
} }
} else if (this.trackedPlayers.contains(entityplayer)) { } else if (this.trackedPlayers.contains(entityplayer)) {
this.trackedPlayers.remove(entityplayer); this.trackedPlayers.remove(entityplayer);
@ -85,5 +85,5 @@ index a026c4c..75c146d 100644
} }
} }
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 5f8e123bf8262bf21389a5cac3396188c7097463 Mon Sep 17 00:00:00 2001 From df7aaaaa25ae229a755ffadd32308cab505e3313 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sun, 3 Feb 2013 09:20:19 +1100 Date: Sun, 3 Feb 2013 09:20:19 +1100
Subject: [PATCH] Detect, remove and warn about null tile entities. Subject: [PATCH] Detect, remove and warn about null tile entities.
@ -8,10 +8,10 @@ Subject: [PATCH] Detect, remove and warn about null tile entities.
1 file changed, 7 insertions(+) 1 file changed, 7 insertions(+)
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 2fe9b1d..4fc1233 100644 index 5cf6bc6..4b6c910 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -1303,6 +1303,13 @@ public abstract class World implements IBlockAccess { @@ -1332,6 +1332,13 @@ public abstract class World implements IBlockAccess {
while (iterator.hasNext()) { while (iterator.hasNext()) {
TileEntity tileentity = (TileEntity) iterator.next(); TileEntity tileentity = (TileEntity) iterator.next();
@ -26,5 +26,5 @@ index 2fe9b1d..4fc1233 100644
ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer; ChunkProviderServer chunkProviderServer = ((WorldServer) this).chunkProviderServer;
if (chunkProviderServer.unloadQueue.contains(tileentity.x >> 4, tileentity.z >> 4)) { if (chunkProviderServer.unloadQueue.contains(tileentity.x >> 4, tileentity.z >> 4)) {
-- --
1.8.1.1 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 4fb653cd3f94ac7bbd2e0815c89de285db157a09 Mon Sep 17 00:00:00 2001 From d9054dc5ea2715c2eb9065ad6ef3ceb47446039c Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 3 Feb 2013 05:10:21 -0500 Date: Sun, 3 Feb 2013 05:10:21 -0500
Subject: [PATCH] Entity Activation Range Subject: [PATCH] Entity Activation Range
@ -11,28 +11,28 @@ This change can have dramatic impact on gameplay if configured too low. Balance
src/main/java/net/minecraft/server/Entity.java | 13 +- src/main/java/net/minecraft/server/Entity.java | 13 +-
.../java/net/minecraft/server/EntityArrow.java | 2 +- .../java/net/minecraft/server/EntityArrow.java | 2 +-
src/main/java/net/minecraft/server/EntityItem.java | 5 +- src/main/java/net/minecraft/server/EntityItem.java | 5 +-
src/main/java/net/minecraft/server/World.java | 14 +- src/main/java/net/minecraft/server/World.java | 10 +-
.../java/org/bukkit/craftbukkit/CraftWorld.java | 15 +- .../java/org/bukkit/craftbukkit/CraftWorld.java | 15 +-
src/main/java/org/bukkit/craftbukkit/Spigot.java | 219 +++++++++++++++++++++ src/main/java/org/bukkit/craftbukkit/Spigot.java | 219 +++++++++++++++++++++
.../java/org/bukkit/craftbukkit/SpigotTimings.java | 3 + .../java/org/bukkit/craftbukkit/SpigotTimings.java | 3 +
src/main/resources/configurations/bukkit.yml | 3 + src/main/resources/configurations/bukkit.yml | 3 +
8 files changed, 263 insertions(+), 11 deletions(-) 8 files changed, 263 insertions(+), 7 deletions(-)
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index bf9108a..8cbe086 100644 index c68e9cf..9e5ce4b 100644
--- a/src/main/java/net/minecraft/server/Entity.java --- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java
@@ -89,7 +89,7 @@ public abstract class Entity { @@ -89,7 +89,7 @@ public abstract class Entity {
public int ticksLived; public int ticksLived;
public int maxFireTicks; public int maxFireTicks;
public int fireTicks; // CraftBukkit - private -> public public int fireTicks; // CraftBukkit - private -> public
- protected boolean ad; - protected boolean ae;
+ public boolean ad; // Spigot - private -> public isInWater - If this renames, update Spigot.checkEntityImmunities + public boolean ae; // Spigot - private -> public isInWater - If this renames, update Spigot.checkEntityImmunities
public int noDamageTicks; public int noDamageTicks;
private boolean justCreated; private boolean justCreated;
protected boolean fireProof; protected boolean fireProof;
@@ -112,8 +112,14 @@ public abstract class Entity { @@ -112,8 +112,14 @@ public abstract class Entity {
public UUID uniqueId = UUID.randomUUID(); // CraftBukkit public EnumEntitySize at;
public boolean valid = false; // CraftBukkit public boolean valid = false; // CraftBukkit
+ // Spigot start + // Spigot start
@ -46,7 +46,7 @@ index bf9108a..8cbe086 100644
public Entity(World world) { public Entity(World world) {
this.id = entityCount++; this.id = entityCount++;
this.l = 1.0D; this.l = 1.0D;
@@ -153,7 +159,12 @@ public abstract class Entity { @@ -154,7 +160,12 @@ public abstract class Entity {
this.setPosition(0.0D, 0.0D, 0.0D); this.setPosition(0.0D, 0.0D, 0.0D);
if (world != null) { if (world != null) {
this.dimension = world.worldProvider.dimension; this.dimension = world.worldProvider.dimension;
@ -60,7 +60,7 @@ index bf9108a..8cbe086 100644
this.datawatcher.a(0, Byte.valueOf((byte) 0)); this.datawatcher.a(0, Byte.valueOf((byte) 0));
this.datawatcher.a(1, Short.valueOf((short) 300)); this.datawatcher.a(1, Short.valueOf((short) 300));
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index 916b9dc..bdd18f6 100644 index 4b47364..647b91f 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java --- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -16,7 +16,7 @@ public class EntityArrow extends Entity implements IProjectile { @@ -16,7 +16,7 @@ public class EntityArrow extends Entity implements IProjectile {
@ -73,7 +73,7 @@ index 916b9dc..bdd18f6 100644
public int shake = 0; public int shake = 0;
public Entity shooter; public Entity shooter;
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
index 5e3ac84..fdfd763 100644 index bc69f5d..430dd79 100644
--- a/src/main/java/net/minecraft/server/EntityItem.java --- a/src/main/java/net/minecraft/server/EntityItem.java
+++ b/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java
@@ -100,8 +100,9 @@ public class EntityItem extends Entity { @@ -100,8 +100,9 @@ public class EntityItem extends Entity {
@ -89,7 +89,7 @@ index 5e3ac84..fdfd763 100644
// CraftBukkit start // CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 4fc1233..7d2bad3 100644 index 4b6c910..417189e 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -13,6 +13,7 @@ import java.util.concurrent.Callable; @@ -13,6 +13,7 @@ import java.util.concurrent.Callable;
@ -100,7 +100,7 @@ index 4fc1233..7d2bad3 100644
import org.bukkit.craftbukkit.SpigotTimings; // Spigot import org.bukkit.craftbukkit.SpigotTimings; // Spigot
import org.bukkit.craftbukkit.util.UnsafeList; import org.bukkit.craftbukkit.util.UnsafeList;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
@@ -1240,6 +1241,7 @@ public abstract class World implements IBlockAccess { @@ -1274,6 +1275,7 @@ public abstract class World implements IBlockAccess {
this.f.clear(); this.f.clear();
this.methodProfiler.c("regular"); this.methodProfiler.c("regular");
@ -108,15 +108,11 @@ index 4fc1233..7d2bad3 100644
timings.entityTick.startTiming(); // Spigot timings.entityTick.startTiming(); // Spigot
for (i = 0; i < this.entityList.size(); ++i) { for (i = 0; i < this.entityList.size(); ++i) {
entity = (Entity) this.entityList.get(i); entity = (Entity) this.entityList.get(i);
@@ -1406,12 +1408,12 @@ public abstract class World implements IBlockAccess { @@ -1434,8 +1436,12 @@ public abstract class World implements IBlockAccess {
} int j = MathHelper.floor(entity.locZ);
byte b0 = 32;
public void entityJoinedWorld(Entity entity, boolean flag) { - if (!flag || this.e(i - b0, 0, j - b0, i + b0, 0, j + b0)) {
- int i = MathHelper.floor(entity.locX);
- int j = MathHelper.floor(entity.locZ);
- byte b0 = 32;
-
- if (!flag || this.d(i - b0, 0, j - b0, i + b0, 0, j + b0)) {
- entity.tickTimer.startTiming(); // Spigot - entity.tickTimer.startTiming(); // Spigot
+ // Spigot start + // Spigot start
+ if (!Spigot.checkIfActive(entity)) { + if (!Spigot.checkIfActive(entity)) {
@ -124,11 +120,11 @@ index 4fc1233..7d2bad3 100644
+ } else { + } else {
+ entity.tickTimer.startTiming(); + entity.tickTimer.startTiming();
+ // Spigot end + // Spigot end
entity.T = entity.locX; entity.U = entity.locX;
entity.U = entity.locY; entity.V = entity.locY;
entity.V = entity.locZ; entity.W = entity.locZ;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 21bd64a..33df602 100644 index 449f3e1..25c462e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -100,10 +100,14 @@ public class CraftWorld implements World { @@ -100,10 +100,14 @@ public class CraftWorld implements World {

View file

@ -1,4 +1,4 @@
From f20cebf078418f0f42373e94481592ee15608692 Mon Sep 17 00:00:00 2001 From 597aeb82a73eed6c5c6af591427a7773fb707bf0 Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com> From: Mike Primm <mike@primmhome.com>
Date: Wed, 20 Feb 2013 23:07:53 -0500 Date: Wed, 20 Feb 2013 23:07:53 -0500
Subject: [PATCH] Optimize getTileEntities performance Subject: [PATCH] Optimize getTileEntities performance
@ -9,10 +9,10 @@ Avoid traversing tile entities for every loaded chunk
1 file changed, 12 insertions(+), 9 deletions(-) 1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 6cb3e24..8f0050a 100644 index 6ade608..d399e7b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java --- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -616,17 +616,20 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate @@ -663,17 +663,20 @@ public class WorldServer extends World implements org.bukkit.BlockChangeDelegate
public List getTileEntities(int i, int j, int k, int l, int i1, int j1) { public List getTileEntities(int i, int j, int k, int l, int i1, int j1) {
ArrayList arraylist = new ArrayList(); ArrayList arraylist = new ArrayList();

View file

@ -1,4 +1,4 @@
From 2ee6a39216c5b2913d0ed585230afe36238960ff Mon Sep 17 00:00:00 2001 From 2d728b9be20e44900ccb1854bcebaafc2af49a48 Mon Sep 17 00:00:00 2001
From: shakytom <tom.roberts00@gmail.com> From: shakytom <tom.roberts00@gmail.com>
Date: Wed, 20 Feb 2013 22:34:38 -0500 Date: Wed, 20 Feb 2013 22:34:38 -0500
Subject: [PATCH] Improved tile entity lookup for chunk sending Subject: [PATCH] Improved tile entity lookup for chunk sending
@ -10,10 +10,10 @@ This results in a good reduction of time spent in player ticking.
1 file changed, 3 insertions(+), 2 deletions(-) 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 8d61ca6..28f462b 100644 index 52fd561..b3c7790 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -163,8 +163,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -172,8 +172,9 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
iterator1.remove(); iterator1.remove();
if (chunkcoordintpair != null && this.world.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) { if (chunkcoordintpair != null && this.world.isLoaded(chunkcoordintpair.x << 4, 0, chunkcoordintpair.z << 4)) {

View file

@ -1,4 +1,4 @@
From 8c47249526c029b0fd635fe1dc4402143b0b6eb3 Mon Sep 17 00:00:00 2001 From 76c7a62e5fdd044a952baf0d6fd53dc7b6cd5515 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sat, 23 Feb 2013 12:33:20 +1100 Date: Sat, 23 Feb 2013 12:33:20 +1100
Subject: [PATCH] Watchdog Thread. Subject: [PATCH] Watchdog Thread.
@ -14,10 +14,10 @@ Subject: [PATCH] Watchdog Thread.
create mode 100644 src/main/java/org/spigotmc/WatchdogThread.java create mode 100644 src/main/java/org/spigotmc/WatchdogThread.java
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index aa6a14a..6005fac 100644 index e8620d5..6d8b89a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -421,6 +421,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -403,6 +403,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.q(); this.q();
SpigotTimings.serverTickTimer.stopTiming(); SpigotTimings.serverTickTimer.stopTiming();
org.bukkit.CustomTimingsHandler.tick(); org.bukkit.CustomTimingsHandler.tick();
@ -25,7 +25,7 @@ index aa6a14a..6005fac 100644
} }
// Spigot end // Spigot end
} else { } else {
@@ -448,6 +449,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo @@ -430,6 +431,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
this.a(crashreport); this.a(crashreport);
} finally { } finally {
try { try {

View file

@ -1,4 +1,4 @@
From a6b6583baf41c2a3043bae060eca88e7f6faf22d Mon Sep 17 00:00:00 2001 From 5bb73d19023fdf238e475dfe5d97c91b9373a1f3 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Thu, 14 Feb 2013 17:32:20 +1100 Date: Thu, 14 Feb 2013 17:32:20 +1100
Subject: [PATCH] Netty Subject: [PATCH] Netty
@ -36,7 +36,7 @@ Subject: [PATCH] Netty
.../java/net/minecraft/server/INetworkManager.java | 24 ++ .../java/net/minecraft/server/INetworkManager.java | 24 ++
.../net/minecraft/server/Packet51MapChunk.java | 2 +- .../net/minecraft/server/Packet51MapChunk.java | 2 +-
.../net/minecraft/server/Packet56MapChunkBulk.java | 2 +- .../net/minecraft/server/Packet56MapChunkBulk.java | 2 +-
.../net/minecraft/server/PendingConnection.java | 11 +- .../net/minecraft/server/PendingConnection.java | 9 +-
.../net/minecraft/server/ThreadCommandReader.java | 1 + .../net/minecraft/server/ThreadCommandReader.java | 1 +
.../net/minecraft/server/ThreadLoginVerifier.java | 1 + .../net/minecraft/server/ThreadLoginVerifier.java | 1 +
.../craftbukkit/scheduler/CraftScheduler.java | 2 +- .../craftbukkit/scheduler/CraftScheduler.java | 2 +-
@ -48,7 +48,7 @@ Subject: [PATCH] Netty
.../java/org/spigotmc/netty/PacketEncoder.java | 43 ++++ .../java/org/spigotmc/netty/PacketEncoder.java | 43 ++++
.../java/org/spigotmc/netty/PacketListener.java | 100 +++++++++ .../java/org/spigotmc/netty/PacketListener.java | 100 +++++++++
src/main/java/org/spigotmc/netty/ReadState.java | 16 ++ src/main/java/org/spigotmc/netty/ReadState.java | 16 ++
17 files changed, 924 insertions(+), 8 deletions(-) 17 files changed, 923 insertions(+), 7 deletions(-)
create mode 100644 src/main/java/net/minecraft/server/INetworkManager.java create mode 100644 src/main/java/net/minecraft/server/INetworkManager.java
create mode 100644 src/main/java/org/spigotmc/netty/CipherCodec.java create mode 100644 src/main/java/org/spigotmc/netty/CipherCodec.java
create mode 100644 src/main/java/org/spigotmc/netty/NettyNetworkManager.java create mode 100644 src/main/java/org/spigotmc/netty/NettyNetworkManager.java
@ -60,7 +60,7 @@ Subject: [PATCH] Netty
create mode 100644 src/main/java/org/spigotmc/netty/ReadState.java create mode 100644 src/main/java/org/spigotmc/netty/ReadState.java
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
index f17bd19..8efab09 100644 index e04acf9..0f9e86a 100644
--- a/pom.xml --- a/pom.xml
+++ b/pom.xml +++ b/pom.xml
@@ -132,6 +132,11 @@ @@ -132,6 +132,11 @@
@ -76,20 +76,20 @@ index f17bd19..8efab09 100644
<!-- This builds a completely 'ready to start' jar with all dependencies inside --> <!-- This builds a completely 'ready to start' jar with all dependencies inside -->
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index bd0377a..73cb5b1 100644 index f985c05..70d05a6 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java --- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -32,7 +32,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -34,7 +34,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
public DedicatedServer(joptsimple.OptionSet options) {
super(options); super(options);
// CraftBukkit end // CraftBukkit end
this.l = new ConsoleLogManager("Minecraft-Server", (String) null, (String) null); // CraftBukkit - null last argument
- new ThreadSleepForever(this); - new ThreadSleepForever(this);
+ // new ThreadSleepForever(this); // Spigot + // new ThreadSleepForever(this); // Spigot
} }
protected boolean init() throws java.net.UnknownHostException { // CraftBukkit - throws UnknownHostException protected boolean init() throws java.net.UnknownHostException { // CraftBukkit - throws UnknownHostException
@@ -93,7 +93,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -94,7 +94,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
log.info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.G()); this.getLogger().info("Starting Minecraft server on " + (this.getServerIp().length() == 0 ? "*" : this.getServerIp()) + ":" + this.G());
try { try {
- this.r = new DedicatedServerConnection(this, inetaddress, this.G()); - this.r = new DedicatedServerConnection(this, inetaddress, this.G());
@ -99,8 +99,8 @@ index bd0377a..73cb5b1 100644
+ : new DedicatedServerConnection(this, inetaddress, this.G()); + : new DedicatedServerConnection(this, inetaddress, this.G());
+ // Spigot end + // Spigot end
} catch (Throwable ioexception) { // CraftBukkit - IOException -> Throwable } catch (Throwable ioexception) { // CraftBukkit - IOException -> Throwable
log.warning("**** FAILED TO BIND TO PORT!"); this.getLogger().warning("**** FAILED TO BIND TO PORT!");
log.log(Level.WARNING, "The exception was: " + ioexception.toString()); this.getLogger().warning("The exception was: {0}", new Object[] { ioexception.toString()});
diff --git a/src/main/java/net/minecraft/server/INetworkManager.java b/src/main/java/net/minecraft/server/INetworkManager.java diff --git a/src/main/java/net/minecraft/server/INetworkManager.java b/src/main/java/net/minecraft/server/INetworkManager.java
new file mode 100644 new file mode 100644
index 0000000..ff3daae index 0000000..ff3daae
@ -158,20 +158,11 @@ index 9d5cee7..8486d82 100644
}; };
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/PendingConnection.java b/src/main/java/net/minecraft/server/PendingConnection.java diff --git a/src/main/java/net/minecraft/server/PendingConnection.java b/src/main/java/net/minecraft/server/PendingConnection.java
index 8413a15..cdd456f 100644 index 5f4bcf2..7b015d7 100644
--- a/src/main/java/net/minecraft/server/PendingConnection.java --- a/src/main/java/net/minecraft/server/PendingConnection.java
+++ b/src/main/java/net/minecraft/server/PendingConnection.java +++ b/src/main/java/net/minecraft/server/PendingConnection.java
@@ -17,7 +17,7 @@ public class PendingConnection extends Connection { @@ -27,10 +27,15 @@ public class PendingConnection extends Connection {
private byte[] d; private SecretKey k = null;
public static Logger logger = Logger.getLogger("Minecraft");
private static Random random = new Random();
- public NetworkManager networkManager;
+ public INetworkManager networkManager;
public boolean c = false;
private MinecraftServer server;
private int g = 0;
@@ -28,10 +28,15 @@ public class PendingConnection extends Connection {
private SecretKey l = null;
public String hostname = ""; // CraftBukkit - add field public String hostname = ""; // CraftBukkit - add field
+ public PendingConnection(MinecraftServer minecraftserver, org.spigotmc.netty.NettyNetworkManager networkManager) { + public PendingConnection(MinecraftServer minecraftserver, org.spigotmc.netty.NettyNetworkManager networkManager) {
@ -181,23 +172,23 @@ index 8413a15..cdd456f 100644
+ +
public PendingConnection(MinecraftServer minecraftserver, Socket socket, String s) throws java.io.IOException { // CraftBukkit - throws IOException public PendingConnection(MinecraftServer minecraftserver, Socket socket, String s) throws java.io.IOException { // CraftBukkit - throws IOException
this.server = minecraftserver; this.server = minecraftserver;
this.networkManager = new NetworkManager(socket, s, this, minecraftserver.F().getPrivate()); this.networkManager = new NetworkManager(minecraftserver.getLogger(), socket, s, this, minecraftserver.F().getPrivate());
- this.networkManager.e = 0; - this.networkManager.e = 0;
+ // this.networkManager.e = 0; + // this.networkManager.e = 0;
} }
// CraftBukkit start // CraftBukkit start
@@ -147,7 +152,7 @@ public class PendingConnection extends Connection { @@ -146,7 +151,7 @@ public class PendingConnection extends Connection {
// CraftBukkit // CraftBukkit
org.bukkit.event.server.ServerListPingEvent pingEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.getMotd(), playerlist.getPlayerCount(), playerlist.getMaxPlayers()); org.bukkit.event.server.ServerListPingEvent pingEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.getMotd(), playerlist.getPlayerCount(), playerlist.getMaxPlayers());
- if (packet254getinfo.a == 1) { - if (packet254getinfo.a == 1) {
+ if (true) { + if (true) {
// CraftBukkit start - fix decompile issues, don't create a list from an array // CraftBukkit start - fix decompile issues, don't create a list from an array
Object[] list = new Object[] { 1, 51, this.server.getVersion(), pingEvent.getMotd(), playerlist.getPlayerCount(), pingEvent.getMaxPlayers() }; Object[] list = new Object[] { 1, 60, this.server.getVersion(), pingEvent.getMotd(), playerlist.getPlayerCount(), pingEvent.getMaxPlayers() };
diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java
index 64eaa4c..fbf6fe6 100644 index 489e184..9533b6f 100644
--- a/src/main/java/net/minecraft/server/ThreadCommandReader.java --- a/src/main/java/net/minecraft/server/ThreadCommandReader.java
+++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java +++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java
@@ -11,6 +11,7 @@ class ThreadCommandReader extends Thread { @@ -11,6 +11,7 @@ class ThreadCommandReader extends Thread {

View file

@ -1,4 +1,4 @@
From e92e872b2cb6bc659372997d6e08cd3489a78162 Mon Sep 17 00:00:00 2001 From 52d22a6258d9e5ccab14e70b6fb8470fb1a5a7a9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 24 Feb 2013 20:45:20 +1100 Date: Sun, 24 Feb 2013 20:45:20 +1100
Subject: [PATCH] Enable Improved ping sending Subject: [PATCH] Enable Improved ping sending
@ -10,10 +10,10 @@ Subject: [PATCH] Enable Improved ping sending
3 files changed, 18 insertions(+) 3 files changed, 18 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 28f462b..933a2e7 100644 index b3c7790..2a77c2f 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -48,6 +48,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -50,6 +50,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public int newLevel = 0; public int newLevel = 0;
public int newTotalExp = 0; public int newTotalExp = 0;
public boolean keepLevel = false; public boolean keepLevel = false;
@ -22,10 +22,10 @@ index 28f462b..933a2e7 100644
public EntityPlayer(MinecraftServer minecraftserver, World world, String s, PlayerInteractManager playerinteractmanager) { public EntityPlayer(MinecraftServer minecraftserver, World world, String s, PlayerInteractManager playerinteractmanager) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index d13fa19..6c19ad7 100644 index 224c57f..ddb2f07 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -662,7 +662,23 @@ public abstract class PlayerList { @@ -713,7 +713,23 @@ public abstract class PlayerList {
this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.ping)); this.sendAll(new Packet201PlayerInfo(entityplayer.name, true, entityplayer.ping));
} }
// CraftBukkit end */ // CraftBukkit end */

View file

@ -1,4 +1,4 @@
From 01db0ede45b595ea3713690c2f9fb91a337f4b95 Mon Sep 17 00:00:00 2001 From 560f69f4f3f38b65081816affd24e7976ca8e0b8 Mon Sep 17 00:00:00 2001
From: EdGruberman <ed@rjump.com> From: EdGruberman <ed@rjump.com>
Date: Tue, 12 Feb 2013 16:17:31 -0700 Date: Tue, 12 Feb 2013 16:17:31 -0700
Subject: [PATCH] Remove dependency on CraftPlayer.getBedSpawnLocation; Fixes Subject: [PATCH] Remove dependency on CraftPlayer.getBedSpawnLocation; Fixes
@ -9,10 +9,10 @@ Subject: [PATCH] Remove dependency on CraftPlayer.getBedSpawnLocation; Fixes
1 file changed, 9 insertions(+), 2 deletions(-) 1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index 6c19ad7..5743822 100644 index ddb2f07..a2510a0 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java --- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -439,8 +439,15 @@ public abstract class PlayerList { @@ -490,8 +490,15 @@ public abstract class PlayerList {
boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END boolean useTravelAgent = false; // don't use agent for custom worlds or return from THE_END
if (exitWorld != null) { if (exitWorld != null) {
if ((cause == TeleportCause.END_PORTAL) && (i == 0)) { if ((cause == TeleportCause.END_PORTAL) && (i == 0)) {

View file

@ -1,4 +1,4 @@
From b8bb51ff362c990ef9cd991a5656cf823cbf2044 Mon Sep 17 00:00:00 2001 From bcb3872477f8ef9805fa7844d4ae7b877cd26af2 Mon Sep 17 00:00:00 2001
From: Yariv Livay <yarivlivay@gmail.com> From: Yariv Livay <yarivlivay@gmail.com>
Date: Mon, 25 Feb 2013 22:26:36 +0200 Date: Mon, 25 Feb 2013 22:26:36 +0200
Subject: [PATCH] Adds BUKKIT-3667, Faux sleepers wake up normally Subject: [PATCH] Adds BUKKIT-3667, Faux sleepers wake up normally
@ -8,10 +8,10 @@ Subject: [PATCH] Adds BUKKIT-3667, Faux sleepers wake up normally
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 933a2e7..fc06e62 100644 index 2a77c2f..eae753d 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java --- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -381,7 +381,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -422,7 +422,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} }
public void a(boolean flag, boolean flag1, boolean flag2) { public void a(boolean flag, boolean flag1, boolean flag2) {
@ -19,7 +19,7 @@ index 933a2e7..fc06e62 100644
+ if (!this.sleeping) return; // CraftBukkit - Can't leave bed if not in one! + if (!this.sleeping) return; // CraftBukkit - Can't leave bed if not in one!
if (this.isSleeping()) { if (this.isSleeping()) {
this.p().getTracker().sendPacketToEntity(this, new Packet18ArmAnimation(this, 3)); this.o().getTracker().sendPacketToEntity(this, new Packet18ArmAnimation(this, 3));
-- --
1.8.1-rc2 1.8.1-rc2

View file

@ -1,4 +1,4 @@
From 2be562a064fd9341e1cfb8b298b5f77d66e9ce07 Mon Sep 17 00:00:00 2001 From b6475416c1cf91bdb1990435118c935f2c1363f9 Mon Sep 17 00:00:00 2001
From: Yariv Livay <yarivlivay@gmail.com> From: Yariv Livay <yarivlivay@gmail.com>
Date: Tue, 26 Feb 2013 20:14:34 +0200 Date: Tue, 26 Feb 2013 20:14:34 +0200
Subject: [PATCH] BUKKIT-3668 Fix wrong block in BlockDispenseEvent when Subject: [PATCH] BUKKIT-3668 Fix wrong block in BlockDispenseEvent when
@ -9,10 +9,10 @@ Subject: [PATCH] BUKKIT-3668 Fix wrong block in BlockDispenseEvent when
1 file changed, 1 insertion(+), 1 deletion(-) 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java
index b381e22..0df0669 100644 index 8f7e09b..ae65526 100644
--- a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java --- a/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java
+++ b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java +++ b/src/main/java/net/minecraft/server/DispenseBehaviorEmptyBucket.java
@@ -37,7 +37,7 @@ public class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem { @@ -32,7 +32,7 @@ final class DispenseBehaviorEmptyBucket extends DispenseBehaviorItem {
} }
// CraftBukkit start // CraftBukkit start

View file

@ -1,4 +1,4 @@
From ac384dd63995c6eb516756b2b0c0b93712038c84 Mon Sep 17 00:00:00 2001 From 8503226f492fd2dfcff2fd1cbc9b737c71c05fd0 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Mon, 4 Mar 2013 18:45:52 +1100 Date: Mon, 4 Mar 2013 18:45:52 +1100
Subject: [PATCH] PlayerItemDamageEvent Subject: [PATCH] PlayerItemDamageEvent
@ -8,10 +8,10 @@ Subject: [PATCH] PlayerItemDamageEvent
1 file changed, 10 insertions(+), 1 deletion(-) 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 3043db9..e3db554 100644 index cd6dd07..a2df1d5 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java --- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -161,7 +161,16 @@ public final class ItemStack { @@ -174,7 +174,16 @@ public final class ItemStack {
} }
i -= k; i -= k;
@ -26,7 +26,7 @@ index 3043db9..e3db554 100644
+ } + }
+ // Spigot end + // Spigot end
+ if (i <= 0 ) { + if (i <= 0 ) {
return; return false;
} }
} }
-- --

View file

@ -1,662 +0,0 @@
From 0440a1cf145aa79ef47d3c2db6f096e3d330d266 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 2 Mar 2013 13:34:17 +1100
Subject: [PATCH] Snapshot support.
---
src/main/java/net/minecraft/server/Container.java | 420 ++++++++++++++-------
src/main/java/net/minecraft/server/ItemStack.java | 1 +
.../java/net/minecraft/server/MinecraftServer.java | 2 +-
.../net/minecraft/server/Packet100OpenWindow.java | 46 +++
.../net/minecraft/server/PendingConnection.java | 6 +-
src/main/java/org/bukkit/craftbukkit/Spigot.java | 8 +
src/main/resources/configurations/bukkit.yml | 2 +
7 files changed, 354 insertions(+), 131 deletions(-)
create mode 100644 src/main/java/net/minecraft/server/Packet100OpenWindow.java
diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java
index 9ecefea..82df589 100644
--- a/src/main/java/net/minecraft/server/Container.java
+++ b/src/main/java/net/minecraft/server/Container.java
@@ -2,6 +2,7 @@ package net.minecraft.server;
import java.util.ArrayList;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -16,9 +17,11 @@ public abstract class Container {
public List c = new ArrayList();
public int windowId = 0;
private short a = 0;
+ private int f = -1;
+ private int g = 0;
+ private final Set h = new HashSet();
protected List listeners = new ArrayList();
- private Set f = new HashSet();
-
+ private Set i = new HashSet();
// CraftBukkit start
public boolean checkReachable = true;
public abstract InventoryView getBukkitView();
@@ -105,168 +108,264 @@ public abstract class Container {
public ItemStack clickItem(int i, int j, int k, EntityHuman entityhuman) {
ItemStack itemstack = null;
PlayerInventory playerinventory = entityhuman.inventory;
- Slot slot;
- ItemStack itemstack1;
int l;
- ItemStack itemstack2;
-
- if ((k == 0 || k == 1) && (j == 0 || j == 1)) {
- if (i == -999) {
- if (playerinventory.getCarried() != null && i == -999) {
- if (j == 0) {
- entityhuman.drop(playerinventory.getCarried());
- playerinventory.setCarried((ItemStack) null);
- }
+ ItemStack itemstack1;
- if (j == 1) {
- // CraftBukkit start - store a reference
- ItemStack itemstack3 = playerinventory.getCarried();
- if (itemstack3.count > 0) {
- entityhuman.drop(itemstack3.a(1));
- }
+ if (k == 5) {
+ int i1 = this.g;
+
+ this.g = c__(j);
+ if ((i1 != 1 || this.g != 2) && i1 != this.g) {
+ this.d__();
+ } else if (playerinventory.getCarried() == null) {
+ this.d__();
+ } else if (this.g == 0) {
+ this.f = b__(j);
+ if (d(this.f)) {
+ this.g = 1;
+ this.h.clear();
+ } else {
+ this.d__();
+ }
+ } else if (this.g == 1) {
+ Slot slot = (Slot) this.c.get(i);
- if (itemstack3.count == 0) {
- // CraftBukkit end
- playerinventory.setCarried((ItemStack) null);
- }
- }
+ if (slot != null && a(slot, playerinventory.getCarried(), true) && slot.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count > this.h.size() && this.b(slot)) {
+ this.h.add(slot);
}
- } else if (k == 1) {
- slot = (Slot) this.c.get(i);
- if (slot != null && slot.a(entityhuman)) {
- itemstack1 = this.b(entityhuman, i);
- if (itemstack1 != null) {
- int i1 = itemstack1.id;
-
- itemstack = itemstack1.cloneItemStack();
- if (slot != null && slot.getItem() != null && slot.getItem().id == i1) {
- this.a(i, j, true, entityhuman);
+ } else if (this.g == 2) {
+ if (!this.h.isEmpty()) {
+ itemstack1 = playerinventory.getCarried().cloneItemStack();
+ l = playerinventory.getCarried().count;
+ Iterator iterator = this.h.iterator();
+
+ while (iterator.hasNext()) {
+ Slot slot1 = (Slot) iterator.next();
+
+ if (slot1 != null && a(slot1, playerinventory.getCarried(), true) && slot1.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count >= this.h.size() && this.b(slot1)) {
+ ItemStack itemstack2 = itemstack1.cloneItemStack();
+ int j1 = slot1.d() ? slot1.getItem().count : 0;
+
+ a(this.h, this.f, itemstack2, j1);
+ if (itemstack2.count > itemstack2.getMaxStackSize()) {
+ itemstack2.count = itemstack2.getMaxStackSize();
+ }
+
+ if (itemstack2.count > slot1.a()) {
+ itemstack2.count = slot1.a();
+ }
+
+ l -= itemstack2.count - j1;
+ slot1.set(itemstack2);
}
}
- }
- } else {
- if (i < 0) {
- return null;
- }
-
- slot = (Slot) this.c.get(i);
- if (slot != null) {
- itemstack1 = slot.getItem();
- ItemStack itemstack3 = playerinventory.getCarried();
- if (itemstack1 != null) {
- itemstack = itemstack1.cloneItemStack();
+ itemstack1.count = l;
+ if (itemstack1.count <= 0) {
+ itemstack1 = null;
}
- if (itemstack1 == null) {
- if (itemstack3 != null && slot.isAllowed(itemstack3)) {
- l = j == 0 ? itemstack3.count : 1;
- if (l > slot.a()) {
- l = slot.a();
- }
+ playerinventory.setCarried(itemstack1);
+ }
- // CraftBukkit start
- if (itemstack3.count >= l) {
- slot.set(itemstack3.a(l));
- }
- // CraftBukkit end
+ this.d__();
+ } else {
+ this.d__();
+ }
+ } else if (this.g != 0) {
+ this.d__();
+ } else {
+ Slot slot2;
+ int k1;
+ ItemStack itemstack3;
+
+ if ((k == 0 || k == 1) && (j == 0 || j == 1)) {
+ if (i == -999) {
+ if (playerinventory.getCarried() != null && i == -999) {
+ if (j == 0) {
+ entityhuman.drop(playerinventory.getCarried());
+ playerinventory.setCarried((ItemStack) null);
+ }
- if (itemstack3.count == 0) {
+ if (j == 1) {
+ entityhuman.drop(playerinventory.getCarried().a(1));
+ if (playerinventory.getCarried().count == 0) {
playerinventory.setCarried((ItemStack) null);
}
}
- } else if (slot.a(entityhuman)) {
- if (itemstack3 == null) {
- l = j == 0 ? itemstack1.count : (itemstack1.count + 1) / 2;
- itemstack2 = slot.a(l);
- playerinventory.setCarried(itemstack2);
- if (itemstack1.count == 0) {
- slot.set((ItemStack) null);
+ }
+ } else if (k == 1) {
+ if (i < 0) {
+ return null;
+ }
+
+ slot2 = (Slot) this.c.get(i);
+ if (slot2 != null && slot2.a(entityhuman)) {
+ itemstack1 = this.b(entityhuman, i);
+ if (itemstack1 != null) {
+ l = itemstack1.id;
+ itemstack = itemstack1.cloneItemStack();
+ if (slot2 != null && slot2.getItem() != null && slot2.getItem().id == l) {
+ this.a(i, j, true, entityhuman);
}
+ }
+ }
+ } else {
+ if (i < 0) {
+ return null;
+ }
- slot.a(entityhuman, playerinventory.getCarried());
- } else if (slot.isAllowed(itemstack3)) {
- if (itemstack1.id == itemstack3.id && itemstack1.getData() == itemstack3.getData() && ItemStack.equals(itemstack1, itemstack3)) {
- l = j == 0 ? itemstack3.count : 1;
- if (l > slot.a() - itemstack1.count) {
- l = slot.a() - itemstack1.count;
- }
+ slot2 = (Slot) this.c.get(i);
+ if (slot2 != null) {
+ itemstack1 = slot2.getItem();
+ ItemStack itemstack4 = playerinventory.getCarried();
+
+ if (itemstack1 != null) {
+ itemstack = itemstack1.cloneItemStack();
+ }
- if (l > itemstack3.getMaxStackSize() - itemstack1.count) {
- l = itemstack3.getMaxStackSize() - itemstack1.count;
+ if (itemstack1 == null) {
+ if (itemstack4 != null && slot2.isAllowed(itemstack4)) {
+ k1 = j == 0 ? itemstack4.count : 1;
+ if (k1 > slot2.a()) {
+ k1 = slot2.a();
}
- itemstack3.a(l);
- if (itemstack3.count == 0) {
+ slot2.set(itemstack4.a(k1));
+ if (itemstack4.count == 0) {
playerinventory.setCarried((ItemStack) null);
}
-
- itemstack1.count += l;
- } else if (itemstack3.count <= slot.a()) {
- slot.set(itemstack3);
- playerinventory.setCarried(itemstack1);
}
- } else if (itemstack1.id == itemstack3.id && itemstack3.getMaxStackSize() > 1 && (!itemstack1.usesData() || itemstack1.getData() == itemstack3.getData()) && ItemStack.equals(itemstack1, itemstack3)) {
- l = itemstack1.count;
- if (l > 0 && l + itemstack3.count <= itemstack3.getMaxStackSize()) {
- itemstack3.count += l;
- itemstack1 = slot.a(l);
+ } else if (slot2.a(entityhuman)) {
+ if (itemstack4 == null) {
+ k1 = j == 0 ? itemstack1.count : (itemstack1.count + 1) / 2;
+ itemstack3 = slot2.a(k1);
+ playerinventory.setCarried(itemstack3);
if (itemstack1.count == 0) {
- slot.set((ItemStack) null);
+ slot2.set((ItemStack) null);
}
- slot.a(entityhuman, playerinventory.getCarried());
+ slot2.a(entityhuman, playerinventory.getCarried());
+ } else if (slot2.isAllowed(itemstack4)) {
+ if (itemstack1.id == itemstack4.id && itemstack1.getData() == itemstack4.getData() && ItemStack.equals(itemstack1, itemstack4)) {
+ k1 = j == 0 ? itemstack4.count : 1;
+ if (k1 > slot2.a() - itemstack1.count) {
+ k1 = slot2.a() - itemstack1.count;
+ }
+
+ if (k1 > itemstack4.getMaxStackSize() - itemstack1.count) {
+ k1 = itemstack4.getMaxStackSize() - itemstack1.count;
+ }
+
+ itemstack4.a(k1);
+ if (itemstack4.count == 0) {
+ playerinventory.setCarried((ItemStack) null);
+ }
+
+ itemstack1.count += k1;
+ } else if (itemstack4.count <= slot2.a()) {
+ slot2.set(itemstack4);
+ playerinventory.setCarried(itemstack1);
+ }
+ } else if (itemstack1.id == itemstack4.id && itemstack4.getMaxStackSize() > 1 && (!itemstack1.usesData() || itemstack1.getData() == itemstack4.getData()) && ItemStack.equals(itemstack1, itemstack4)) {
+ k1 = itemstack1.count;
+ if (k1 > 0 && k1 + itemstack4.count <= itemstack4.getMaxStackSize()) {
+ itemstack4.count += k1;
+ itemstack1 = slot2.a(k1);
+ if (itemstack1.count == 0) {
+ slot2.set((ItemStack) null);
+ }
+
+ slot2.a(entityhuman, playerinventory.getCarried());
+ }
}
}
+
+ slot2.e();
+ }
+ }
+ } else if (k == 2 && j >= 0 && j < 9) {
+ slot2 = (Slot) this.c.get(i);
+ if (slot2.a(entityhuman)) {
+ itemstack1 = playerinventory.getItem(j);
+ boolean flag = itemstack1 == null || slot2.inventory == playerinventory && slot2.isAllowed(itemstack1);
+
+ k1 = -1;
+ if (!flag) {
+ k1 = playerinventory.i();
+ flag |= k1 > -1;
}
- slot.e();
+ if (slot2.d() && flag) {
+ itemstack3 = slot2.getItem();
+ playerinventory.setItem(j, itemstack3);
+ if ((slot2.inventory != playerinventory || !slot2.isAllowed(itemstack1)) && itemstack1 != null) {
+ if (k1 > -1) {
+ playerinventory.pickup(itemstack1);
+ slot2.a(itemstack3.count);
+ slot2.set((ItemStack) null);
+ slot2.a(entityhuman, itemstack3);
+ }
+ } else {
+ slot2.a(itemstack3.count);
+ slot2.set(itemstack1);
+ slot2.a(entityhuman, itemstack3);
+ }
+ } else if (!slot2.d() && itemstack1 != null && slot2.isAllowed(itemstack1)) {
+ playerinventory.setItem(j, (ItemStack) null);
+ slot2.set(itemstack1);
+ }
}
- }
- } else if (k == 2 && j >= 0 && j < 9) {
- slot = (Slot) this.c.get(i);
- if (slot.a(entityhuman)) {
- itemstack1 = playerinventory.getItem(j);
- boolean flag = itemstack1 == null || slot.inventory == playerinventory && slot.isAllowed(itemstack1);
-
- l = -1;
- if (!flag) {
- l = playerinventory.i();
- flag |= l > -1;
+ } else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) {
+ slot2 = (Slot) this.c.get(i);
+ if (slot2 != null && slot2.d()) {
+ itemstack1 = slot2.getItem().cloneItemStack();
+ itemstack1.count = itemstack1.getMaxStackSize();
+ playerinventory.setCarried(itemstack1);
}
-
- if (slot.d() && flag) {
- itemstack2 = slot.getItem();
- playerinventory.setItem(j, itemstack2);
- if ((slot.inventory != playerinventory || !slot.isAllowed(itemstack1)) && itemstack1 != null) {
- if (l > -1) {
- playerinventory.pickup(itemstack1);
- slot.a(itemstack2.count);
- slot.set((ItemStack) null);
- slot.a(entityhuman, itemstack2);
+ } else if (k == 4 && playerinventory.getCarried() == null && i >= 0) {
+ slot2 = (Slot) this.c.get(i);
+ if (slot2 != null && slot2.d()) {
+ itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count);
+ slot2.a(entityhuman, itemstack1);
+ entityhuman.drop(itemstack1);
+ }
+ } else if (k == 6 && i >= 0) {
+ slot2 = (Slot) this.c.get(i);
+ itemstack1 = playerinventory.getCarried();
+ if (itemstack1 != null && (slot2 == null || !slot2.d() || !slot2.a(entityhuman))) {
+ l = j == 0 ? 0 : this.c.size() - 1;
+ k1 = j == 0 ? 1 : -1;
+
+ for (int l1 = 0; l1 < 2; ++l1) {
+ for (int i2 = l; i2 >= 0 && i2 < this.c.size() && itemstack1.count < itemstack1.getMaxStackSize(); i2 += k1) {
+ Slot slot3 = (Slot) this.c.get(i2);
+
+ if (slot3.d() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) {
+ int j2 = Math.min(itemstack1.getMaxStackSize() - itemstack1.count, slot3.getItem().count);
+ ItemStack itemstack5 = slot3.a(j2);
+
+ itemstack1.count += j2;
+ if (itemstack5.count <= 0) {
+ slot3.set((ItemStack) null);
+ slot3.a(entityhuman, itemstack5);
+ }
+ }
}
- } else {
- slot.a(itemstack2.count);
- slot.set(itemstack1);
- slot.a(entityhuman, itemstack2);
}
- } else if (!slot.d() && itemstack1 != null && slot.isAllowed(itemstack1)) {
- playerinventory.setItem(j, (ItemStack) null);
- slot.set(itemstack1);
}
- }
- } else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) {
- slot = (Slot) this.c.get(i);
- if (slot != null && slot.d()) {
- itemstack1 = slot.getItem().cloneItemStack();
- itemstack1.count = itemstack1.getMaxStackSize();
- playerinventory.setCarried(itemstack1);
+
+ this.b();
}
}
return itemstack;
}
+ public boolean a(ItemStack itemstack, Slot slot) {
+ return true;
+ }
+
protected void a(int i, int j, boolean flag, EntityHuman entityhuman) {
this.clickItem(i, j, 1, entityhuman);
}
@@ -289,14 +388,14 @@ public abstract class Container {
}
public boolean c(EntityHuman entityhuman) {
- return !this.f.contains(entityhuman);
+ return !this.i.contains(entityhuman);
}
public void a(EntityHuman entityhuman, boolean flag) {
if (flag) {
- this.f.remove(entityhuman);
+ this.i.remove(entityhuman);
} else {
- this.f.add(entityhuman);
+ this.i.add(entityhuman);
}
}
@@ -369,4 +468,71 @@ public abstract class Container {
return flag1;
}
+
+ public static int b__(int i) {
+ return i >> 2 & 3;
+ }
+
+ public static int c__(int i) {
+ return i & 3;
+ }
+
+ public static boolean d(int i) {
+ return i == 0 || i == 1;
+ }
+
+ protected void d__() {
+ this.g = 0;
+ this.h.clear();
+ }
+
+ public static boolean a(Slot slot, ItemStack itemstack, boolean flag) {
+ boolean flag1 = slot == null || !slot.d();
+
+ if (slot != null && slot.d() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) {
+ int i = flag ? 0 : itemstack.count;
+
+ flag1 |= slot.getItem().count + i <= itemstack.getMaxStackSize();
+ }
+
+ return flag1;
+ }
+
+ public static void a(Set set, int i, ItemStack itemstack, int j) {
+ switch (i) {
+ case 0:
+ itemstack.count = MathHelper.d((float) itemstack.count / (float) set.size());
+ break;
+
+ case 1:
+ itemstack.count = 1;
+ }
+
+ itemstack.count += j;
+ }
+
+ public boolean b(Slot slot) {
+ return true;
+ }
+
+ public static int b(IInventory iinventory) {
+ if (iinventory == null) {
+ return 0;
+ } else {
+ int i = 0;
+ float f = 0.0F;
+
+ for (int j = 0; j < iinventory.getSize(); ++j) {
+ ItemStack itemstack = iinventory.getItem(j);
+
+ if (itemstack != null) {
+ f += (float) itemstack.count / (float) Math.min(iinventory.getMaxStackSize(), itemstack.getMaxStackSize());
+ ++i;
+ }
+ }
+
+ f /= (float) iinventory.getSize();
+ return MathHelper.d(f * 14.0F) + (i > 0 ? 1 : 0);
+ }
+ }
}
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 8f0a5ad..3043db9 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -38,6 +38,7 @@ public final class ItemStack {
this.f = null;
this.id = i;
this.count = j;
+ if (org.bukkit.craftbukkit.Spigot.snapshotSupport && this.id >= 146 && this.id <= 158) this.id = 0; // Spigot
this.setData(k); // CraftBukkit
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6005fac..79b4369 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -765,7 +765,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IMo
}
public String getVersion() {
- return "1.4.7";
+ return (org.bukkit.craftbukkit.Spigot.snapshotSupport) ? org.bukkit.craftbukkit.Spigot.snapshotVersion : "1.4.7";
}
public int y() {
diff --git a/src/main/java/net/minecraft/server/Packet100OpenWindow.java b/src/main/java/net/minecraft/server/Packet100OpenWindow.java
new file mode 100644
index 0000000..5182bfa
--- /dev/null
+++ b/src/main/java/net/minecraft/server/Packet100OpenWindow.java
@@ -0,0 +1,46 @@
+package net.minecraft.server;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+
+public class Packet100OpenWindow extends Packet {
+
+ public int a;
+ public int b;
+ public String c;
+ public int d;
+
+ public Packet100OpenWindow() {}
+
+ public Packet100OpenWindow(int i, int j, String s, int k) {
+ this.a = i;
+ this.b = j;
+ this.c = s;
+ this.d = k;
+ }
+
+ public void handle(Connection connection) {
+ connection.a(this);
+ }
+
+ public void a(DataInputStream datainputstream) throws IOException {
+ this.a = datainputstream.readByte() & 255;
+ this.b = datainputstream.readByte() & 255;
+ this.c = a(datainputstream, 32);
+ this.d = datainputstream.readByte() & 255;
+ if (org.bukkit.craftbukkit.Spigot.snapshotSupport) datainputstream.readBoolean(); // Spigot
+ }
+
+ public void a(DataOutputStream dataoutputstream) throws IOException {
+ dataoutputstream.writeByte(this.a & 255);
+ dataoutputstream.writeByte(this.b & 255);
+ a(this.c, dataoutputstream);
+ dataoutputstream.writeByte(this.d & 255);
+ if (org.bukkit.craftbukkit.Spigot.snapshotSupport) dataoutputstream.writeBoolean(false); // Spigot
+ }
+
+ public int a() {
+ return 3 + this.c.length();
+ }
+}
diff --git a/src/main/java/net/minecraft/server/PendingConnection.java b/src/main/java/net/minecraft/server/PendingConnection.java
index cdd456f..08aa314 100644
--- a/src/main/java/net/minecraft/server/PendingConnection.java
+++ b/src/main/java/net/minecraft/server/PendingConnection.java
@@ -78,8 +78,8 @@ public class PendingConnection extends Connection {
} else {
PublicKey publickey = this.server.F().getPublic();
- if (packet2handshake.d() != 51) {
- if (packet2handshake.d() > 51) {
+ if (packet2handshake.d() != ((org.bukkit.craftbukkit.Spigot.snapshotSupport) ? org.bukkit.craftbukkit.Spigot.snapshotProtocolVersion : 51)) {
+ if (packet2handshake.d() > ((org.bukkit.craftbukkit.Spigot.snapshotSupport) ? org.bukkit.craftbukkit.Spigot.snapshotProtocolVersion : 51)) {
this.disconnect("Outdated server!");
} else {
this.disconnect("Outdated client!");
@@ -154,7 +154,7 @@ public class PendingConnection extends Connection {
if (true) {
// CraftBukkit start - fix decompile issues, don't create a list from an array
- Object[] list = new Object[] { 1, 51, this.server.getVersion(), pingEvent.getMotd(), playerlist.getPlayerCount(), pingEvent.getMaxPlayers() };
+ Object[] list = new Object[] { 1, ((org.bukkit.craftbukkit.Spigot.snapshotSupport) ? org.bukkit.craftbukkit.Spigot.snapshotProtocolVersion : 51), this.server.getVersion(), pingEvent.getMotd(), playerlist.getPlayerCount(), pingEvent.getMaxPlayers() };
for (Object object : list) {
if (s == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Spigot.java b/src/main/java/org/bukkit/craftbukkit/Spigot.java
index 6713281..208bf02 100644
--- a/src/main/java/org/bukkit/craftbukkit/Spigot.java
+++ b/src/main/java/org/bukkit/craftbukkit/Spigot.java
@@ -23,6 +23,9 @@ public class Spigot {
public static boolean tabPing = false;
private static Metrics metrics;
+ public static boolean snapshotSupport;
+ public static int snapshotProtocolVersion = 60;
+ public static String snapshotVersion = "1.5";
public static void initialize(CraftServer server, SimpleCommandMap commandMap, YamlConfiguration configuration) {
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
@@ -60,6 +63,11 @@ public class Spigot {
tabPing = configuration.getBoolean("settings.tab-ping", tabPing);
+ snapshotSupport = configuration.getBoolean("settings.snapshot-protocol", snapshotSupport);
+ if (snapshotSupport) {
+ server.getLogger().log(Level.INFO, "Enabled support for pre release / snapshot version {0}", snapshotVersion);
+ }
+
if (metrics == null) {
try {
metrics = new Metrics();
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index aac1406..0351530 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -35,6 +35,8 @@ settings:
timeout-time: 30
restart-on-crash: false
restart-script-location: /path/to/server/start.sh
+ # fakes the latest pre release / snapshot
+ snapshot-protocol: false
world-settings:
default:
growth-chunks-per-tick: 650
--
1.8.1-rc2

View file

@ -1,30 +0,0 @@
From 65e4386d461d313d9de97bc9f27c0e7aaef60dbd Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 3 Mar 2013 20:22:45 +1100
Subject: [PATCH] Fix crash with exceptions in command block commands.
---
src/main/java/net/minecraft/server/TileEntityCommand.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/TileEntityCommand.java b/src/main/java/net/minecraft/server/TileEntityCommand.java
index 4ff401b..10215ec 100644
--- a/src/main/java/net/minecraft/server/TileEntityCommand.java
+++ b/src/main/java/net/minecraft/server/TileEntityCommand.java
@@ -70,7 +70,12 @@ public class TileEntityCommand extends TileEntity implements ICommandListener {
// now dispatch all of the commands we ended up with
for (int i = 0; i < commands.size(); i++) {
- commandMap.dispatch(sender, joiner.join(Arrays.asList(commands.get(i))));
+ String[] cmd = commands.get(i);
+ try {
+ commandMap.dispatch(sender, joiner.join(Arrays.asList(cmd)));
+ } catch (org.bukkit.command.CommandException ex) {
+ org.bukkit.Bukkit.getServer().getLogger().log(java.util.logging.Level.WARNING, "Unexpected exception while parsing command block command \"" + cmd[0] + '"', ex);
+ }
}
// CraftBukkit end
}
--
1.8.1-rc2

View file

@ -1,4 +1,4 @@
From f4ffbf28426aefbec5fcef262ea3dd5c4133212a Mon Sep 17 00:00:00 2001 From 950d9560cf2fee49bbadf1607cca570bd1c5808a Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Thu, 7 Mar 2013 20:12:46 +1100 Date: Thu, 7 Mar 2013 20:12:46 +1100
Subject: [PATCH] Thread safety. Adds thread safety for chunk load / unload Subject: [PATCH] Thread safety. Adds thread safety for chunk load / unload
@ -9,7 +9,7 @@ Subject: [PATCH] Thread safety. Adds thread safety for chunk load / unload
1 file changed, 3 insertions(+) 1 file changed, 3 insertions(+)
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 33df602..1238f3b 100644 index 25c462e..d6a4d2d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -254,6 +254,7 @@ public class CraftWorld implements World { @@ -254,6 +254,7 @@ public class CraftWorld implements World {