13
0
geforkt von Mirrors/Paper

Initial commit - hello future of Spigot!

Dieser Commit ist enthalten in:
md_5 2013-01-15 12:18:40 +11:00
Commit 017a98eb68
24 geänderte Dateien mit 6974 neuen und 0 gelöschten Zeilen

6
.gitmodules vendored Normale Datei
Datei anzeigen

@ -0,0 +1,6 @@
[submodule "Bukkit"]
path = Bukkit
url = https://github.com/Bukkit/Bukkit.git
[submodule "CraftBukkit"]
path = CraftBukkit
url = https://github.com/Bukkit/CraftBukkit.git

1
Bukkit Submodul

@ -0,0 +1 @@
Subproject commit 2877472d921d414b9c296c8997f30e838f08d351

Datei anzeigen

@ -0,0 +1,64 @@
From 3359843a528eeada4d61ef1d4e7c0c30ad4ca982 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Sat, 5 Jan 2013 15:34:12 +1100
Subject: [PATCH] Spigot POM Changes
---
pom.xml | 36 ++++--------------------------------
1 file changed, 4 insertions(+), 32 deletions(-)
diff --git a/pom.xml b/pom.xml
index 1847285..b29f810 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,43 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.bukkit</groupId>
- <artifactId>bukkit</artifactId>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot-api</artifactId>
<version>1.4.6-R0.4-SNAPSHOT</version>
- <name>Bukkit</name>
- <url>http://www.bukkit.org</url>
+ <name>Spigot-API</name>
+ <url>http://www.spigotmc.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
- <scm>
- <developerConnection>scm:git:git@github.com:Bukkit/Bukkit.git</developerConnection>
- <connection>scm:git:git://github.com/Bukkit/Bukkit.git</connection>
- <url>https://github.com/Bukkit/Bukkit/tree/master/</url>
- </scm>
-
- <ciManagement>
- <system>jenkins</system>
- <url>http://ci.bukkit.org</url>
- </ciManagement>
-
- <distributionManagement>
- <site>
- <id>jd.bukkit.org</id>
- <url>file:///home/javadocs/public_html/</url>
- </site>
- <repository>
- <id>repobo-rel</id>
- <name>repo.bukkit.org Releases</name>
- <url>http://repo.bukkit.org/content/repositories/releases/</url>
- </repository>
- <snapshotRepository>
- <id>repobo-snap</id>
- <name>repo.bukkit.org Snapshots</name>
- <url>http://repo.bukkit.org/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-
<build>
<plugins>
<plugin>
--
1.8.1-rc2

1
CraftBukkit Submodul

