Update PaperSpigot to 1.8.4

This commit is contained in:
Zach Brown 2015-05-18 18:41:57 -05:00
parent 80d0e8ffa7
commit b7ec28b5d2
5 changed files with 78 additions and 23 deletions

View File

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <artifactId>spigot-api</artifactId> - <artifactId>spigot-api</artifactId>
+ <groupId>org.github.paperspigot</groupId> + <groupId>org.github.paperspigot</groupId>
+ <artifactId>paperspigot-api</artifactId> + <artifactId>paperspigot-api</artifactId>
<version>1.8.3-R0.1-SNAPSHOT</version> <version>1.8.4-R0.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
- <name>Spigot-API</name> - <name>Spigot-API</name>

View File

@ -8,8 +8,8 @@ diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
@@ -0,0 +0,0 @@ import java.util.Set; @@ -0,0 +0,0 @@ import org.bukkit.generator.ChunkGenerator;
import java.util.UUID; import java.util.*;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
+// PaperSpigot start +// PaperSpigot start
@ -19,27 +19,27 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+// PaperSpigot end +// PaperSpigot end
+ +
// CraftBukkit start // CraftBukkit start
import com.google.common.collect.Maps; // CraftBukkit end
import java.util.Map;
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ()); blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ());
} }
+ // PaperSpigot start - Configurable async light updates + // PaperSpigot start - configurable async light updates
if (!this.isValidLocation(blockposition)) { if (!this.isValidLocation(blockposition)) {
return enumskyblock.c; return enumskyblock.c;
- } else if (!this.isLoaded(blockposition)) { - } else if (!this.isLoaded(blockposition)) {
+ } + }
+ +
+ Chunk chunk = this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + Chunk chunk = this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ if (chunk == null) { + if (chunk != null) {
return enumskyblock.c; return enumskyblock.c;
} else { } else {
- Chunk chunk = this.getChunkAtWorldCoords(blockposition); - Chunk chunk = this.getChunkAtWorldCoords(blockposition);
- -
+ // PaperSpigot end
return chunk.getBrightness(enumskyblock, blockposition); return chunk.getBrightness(enumskyblock, blockposition);
} }
+ // PaperSpigot end
} }
public void a(EnumSkyBlock enumskyblock, BlockPosition blockposition, int i) { public void a(EnumSkyBlock enumskyblock, BlockPosition blockposition, int i) {
@ -59,8 +59,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private int a(BlockPosition blockposition, EnumSkyBlock enumskyblock) { private int a(BlockPosition blockposition, EnumSkyBlock enumskyblock) {
- if (enumskyblock == EnumSkyBlock.SKY && this.i(blockposition)) { - if (enumskyblock == EnumSkyBlock.SKY && this.i(blockposition)) {
+ Chunk chunk = this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); // PaperSpigot - Configurable async light updates + // PaperSpigot start - Configurable async light updates
+ Chunk chunk = this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ if (chunk == null || (enumskyblock == EnumSkyBlock.SKY && chunk.d(blockposition))) { + if (chunk == null || (enumskyblock == EnumSkyBlock.SKY && chunk.d(blockposition))) {
+ // PaperSpigot end
return 15; return 15;
} else { } else {
- Block block = this.getType(blockposition).getBlock(); - Block block = this.getType(blockposition).getBlock();
@ -139,7 +141,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public boolean c(final EnumSkyBlock enumskyblock, final BlockPosition blockposition) { + public boolean c(final EnumSkyBlock enumskyblock, final BlockPosition blockposition) {
+ Callable<Boolean> callable = new Callable<Boolean>() { + Callable<Boolean> callable = new Callable<Boolean>() {
+ @Override + @Override
+ public Boolean call() { + public Boolean call() throws Exception {
+ // CraftBukkit start - Use neighbor cache instead of looking up + // CraftBukkit start - Use neighbor cache instead of looking up
+ Chunk chunk = World.this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + Chunk chunk = World.this.getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ if (chunk == null || !chunk.areNeighborsLoaded(1) /*!this.areChunksLoaded(blockposition, 17, false)*/) { + if (chunk == null || !chunk.areNeighborsLoaded(1) /*!this.areChunksLoaded(blockposition, 17, false)*/) {

View File

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ <groupId>org.github.paperspigot</groupId> + <groupId>org.github.paperspigot</groupId>
+ <artifactId>paperspigot</artifactId> + <artifactId>paperspigot</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.8.3-R0.1-SNAPSHOT</version> <version>1.8.4-R0.1-SNAPSHOT</version>
- <name>Spigot</name> - <name>Spigot</name>
- <url>http://www.spigotmc.org</url> - <url>http://www.spigotmc.org</url>
+ <name>PaperSpigot</name> + <name>PaperSpigot</name>

View File

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sat, 7 Mar 2015 22:52:21 -0600 Date: Mon, 18 May 2015 17:52:45 -0500
Subject: [PATCH] Player affects spawning API Subject: [PATCH] Player affects spawning API
@ -50,8 +50,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) { while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next(); EntityHuman entityhuman = (EntityHuman) iterator.next();
- if (!entityhuman.v()) { - if (!entityhuman.isSpectator()) {
+ if (!entityhuman.v() || !entityhuman.affectsSpawning) { // PaperSpigot + if (!entityhuman.isSpectator() || !entityhuman.affectsSpawning) { // PaperSpigot) {
int l = MathHelper.floor(entityhuman.locX / 16.0D); int l = MathHelper.floor(entityhuman.locX / 16.0D);
j = MathHelper.floor(entityhuman.locZ / 16.0D); j = MathHelper.floor(entityhuman.locZ / 16.0D);
@ -68,11 +68,54 @@ diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { @@ -0,0 +0,0 @@ package net.minecraft.server;
return k >= -short0 && k <= short0 && l >= -short0 && l <= short0 && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' import com.google.common.base.Predicate;
} import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.Callable;
-
-// CraftBukkit start
import com.google.common.collect.Maps;
-import java.util.Map;
-
import org.bukkit.Bukkit;
import org.bukkit.block.BlockState;
-import org.bukkit.craftbukkit.util.CraftMagicNumbers;
-import org.bukkit.craftbukkit.util.LongHashSet;
-import org.bukkit.craftbukkit.SpigotTimings; // Spigot
-import org.bukkit.generator.ChunkGenerator;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.craftbukkit.SpigotTimings;
import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.util.CraftMagicNumbers;
import org.bukkit.event.block.BlockCanBuildEvent;
import org.bukkit.event.block.BlockPhysicsEvent;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
-import org.bukkit.event.weather.WeatherChangeEvent;
-import org.bukkit.event.weather.ThunderChangeEvent;
+import org.bukkit.generator.ChunkGenerator;
+ +
+import java.util.*;
+import java.util.concurrent.Callable;
+
+// CraftBukkit start
// CraftBukkit end
public abstract class World implements IBlockAccess {
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
return false;
}
+ // PaperSpigot start - Modified methods for affects spawning + // PaperSpigot start - Modified methods for affects spawning
+ public EntityHuman findNearbyPlayerWhoAffectsSpawning(Entity entity, double d0) { + public EntityHuman findNearbyPlayerWhoAffectsSpawning(Entity entity, double d0) {
+ return this.findNearbyPlayerWhoAffectsSpawning(entity.locX, entity.locY, entity.locZ, d0); + return this.findNearbyPlayerWhoAffectsSpawning(entity.locX, entity.locY, entity.locZ, d0);
@ -118,11 +161,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ return false; + return false;
+ } + }
} + // PaperSpigot end
+
public EntityHuman a(String s) {
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ import io.netty.buffer.Unpooled;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
+import java.lang.Override;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.ArrayList;
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
packet.components = components; packet.components = components;
getHandle().playerConnection.sendPacket(packet); getHandle().playerConnection.sendPacket(packet);

View File

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com> From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sat, 7 Mar 2015 19:44:29 -0600 Date: Mon, 18 May 2015 17:32:46 -0500
Subject: [PATCH] mc-dev imports Subject: [PATCH] mc-dev imports
@ -918,5 +918,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+} +}
-- --
1.9.4.msysgit.2