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

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sat, 7 Mar 2015 22:52:21 -0600
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Mon, 18 May 2015 17:52:45 -0500
Subject: [PATCH] Player affects spawning API
@@ -50,8 +50,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
- if (!entityhuman.v()) {
+ if (!entityhuman.v() || !entityhuman.affectsSpawning) { // PaperSpigot
- if (!entityhuman.isSpectator()) {
+ if (!entityhuman.isSpectator() || !entityhuman.affectsSpawning) { // PaperSpigot) {
int l = MathHelper.floor(entityhuman.locX / 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
--- a/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
+ public EntityHuman findNearbyPlayerWhoAffectsSpawning(Entity entity, double d0) {
+ return this.findNearbyPlayerWhoAffectsSpawning(entity.locX, entity.locY, entity.locZ, d0);
@@ -118,11 +161,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ 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
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/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 {
packet.components = components;
getHandle().playerConnection.sendPacket(packet);