@ -0,0 +1 @@
Subproject commit c056293b38cb9a1296937d91746b175252be044a

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -0,0 +1,26 @@
From c17687209fb0774502789624c38b5e8879fc737a Mon Sep 17 00:00:00 2001
From: Agaricus <agaricusb@yahoo.com>
Date: Wed, 19 Dec 2012 19:13:17 -0800
Subject: [PATCH 02/13] Update Maven Shade Plugin to version 2.0. Fixes
BUKKIT-3213
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index c923f94..b1c566a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -215,7 +215,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>1.4</version>
+ <version>2.0</version>
<executions>
<execution>
<phase>package</phase>
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,43 @@
From dabb132cd8dd0b5940ee7f2a1c2ff37c5239e037 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Sun, 23 Dec 2012 17:09:40 +1100
Subject: [PATCH 03/13] Address BUKKIT-3286 by firing the inventory close event
when a secondary container is closed due to the player entity being
destroyed. This covers all edge cases such as server stop / player kick /
player quit.
---
src/main/java/net/minecraft/server/EntityHuman.java | 6 ++++++
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
index 8566391..0b0c351 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -4,10 +4,12 @@ import java.util.Iterator;
import java.util.List;
// CraftBukkit start
+import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityCombustByEntityEvent;
+import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.player.PlayerBedEnterEvent;
import org.bukkit.event.player.PlayerBedLeaveEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
@@ -882,6 +884,10 @@ public abstract class EntityHuman extends EntityLiving implements ICommandListen
super.die();
this.defaultContainer.b(this);
if (this.activeContainer != null) {
+ // CraftBukkit start
+ InventoryCloseEvent event = new InventoryCloseEvent(this.activeContainer.getBukkitView());
+ Bukkit.getServer().getPluginManager().callEvent(event);
+ // CraftBukkit end
this.activeContainer.b(this);
}
}
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,45 @@
From f1b9d9c2a5d620dc7aee11722fd329cd34dcb507 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Sun, 23 Dec 2012 17:51:07 +1100
Subject: [PATCH 04/13] Update item merge logic
---
src/main/java/net/minecraft/server/World.java | 15 +++++++--------
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
index c50b814..29ccbef 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -927,6 +927,7 @@ public abstract class World implements IBlockAccess {
event = CraftEventFactory.callItemSpawnEvent((EntityItem) entity);
// Spigot start
ItemStack item = ((EntityItem) entity).getItemStack();
+ org.bukkit.craftbukkit.inventory.CraftItemStack craft = org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(item);
int maxSize = item.getMaxStackSize();
if (item.count < maxSize) {
double radius = this.getWorld().itemMergeRadius;
@@ -936,14 +937,12 @@ public abstract class World implements IBlockAccess {
if (e instanceof EntityItem) {
EntityItem loopItem = (EntityItem) e;
ItemStack loopStack = loopItem.getItemStack();
- if (!loopItem.dead && loopStack.id == item.id && loopStack.getData() == item.getData()) {
- if (loopStack.tag == null || item.tag == null || !loopStack.tag.equals(item.tag)) {
- int toAdd = Math.min(loopStack.count, maxSize - item.count);
- item.count += toAdd;
- loopStack.count -= toAdd;
- if (loopStack.count <= 0) {
- loopItem.die();
- }
+ if (!loopItem.dead && craft.isSimilar(org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(loopStack))) {
+ int toAdd = Math.min(loopStack.count, maxSize - item.count);
+ item.count += toAdd;
+ loopStack.count -= toAdd;
+ if (loopStack.count <= 0) {
+ loopItem.die();
}
}
}
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,59 @@
From 1971336996f8ac3eccdbc631a3d271890d97fc83 Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Fri, 14 Dec 2012 21:51:06 -0600
Subject: [PATCH 05/13] Include NibbleArray from mc-dev for diff visibility
---
.../java/net/minecraft/server/NibbleArray.java | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 src/main/java/net/minecraft/server/NibbleArray.java
diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java
new file mode 100644
index 0000000..5d75a54
--- /dev/null
+++ b/src/main/java/net/minecraft/server/NibbleArray.java
@@ -0,0 +1,40 @@
+package net.minecraft.server;
+
+public class NibbleArray {
+
+ public final byte[] a;
+ private final int b;
+ private final int c;
+
+ public NibbleArray(int i, int j) {
+ this.a = new byte[i >> 1];
+ this.b = j;
+ this.c = j + 4;
+ }
+
+ public NibbleArray(byte[] abyte, int i) {
+ this.a = abyte;
+ this.b = i;
+ this.c = i + 4;
+ }
+
+ public int a(int i, int j, int k) {
+ int l = j << this.c | k << this.b | i;
+ int i1 = l >> 1;
+ int j1 = l & 1;
+
+ return j1 == 0 ? this.a[i1] & 15 : this.a[i1] >> 4 & 15;
+ }
+
+ public void a(int i, int j, int k, int l) {
+ int i1 = j << this.c | k << this.b | i;
+ int j1 = i1 >> 1;
+ int k1 = i1 & 1;
+
+ if (k1 == 0) {
+ this.a[j1] = (byte) (this.a[j1] & 240 | l & 15);
+ } else {
+ this.a[j1] = (byte) (this.a[j1] & 15 | (l & 15) << 4);
+ }
+ }
+}
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,389 @@
From ccb92789b659c2610a7b8f23740197ed784b749a Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Sun, 23 Dec 2012 14:46:23 -0600
Subject: [PATCH 06/13] Implement 'lightening' of NibbleArrays - only allocate
buffers when non-trivial value Saving from 40-45% of memory use by chunk
section data.
Finish up NibbleArray lightening work - use for Snapshots, reduce copies
Fix nibble handling with NBT - arrays aren't copied by NBTByteArray
---
.../net/minecraft/server/ChunkRegionLoader.java | 10 +-
.../java/net/minecraft/server/ChunkSection.java | 24 ++--
.../java/net/minecraft/server/NibbleArray.java | 122 ++++++++++++++++++++-
.../net/minecraft/server/Packet51MapChunk.java | 28 +++--
.../java/org/bukkit/craftbukkit/CraftChunk.java | 44 +++++++-
5 files changed, 197 insertions(+), 31 deletions(-)
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
index e5e60a9..2e72ab5 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -225,15 +225,15 @@ public class ChunkRegionLoader implements IAsyncChunkSaver, IChunkLoader {
nbttagcompound1.setByte("Y", (byte) (chunksection.d() >> 4 & 255));
nbttagcompound1.setByteArray("Blocks", chunksection.g());
if (chunksection.i() != null) {
- nbttagcompound1.setByteArray("Add", chunksection.i().a);
+ nbttagcompound1.setByteArray("Add", chunksection.i().getValueArray()); // Spigot
}
- nbttagcompound1.setByteArray("Data", chunksection.j().a);
- nbttagcompound1.setByteArray("BlockLight", chunksection.k().a);
+ nbttagcompound1.setByteArray("Data", chunksection.j().getValueArray()); // Spigot
+ nbttagcompound1.setByteArray("BlockLight", chunksection.k().getValueArray()); // Spigot
if (flag) {
- nbttagcompound1.setByteArray("SkyLight", chunksection.l().a);
+ nbttagcompound1.setByteArray("SkyLight", chunksection.l().getValueArray()); // Spigot
} else {
- nbttagcompound1.setByteArray("SkyLight", new byte[chunksection.k().a.length]);
+ nbttagcompound1.setByteArray("SkyLight", new byte[chunksection.k().getValueArray().length]); // Spigot
}
nbttaglist.add(nbttagcompound1);
diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
index 051cf6d..42e669c 100644
--- a/src/main/java/net/minecraft/server/ChunkSection.java
+++ b/src/main/java/net/minecraft/server/ChunkSection.java
@@ -134,7 +134,8 @@ public class ChunkSection {
}
}
} else {
- byte[] ext = this.extBlockIds.a;
+ this.extBlockIds.forceToNonTrivialArray(); // Spigot
+ byte[] ext = this.extBlockIds.getValueArray();
for (int off = 0, off2 = 0; off < blkIds.length;) {
byte extid = ext[off2];
int l = (blkIds[off] & 0xFF) | ((extid & 0xF) << 8); // Even data
@@ -165,6 +166,12 @@ public class ChunkSection {
off++;
off2++;
}
+ // Spigot start
+ this.extBlockIds.detectAndProcessTrivialArray();
+ if (this.extBlockIds.isTrivialArray() && (this.extBlockIds.getTrivialArrayValue() == 0)) {
+ this.extBlockIds = null;
+ }
+ // Spigot end
}
this.nonEmptyBlockCount = cntNonEmpty;
this.tickingBlockCount = cntTicking;
@@ -225,12 +232,11 @@ public class ChunkSection {
public void a(NibbleArray nibblearray) {
// CraftBukkit start - don't hang on to an empty nibble array
boolean empty = true;
- for (int i = 0; i < nibblearray.a.length; i++) {
- if (nibblearray.a[i] != 0) {
- empty = false;
- break;
- }
+ // Spigot start
+ if ((!nibblearray.isTrivialArray()) || (nibblearray.getTrivialArrayValue() != 0)) {
+ empty = false;
}
+ // Spigot end
if (empty) {
return;
@@ -253,10 +259,8 @@ public class ChunkSection {
// Spigot start - validate/correct nibble array
private static final NibbleArray validateNibbleArray(NibbleArray na) {
- if ((na != null) && (na.a.length < 2048)) {
- NibbleArray newna = new NibbleArray(4096, 4);
- System.arraycopy(na.a, 0, newna.a, 0, na.a.length);
- na = newna;
+ if ((na != null) && (na.getByteLength() < 2048)) {
+ na.resizeArray(2048);
}
return na;
}
diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java
index 5d75a54..c9bc20c 100644
--- a/src/main/java/net/minecraft/server/NibbleArray.java
+++ b/src/main/java/net/minecraft/server/NibbleArray.java
@@ -1,13 +1,117 @@
package net.minecraft.server;
+import java.util.Arrays; // Spigot
+
public class NibbleArray {
- public final byte[] a;
+ private byte[] a; // Spigot - remove final, make private (anyone directly accessing this is broken already)
private final int b;
private final int c;
+ // Spigot start
+ private byte trivialValue;
+ private byte trivialByte;
+ private int length;
+ private static final int LEN2K = 2048; // Universal length used right now - optimize around this
+ private static final byte[][] TrivLen2k;
+
+ static {
+ TrivLen2k = new byte[16][];
+ for (int i = 0; i < 16; i++) {
+ TrivLen2k[i] = new byte[LEN2K];
+ Arrays.fill(TrivLen2k[i], (byte) (i | (i << 4)));
+ }
+ }
+
+ // Try to convert array to trivial array
+ public void detectAndProcessTrivialArray() {
+ trivialValue = (byte) (a[0] & 0xF);
+ trivialByte = (byte) (trivialValue | (trivialValue << 4));
+ for (int i = 0; i < a.length; i++) {
+ if (a[i] != trivialByte) return;
+ }
+ // All values matches, so array is trivial
+ this.length = a.length;
+ this.a = null;
+ }
+
+ // Force array to non-trivial state
+ public void forceToNonTrivialArray() {
+ if (this.a == null) {
+ this.a = new byte[this.length];
+ if (this.trivialByte != 0) {
+ Arrays.fill(this.a, this.trivialByte);
+ }
+ }
+ }
+
+ // Test if array is in trivial state
+ public boolean isTrivialArray() {
+ return (this.a == null);
+ }
+
+ // Get value of all elements (only valid if array is in trivial state)
+ public int getTrivialArrayValue() {
+ return this.trivialValue;
+ }
+
+ // Get logical length of byte array for nibble data (whether trivial or non-trivial)
+ public int getByteLength() {
+ if (this.a == null) {
+ return this.length;
+ } else {
+ return this.a.length;
+ }
+ }
+
+ // Return byte encoding of array (whether trivial or non-trivial) - returns read-only array if trivial (do not modify!)
+ public byte[] getValueArray() {
+ if (this.a != null) {
+ return this.a;
+ } else {
+ byte[] rslt;
+
+ if (this.length == LEN2K) { // All current uses are 2k long, but be safe
+ rslt = TrivLen2k[this.trivialValue];
+ } else {
+ rslt = new byte[this.length];
+ if (this.trivialByte != 0) {
+ Arrays.fill(rslt, this.trivialByte);
+ }
+ }
+ return rslt;
+ }
+ }
+
+ // Copy byte representation of array to given offset in given byte array
+ public int copyToByteArray(byte[] dest, int off) {
+ if (this.a == null) {
+ Arrays.fill(dest, off, off + this.length, this.trivialByte);
+ return off + this.length;
+ } else {
+ System.arraycopy(this.a, 0, dest, off, this.a.length);
+ return off + this.a.length;
+ }
+ }
+
+ // Resize array to given byte length
+ public void resizeArray(int len) {
+ if (this.a == null) {
+ this.length = len;
+ } else if (this.a.length != len) {
+ byte[] newa = new byte[len];
+ System.arraycopy(this.a, 0, newa, 0, ((this.a.length > len) ? len : this.a.length));
+ this.a = newa;
+ }
+ }
+ // Spigot end
public NibbleArray(int i, int j) {
- this.a = new byte[i >> 1];
+ // Spigot start
+ //this.a = new byte[i >> 1];
+ this.a = null; // Start off as trivial value (all same zero value)
+ this.length = i >> 1;
+ this.trivialByte = this.trivialValue = 0;
+ // Spigot end
this.b = j;
this.c = j + 4;
}
@@ -16,9 +120,11 @@ public class NibbleArray {
this.a = abyte;
this.b = i;
this.c = i + 4;
+ detectAndProcessTrivialArray(); // Spigot
}
public int a(int i, int j, int k) {
+ if (this.a == null) return this.trivialValue; // Spigot
int l = j << this.c | k << this.b | i;
int i1 = l >> 1;
int j1 = l & 1;
@@ -27,6 +133,18 @@ public class NibbleArray {
}
public void a(int i, int j, int k, int l) {
+ // Spigot start
+ if (this.a == null) {
+ if (l != this.trivialValue) { // Not same as trivial value, array no longer trivial
+ this.a = new byte[this.length];
+ if (this.trivialByte != 0) {
+ Arrays.fill(this.a, this.trivialByte);
+ }
+ } else {
+ return;
+ }
+ }
+ // Spigot end
int i1 = j << this.c | k << this.b | i;
int j1 = i1 >> 1;
int k1 = i1 & 1;
diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java
index 14a6245..ee179be 100644
--- a/src/main/java/net/minecraft/server/Packet51MapChunk.java
+++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java
@@ -139,16 +139,22 @@ public class Packet51MapChunk extends Packet {
for (l = 0; l < achunksection.length; ++l) {
if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) {
nibblearray = achunksection[l].j();
- System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
- j += nibblearray.a.length;
+ // Spigot start
+ // System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ // j += nibblearray.a.length;
+ j = nibblearray.copyToByteArray(abyte, j);
+ // Spigot end
}
}
for (l = 0; l < achunksection.length; ++l) {
if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) {
nibblearray = achunksection[l].k();
- System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
- j += nibblearray.a.length;
+ // Spigot start
+ // System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ // j += nibblearray.a.length;
+ j = nibblearray.copyToByteArray(abyte, j);
+ // Spigot end
}
}
@@ -156,8 +162,11 @@ public class Packet51MapChunk extends Packet {
for (l = 0; l < achunksection.length; ++l) {
if (achunksection[l] != null && (!flag || !achunksection[l].a()) && (i & 1 << l) != 0) {
nibblearray = achunksection[l].l();
- System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
- j += nibblearray.a.length;
+ // Spigot start
+ // System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ // j += nibblearray.a.length;
+ j = nibblearray.copyToByteArray(abyte, j);
+ // Spigot end
}
}
}
@@ -166,8 +175,11 @@ public class Packet51MapChunk extends Packet {
for (l = 0; l < achunksection.length; ++l) {
if (achunksection[l] != null && (!flag || !achunksection[l].a()) && achunksection[l].i() != null && (i & 1 << l) != 0) {
nibblearray = achunksection[l].i();
- System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
- j += nibblearray.a.length;
+ // Spigot start
+ //System.arraycopy(nibblearray.a, 0, abyte, j, nibblearray.a.length);
+ //j += nibblearray.a.length;
+ j = nibblearray.copyToByteArray(abyte, j);
+ // Spigot end
}
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
index c3b9113..e34e781 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java
@@ -174,7 +174,18 @@ public class CraftChunk implements Chunk {
}
if (cs[i].i() != null) { /* If we've got extended IDs */
- byte[] extids = cs[i].i().a;
+ // Spigot start
+ if (cs[i].i().isTrivialArray()) {
+ int tval = cs[i].i().getTrivialArrayValue();
+ if (tval != 0) {
+ tval = tval << 8;
+ for (int j = 0; j < 4096; j++) {
+ blockids[j << 1] |= tval;
+ }
+ }
+ } else {
+ byte[] extids = cs[i].i().getValueArray();
+ // Spigot end
for (int j = 0; j < 2048; j++) {
short b = (short) (extids[j] & 0xFF);
@@ -186,21 +197,42 @@ public class CraftChunk implements Chunk {
blockids[j<<1] |= (b & 0x0F) << 8;
blockids[(j<<1)+1] |= (b & 0xF0) << 4;
}
+ } // Spigot
}
sectionBlockIDs[i] = blockids;
/* Get block data nibbles */
- sectionBlockData[i] = new byte[2048];
- System.arraycopy(cs[i].j().a, 0, sectionBlockData[i], 0, 2048); // Should be getData
+ // Spigot start
+ if (cs[i].j().isTrivialArray() && (cs[i].j().getTrivialArrayValue() == 0)) {
+ sectionBlockData[i] = emptyData;
+ } else {
+ sectionBlockData[i] = new byte[2048];
+ cs[i].j().copyToByteArray(sectionBlockData[i], 0);
+ }
if (cs[i].l() == null) {
sectionSkyLights[i] = emptyData;
+ }
+ else if (cs[i].l().isTrivialArray()) {
+ if (cs[i].l().getTrivialArrayValue() == 0) {
+ sectionSkyLights[i] = emptyData;
+ } else if (cs[i].l().getTrivialArrayValue() == 15) {
+ sectionSkyLights[i] = emptySkyLight;
+ } else {
+ sectionSkyLights[i] = new byte[2048];
+ cs[i].l().copyToByteArray(sectionSkyLights[i], 0);
+ }
} else {
sectionSkyLights[i] = new byte[2048];
- System.arraycopy(cs[i].l().a, 0, sectionSkyLights[i], 0, 2048); // Should be getSkyLight
+ cs[i].l().copyToByteArray(sectionSkyLights[i], 0);
+ }
+ if (cs[i].k().isTrivialArray() && (cs[i].k().getTrivialArrayValue() == 0)) {
+ sectionEmitLights[i] = emptyData;
+ } else {
+ sectionEmitLights[i] = new byte[2048];
+ cs[i].k().copyToByteArray(sectionEmitLights[i], 0);
}
- sectionEmitLights[i] = new byte[2048];
- System.arraycopy(cs[i].k().a, 0, sectionEmitLights[i], 0, 2048); // Should be getBlockLight
+ // Spigot end
}
}
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,30 @@
From cb844f20abeb6fc8a6a9f6492307c7b5ed62b765 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Mon, 7 Jan 2013 09:57:30 +1100
Subject: [PATCH 07/13] Return LOHS to full operation.
---
src/main/java/org/bukkit/craftbukkit/util/LongHashSet.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/bukkit/craftbukkit/util/LongHashSet.java b/src/main/java/org/bukkit/craftbukkit/util/LongHashSet.java
index 3f1617d..a1250d3 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/LongHashSet.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/LongHashSet.java
@@ -81,11 +81,11 @@ public class LongHashSet {
}
public boolean add(int msw, int lsw) {
- flat.put(msw, lsw, PRESENT); // Spigot
return add(LongHash.toLong(msw, lsw));
}
- private boolean add(long value) { // Spigot
+ public boolean add(long value) {
+ flat.put(value, PRESENT); // Spigot
int hash = hash(value);
int index = (hash & 0x7FFFFFFF) % values.length;
int offset = 1;
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,46 @@
From ac06044ae6bcc052df0c71fe3c7fcacef84467bc Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Thu, 10 Jan 2013 12:33:37 +1100
Subject: [PATCH 08/13] Update timeout time to new default value.
---
src/main/java/org/bukkit/craftbukkit/CraftServer.java | 9 ++++++++-
src/main/resources/configurations/bukkit.yml | 2 +-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 67593d5..047378a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -226,7 +226,14 @@ public final class CraftServer implements Server {
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.RestartCommand("restart"));
commandMap.register("bukkit", new org.bukkit.craftbukkit.command.TicksPerSecondCommand("tps"));
- org.bukkit.craftbukkit.util.WatchdogThread.startThread(configuration.getInt("settings.timeout-time", 180), configuration.getBoolean("settings.restart-on-crash", false));
+ int timeout = configuration.getInt("settings.timeout-time", 300);
+ if (timeout == 180) {
+ timeout = 300;
+ getLogger().info("Migrating to new timeout time of 300");
+ configuration.set("settings.timeout-time", timeout);
+ saveConfig();
+ }
+ org.bukkit.craftbukkit.util.WatchdogThread.startThread(timeout, configuration.getBoolean("settings.restart-on-crash", false));
whitelistMessage = configuration.getString("settings.whitelist-message", whitelistMessage);
stopMessage = configuration.getString("settings.stop-message", stopMessage);
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index e192700..78134f9 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -26,7 +26,7 @@ settings:
deprecated-verbose: default
shutdown-message: Server closed
restart-script-location: start.bat
- timeout-time: 180
+ timeout-time: 300
restart-on-crash: false
filter-unsafe-ips: false
whitelist-message: You are not white-listed on this server!
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,69 @@
From 3118b5b6884ef2b1e21e87e00e14a984ef738776 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Sat, 12 Jan 2013 19:57:45 +1100
Subject: [PATCH 09/13] Per world view distance.
---
src/main/java/net/minecraft/server/WorldServer.java | 2 +-
src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 5 +++++
src/main/resources/configurations/bukkit.yml | 1 +
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
index 6de6b12..6e5434b 100644
--- a/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
// CraftBukkit end
this.server = minecraftserver;
this.tracker = new EntityTracker(this);
- this.manager = new PlayerChunkMap(this, minecraftserver.getPlayerList().o());
+ this.manager = new PlayerChunkMap(this, getWorld().viewDistance); // Spigot
if (this.entitiesById == null) {
this.entitiesById = new IntHashMap();
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3544aa3..856307f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -114,6 +114,9 @@ public class CraftWorld implements World {
treeGrowthModifier = configuration.getInt("world-settings." + name + ".tree-growth-modifier", treeGrowthModifier);
mushroomGrowthModifier = configuration.getInt("world-settings." + name + ".mushroom-growth-modifier", mushroomGrowthModifier);
+ viewDistance = Bukkit.getServer().getViewDistance();
+ viewDistance = configuration.getInt("world-settings." + name + ".view-distance", viewDistance);
+
server.getLogger().info("-------------- Spigot ----------------");
server.getLogger().info("-------- World Settings For [" + name + "] --------");
server.getLogger().info("Growth Per Chunk: " + growthPerTick);
@@ -129,6 +132,7 @@ public class CraftWorld implements World {
server.getLogger().info("Sugar Growth Modifier: " + sugarGrowthModifier);
server.getLogger().info("Tree Growth Modifier: " + treeGrowthModifier);
server.getLogger().info("Mushroom Growth Modifier: " + mushroomGrowthModifier);
+ server.getLogger().info("View distance: " + viewDistance);
server.getLogger().info("-------------------------------------------------");
// Spigot end
}
@@ -139,6 +143,7 @@ public class CraftWorld implements World {
public boolean randomLightingUpdates = false;
public int mobSpawnRange = 4;
public int aggregateTicks = 4;
+ public int viewDistance;
//Crop growth rates:
public int wheatGrowthModifier = 100;
public int cactusGrowthModifier = 100;
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index 78134f9..c41fac1 100644
--- a/src/main/resources/configurations/bukkit.yml
+++ b/src/main/resources/configurations/bukkit.yml
@@ -52,6 +52,7 @@ world-settings:
world:
growth-chunks-per-tick: 1000
world_nether:
+ view-distance: 5
growth-chunks-per-tick: 0
random-light-updates: true
water-creatures-per-chunk: 0
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,125 @@
From c496c06761b4bda4b215743b3cd33039aef8d5ac Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 11 Jan 2013 11:08:45 -0500
Subject: [PATCH 10/13] Fix various crop growth modifier formula issues
---
src/main/java/net/minecraft/server/BlockCactus.java | 2 +-
src/main/java/net/minecraft/server/BlockCrops.java | 2 +-
src/main/java/net/minecraft/server/BlockGrass.java | 3 ++-
src/main/java/net/minecraft/server/BlockMushroom.java | 2 +-
src/main/java/net/minecraft/server/BlockMycel.java | 3 ++-
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 +-
8 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java
index 1cb89fa..57bedfc 100644
--- a/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 {
if (l < 3) {
int i1 = world.getData(i, j, k);
- 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
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0);
} else {
diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java
index 4d3b448..815e050 100644
--- a/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 {
if (l < 7) {
float f = this.l(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 / world.getWorld().wheatGrowthModifier * ((25.0F / f) + 1))) == 0) { // Spigot
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, ++l); // CraftBukkit
}
}
diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java
index 0bc7882..bf117bc 100644
--- a/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 {
}
// CraftBukkit end
} else if (world.getLightLevel(i, j + 1, k) >= 9) {
- for (int l = 0; l < Math.max(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); ++l) { // Spigot
+ int numGrowth = Math.min(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); // Spigot
+ for (int l = 0; l < numGrowth; ++l) { // Spigot
int i1 = i + random.nextInt(3) - 1;
int j1 = j + random.nextInt(5) - 3;
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
index 8fa8302..f66ea7a 100644
--- a/src/main/java/net/minecraft/server/BlockMushroom.java
+++ b/src/main/java/net/minecraft/server/BlockMushroom.java
@@ -23,7 +23,7 @@ public class BlockMushroom extends BlockFlower {
}
public void b(World world, int i, int j, int k, Random random) {
- if (random.nextInt((int) (world.growthOdds * 100 / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot
+ if (random.nextInt((int) (world.growthOdds / world.getWorld().mushroomGrowthModifier * 25)) == 0) { // Spigot
byte b0 = 4;
int l = 5;
diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java
index afef94d..b7cfa69 100644
--- a/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 {
}
// CraftBukkit end
} else if (world.getLightLevel(i, j + 1, k) >= 9) {
- for (int l = 0; l < Math.max(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); ++l) { // Spigot
+ int numGrowth = Math.min(4, Math.max(20, (int) (4 * 100F / world.growthOdds))); // Spigot
+ for (int l = 0; l < numGrowth; ++l) { // Spigot
int i1 = i + random.nextInt(3) - 1;
int j1 = j + random.nextInt(5) - 3;
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
index 66ad508..c5a8d8a 100644
--- a/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 {
if (l < 3) {
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 / world.getWorld().sugarGrowthModifier * 15) + 0.5F, 15)) { // Spigot
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j + 1, k, this.id, 0); // CraftBukkit
world.setData(i, j, k, 0);
} 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
index dfaf45d..82be68e 100644
--- a/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 {
if (world.getLightLevel(i, j + 1, k) >= 9) {
float f = this.n(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 / (this.id == Block.PUMPKIN_STEM.id ? world.getWorld().pumpkinGrowthModifier : world.getWorld().melonGrowthModifier) * ((25.0F / f) + 1))) == 0) { // Spigot
int l = world.getData(i, j, k);
if (l < 7) {
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,29 @@
From 2600250e5c8ad99a131ef58f3180fc5c288882ed Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 11 Jan 2013 14:54:51 -0500
Subject: [PATCH 11/13] Fix mob-spawn-radius setting so that its actually
used...
---
src/main/java/net/minecraft/server/SpawnerCreature.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 576cbd3..1e4a1a5 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -37,7 +37,10 @@ public final class SpawnerCreature {
int j;
// Spigot start - limit radius to spawn distance (chunks aren't loaded)
if (spawnRadius == 0) {
- spawnRadius = (byte) worldserver.getServer().getViewDistance();
+ spawnRadius = (byte) worldserver.getWorld().mobSpawnRange;
+ if (spawnRadius > (byte) worldserver.getServer().getViewDistance()) {
+ spawnRadius = (byte) worldserver.getServer().getViewDistance();
+ }
if (spawnRadius > 8) {
spawnRadius = 8;
}
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,140 @@
From 7fd81ee8ece682794b2cc214b9be16506514a1e6 Mon Sep 17 00:00:00 2001
From: Agaricus <agaricusb@yahoo.com>
Date: Sun, 13 Jan 2013 03:41:38 -0800
Subject: [PATCH 12/13] Add OldChunkLoader from mc-dev for diff visibility
---
.../java/net/minecraft/server/OldChunkLoader.java | 120 +++++++++++++++++++++
1 file changed, 120 insertions(+)
create mode 100644 src/main/java/net/minecraft/server/OldChunkLoader.java
diff --git a/src/main/java/net/minecraft/server/OldChunkLoader.java b/src/main/java/net/minecraft/server/OldChunkLoader.java
new file mode 100644
index 0000000..65b0b70
--- /dev/null
+++ b/src/main/java/net/minecraft/server/OldChunkLoader.java
@@ -0,0 +1,120 @@
+package net.minecraft.server;
+
+public class OldChunkLoader {
+
+ public static OldChunk a(NBTTagCompound nbttagcompound) {
+ int i = nbttagcompound.getInt("xPos");
+ int j = nbttagcompound.getInt("zPos");
+ OldChunk oldchunk = new OldChunk(i, j);
+
+ oldchunk.g = nbttagcompound.getByteArray("Blocks");
+ oldchunk.f = new OldNibbleArray(nbttagcompound.getByteArray("Data"), 7);
+ oldchunk.e = new OldNibbleArray(nbttagcompound.getByteArray("SkyLight"), 7);
+ oldchunk.d = new OldNibbleArray(nbttagcompound.getByteArray("BlockLight"), 7);
+ oldchunk.c = nbttagcompound.getByteArray("HeightMap");
+ oldchunk.b = nbttagcompound.getBoolean("TerrainPopulated");
+ oldchunk.h = nbttagcompound.getList("Entities");
+ oldchunk.i = nbttagcompound.getList("TileEntities");
+ oldchunk.j = nbttagcompound.getList("TileTicks");
+
+ try {
+ oldchunk.a = nbttagcompound.getLong("LastUpdate");
+ } catch (ClassCastException classcastexception) {
+ oldchunk.a = (long) nbttagcompound.getInt("LastUpdate");
+ }
+
+ return oldchunk;
+ }
+
+ public static void a(OldChunk oldchunk, NBTTagCompound nbttagcompound, WorldChunkManager worldchunkmanager) {
+ nbttagcompound.setInt("xPos", oldchunk.k);
+ nbttagcompound.setInt("zPos", oldchunk.l);
+ nbttagcompound.setLong("LastUpdate", oldchunk.a);
+ int[] aint = new int[oldchunk.c.length];
+
+ for (int i = 0; i < oldchunk.c.length; ++i) {
+ aint[i] = oldchunk.c[i];
+ }
+
+ nbttagcompound.setIntArray("HeightMap", aint);
+ nbttagcompound.setBoolean("TerrainPopulated", oldchunk.b);
+ NBTTagList nbttaglist = new NBTTagList("Sections");
+
+ int j;
+
+ for (int k = 0; k < 8; ++k) {
+ boolean flag = true;
+
+ for (j = 0; j < 16 && flag; ++j) {
+ int l = 0;
+
+ while (l < 16 && flag) {
+ int i1 = 0;
+
+ while (true) {
+ if (i1 < 16) {
+ int j1 = j << 11 | i1 << 7 | l + (k << 4);
+ byte b0 = oldchunk.g[j1];
+
+ if (b0 == 0) {
+ ++i1;
+ continue;
+ }
+
+ flag = false;
+ }
+
+ ++l;
+ break;
+ }
+ }
+ }
+
+ if (!flag) {
+ byte[] abyte = new byte[4096];
+ NibbleArray nibblearray = new NibbleArray(abyte.length, 4);
+ NibbleArray nibblearray1 = new NibbleArray(abyte.length, 4);
+ NibbleArray nibblearray2 = new NibbleArray(abyte.length, 4);
+
+ for (int k1 = 0; k1 < 16; ++k1) {
+ for (int l1 = 0; l1 < 16; ++l1) {
+ for (int i2 = 0; i2 < 16; ++i2) {
+ int j2 = k1 << 11 | i2 << 7 | l1 + (k << 4);
+ byte b1 = oldchunk.g[j2];
+
+ abyte[l1 << 8 | i2 << 4 | k1] = (byte) (b1 & 255);
+ nibblearray.a(k1, l1, i2, oldchunk.f.a(k1, l1 + (k << 4), i2));
+ nibblearray1.a(k1, l1, i2, oldchunk.e.a(k1, l1 + (k << 4), i2));
+ nibblearray2.a(k1, l1, i2, oldchunk.d.a(k1, l1 + (k << 4), i2));
+ }
+ }
+ }
+
+ NBTTagCompound nbttagcompound1 = new NBTTagCompound();
+
+ nbttagcompound1.setByte("Y", (byte) (k & 255));
+ nbttagcompound1.setByteArray("Blocks", abyte);
+ nbttagcompound1.setByteArray("Data", nibblearray.a);
+ nbttagcompound1.setByteArray("SkyLight", nibblearray1.a);
+ nbttagcompound1.setByteArray("BlockLight", nibblearray2.a);
+ nbttaglist.add(nbttagcompound1);
+ }
+ }
+
+ nbttagcompound.set("Sections", nbttaglist);
+ byte[] abyte1 = new byte[256];
+
+ for (int k2 = 0; k2 < 16; ++k2) {
+ for (j = 0; j < 16; ++j) {
+ abyte1[j << 4 | k2] = (byte) (worldchunkmanager.getBiome(oldchunk.k << 4 | k2, oldchunk.l << 4 | j).id & 255);
+ }
+ }
+
+ nbttagcompound.setByteArray("Biomes", abyte1);
+ nbttagcompound.set("Entities", oldchunk.h);
+ nbttagcompound.set("TileEntities", oldchunk.i);
+ if (oldchunk.j != null) {
+ nbttagcompound.set("TileTicks", oldchunk.j);
+ }
+ }
+}
\ No newline at end of file
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,31 @@
From 6d3d278b13d8909db71e87a24af672d0227a0c4c Mon Sep 17 00:00:00 2001
From: Agaricus <agaricusb@yahoo.com>
Date: Sun, 13 Jan 2013 03:49:07 -0800
Subject: [PATCH 13/13] Fix mcRegion-to-Anvil conversion
---
src/main/java/net/minecraft/server/OldChunkLoader.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/main/java/net/minecraft/server/OldChunkLoader.java b/src/main/java/net/minecraft/server/OldChunkLoader.java
index 65b0b70..0b3bd0d 100644
--- a/src/main/java/net/minecraft/server/OldChunkLoader.java
+++ b/src/main/java/net/minecraft/server/OldChunkLoader.java
@@ -94,9 +94,11 @@ public class OldChunkLoader {
nbttagcompound1.setByte("Y", (byte) (k & 255));
nbttagcompound1.setByteArray("Blocks", abyte);
- nbttagcompound1.setByteArray("Data", nibblearray.a);
- nbttagcompound1.setByteArray("SkyLight", nibblearray1.a);
- nbttagcompound1.setByteArray("BlockLight", nibblearray2.a);
+ // Spigot start - a -> getValueArray() accessor
+ nbttagcompound1.setByteArray("Data", nibblearray.getValueArray());
+ nbttagcompound1.setByteArray("SkyLight", nibblearray1.getValueArray());
+ nbttagcompound1.setByteArray("BlockLight", nibblearray2.getValueArray());
+ // Spigot end
nbttaglist.add(nbttagcompound1);
}
}
--
1.8.1-rc2

Datei anzeigen

@ -0,0 +1,73 @@
From 65bee98f2dc2243a21f93902ddc95b371e5f9baa Mon Sep 17 00:00:00 2001
From: md_5 <md_5@bigpond.com>
Date: Tue, 15 Jan 2013 11:48:54 +1100
Subject: [PATCH 14/14] Update pom with Spigot specific info.
---
pom.xml | 34 ++++------------------------------
1 file changed, 4 insertions(+), 30 deletions(-)
diff --git a/pom.xml b/pom.xml
index 4540fe2..ea5435d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.bukkit</groupId>
- <artifactId>craftbukkit</artifactId>
+ <groupId>org.spigotmc</groupId>
+ <artifactId>spigot</artifactId>
<packaging>jar</packaging>
<version>1.4.6-R0.4-SNAPSHOT</version>
- <name>CraftBukkit</name>
- <url>http://www.bukkit.org</url>
+ <name>Spigot</name>
+ <url>http://www.spigotmc.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -16,25 +16,6 @@
<minecraft_version>1_4_6</minecraft_version>
</properties>
- <scm>
- <connection>scm:git:git://github.com/Bukkit/CraftBukkit.git</connection>
- <developerConnection>scm:git:ssh://git@github.com/Bukkit/CraftBukkit.git</developerConnection>
- <url>https://github.com/Bukkit/CraftBukkit</url>
- </scm>
-
- <distributionManagement>
- <repository>
- <id>repobo-rel</id>
- <name>repo.bukkit.org Releases</name>
- <url>http://repo.bukkit.org/content/repositories/releases/</url>
- </repository>
- <snapshotRepository>
- <id>repobo-snap</id>
- <name>repo.bukkit.org Snapshots</name>
- <url>http://repo.bukkit.org/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-
<repositories>
<repository>
<id>repobo-snap</id>
@@ -42,13 +23,6 @@
</repository>
</repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>bukkit-plugins</id>
- <url>http://repo.bukkit.org/content/groups/public</url>
- </pluginRepository>
- </pluginRepositories>
-
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
--
1.8.1-rc2

4
README.md Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
Spigot
===========
High performance Minecraft server implementation

32
applyPatches.sh Ausführbare Datei
Datei anzeigen

@ -0,0 +1,32 @@
#!/bin/bash
basedir=$(dirname $(readlink -f $0))
echo "Rebuilding Forked projects.... "
function applyPatch {
what=$1
target=$2
cd $basedir
if [ ! -d "$basedir/$target" ]; then
git clone $1 $target
fi
cd "$basedir/$target"
echo "Resetting $target to $what..."
git remote rm upstream 2>/dev/null
git remote add upstream ../$what
git checkout master
git fetch upstream
git reset --hard upstream/master
echo " Applying patches to $target..."
git am --3way $basedir/${what}-Patches/*.patch
if [ "$?" != "0" ]; then
echo " Something did not apply cleanly to $target."
echo " Please review above details and finish the apply then"
echo " save the changes with rebuildPatches.sh"
else
echo " Patches applied cleanly to $target"
fi
}
applyPatch Bukkit Spigot-API
applyPatch CraftBukkit Spigot

23
pom.xml Normale Datei
Datei anzeigen

@ -0,0 +1,23 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-parent</artifactId>
<version>dev-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spigot-Parent</name>
<description>Parent project for all Spigot modules.</description>
<url>https://github.com/EcoCityCraft/Spigot</url>
<modules>
<module>Spigot</module>
<module>Spigot-API</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

17
rebuildPatches.sh Ausführbare Datei
Datei anzeigen

@ -0,0 +1,17 @@
#!/bin/bash
basedir=$(dirname $(readlink -f $0))
echo "Rebuilding patch files from current fork state..."
function savePatches {
what=$1
target=$2
cd $basedir/$target/
git format-patch -o $basedir/${what}-Patches/ upstream/master
cd $basedir
git add $basedir/${what}-Patches
echo " Patches saved for $what to $what-Patches/"
}
savePatches Bukkit Spigot-API
savePatches CraftBukkit Spigot

10
upstreamMerge.sh Ausführbare Datei
Datei anzeigen

@ -0,0 +1,10 @@
#!/bin/bash
basedir=$(dirname $(readlink -f $0))
function update {
cd $basedir/$1
git fetch && git reset --hard origin/master
cd ../
git add $1
}
update Bukkit
update CraftBukkit