Improve chunk loaded checks
This commit is contained in:
parent
7a3054158d
commit
1c68c72b1f
|
@ -1,4 +1,4 @@
|
|||
From 412fe7b001625806a64ebd7a3dea1f662c325b17 Mon Sep 17 00:00:00 2001
|
||||
From 8dbe084873df655de066118b90ebe479bcf299cd Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 28 Mar 2016 20:55:47 -0400
|
||||
Subject: [PATCH] MC Utils
|
||||
|
@ -181,6 +181,49 @@ index 857b2f8868..bbf136614c 100644
|
|||
return (long) i & 4294967295L | ((long) j & 4294967295L) << 32;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index dcf2d38df5..ea73e4baba 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -66,6 +66,38 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
return this.playerChunkMap.c();
|
||||
}
|
||||
|
||||
+ // Paper start - "real" get chunk if loaded
|
||||
+ // Note: Partially copied from the getChunkAt method below
|
||||
+ @Nullable
|
||||
+ public Chunk getChunkAtIfLoadedImmediately(int x, int z) {
|
||||
+ if (Thread.currentThread() != this.serverThread) {
|
||||
+ return CompletableFuture.supplyAsync(() -> {
|
||||
+ return this.getChunkAtIfLoadedImmediately(x, z);
|
||||
+ }).join();
|
||||
+ }
|
||||
+
|
||||
+ long k = ChunkCoordIntPair.pair(x, z);
|
||||
+
|
||||
+ IChunkAccess ichunkaccess;
|
||||
+
|
||||
+ for (int l = 0; l < 4; ++l) {
|
||||
+ if (k == this.cachePos[l] && ChunkStatus.FULL == this.cacheStatus[l]) {
|
||||
+ ichunkaccess = this.cacheChunk[l];
|
||||
+ if (ichunkaccess instanceof Chunk) { // CraftBukkit - the chunk can become accessible in the meantime TODO for non-null chunks it might also make sense to check that the chunk's state hasn't changed in the meantime
|
||||
+ return (Chunk)ichunkaccess;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ PlayerChunk playerChunk = this.getChunk(k);
|
||||
+ if (playerChunk == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ return playerChunk.getFullChunk();
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Nullable
|
||||
@Override
|
||||
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
|
||||
diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java
|
||||
index 8bda055159..409dc837c6 100644
|
||||
--- a/src/main/java/net/minecraft/server/DataBits.java
|
||||
|
@ -899,7 +942,7 @@ index 58f9946455..ae194b981f 100644
|
|||
private volatile int chatThrottle;
|
||||
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java
|
||||
index a5dba62caf..a088658ae0 100644
|
||||
index 2fe3d5d4c2..4aee712a6f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInventory.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInventory.java
|
||||
@@ -17,7 +17,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity {
|
||||
|
@ -1003,10 +1046,10 @@ index b3799ab564..5fae5a1233 100644
|
|||
|
||||
public static long getTimeMillis() {
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 91e50ccea1..69c704a429 100644
|
||||
index 91e50ccea1..a2b1aba49f 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -210,6 +210,44 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -210,6 +210,40 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL);
|
||||
}
|
||||
|
||||
|
@ -1014,11 +1057,7 @@ index 91e50ccea1..69c704a429 100644
|
|||
+ @Nullable
|
||||
+ @Override
|
||||
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
|
||||
+ if (!((ChunkProviderServer)this.chunkProvider).isLoaded(x, z)) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ return this.chunkProvider.getChunkAt(x, z, ChunkStatus.FULL, true);
|
||||
+ return ((ChunkProviderServer)this.chunkProvider).getChunkAtIfLoadedImmediately(x, z);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
|
@ -1051,7 +1090,7 @@ index 91e50ccea1..69c704a429 100644
|
|||
@Override
|
||||
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
|
||||
IChunkAccess ichunkaccess = this.chunkProvider.getChunkAt(i, j, chunkstatus, flag);
|
||||
@@ -371,8 +409,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -371,8 +405,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
||||
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From ae7c188e1350bace38205042fd1b9b1f5010c2ea Mon Sep 17 00:00:00 2001
|
||||
From 846f066045c2247d98852987cc080151986de7c5 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 3 Mar 2016 04:00:11 -0600
|
||||
Subject: [PATCH] Timings v2
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2
|
|||
|
||||
diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
new file mode 100644
|
||||
index 000000000..3f9fb6f90
|
||||
index 0000000000..3f9fb6f906
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/MinecraftTimings.java
|
||||
@@ -0,0 +1,133 @@
|
||||
|
@ -145,7 +145,7 @@ index 000000000..3f9fb6f90
|
|||
+}
|
||||
diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
new file mode 100644
|
||||
index 000000000..d5d3b2a20
|
||||
index 0000000000..d5d3b2a20c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java
|
||||
@@ -0,0 +1,105 @@
|
||||
|
@ -255,7 +255,7 @@ index 000000000..d5d3b2a20
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
index 5518ec1e5..0c65afccf 100644
|
||||
index 5518ec1e54..0c65afccfd 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
@@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit;
|
||||
|
@ -302,7 +302,7 @@ index 5518ec1e5..0c65afccf 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java
|
||||
index b2e5bcf57..78b0e7847 100644
|
||||
index b2e5bcf57c..78b0e78474 100644
|
||||
--- a/src/main/java/net/minecraft/server/Block.java
|
||||
+++ b/src/main/java/net/minecraft/server/Block.java
|
||||
@@ -31,6 +31,15 @@ public class Block implements IMaterial {
|
||||
|
@ -322,7 +322,7 @@ index b2e5bcf57..78b0e7847 100644
|
|||
private final float frictionFactor;
|
||||
protected final BlockStateList<Block, IBlockData> blockStateList;
|
||||
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||
index 8075cc482..3de0f6975 100644
|
||||
index 8075cc4827..3de0f69758 100644
|
||||
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||
@@ -573,6 +573,7 @@ public class Chunk implements IChunkAccess {
|
||||
|
@ -342,10 +342,10 @@ index 8075cc482..3de0f6975 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index dcf2d38df..2933439ba 100644
|
||||
index ea73e4baba..82ba0878ed 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -245,7 +245,9 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -277,7 +277,9 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
|
||||
public void save(boolean flag) {
|
||||
this.tickDistanceManager();
|
||||
|
@ -355,7 +355,7 @@ index dcf2d38df..2933439ba 100644
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -365,9 +367,9 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -397,9 +399,9 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
|
@ -367,7 +367,7 @@ index dcf2d38df..2933439ba 100644
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -381,9 +383,7 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
@@ -413,9 +415,7 @@ public class ChunkProviderServer extends IChunkProvider {
|
||||
this.world.getMethodProfiler().exit();
|
||||
}
|
||||
|
||||
|
@ -378,7 +378,7 @@ index dcf2d38df..2933439ba 100644
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
index 2e09900f4..1ebb16f0f 100644
|
||||
index 2e09900f45..1ebb16f0f6 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -416,7 +416,7 @@ index 2e09900f4..1ebb16f0f 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
index 46e7737ca..a3ef94306 100644
|
||||
index 46e7737ca3..a3ef943066 100644
|
||||
--- a/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
+++ b/src/main/java/net/minecraft/server/CustomFunction.java
|
||||
@@ -13,12 +13,22 @@ public class CustomFunction {
|
||||
|
@ -443,7 +443,7 @@ index 46e7737ca..a3ef94306 100644
|
|||
return this.b;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
index 9c9eef0ad..b42fbf2c6 100644
|
||||
index 9c9eef0ad9..b42fbf2c65 100644
|
||||
--- a/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
+++ b/src/main/java/net/minecraft/server/CustomFunctionData.java
|
||||
@@ -101,7 +101,7 @@ public class CustomFunctionData implements IResourcePackListener {
|
||||
|
@ -456,7 +456,7 @@ index 9c9eef0ad..b42fbf2c6 100644
|
|||
int j = 0;
|
||||
CustomFunction.c[] acustomfunction_c = customfunction.b();
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index b60956218..19e2df309 100644
|
||||
index b60956218d..19e2df3098 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -31,7 +31,7 @@ import org.apache.logging.log4j.Level;
|
||||
|
@ -509,7 +509,7 @@ index b60956218..19e2df309 100644
|
|||
return waitable.get();
|
||||
} catch (java.util.concurrent.ExecutionException e) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 708f6c97c..c348d6bec 100644
|
||||
index 708f6c97c6..c348d6bec3 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender;
|
||||
|
@ -548,7 +548,7 @@ index 708f6c97c..c348d6bec 100644
|
|||
|
||||
protected Vec3D a(Vec3D vec3d, EnumMoveType enummovetype) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 40173aa35..678dae6da 100644
|
||||
index 40173aa35b..678dae6dae 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -35,7 +35,7 @@ import org.bukkit.event.entity.EntityTeleportEvent;
|
||||
|
@ -624,7 +624,7 @@ index 40173aa35..678dae6da 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 64318e6e7..c76620f2b 100644
|
||||
index 64318e6e78..c76620f2b3 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1,5 +1,7 @@
|
||||
|
@ -752,7 +752,7 @@ index 64318e6e7..c76620f2b 100644
|
|||
this.methodProfiler.exit();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
index 3d2436365..db159baab 100644
|
||||
index 3d2436365f..db159baab2 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -1,6 +1,8 @@
|
||||
|
@ -799,7 +799,7 @@ index 3d2436365..db159baab 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index ae194b981..d20037bd0 100644
|
||||
index ae194b981f..d20037bd00 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -58,6 +58,7 @@ import org.bukkit.inventory.CraftingInventory;
|
||||
|
@ -854,7 +854,7 @@ index ae194b981..d20037bd0 100644
|
|||
// this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s);
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
|
||||
index cb6d50ea7..9ba03f8ed 100644
|
||||
index cb6d50ea70..9ba03f8ed0 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java
|
||||
@@ -1,5 +1,8 @@
|
||||
|
@ -880,7 +880,7 @@ index cb6d50ea7..9ba03f8ed 100644
|
|||
throw CancelledPacketHandleException.INSTANCE;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 017db63a4..fc3422cca 100644
|
||||
index 017db63a4c..fc3422cca3 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -904,7 +904,7 @@ index 017db63a4..fc3422cca 100644
|
|||
|
||||
public WhiteList getWhitelist() {
|
||||
diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java
|
||||
index 061730c56..c5890f5dc 100644
|
||||
index 061730c560..c5890f5dcc 100644
|
||||
--- a/src/main/java/net/minecraft/server/TickListServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/TickListServer.java
|
||||
@@ -28,13 +28,18 @@ public class TickListServer<T> implements TickList<T> {
|
||||
|
@ -954,7 +954,7 @@ index 061730c56..c5890f5dc 100644
|
|||
this.g.clear();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
index 382498d19..a833781e5 100644
|
||||
index 382498d193..a833781e59 100644
|
||||
--- a/src/main/java/net/minecraft/server/TileEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/TileEntity.java
|
||||
@@ -9,11 +9,12 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
|
||||
|
@ -973,7 +973,7 @@ index 382498d19..a833781e5 100644
|
|||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
public final CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 69c704a42..d7b3b4b8c 100644
|
||||
index a2b1aba49f..2a0a7f2480 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1,5 +1,7 @@
|
||||
|
@ -1010,7 +1010,7 @@ index 69c704a42..d7b3b4b8c 100644
|
|||
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
|
||||
}
|
||||
@@ -777,21 +778,26 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -773,21 +774,26 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}
|
||||
|
||||
timings.tileEntityPending.stopTiming(); // Spigot
|
||||
|
@ -1040,7 +1040,7 @@ index 69c704a42..d7b3b4b8c 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 508cdc6a0..089468835 100644
|
||||
index 508cdc6a0c..089468835b 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -1,5 +1,7 @@
|
||||
|
@ -1132,7 +1132,7 @@ index 508cdc6a0..089468835 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 4413066ee..834c16172 100644
|
||||
index 4413066eea..834c16172b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1926,12 +1926,31 @@ public final class CraftServer implements Server {
|
||||
|
@ -1169,7 +1169,7 @@ index 4413066ee..834c16172 100644
|
|||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
|
||||
deleted file mode 100644
|
||||
index 38f211526..000000000
|
||||
index 38f211526b..0000000000
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java
|
||||
+++ /dev/null
|
||||
@@ -1,166 +0,0 @@
|
||||
|
@ -1340,7 +1340,7 @@ index 38f211526..000000000
|
|||
- }
|
||||
-}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index c94a41d02..037b0bc68 100644
|
||||
index c94a41d029..037b0bc685 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1740,6 +1740,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
@ -1359,7 +1359,7 @@ index c94a41d02..037b0bc68 100644
|
|||
|
||||
public Player.Spigot spigot()
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index b90979c7b..8823f94f7 100644
|
||||
index b90979c7ba..8823f94f7b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -1425,7 +1425,7 @@ index b90979c7b..8823f94f7 100644
|
|||
|
||||
private boolean isReady(final int currentTick) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
||||
index 3f55381c1..0d9a46680 100644
|
||||
index 3f55381c15..0d9a466809 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java
|
||||
@@ -1,9 +1,11 @@
|
||||
|
@ -1510,7 +1510,7 @@ index 3f55381c1..0d9a46680 100644
|
|||
- // Spigot end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
|
||||
index e52ef47b7..3d90b3426 100644
|
||||
index e52ef47b78..3d90b34268 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java
|
||||
@@ -5,6 +5,7 @@ import org.bukkit.util.CachedServerIcon;
|
||||
|
@ -1522,7 +1522,7 @@ index e52ef47b7..3d90b3426 100644
|
|||
this.value = value;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index c88704f69..f7fdd0727 100644
|
||||
index c88704f69e..f7fdd0727b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -271,6 +271,13 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
@ -1540,7 +1540,7 @@ index c88704f69..f7fdd0727 100644
|
|||
* This helper class represents the different NBT Tags.
|
||||
* <p>
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 4c947a935..106e9d7e2 100644
|
||||
index 4c947a9352..106e9d7e2d 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -31,7 +31,7 @@ import net.minecraft.server.EntityWither;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 3aac318eaf63309fdee0aa327f084a44d99add85 Mon Sep 17 00:00:00 2001
|
||||
From cb49f6902fd8a65dcf393e090d28c11908d679b0 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 a833781e59..1307152997 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index df681c5d6b..26c93af981 100644
|
||||
index 85056a7b1f..3cbaeb387b 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -718,11 +718,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -714,11 +714,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
||||
gameprofilerfiller.exit();
|
||||
} catch (Throwable throwable) {
|
||||
|
@ -45,7 +45,7 @@ index df681c5d6b..26c93af981 100644
|
|||
}
|
||||
// Spigot start
|
||||
finally {
|
||||
@@ -791,11 +793,12 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -787,11 +789,12 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
// Spigot end
|
||||
consumer.accept(entity);
|
||||
} catch (Throwable throwable) {
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From f95651b3c8c5bc05371d739ec420b86cdd010414 Mon Sep 17 00:00:00 2001
|
||||
From 766ef284f08e2b95b3baba106c11d8c7e65b3f35 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 5b21f87d13..90548096f6 100644
|
||||
index 1db06c6d94..8d72146760 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -689,9 +689,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -685,9 +685,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
// Spigot start
|
||||
// Iterator iterator = this.tileEntityListTick.iterator();
|
||||
int tilesThisCycle = 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From bfd0d62bfb4b0a82bd3efb1fe925ec0a2180e3ab Mon Sep 17 00:00:00 2001
|
||||
From f99dbe1d03a703db6a28827f96940efe0453a88b 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
|
||||
|
@ -80,7 +80,7 @@ index e990445196..9b65972569 100644
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index 2933439ba1..769794ad47 100644
|
||||
index 82ba0878ed..ba5f673b28 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -16,6 +16,9 @@ import java.util.function.BooleanSupplier;
|
||||
|
@ -216,7 +216,7 @@ index beeb9ccb8d..bb3aa4a376 100644
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index d44cf6164b..9d10caea4a 100644
|
||||
index c4d476eb61..b4ed1e4435 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -2,6 +2,9 @@ package net.minecraft.server;
|
||||
|
@ -229,7 +229,7 @@ index d44cf6164b..9d10caea4a 100644
|
|||
import com.google.common.collect.Lists;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
@@ -719,8 +722,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -715,8 +718,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
gameprofilerfiller.exit();
|
||||
} catch (Throwable throwable) {
|
||||
// Paper start - Prevent tile entity and entity crashes
|
||||
|
@ -242,7 +242,7 @@ index d44cf6164b..9d10caea4a 100644
|
|||
tilesThisCycle--;
|
||||
this.tileEntityListTick.remove(tileTickPosition--);
|
||||
continue;
|
||||
@@ -794,8 +800,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -790,8 +796,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
consumer.accept(entity);
|
||||
} catch (Throwable throwable) {
|
||||
// Paper start - Prevent tile entity and entity crashes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 038989166dcaa17be17fd644d232f7f77da00a46 Mon Sep 17 00:00:00 2001
|
||||
From f123c0c8360db44fe7f57d32248e65fa13092959 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 28 Mar 2016 19:55:45 -0400
|
||||
Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
|
||||
|
@ -44,10 +44,10 @@ index 454e28fc47..40b9bff98f 100644
|
|||
if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
|
||||
this.methodProfiler.a(() -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 74c1beb4b8..7e5ebb5ba4 100644
|
||||
index 4ec6a860d5..c8a859d7ba 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -444,7 +444,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -440,7 +440,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
// CraftBukkit start
|
||||
iblockdata1.b(this, blockposition, j); // Don't call an event for the old block to limit event spam
|
||||
CraftWorld world = ((WorldServer) this).getWorld();
|
||||
|
@ -56,7 +56,7 @@ index 74c1beb4b8..7e5ebb5ba4 100644
|
|||
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
|
||||
this.getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@@ -556,7 +556,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -552,7 +552,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
try {
|
||||
// CraftBukkit start
|
||||
CraftWorld world = ((WorldServer) this).getWorld();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 2d3ae802f90e7c88c39ec5fd10860b582b938bd6 Mon Sep 17 00:00:00 2001
|
||||
From 5bd8ffda82f98b275325f1ad5953da7d78ad2d28 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 7e5ebb5ba4..4db49d6cdb 100644
|
||||
index c8a859d7ba..6f9c35cd18 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -596,6 +596,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -592,6 +592,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
if (blockposition.getY() >= 256) {
|
||||
blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From e0a746fc2f95bf124958446d2fc83da64b51b428 Mon Sep 17 00:00:00 2001
|
||||
From 40de6ec559bbb3fabec4899249b26e1e11284447 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 4db49d6cdb..136b8bba56 100644
|
||||
index 6f9c35cd18..40757fc7a2 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -514,6 +514,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -510,6 +510,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
public void m(BlockPosition blockposition) {}
|
||||
|
||||
public void applyPhysics(BlockPosition blockposition, Block block) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From e06d6176687c54b2792da16762ac441320389025 Mon Sep 17 00:00:00 2001
|
||||
From 7da36456257792bbbe1ef3773cf7a62c7d5b966d 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,7 +6,7 @@ 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 136b8bba56..0688f9afa0 100644
|
||||
index 40757fc7a2..ce710c730d 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -40,7 +40,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
@ -18,7 +18,7 @@ index 136b8bba56..0688f9afa0 100644
|
|||
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
|
||||
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
|
||||
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper
|
||||
@@ -696,9 +696,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -692,9 +692,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}, tileentity::getPosition});
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ index 136b8bba56..0688f9afa0 100644
|
|||
this.tileEntityListTick.add(tileentity);
|
||||
}
|
||||
|
||||
@@ -734,7 +734,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -730,7 +730,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
timings.tileEntityTick.startTiming(); // Spigot
|
||||
if (!this.tileEntityListUnload.isEmpty()) {
|
||||
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
|
||||
|
@ -39,7 +39,7 @@ index 136b8bba56..0688f9afa0 100644
|
|||
this.tileEntityListUnload.clear();
|
||||
}
|
||||
|
||||
@@ -795,7 +795,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -791,7 +791,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
tilesThisCycle--;
|
||||
this.tileEntityListTick.remove(tileTickPosition--);
|
||||
// Spigot end
|
||||
|
@ -48,7 +48,7 @@ index 136b8bba56..0688f9afa0 100644
|
|||
if (this.isLoaded(tileentity.getPosition())) {
|
||||
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
|
||||
}
|
||||
@@ -825,7 +825,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -821,7 +821,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
|
||||
// CraftBukkit start
|
||||
// From above, don't screw this up - SPIGOT-1746
|
||||
|
@ -57,7 +57,7 @@ index 136b8bba56..0688f9afa0 100644
|
|||
this.a(tileentity1);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@@ -1093,7 +1093,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -1089,7 +1089,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
} else {
|
||||
if (tileentity != null) {
|
||||
this.tileEntityListPending.remove(tileentity);
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From 21db6e1450839d459f3b24c0d0005d7e307bb38f Mon Sep 17 00:00:00 2001
|
||||
From a59b0c0df5dcb8477e228b39220111afa5cc613b Mon Sep 17 00:00:00 2001
|
||||
From: mezz <tehgeek@gmail.com>
|
||||
Date: Wed, 9 Aug 2017 17:51:22 -0500
|
||||
Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 34d35f4fa5..71c4861712 100644
|
||||
index a8cfdd0eee..250767b94e 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -738,7 +738,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -734,7 +734,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
gameprofilerfiller.enter("blockEntities");
|
||||
timings.tileEntityTick.startTiming(); // Spigot
|
||||
if (!this.tileEntityListUnload.isEmpty()) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 383749850f3a3f183371c5c64b948ba013d108da Mon Sep 17 00:00:00 2001
|
||||
From 03a73fb408c0fd33d099d368be332b0e74ad27c9 Mon Sep 17 00:00:00 2001
|
||||
From: Brokkonaut <hannos17@gmx.de>
|
||||
Date: Tue, 31 Oct 2017 03:26:18 +0100
|
||||
Subject: [PATCH] Send attack SoundEffects only to players who can see the
|
||||
|
@ -72,10 +72,10 @@ index b8fe15f1a1..ec0982b587 100644
|
|||
entity.extinguish();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 71c4861712..bc847e409c 100644
|
||||
index 250767b94e..3d5b3892f1 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -675,6 +675,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -671,6 +671,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
this.a(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From f521cea313549b8e060942592f1d8d3d82c3c51f Mon Sep 17 00:00:00 2001
|
||||
From b6382d7274d553395afcdb16bf13570d4f16f862 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Thu, 16 Nov 2017 12:12:41 +0000
|
||||
Subject: [PATCH] use CB BlockState implementations for captured blocks
|
||||
|
@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping
|
|||
information on restoration when the event is cancelled.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index bc847e409c..d7229f100b 100644
|
||||
index 3d5b3892f1..0fc24f2076 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -352,7 +352,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -348,7 +348,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
// CraftBukkit start - capture blockstates
|
||||
CraftBlockState blockstate = null;
|
||||
if (this.captureBlockStates) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From ce83efc44b6f9f0820ef8e9a8e1729079b07815e Mon Sep 17 00:00:00 2001
|
||||
From f6bcaaa7b098b2b008799be198f4ea8aea97dd9e Mon Sep 17 00:00:00 2001
|
||||
From: Hugo Manrique <hugmanrique@gmail.com>
|
||||
Date: Mon, 23 Jul 2018 12:57:39 +0200
|
||||
Subject: [PATCH] Option to prevent armor stands from doing entity lookups
|
||||
|
@ -21,10 +21,10 @@ index 83e54cb904..f06bb3ae19 100644
|
|||
private void maxEntityCollision() {
|
||||
maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) );
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 5cf3aea4fc..dbb4eb0a88 100644
|
||||
index 299a316a4b..d205ec01ac 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -877,6 +877,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -873,6 +873,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 7870b98036432b99de7ef1b689f9942641969c65 Mon Sep 17 00:00:00 2001
|
||||
From 92f3ec2f8d295fd2fb464c5df0ed21abb32337fc Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 7 Oct 2018 00:54:21 -0500
|
||||
Subject: [PATCH] Add sun related API
|
||||
|
@ -17,10 +17,10 @@ index c2771c5d94..c81e530902 100644
|
|||
if (this.world.J() && !this.world.isClientSide) {
|
||||
float f = this.aE();
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index dbb4eb0a88..d13e4cf735 100644
|
||||
index d205ec01ac..ce7e019208 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -667,6 +667,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -663,6 +663,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 6182c6be4850382a36d038958f64705b6c86114c Mon Sep 17 00:00:00 2001
|
||||
From 1277578bbc3593a59a9b11fbdfa8b1e5c4ede12d Mon Sep 17 00:00:00 2001
|
||||
From: theosib <millerti@172.16.221.1>
|
||||
Date: Thu, 27 Sep 2018 01:43:35 -0600
|
||||
Subject: [PATCH] Optimize redstone algorithm
|
||||
|
@ -1124,10 +1124,10 @@ index 7ce9cdb853..6b5015ce5f 100644
|
|||
c(iblockdata, world, blockposition);
|
||||
world.a(blockposition, false);
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index d13e4cf735..f811ef8cc8 100644
|
||||
index ce7e019208..638b9887c0 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -556,6 +556,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -552,6 +552,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ index d13e4cf735..f811ef8cc8 100644
|
|||
public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
|
||||
if (!this.isClientSide) {
|
||||
IBlockData iblockdata = this.getType(blockposition);
|
||||
@@ -1302,6 +1303,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -1298,6 +1299,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
return this.getBlockFacePower(blockposition.down(), EnumDirection.DOWN) > 0 ? true : (this.getBlockFacePower(blockposition.up(), EnumDirection.UP) > 0 ? true : (this.getBlockFacePower(blockposition.north(), EnumDirection.NORTH) > 0 ? true : (this.getBlockFacePower(blockposition.south(), EnumDirection.SOUTH) > 0 ? true : (this.getBlockFacePower(blockposition.west(), EnumDirection.WEST) > 0 ? true : this.getBlockFacePower(blockposition.east(), EnumDirection.EAST) > 0))));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 4e6332dea1e906cd1261ee8d7ca68a4023bac8ea Mon Sep 17 00:00:00 2001
|
||||
From 25f37ee20fbc715dfb9692e1ed7b817b2fe65b85 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 6 Feb 2019 00:20:33 -0500
|
||||
Subject: [PATCH] BlockDestroyEvent
|
||||
|
@ -11,10 +11,10 @@ floating in the air.
|
|||
This can replace many uses of BlockPhysicsEvent
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index f811ef8cc8..0324191551 100644
|
||||
index 638b9887c0..988f778f19 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -486,8 +486,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -482,8 +482,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
return false;
|
||||
} else {
|
||||
Fluid fluid = this.getFluid(blockposition);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 23f3d0db1d1c00b42cd80431fafacc551af8056a Mon Sep 17 00:00:00 2001
|
||||
From d52cb07a6bf06ed929ba2721540898488051e980 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 6 Apr 2019 10:16:48 -0400
|
||||
Subject: [PATCH] Optimize Captured TileEntity Lookup
|
||||
|
@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
|
|||
just do a get call since the value can never be null.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 0324191551..177ea8f4cd 100644
|
||||
index 988f778f19..469d967a43 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1049,12 +1049,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -1045,12 +1045,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
return null;
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
From e26b52705a78ba126636037a2dcce82441872159 Mon Sep 17 00:00:00 2001
|
||||
From ff1e504ed0f719e661b54f913b64a769b62bda55 Mon Sep 17 00:00:00 2001
|
||||
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
Date: Tue, 1 Jan 2019 02:22:01 -0800
|
||||
Subject: [PATCH] Add Heightmap API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 177ea8f4cd..a12964f904 100644
|
||||
index 469d967a43..78bae25255 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -625,8 +625,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
@@ -621,8 +621,8 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From c64f25a169f864c9423a75e2f52ca16b9ea1c64b Mon Sep 17 00:00:00 2001
|
||||
From ab8e9ba312df771c66db2e4a84895c8ffde3d9ad Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Tue, 21 May 2019 02:34:04 +0100
|
||||
Subject: [PATCH] improve CraftWorld#isChunkLoaded
|
||||
|
@ -9,7 +9,7 @@ waiting for the execution queue to get to our request; We can just query
|
|||
the chunk status and get a response now, vs having to wait
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0328eadf27..7b17a634c2 100644
|
||||
index 0328eadf27..4e1fd76bbd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -382,8 +382,7 @@ public class CraftWorld implements World {
|
||||
|
@ -18,7 +18,7 @@ index 0328eadf27..7b17a634c2 100644
|
|||
public boolean isChunkLoaded(int x, int z) {
|
||||
- net.minecraft.server.Chunk chunk = world.getChunkProvider().getChunkAt(x, z, false);
|
||||
- return chunk != null;
|
||||
+ return world.getChunkProvider().isLoaded(x, z);// Paper
|
||||
+ return world.getChunkProvider().getChunkAtIfLoadedImmediately(x, z) != null; // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue