Update SB's affectsSpawning API to use filters

Closes GH-169
This commit is contained in:
Jedediah Smith 2016-04-13 15:57:34 -05:00 committed by Zach Brown
parent 4ee5d3eb31
commit 15cdfc7472
23 changed files with 238 additions and 217 deletions

View file

@ -1,23 +1,43 @@
From eb8ba651ad60e2edc9ef0d68d7204434351acc9b Mon Sep 17 00:00:00 2001
From 7db15879def797030fee0b06144841db99e44c98 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Tue, 1 Mar 2016 14:47:52 -0600
Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 8e143f7..b6aa51e 100644
index 11388ab..767c384 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -64,6 +64,7 @@ public abstract class EntityHuman extends EntityLiving {
private ItemStack bT = null;
@@ -1,6 +1,7 @@
package net.minecraft.server;
import com.google.common.base.Charsets;
+import com.google.common.base.Predicate; // Paper
import com.google.common.collect.Lists;
import com.mojang.authlib.GameProfile;
import java.util.Arrays;
@@ -65,6 +66,19 @@ public abstract class EntityHuman extends EntityLiving {
private final ItemCooldown bU = this.l();
public EntityFishingHook hookedFish;
+ public boolean affectsSpawning = true; // Paper
+ // Paper start - affectsSpawning API
+ public boolean affectsSpawning = true;
+
+ public static Predicate<EntityHuman> affectsSpawningFilter() {
+ return new Predicate<EntityHuman>() {
+ @Override
+ public boolean apply(EntityHuman entityHuman) {
+ return entityHuman.affectsSpawning;
+ }
+ };
+ }
+ // Paper end
+
// CraftBukkit start
public boolean fauxSleeping;
public String spawnWorld = "";
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index fdda1ae..6ad5279 100644
index fdda1ae..d598f94 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -593,7 +593,7 @@ public abstract class EntityInsentient extends EntityLiving {
@ -25,12 +45,38 @@ index fdda1ae..6ad5279 100644
this.ticksFarFromPlayer = 0;
} else {
- EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D);
+ EntityHuman entityhuman = this.world.findNearbyPlayerWhoAffectsSpawning(this, -1.0D); // Paper - Affects Spawning API
+ EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
if (entityhuman != null) {
double d0 = entityhuman.locX - this.locX;
diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java
index 28db04e..e19a19a 100644
--- a/src/main/java/net/minecraft/server/EntitySilverfish.java
+++ b/src/main/java/net/minecraft/server/EntitySilverfish.java
@@ -86,7 +86,7 @@ public class EntitySilverfish extends EntityMonster {
public boolean cF() {
if (super.cF()) {
- EntityHuman entityhuman = this.world.b(this, 5.0D);
+ EntityHuman entityhuman = this.world.findNearbyPlayerNotInCreativeMode(this, 5.0D, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
return entityhuman == null;
} else {
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 7a5b053..28fed1f 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -196,7 +196,7 @@ public class EntityZombie extends EntityMonster {
if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
- if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
+ if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D, EntityHuman.affectsSpawningFilter()) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { // Paper - affectsSpawning filter
this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
entityzombie.setGoalTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true);
entityzombie.prepare(this.world.D(new BlockPosition(entityzombie)), (GroupDataEntity) null);
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index a7903a2..2eee845 100644
index a7903a2..f53e52c 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -32,7 +32,7 @@ public abstract class MobSpawnerAbstract {
@ -38,113 +84,124 @@ index a7903a2..2eee845 100644
BlockPosition blockposition = this.b();
- return this.a().isPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange);
+ return this.a().isPlayerNearbyWhoAffectsSpawning((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange); // Paper - Affects spawning API
+ return this.a().isPlayerNearby((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, (double) this.requiredPlayerRange, EntityHuman.affectsSpawningFilter()); // Paper - affectsSpawning filter
}
public void c() {
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 9e19dfd..b724586 100644
index 9e19dfd..588377c 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -50,7 +50,7 @@ public final class SpawnerCreature {
@@ -50,6 +50,8 @@ public final class SpawnerCreature {
while (iterator.hasNext()) {
EntityHuman entityhuman = (EntityHuman) iterator.next();
- if (!entityhuman.isSpectator()) {
+ if (!entityhuman.isSpectator() || !entityhuman.affectsSpawning) {
+ if (!entityhuman.affectsSpawning) continue; // Paper - affectsSpawning check
+
if (!entityhuman.isSpectator()) {
int l = MathHelper.floor(entityhuman.locX / 16.0D);
j = MathHelper.floor(entityhuman.locZ / 16.0D);
@@ -160,7 +160,7 @@ public final class SpawnerCreature {
@@ -160,7 +162,7 @@ public final class SpawnerCreature {
float f = (float) j3 + 0.5F;
float f1 = (float) l3 + 0.5F;
- if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) {
+ if (!worldserver.isPlayerNearbyWhoAffectsSpawning((double) f, (double) k3, (double) f1, 24.0D) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) {
+ if (!worldserver.isPlayerNearby((double) f, (double) k3, (double) f1, 24.0D, EntityHuman.affectsSpawningFilter()) && blockposition.distanceSquared((double) f, (double) k3, (double) f1) >= 576.0D) { // Paper - affectsSpawning filter
if (biomebase_biomemeta == null) {
biomebase_biomemeta = worldserver.a(enumcreaturetype, (BlockPosition) blockposition_mutableblockposition);
if (biomebase_biomemeta == null) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 5524e43..0460dc5 100644
index 8b30dc4..60d658f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -2689,6 +2689,53 @@ public abstract class World implements IBlockAccess {
return i;
@@ -3,6 +3,7 @@
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
+import com.google.common.base.Predicates; // Paper
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Calendar;
@@ -2690,14 +2691,29 @@ public abstract class World implements IBlockAccess {
}
+ // Paper start - Modified methods for affects spawning
+ public EntityHuman findNearbyPlayerWhoAffectsSpawning(Entity entity, double d0) {
+ return this.findNearbyPlayerWhoAffectsSpawning(entity.locX, entity.locY, entity.locZ, d0);
+ }
+
+ public EntityHuman findNearbyPlayerWhoAffectsSpawning(double d0, double d1, double d2, double d3) {
+ double d4 = -1.0D;
+ EntityHuman entityhuman = null;
+
+ for (int i = 0; i < this.players.size(); ++i) {
+ EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
+ // CraftBukkit start - Fixed an NPE
+ if (entityhuman1 == null || entityhuman1.dead || !entityhuman1.affectsSpawning) {
+ continue;
+ }
+ // CraftBukkit end
+
+ if (IEntitySelector.d.apply(entityhuman1)) {
+ double d5 = entityhuman1.e(d0, d1, d2);
+
+ if ((d3 < 0.0D || d5 < d3 * d3) && (d4 == -1.0D || d5 < d4)) {
+ d4 = d5;
+ entityhuman = entityhuman1;
+ }
+ }
+ }
+
+ return entityhuman;
+ }
+
+ public boolean isPlayerNearbyWhoAffectsSpawning(double d0, double d1, double d2, double d3) {
+ for (int i = 0; i < this.players.size(); ++i) {
+ EntityHuman entityhuman = (EntityHuman) this.players.get(i);
+
+ if (IEntitySelector.d.apply(entityhuman)) {
+ double d4 = entityhuman.e(d0, d1, d2);
+
+ if (d3 < 0.0D || d4 < d3 * d3 && entityhuman.affectsSpawning) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+ // Paper end
+
public EntityHuman findNearbyPlayer(Entity entity, double d0) {
return this.a(entity.locX, entity.locY, entity.locZ, d0, false);
- return this.a(entity.locX, entity.locY, entity.locZ, d0, false);
+ // Paper start - Add filter parameter
+ return findNearbyPlayer(entity, d0, Predicates.<EntityHuman>alwaysTrue());
+ }
+
+ public EntityHuman findNearbyPlayer(Entity entity, double d0, Predicate<EntityHuman> filter) {
+ return this.findNearbyPlayer(entity.locX, entity.locY, entity.locZ, d0, false, filter);
}
public EntityHuman b(Entity entity, double d0) {
- return this.a(entity.locX, entity.locY, entity.locZ, d0, true);
+ return this.findNearbyPlayerNotInCreativeMode(entity, d0, Predicates.<EntityHuman>alwaysTrue());
+ }
+
+ public EntityHuman findNearbyPlayerNotInCreativeMode(Entity entity, double d0, Predicate<EntityHuman> filter) {
+ return this.findNearbyPlayer(entity.locX, entity.locY, entity.locZ, d0, true, filter);
}
public EntityHuman a(double d0, double d1, double d2, double d3, boolean flag) {
+ return findNearbyPlayer(d0, d1, d2, d3, flag, Predicates.<EntityHuman>alwaysTrue());
+ }
+
+ public EntityHuman findNearbyPlayer(double d0, double d1, double d2, double d3, boolean flag, Predicate<EntityHuman> filter) {
+ // FYI the flag means "exclude creative mode players"
+ // Paper end
double d4 = -1.0D;
EntityHuman entityhuman = null;
@@ -2709,6 +2725,8 @@ public abstract class World implements IBlockAccess {
}
// CraftBukkit end
+ if (!filter.apply(entityhuman1)) continue; // Paper - check filter
+
if ((IEntitySelector.d.apply(entityhuman1) || !flag) && (IEntitySelector.e.apply(entityhuman1) || flag)) {
double d5 = entityhuman1.e(d0, d1, d2);
@@ -2723,9 +2741,17 @@ public abstract class World implements IBlockAccess {
}
public boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
+ // Paper start - add filter parameter
+ return isPlayerNearby(d0, d1, d2, d3, Predicates.<EntityHuman>alwaysTrue());
+ }
+
+ public boolean isPlayerNearby(double d0, double d1, double d2, double d3, Predicate<EntityHuman> filter) {
+ // Paper end
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman = (EntityHuman) this.players.get(i);
+ if (!filter.apply(entityhuman)) continue; // Paper - check filter
+
if (IEntitySelector.e.apply(entityhuman)) {
double d4 = entityhuman.e(d0, d1, d2);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index dfa5962..3203458 100644
index 888823c..3f1c9bf 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1405,6 +1405,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -1405,6 +1405,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
+ // Paper start
+ @Override
+ public boolean getAffectsSpawning() {
+ return getHandle().affectsSpawning;
+ public void setAffectsSpawning(boolean affects) {
+ this.getHandle().affectsSpawning = affects;
+ }
+
+ @Override
+ public void setAffectsSpawning(boolean affects) {
+ getHandle().affectsSpawning = affects;
+ public boolean getAffectsSpawning() {
+ return this.getHandle().affectsSpawning;
+ }
+ // Paper end
+
// Spigot start
private final Player.Spigot spigot = new Player.Spigot()
{
--
2.7.4
2.8.0

View file

@ -1,4 +1,4 @@
From 25b0aac196ce95c319b3886df553f581a0c05ab0 Mon Sep 17 00:00:00 2001
From 72f0c84a2ce35945f2df3a37d9a7304a50e710da Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 23:45:08 -0600
Subject: [PATCH] Entity Origin API
@ -81,10 +81,10 @@ index 564ea37..1113b1c 100644
public EntityLiving getSource() {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 72d0f5c..3f4bc0f 100644
index 60d658f..0e9cf7a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -948,6 +948,12 @@ public abstract class World implements IBlockAccess {
@@ -949,6 +949,12 @@ public abstract class World implements IBlockAccess {
int j = MathHelper.floor(entity.locZ / 16.0D);
boolean flag = entity.attachedToPlayer;

View file

@ -1,4 +1,4 @@
From c38899ff17304f5a6e10ac12f100d4b05efd4b02 Mon Sep 17 00:00:00 2001
From f91f93ffdd35c348ea7d926e70c876ae4dcf6b20 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 Mar 2016 23:52:34 -0600
Subject: [PATCH] Prevent tile entity and entity crashes
@ -23,10 +23,10 @@ index 4193f20..f579d28 100644
public String a() throws Exception {
int i = Block.getId(TileEntity.this.world.getType(TileEntity.this.position).getBlock());
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 87236e8..f8746b3 100644
index 0e9cf7a..3b84e27 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1435,10 +1435,12 @@ public abstract class World implements IBlockAccess {
@@ -1436,10 +1436,12 @@ public abstract class World implements IBlockAccess {
entity.tickTimer.stopTiming(); // Paper
} catch (Throwable throwable1) {
entity.tickTimer.stopTiming();
@ -43,7 +43,7 @@ index 87236e8..f8746b3 100644
}
}
@@ -1500,10 +1502,13 @@ public abstract class World implements IBlockAccess {
@@ -1501,10 +1503,13 @@ public abstract class World implements IBlockAccess {
((ITickable) tileentity).c();
this.methodProfiler.b();
} catch (Throwable throwable2) {
@ -62,5 +62,5 @@ index 87236e8..f8746b3 100644
// Spigot start
finally {
--
2.7.4
2.8.0

View file

@ -1,4 +1,4 @@
From 1058af235335e48fa69b95461b0127b3a57148bb Mon Sep 17 00:00:00 2001
From 3918396fc7f5413c3b04eb4023c329fd638f648a Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 00:52:31 -0600
Subject: [PATCH] Lighting Queue
@ -207,10 +207,10 @@ index 3aac51d..24aa5b5 100644
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f8746b3..a6d4097 100644
index 3b84e27..1793995 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -378,7 +378,17 @@ public abstract class World implements IBlockAccess {
@@ -379,7 +379,17 @@ public abstract class World implements IBlockAccess {
} else {
if (iblockdata.c() != iblockdata1.c() || iblockdata.d() != iblockdata1.d()) {
this.methodProfiler.a("checkLight");
@ -230,5 +230,5 @@ index f8746b3..a6d4097 100644
}
--
2.7.4
2.8.0

View file

@ -1,4 +1,4 @@
From b389a0730f5ef11a6069b5b4e559353eb224f82b Mon Sep 17 00:00:00 2001
From e4f94a4f98e5082dc5522095541902f568b82c06 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 11:59:48 -0600
Subject: [PATCH] Optimize explosions
@ -136,10 +136,10 @@ index 24aa5b5..ee9491f 100644
// this.i[i][this.ticks % 100] = System.nanoTime() - j; // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a6d4097..c0f0b83 100644
index 1793995..a9cda67 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -15,6 +15,7 @@ import java.util.concurrent.Callable;
@@ -16,6 +16,7 @@ import java.util.concurrent.Callable;
// CraftBukkit start
import com.google.common.collect.Maps;
@ -147,7 +147,7 @@ index a6d4097..c0f0b83 100644
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.block.BlockState;
@@ -134,6 +135,7 @@ public abstract class World implements IBlockAccess {
@@ -135,6 +136,7 @@ public abstract class World implements IBlockAccess {
private org.spigotmc.TickLimiter entityLimiter;
private org.spigotmc.TickLimiter tileLimiter;
private int tileTickPosition;
@ -156,5 +156,5 @@ index a6d4097..c0f0b83 100644
public CraftWorld getWorld() {
return this.world;
--
2.7.4
2.8.0

View file

@ -1,11 +1,11 @@
From 84315fb08fc96322d441c192dbb8b6c39fa63913 Mon Sep 17 00:00:00 2001
From bae3a766c801e4eac121ce00213b2b8ce57d27fb Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Wed, 2 Mar 2016 14:35:27 -0600
Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
index 8d04c82..ed307bc 100644
index dffc6d9..2db41bc 100644
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
@@ -53,6 +53,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@ -88,14 +88,13 @@ index 8ef7eb2..5421026 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 8370d94..8e94ddd 100644
index b618cf1..202085b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1416,6 +1416,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setAffectsSpawning(boolean affects) {
getHandle().affectsSpawning = affects;
return this.getHandle().affectsSpawning;
}
+
+ @Override
+ public int getViewDistance() {
+ return getHandle().viewDistance;
@ -105,9 +104,10 @@ index 8370d94..8e94ddd 100644
+ public void setViewDistance(int viewDistance) {
+ ((WorldServer) getHandle().world).getPlayerChunkMap().updateViewDistance(getHandle(), viewDistance);
+ }
// Paper end
+
// Spigot start
private final Player.Spigot spigot = new Player.Spigot()
{
--
2.8.0

View file

@ -1,14 +1,14 @@
From ae8a00e13119c8db9690397334b9259e9d5f828f Mon Sep 17 00:00:00 2001
From 0011716db31efd84a96342fabf79e81347b27e8c Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 2 Mar 2016 23:45:17 -0600
Subject: [PATCH] Disable spigot tick limiters
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c0f0b83..bffa3ac 100644
index a9cda67..af43a87 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1422,10 +1422,10 @@ public abstract class World implements IBlockAccess {
@@ -1423,10 +1423,10 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - Use field for loop variable
co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper
int entitiesThisCycle = 0;
@ -23,7 +23,7 @@ index c0f0b83..bffa3ac 100644
tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0;
entity = (Entity) this.entityList.get(this.tickPosition);
// CraftBukkit end
@@ -1490,9 +1490,7 @@ public abstract class World implements IBlockAccess {
@@ -1491,9 +1491,7 @@ public abstract class World implements IBlockAccess {
// Spigot start
// Iterator iterator = this.tileEntityListTick.iterator();
int tilesThisCycle = 0;

View file

@ -1,4 +1,4 @@
From bc6ae7496c8eabe23ee4e1773211e5fa75eeee33 Mon Sep 17 00:00:00 2001
From 84fb7750d13c260f07760685068b41c5dc912f3b Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 02:39:54 -0600
Subject: [PATCH] Change implementation of (tile)entity removal list
@ -22,10 +22,10 @@ index c3e6588..5ff5c54 100644
public boolean impulse;
public int portalCooldown;
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1a1f082..e676482 100644
index af43a87..074d80d 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -30,6 +30,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -31,6 +31,11 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.generator.ChunkGenerator;
// CraftBukkit end
@ -37,7 +37,7 @@ index 1a1f082..e676482 100644
public abstract class World implements IBlockAccess {
private int a = 63;
@@ -60,11 +65,11 @@ public abstract class World implements IBlockAccess {
@@ -61,11 +66,11 @@ public abstract class World implements IBlockAccess {
}
};
// Spigot end
@ -51,7 +51,7 @@ index 1a1f082..e676482 100644
public final List<EntityHuman> players = Lists.newArrayList();
public final List<Entity> j = Lists.newArrayList();
protected final IntHashMap<Entity> entitiesById = new IntHashMap();
@@ -1394,19 +1399,20 @@ public abstract class World implements IBlockAccess {
@@ -1395,19 +1400,20 @@ public abstract class World implements IBlockAccess {
int j;

View file

@ -1,4 +1,4 @@
From 4751d36b42803328e4a375bf9c4959404b2febd5 Mon Sep 17 00:00:00 2001
From 4e878aa92cc3db36e47201744cc503c5627c0545 Mon Sep 17 00:00:00 2001
From: Joseph Hirschfeld <joe@ibj.io>
Date: Thu, 3 Mar 2016 03:15:41 -0600
Subject: [PATCH] Add exception reporting event
@ -244,7 +244,7 @@ index 01a08d4..5eb01c3 100644
}
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index b724586..63e118d 100644
index 588377c..e15cc1a 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -5,6 +5,7 @@ import java.util.List;
@ -255,7 +255,7 @@ index b724586..63e118d 100644
import org.bukkit.craftbukkit.util.LongHash;
import org.bukkit.craftbukkit.util.LongHashSet;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
@@ -175,6 +176,7 @@ public final class SpawnerCreature {
@@ -177,6 +178,7 @@ public final class SpawnerCreature {
entityinsentient = (EntityInsentient) biomebase_biomemeta.b.getConstructor(new Class[] { World.class}).newInstance(new Object[] { worldserver});
} catch (Exception exception) {
exception.printStackTrace();
@ -263,7 +263,7 @@ index b724586..63e118d 100644
return j1;
}
@@ -282,6 +284,7 @@ public final class SpawnerCreature {
@@ -284,6 +286,7 @@ public final class SpawnerCreature {
entityinsentient = (EntityInsentient) biomebase_biomemeta.b.getConstructor(new Class[] { World.class}).newInstance(new Object[] { world});
} catch (Exception exception) {
exception.printStackTrace();
@ -292,7 +292,7 @@ index 320e52e..d40257f 100644
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e676482..2551f48 100644
index 074d80d..f811cd2 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1,5 +1,7 @@
@ -303,7 +303,7 @@ index e676482..2551f48 100644
import com.google.common.base.Function;
import com.google.common.base.Objects;
import com.google.common.base.Predicate;
@@ -1454,8 +1456,10 @@ public abstract class World implements IBlockAccess {
@@ -1455,8 +1457,10 @@ public abstract class World implements IBlockAccess {
} catch (Throwable throwable1) {
entity.tickTimer.stopTiming();
// Paper start - Prevent tile entity and entity crashes
@ -315,7 +315,7 @@ index e676482..2551f48 100644
entity.dead = true;
continue;
// Paper end
@@ -1519,8 +1523,10 @@ public abstract class World implements IBlockAccess {
@@ -1520,8 +1524,10 @@ public abstract class World implements IBlockAccess {
this.methodProfiler.b();
} catch (Throwable throwable2) {
// Paper start - Prevent tile entity and entity crashes

View file

@ -1,4 +1,4 @@
From 6787cb91302117d42751fccd63a7fa3a4195e0c4 Mon Sep 17 00:00:00 2001
From 14d62c55a3a42150e6cba8a03c791730de3f14ad Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sat, 4 Apr 2015 23:17:52 -0400
Subject: [PATCH] Complete resource pack API
@ -18,7 +18,7 @@ index 04e52d2..2a14e1a 100644
public PacketPlayInResourcePackStatus() {}
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 42456b6..ff64891 100644
index 79448eb..3837f64 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1026,7 +1026,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
@ -37,7 +37,7 @@ index 42456b6..ff64891 100644
// CraftBukkit end
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2f86dd3..a168a77 100644
index f28fac0..caff497 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -72,6 +72,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -52,10 +52,9 @@ index 2f86dd3..a168a77 100644
public CraftPlayer(CraftServer server, EntityPlayer entity) {
super(server, entity);
@@ -1521,6 +1525,33 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void setViewDistance(int viewDistance) {
((WorldServer) getHandle().world).getPlayerChunkMap().updateViewDistance(getHandle(), viewDistance);
}
+
+ @Override
+ public void setResourcePack(String url, String hash) {
+ Validate.notNull(url, "Resource pack URL cannot be null");
@ -82,9 +81,10 @@ index 2f86dd3..a168a77 100644
+ this.resourcePackStatus = status;
+ this.resourcePackHash = hash;
+ }
// Paper end
+
// Spigot start
private final Player.Spigot spigot = new Player.Spigot()
{
--
2.8.0

View file

@ -1,4 +1,4 @@
From 18d902ae10f701f1f73d26d1ac79f59427e9264c Mon Sep 17 00:00:00 2001
From a73a37ed1c7987b84c1fe0b8f033c72ababd0d43 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 20:16:03 -0400
Subject: [PATCH] Add World Util Methods
@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods
Methods that can be used for other patches to help improve logic.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 2551f48..f76ff72 100644
index f811cd2..c6f15b8 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -152,6 +152,12 @@ public abstract class World implements IBlockAccess {
@@ -153,6 +153,12 @@ public abstract class World implements IBlockAccess {
return (CraftServer) Bukkit.getServer();
}
@ -22,7 +22,7 @@ index 2551f48..f76ff72 100644
public Chunk getChunkIfLoaded(int x, int z) {
return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(x, z);
}
@@ -634,6 +640,41 @@ public abstract class World implements IBlockAccess {
@@ -635,6 +641,41 @@ public abstract class World implements IBlockAccess {
}
}
@ -64,7 +64,7 @@ index 2551f48..f76ff72 100644
public int getLightLevel(BlockPosition blockposition) {
return this.c(blockposition, true);
}
@@ -748,6 +789,27 @@ public abstract class World implements IBlockAccess {
@@ -749,6 +790,27 @@ public abstract class World implements IBlockAccess {
return this.worldProvider.n()[this.getLightLevel(blockposition)];
}

View file

@ -1,4 +1,4 @@
From 40da4eaa1b6515d51742dc8a7bb9960666a75299 Mon Sep 17 00:00:00 2001
From 58cdfccf5ed3401d652bcbbc099103b7f19141ff Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 21:22:56 -0400
Subject: [PATCH] Optimized Light Level Comparisons
@ -118,7 +118,7 @@ index f477036..23826fe 100644
}
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
index 7a5b053..0b0eef3 100644
index 28fed1f..e3cce4c 100644
--- a/src/main/java/net/minecraft/server/EntityZombie.java
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
@@ -194,7 +194,7 @@ public class EntityZombie extends EntityMonster {
@ -128,7 +128,7 @@ index 7a5b053..0b0eef3 100644
- if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) {
+ if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper
entityzombie.setPosition((double) i1, (double) j1, (double) k1);
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) {
if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D, EntityHuman.affectsSpawningFilter()) && this.world.a(entityzombie.getBoundingBox(), (Entity) entityzombie) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()).isEmpty() && !this.world.containsLiquid(entityzombie.getBoundingBox())) { // Paper - affectsSpawning filter
this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit
--
2.8.0

View file

@ -1,4 +1,4 @@
From 0dce8356b0edff838a19e1b615fa18366af30563 Mon Sep 17 00:00:00 2001
From ee06b0730cdcaa25235e3fec5594288200403a26 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 17:57:25 -0400
Subject: [PATCH] Optimize Chunk Unload Queue
@ -238,7 +238,7 @@ index 450bf9b..5485a66 100644
+ // Paper end
}
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 63e118d..721bcae 100644
index e15cc1a..dc7c17c 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -28,7 +28,7 @@ public final class SpawnerCreature {
@ -251,10 +251,10 @@ index 63e118d..721bcae 100644
i += server.getChunkAt( x, z ).entityCount.get( oClass );
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f76ff72..c1cb133 100644
index c6f15b8..b223847 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -159,9 +159,15 @@ public abstract class World implements IBlockAccess {
@@ -160,9 +160,15 @@ public abstract class World implements IBlockAccess {
// Paper end
public Chunk getChunkIfLoaded(int x, int z) {
@ -359,5 +359,5 @@ index f0d3a19..c32b805 100644
{
isActive = false;
--
2.8.0.windows.1
2.8.0

View file

@ -1,4 +1,4 @@
From eaa70396911818f37f9a29242382e293a28e2828 Mon Sep 17 00:00:00 2001
From 62e3299a5f3113b0d4ccbc3809df6c1cf717f8a7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Mar 2016 23:41:34 -0400
Subject: [PATCH] Optimize isValidLocation for inlining
@ -22,10 +22,10 @@ index c5b6a34..17bbfb0 100644
public BaseBlockPosition(int i, int j, int k) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c1cb133..1a9a847 100644
index b223847..6c4a0aa 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -278,8 +278,8 @@ public abstract class World implements IBlockAccess {
@@ -279,8 +279,8 @@ public abstract class World implements IBlockAccess {
return this.getType(blockposition1);
}
@ -36,7 +36,7 @@ index c1cb133..1a9a847 100644
}
public boolean isEmpty(BlockPosition blockposition) {
@@ -291,7 +291,7 @@ public abstract class World implements IBlockAccess {
@@ -292,7 +292,7 @@ public abstract class World implements IBlockAccess {
}
public boolean a(BlockPosition blockposition, boolean flag) {
@ -45,7 +45,7 @@ index c1cb133..1a9a847 100644
}
public boolean areChunksLoaded(BlockPosition blockposition, int i) {
@@ -371,7 +371,7 @@ public abstract class World implements IBlockAccess {
@@ -372,7 +372,7 @@ public abstract class World implements IBlockAccess {
return true;
}
// CraftBukkit end
@ -54,7 +54,7 @@ index c1cb133..1a9a847 100644
return false;
} else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
return false;
@@ -649,7 +649,7 @@ public abstract class World implements IBlockAccess {
@@ -650,7 +650,7 @@ public abstract class World implements IBlockAccess {
// Paper start - test if meets light level, return faster
// logic copied from below
public boolean isLightLevel(BlockPosition blockposition, int level) {
@ -63,7 +63,7 @@ index c1cb133..1a9a847 100644
if (this.getType(blockposition).f()) {
if (this.c(blockposition.up(), false) >= level) {
return true;
@@ -762,7 +762,7 @@ public abstract class World implements IBlockAccess {
@@ -763,7 +763,7 @@ public abstract class World implements IBlockAccess {
blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ());
}
@ -72,7 +72,7 @@ index c1cb133..1a9a847 100644
return enumskyblock.c;
} else if (!this.isLoaded(blockposition)) {
return enumskyblock.c;
@@ -774,7 +774,7 @@ public abstract class World implements IBlockAccess {
@@ -775,7 +775,7 @@ public abstract class World implements IBlockAccess {
}
public void a(EnumSkyBlock enumskyblock, BlockPosition blockposition, int i) {
@ -81,7 +81,7 @@ index c1cb133..1a9a847 100644
if (this.isLoaded(blockposition)) {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
@@ -810,7 +810,7 @@ public abstract class World implements IBlockAccess {
@@ -811,7 +811,7 @@ public abstract class World implements IBlockAccess {
// CraftBukkit end
Chunk chunk = this.getChunkIfLoaded(blockposition);
if (chunk != null) {
@ -90,7 +90,7 @@ index c1cb133..1a9a847 100644
}
return null;
}
@@ -828,7 +828,7 @@ public abstract class World implements IBlockAccess {
@@ -829,7 +829,7 @@ public abstract class World implements IBlockAccess {
}
}
// CraftBukkit end
@ -99,7 +99,7 @@ index c1cb133..1a9a847 100644
return Blocks.AIR.getBlockData();
} else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
@@ -2057,7 +2057,7 @@ public abstract class World implements IBlockAccess {
@@ -2058,7 +2058,7 @@ public abstract class World implements IBlockAccess {
public Map<BlockPosition, TileEntity> capturedTileEntities = Maps.newHashMap();
public TileEntity getTileEntity(BlockPosition blockposition) {
@ -108,7 +108,7 @@ index c1cb133..1a9a847 100644
return null;
} else {
// CraftBukkit start
@@ -2160,7 +2160,7 @@ public abstract class World implements IBlockAccess {
@@ -2161,7 +2161,7 @@ public abstract class World implements IBlockAccess {
}
public boolean d(BlockPosition blockposition, boolean flag) {

View file

@ -1,11 +1,11 @@
From 55869f17856d6d11d00b4729ddda93feea603d2f Mon Sep 17 00:00:00 2001
From 7616ed0a0949bef668e0284f5f0f49218d293be7 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 27 Mar 2016 20:24:05 -0500
Subject: [PATCH] Check async, remove unused vars, GH-159
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 721bcae..3ba55d7 100644
index dc7c17c..15a0ce9 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -38,6 +38,7 @@ public final class SpawnerCreature {
@ -16,7 +16,7 @@ index 721bcae..3ba55d7 100644
if (!flag && !flag1) {
return 0;
} else {
@@ -118,8 +119,10 @@ public final class SpawnerCreature {
@@ -120,8 +121,10 @@ public final class SpawnerCreature {
// CraftBukkit end
if ((!enumcreaturetype.d() || flag1) && (enumcreaturetype.d() || flag) && (!enumcreaturetype.e() || flag2)) {

View file

@ -1,4 +1,4 @@
From b228a1640f4cbe86afc1e4d3800ad03f3937d4d2 Mon Sep 17 00:00:00 2001
From 619347f84ad66e6e4fc8b55532fdf4077374df7d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 19:55:45 -0400
Subject: [PATCH] Option to disable BlockPhysicsEvent for Redstone
@ -25,10 +25,10 @@ index 55b211e..d6b8f72 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 1a9a847..c6463b2 100644
index 6c4a0aa..4bfeb01 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -568,7 +568,7 @@ public abstract class World implements IBlockAccess {
@@ -569,7 +569,7 @@ public abstract class World implements IBlockAccess {
try {
// CraftBukkit start
CraftWorld world = ((WorldServer) this).getWorld();

View file

@ -1,14 +1,14 @@
From 343a5f46582da5a74c73c69c9c0c6e8f8bf7eea5 Mon Sep 17 00:00:00 2001
From b5c79135ca8139c5f1f8ccd31712f2d0bc1d4cde Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:32:58 -0400
Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index c6463b2..d5ba601 100644
index 4bfeb01..6501091 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1113,6 +1113,7 @@ public abstract class World implements IBlockAccess {
@@ -1114,6 +1114,7 @@ public abstract class World implements IBlockAccess {
}
entity.valid = true; // CraftBukkit
@ -16,7 +16,7 @@ index c6463b2..d5ba601 100644
}
protected void c(Entity entity) {
@@ -1120,6 +1121,7 @@ public abstract class World implements IBlockAccess {
@@ -1121,6 +1122,7 @@ public abstract class World implements IBlockAccess {
((IWorldAccess) this.u.get(i)).b(entity);
}

View file

@ -1,4 +1,4 @@
From a88cf69c865f77217e0565941cca9a260047ff3a Mon Sep 17 00:00:00 2001
From 65245988b7681107893c71f8c59cdcaf5d02c666 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 31 Mar 2016 19:17:58 -0400
Subject: [PATCH] Do not load chunks for light checks
@ -7,10 +7,10 @@ Should only happen for blocks on the edge that uses neighbors light level
(certain blocks). In that case, there will be 3-4 other neighbors to get a light level from.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d5ba601..ea187f9 100644
index 6501091..5be36f5 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -717,6 +717,7 @@ public abstract class World implements IBlockAccess {
@@ -718,6 +718,7 @@ public abstract class World implements IBlockAccess {
if (blockposition.getY() >= 256) {
blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
}

View file

@ -1,4 +1,4 @@
From 7e68dc8430adc1759e5bca25c1e819723843d39d Mon Sep 17 00:00:00 2001
From a28f9107123ed0732dde748e4c8e13b7e0952e2b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 13 Sep 2014 23:14:43 -0400
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
@ -37,10 +37,10 @@ index 06dec17..b1e6e5d 100644
if (i1 - j > 1000L) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index ea187f9..492831d 100644
index 5be36f5..0e1bcdd 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -3245,7 +3245,7 @@ public abstract class World implements IBlockAccess {
@@ -3224,7 +3224,7 @@ public abstract class World implements IBlockAccess {
BlockPosition blockposition = this.getSpawn();
int k = i * 16 + 8 - blockposition.getX();
int l = j * 16 + 8 - blockposition.getZ();
@ -79,5 +79,5 @@ index 922ebaf..207a8d8 100644
loadChunk(chunkCoordX + x, chunkCoordZ + z);
} else {
--
2.8.0.windows.1
2.8.0

View file

@ -1,14 +1,14 @@
From 8f77a10266af399b92df901a54c938c7dab91a84 Mon Sep 17 00:00:00 2001
From 8aa5f679036c0c31e43fa5d03c48d3ae2a7a4b4e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 3 Apr 2016 17:48:50 -0400
Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 492831d..10e40aa 100644
index 0e1bcdd..9b9d2d7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -526,6 +526,7 @@ public abstract class World implements IBlockAccess {
@@ -527,6 +527,7 @@ public abstract class World implements IBlockAccess {
}
public void applyPhysics(BlockPosition blockposition, Block block) {

View file

@ -1,14 +1,14 @@
From b4c1805159d14e38fede429d131fde0160d3cc88 Mon Sep 17 00:00:00 2001
From 0a64b8341f3ffb2613ccfa498f0751b8aac5cdea Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Apr 2016 19:42:22 -0400
Subject: [PATCH] Don't spam reload spawn chunks in nether/end
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 10e40aa..220a942 100644
index 9b9d2d7..606ffef 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -3242,6 +3242,7 @@ public abstract class World implements IBlockAccess {
@@ -3221,6 +3221,7 @@ public abstract class World implements IBlockAccess {
return this.N;
}

View file

@ -1,4 +1,4 @@
From d4d3e808798c72164a72ef0b9046d95ab2bb6af6 Mon Sep 17 00:00:00 2001
From 46bc214fe10b3015ac04381f15972f70e5c045ba Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 00:25:28 -0400
Subject: [PATCH] Remove unused World Tile Entity List
@ -6,10 +6,10 @@ Subject: [PATCH] Remove unused World Tile Entity List
Massive hit to performance and it is completely unnecessary.
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 220a942..3241803 100644
index 606ffef..b860c91 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -68,7 +68,7 @@ public abstract class World implements IBlockAccess {
@@ -69,7 +69,7 @@ public abstract class World implements IBlockAccess {
};
// Spigot end
protected final Set<Entity> f = Sets.newHashSet(); // Paper
@ -18,7 +18,7 @@ index 220a942..3241803 100644
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
private final List<TileEntity> b = Lists.newArrayList();
private final Set<TileEntity> tileEntityListUnload = Sets.newHashSet(); // Paper
@@ -1564,7 +1564,7 @@ public abstract class World implements IBlockAccess {
@@ -1565,7 +1565,7 @@ public abstract class World implements IBlockAccess {
// CraftBukkit start - From below, clean up tile entities before ticking them
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@ -27,7 +27,7 @@ index 220a942..3241803 100644
this.tileEntityListUnload.clear();
}
// CraftBukkit end
@@ -1615,7 +1615,7 @@ public abstract class World implements IBlockAccess {
@@ -1616,7 +1616,7 @@ public abstract class World implements IBlockAccess {
if (tileentity.x()) {
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
@ -36,7 +36,7 @@ index 220a942..3241803 100644
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition());
}
@@ -1653,7 +1653,7 @@ public abstract class World implements IBlockAccess {
@@ -1654,7 +1654,7 @@ public abstract class World implements IBlockAccess {
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
// CraftBukkit start
// From above, don't screw this up - SPIGOT-1746
@ -45,7 +45,7 @@ index 220a942..3241803 100644
this.a(tileentity1);
}
// CraftBukkit end
@@ -1673,9 +1673,9 @@ public abstract class World implements IBlockAccess {
@@ -1674,9 +1674,9 @@ public abstract class World implements IBlockAccess {
protected void l() {}
public boolean a(TileEntity tileentity) {
@ -57,7 +57,7 @@ index 220a942..3241803 100644
this.tileEntityListTick.add(tileentity);
}
@@ -2144,7 +2144,7 @@ public abstract class World implements IBlockAccess {
@@ -2145,7 +2145,7 @@ public abstract class World implements IBlockAccess {
} else {
if (tileentity != null) {
this.b.remove(tileentity);
@ -67,5 +67,5 @@ index 220a942..3241803 100644
}
--
2.8.1
2.8.0

View file

@ -1,36 +0,0 @@
From e0dcc5f2cdae334820821f3c97a06867748e8026 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 13 Apr 2016 02:10:49 -0400
Subject: [PATCH] Configurable Player Collision
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index cd25fb8..a07ee75 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -190,4 +190,9 @@ public class PaperConfig {
private static void regionFileCacheSize() {
regionFileCacheSize = getInt("settings.region-file-cache-size", 256);
}
+
+ public static boolean enablePlayerCollisions = true;
+ private static void enablePlayerCollisions() {
+ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true);
+ }
}
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
index f86bf8d..766b764 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java
@@ -96,7 +96,7 @@ public class PacketPlayOutScoreboardTeam implements Packet<PacketListenerPlayOut
packetdataserializer.a(this.d);
packetdataserializer.writeByte(this.j);
packetdataserializer.a(this.e);
- packetdataserializer.a(this.f);
+ packetdataserializer.a(!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions ? "never" : this.f); // Paper
packetdataserializer.writeByte(this.g);
}
--
2.8.1