Move getTypeIfLoaded and friends to IBlockAccess (#2077)

This commit is contained in:
Spottedleaf 2019-05-26 23:14:14 -07:00 committed by Zach
parent 90141ff411
commit 5dc46cd3b2
139 changed files with 508 additions and 370 deletions

View File

@ -1,4 +1,4 @@
From cc06df92293c73ca71ab2542a33a665e21d290b7 Mon Sep 17 00:00:00 2001
From 53952ace87eec73c1b221d705a5d92c7ab7d560b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 30 Mar 2016 19:36:20 -0400
Subject: [PATCH] MC Dev fixes

View File

@ -1,4 +1,4 @@
From 79e06adaed0644fd436bf25e6ea36698e5327395 Mon Sep 17 00:00:00 2001
From 455709eb3fa018d50a6fea993e346ae69f8a05ed 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
@ -19,6 +19,29 @@ index 2f2b103641..b1900ba364 100644
void c(AttributeModifier attributemodifier);
void b(UUID uuid);
diff --git a/src/main/java/net/minecraft/server/BlockAccessAir.java b/src/main/java/net/minecraft/server/BlockAccessAir.java
index e8ab5d3221..d7a68a1ef7 100644
--- a/src/main/java/net/minecraft/server/BlockAccessAir.java
+++ b/src/main/java/net/minecraft/server/BlockAccessAir.java
@@ -14,6 +14,18 @@ public enum BlockAccessAir implements IBlockAccess {
return null;
}
+ // Paper start - If loaded util
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ return this.getFluid(blockposition);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ return this.getType(blockposition);
+ }
+ // Paper end
+
@Override
public IBlockData getType(BlockPosition blockposition) {
return Blocks.AIR.getBlockData();
diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java
index b370316574..841c7d1904 100644
--- a/src/main/java/net/minecraft/server/BlockDataAbstract.java
@ -69,7 +92,7 @@ index dd47e9cbe4..c927d524a8 100644
return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2));
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index ca73bfbd83..26414a07a2 100644
index ca73bfbd83..2cbae8230f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger;
@ -81,7 +104,26 @@ index ca73bfbd83..26414a07a2 100644
private final ChunkSection[] sections;
private final BiomeBase[] d;
private final Map<BlockPosition, NBTTagCompound> e;
@@ -400,6 +400,7 @@ public class Chunk implements IChunkAccess {
@@ -213,6 +213,18 @@ public class Chunk implements IChunkAccess {
}
}
+ // Paper start - If loaded util
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ return this.getFluid(blockposition);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ return this.getType(blockposition);
+ }
+ // Paper end
+
@Override
public Fluid getFluid(BlockPosition blockposition) {
return this.a(blockposition.getX(), blockposition.getY(), blockposition.getZ());
@@ -400,6 +412,7 @@ public class Chunk implements IChunkAccess {
return this.a(blockposition, Chunk.EnumTileEntityState.CHECK);
}
@ -89,6 +131,41 @@ index ca73bfbd83..26414a07a2 100644
@Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
index 2c9bf7d00f..ccbc1dde09 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
@@ -47,6 +47,30 @@ public class ChunkCache implements IWorldReader {
return this.e.getLightLevel(blockposition, i);
}
+ // Paper start - if loaded util
+ @Nullable
+ @Override
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
+ IChunkAccess chunk = this.getChunkAt(x, z, ChunkStatus.FULL, false);
+ if (chunk instanceof ChunkEmpty) {
+ return null;
+ }
+ return chunk;
+ }
+
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ return chunk == null ? null : chunk.getFluid(blockposition);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ return chunk == null ? null : chunk.getType(blockposition);
+ }
+ // Paper end
+
@Nullable
@Override
public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) {
diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
index 857b2f8868..bbf136614c 100644
--- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java
@ -267,6 +344,47 @@ index 4510018d6f..c0d5112444 100644
public void a(R r0) {
this.d.add(r0);
LockSupport.unpark(this.getThread());
diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
index 6e365f402c..577b227758 100644
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
@@ -9,10 +9,24 @@ public interface IBlockAccess {
@Nullable
TileEntity getTileEntity(BlockPosition blockposition);
+ IBlockData getTypeIfLoaded(BlockPosition blockposition); // Paper - if loaded util
IBlockData getType(BlockPosition blockposition);
+ Fluid getFluidIfLoaded(BlockPosition blockposition); // Paper - if loaded util
Fluid getFluid(BlockPosition blockposition);
+ // Paper start - if loaded util
+ default Material getMaterialIfLoaded(BlockPosition blockposition) {
+ IBlockData type = this.getTypeIfLoaded(blockposition);
+ return type == null ? null : type.getMaterial();
+ }
+
+ default Block getBlockIfLoaded(BlockPosition blockposition) {
+ IBlockData type = this.getTypeIfLoaded(blockposition);
+ return type == null ? null : type.getBlock();
+ }
+ // Paper end
+
default int h(BlockPosition blockposition) {
return this.getType(blockposition).h();
}
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
index 9a98fb4af5..17dac8dfa4 100644
--- a/src/main/java/net/minecraft/server/IWorldReader.java
+++ b/src/main/java/net/minecraft/server/IWorldReader.java
@@ -39,6 +39,7 @@ public interface IWorldReader extends IIBlockAccess {
int getLightLevel(BlockPosition blockposition, int i);
+ @Nullable IChunkAccess getChunkIfLoadedImmediately(int x, int z); // Paper - ifLoaded api (we need this since current impl blocks if the chunk is loading)
@Nullable
IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag);
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index e975265a28..aa6a58dd88 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
@ -805,6 +923,60 @@ index b3824898da..bf4172be52 100644
public static ItemStack a(ItemStack itemstack, PotionRegistry potionregistry) {
MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry);
diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java
index 6296611f19..807bd68485 100644
--- a/src/main/java/net/minecraft/server/ProtoChunk.java
+++ b/src/main/java/net/minecraft/server/ProtoChunk.java
@@ -79,6 +79,18 @@ public class ProtoChunk implements IChunkAccess {
}
+ // Paper start - If loaded util
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ return this.getFluid(blockposition);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ return this.getType(blockposition);
+ }
+ // Paper end
+
@Override
public IBlockData getType(BlockPosition blockposition) {
int i = blockposition.getY();
diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
index 33db1403fe..aff3591ec8 100644
--- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
+++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java
@@ -106,6 +106,26 @@ public class RegionLimitedWorldAccess implements GeneratorAccess {
return i >= ichunkaccess.getPos().x && i <= ichunkaccess1.getPos().x && j >= ichunkaccess.getPos().z && j <= ichunkaccess1.getPos().z;
}
+ // Paper start - if loaded util
+ @Nullable
+ @Override
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
+ return this.getChunkAt(x, z, ChunkStatus.FULL, false);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ return chunk == null ? null : chunk.getType(blockposition);
+ }
+
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+ return chunk == null ? null : chunk.getFluid(blockposition);
+ }
+ // Paper end
+
@Override
public IBlockData getType(BlockPosition blockposition) {
return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4).getType(blockposition);
diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java
index 4efcb8b595..60948afa4e 100644
--- a/src/main/java/net/minecraft/server/RegistryBlockID.java
@ -831,10 +1003,55 @@ 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 923d8e28e7..404d3d8c82 100644
index 923d8e28e7..541fc0cf94 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -371,8 +371,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -210,6 +210,44 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL);
}
+ // Paper start - if loaded
+ @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);
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ // CraftBukkit start - tree generation
+ if (captureTreeGeneration) {
+ for (CraftBlockState previous : capturedBlockStates) {
+ if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) {
+ return previous.getHandle();
+ }
+ }
+ }
+ // CraftBukkit end
+ if (!isValidLocation(blockposition)) {
+ return Blocks.AIR.getBlockData();
+ }
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+
+ return chunk == null ? null : chunk.getType(blockposition);
+ }
+
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ IChunkAccess chunk = this.getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
+
+ return chunk == null ? null : chunk.getFluid(blockposition);
+ }
+ // Paper end
+
@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
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
@ -858,6 +1075,33 @@ index 42f7bb0f7d..5d71addb0c 100644
/**
* Mirror
diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
index 755f7f2649..cd910f3dcb 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java
@@ -201,4 +201,22 @@ public class DummyGeneratorAccess implements GeneratorAccess {
public boolean b(BlockPosition blockposition, boolean flag) {
throw new UnsupportedOperationException("Not supported yet.");
}
+
+ // Paper start - if loaded util
+ @javax.annotation.Nullable
+ @Override
+ public IChunkAccess getChunkIfLoadedImmediately(int x, int z) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @Override
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ // Paper end
}
--
2.21.0

View File

@ -1,4 +1,4 @@
From 32e02b9ab75edabd42a8e9302fd2d063c980542d Mon Sep 17 00:00:00 2001
From 1f5d2fdb86b5f80245f453099885feb063f1af22 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 01:40:13 -0400
Subject: [PATCH] Add MinecraftKey Information to Objects

View File

@ -1,4 +1,4 @@
From b4105584eaa5975d541fae230fb5562c59bdc4ba Mon Sep 17 00:00:00 2001
From 81c056ba360b52b5661c92d34a72d15812efa9ad Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:10:36 -0400
Subject: [PATCH] Store reference to current Chunk for Entity and Block
@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead
of having to look it up by hashmap lookups.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 26414a07a2..ce40882b17 100644
index 2cbae8230f..4d1326efb4 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -29,7 +29,7 @@ public class Chunk implements IChunkAccess {
@ -58,7 +58,7 @@ index 26414a07a2..ce40882b17 100644
this.l = Maps.newHashMap();
this.m = Maps.newHashMap();
this.n = new ShortList[16];
@@ -354,6 +379,7 @@ public class Chunk implements IChunkAccess {
@@ -366,6 +391,7 @@ public class Chunk implements IChunkAccess {
}
entity.inChunk = true;
@ -66,7 +66,7 @@ index 26414a07a2..ce40882b17 100644
entity.chunkX = this.loc.x;
entity.chunkY = k;
entity.chunkZ = this.loc.z;
@@ -365,6 +391,7 @@ public class Chunk implements IChunkAccess {
@@ -377,6 +403,7 @@ public class Chunk implements IChunkAccess {
((HeightMap) this.heightMap.get(heightmap_type)).a(along);
}
@ -74,7 +74,7 @@ index 26414a07a2..ce40882b17 100644
public void b(Entity entity) {
this.a(entity, entity.chunkY);
}
@@ -377,8 +404,12 @@ public class Chunk implements IChunkAccess {
@@ -389,8 +416,12 @@ public class Chunk implements IChunkAccess {
if (i >= this.entitySlices.length) {
i = this.entitySlices.length - 1;
}

View File

@ -1,4 +1,4 @@
From b0d8c37bfea84dd51fffd1e950e359bdc819e832 Mon Sep 17 00:00:00 2001
From d575c325a1b4d90238df8f470c66830ecf154ad6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:13:59 -0400
Subject: [PATCH] Store counts for each Entity/Block Entity Type
@ -6,7 +6,7 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type
Opens door for future patches to optimize performance
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index ce40882b17..7bcbe601bc 100644
index 4d1326efb4..787490faac 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -56,15 +56,19 @@ public class Chunk implements IChunkAccess {
@ -37,7 +37,7 @@ index ce40882b17..7bcbe601bc 100644
}
return removed;
}
@@ -378,6 +383,7 @@ public class Chunk implements IChunkAccess {
@@ -390,6 +395,7 @@ public class Chunk implements IChunkAccess {
k = this.entitySlices.length - 1;
}
@ -45,7 +45,7 @@ index ce40882b17..7bcbe601bc 100644
entity.inChunk = true;
entity.setCurrentChunk(this); // Paper
entity.chunkX = this.loc.x;
@@ -409,6 +415,7 @@ public class Chunk implements IChunkAccess {
@@ -421,6 +427,7 @@ public class Chunk implements IChunkAccess {
if (!this.entitySlices[i].remove(entity)) {
return;
}

View File

@ -1,4 +1,4 @@
From 87f684f7a17d5cbd42d489b31ae07bafc47e8435 Mon Sep 17 00:00:00 2001
From f32a46fdeb9d66f009b8a0c10935e60632bebcd5 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
@ -322,10 +322,10 @@ index afa9f0c1e6..85a5776b04 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 7bcbe601bc..0d1cafe3d8 100644
index 787490faac..4ec0c22233 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -540,6 +540,7 @@ public class Chunk implements IChunkAccess {
@@ -552,6 +552,7 @@ public class Chunk implements IChunkAccess {
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(this.bukkitChunk, this.needsDecoration));
if (this.needsDecoration) {
@ -333,7 +333,7 @@ index 7bcbe601bc..0d1cafe3d8 100644
this.needsDecoration = false;
java.util.Random random = new java.util.Random();
random.setSeed(world.getSeed());
@@ -559,6 +560,7 @@ public class Chunk implements IChunkAccess {
@@ -571,6 +572,7 @@ public class Chunk implements IChunkAccess {
}
}
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(bukkitChunk));
@ -973,7 +973,7 @@ index 7546f6690b..095ef9ba51 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 404d3d8c82..93fa091216 100644
index 541fc0cf94..ecf334e535 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 404d3d8c82..93fa091216 100644
this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime);
this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime);
}
@@ -739,21 +740,26 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -777,21 +778,26 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
timings.tileEntityPending.stopTiming(); // Spigot

View File

@ -1,4 +1,4 @@
From 1435329d80816a339495ea99435f9a8df6ccaf3e Mon Sep 17 00:00:00 2001
From 3ddcc8e9b829b3ba3fd1083e2cbe543a5f9c0c63 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 14:14:15 -0600
Subject: [PATCH] Drop falling block and tnt entities at the specified height

View File

@ -1,14 +1,14 @@
From c16942339b1862fb48630e8de20f79559dadcf94 Mon Sep 17 00:00:00 2001
From b3eef60e49a65dd67c160fd3fc6d11456b77c44e Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Tue, 1 Mar 2016 15:08:03 -0600
Subject: [PATCH] Remove invalid mob spawner tile entities
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 0d1cafe3d8..ad2c49df52 100644
index 4ec0c22233..318035a48e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -494,6 +494,10 @@ public class Chunk implements IChunkAccess {
@@ -506,6 +506,10 @@ public class Chunk implements IChunkAccess {
}
// CraftBukkit start

View File

@ -1,4 +1,4 @@
From e63f67c77aaff7ad6779485839de524816d225b0 Mon Sep 17 00:00:00 2001
From f394769c4ad8881b21c3e2931a2a01c075a241a3 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 8 Mar 2015 22:55:25 -0600
Subject: [PATCH] Optimize TileEntity Ticking

View File

@ -1,4 +1,4 @@
From 96b25316334d6d05d22da12271ce2c12b3a8da77 Mon Sep 17 00:00:00 2001
From 57df59aeea7c458019b13260624d79ef7f1704d7 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

View File

@ -1,11 +1,11 @@
From 4d084776d0ce9cdda67239aa16e4eeb445c97774 Mon Sep 17 00:00:00 2001
From fcbb62d33056f461daaa3d81fdfc0b8667bd29d8 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
diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java
index 095ef9ba5..b99bcbf8a 100644
index 095ef9ba51..b99bcbf8a4 100644
--- a/src/main/java/net/minecraft/server/TileEntity.java
+++ b/src/main/java/net/minecraft/server/TileEntity.java
@@ -199,7 +199,12 @@ public abstract class TileEntity implements KeyedObject { // Paper
@ -23,10 +23,10 @@ index 095ef9ba5..b99bcbf8a 100644
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index f9f14cc1f..cfbe3d592 100644
index d659b7613f..4369574891 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -680,11 +680,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -718,11 +718,13 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
gameprofilerfiller.exit();
} catch (Throwable throwable) {
@ -45,7 +45,7 @@ index f9f14cc1f..cfbe3d592 100644
}
// Spigot start
finally {
@@ -753,11 +755,12 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -791,11 +793,12 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// Spigot end
consumer.accept(entity);
} catch (Throwable throwable) {

View File

@ -1,4 +1,4 @@
From 52d7305ce22a2ec8252da7362741f89ed31247a4 Mon Sep 17 00:00:00 2001
From 34c016eb943d594c20a8e2445f4b31177a43a280 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 1 Mar 2016 23:58:50 -0600
Subject: [PATCH] Configurable top of nether void damage

View File

@ -1,4 +1,4 @@
From 9293b643974ed4899b2eb15c538ca0319a1e2ac8 Mon Sep 17 00:00:00 2001
From 86fde0759e459ea013497fca2cd7e5530edcb049 Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Wed, 2 Mar 2016 23:13:07 -0600
Subject: [PATCH] Send absolute position the first time an entity is seen

View File

@ -1,14 +1,14 @@
From 97ea789a78f69ed7201f63a91ab59587719f3dc5 Mon Sep 17 00:00:00 2001
From 96a5e81f64bf7dd5431e78b5b08080e88f9e2340 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 62098b2fc7..47defb2f0a 100644
index c792b713fc..6d900669d7 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -651,9 +651,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -689,9 +689,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// Spigot start
// Iterator iterator = this.tileEntityListTick.iterator();
int tilesThisCycle = 0;

View File

@ -1,4 +1,4 @@
From 542a784ae0d8fd10d0fbe3279d719526bd4ac836 Mon Sep 17 00:00:00 2001
From 3fe8c35abd7b40ad2ac20e7a686e33fd42fff9c3 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
@ -49,7 +49,7 @@ index 0000000000..f699ce18ca
+ }
+}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index ad2c49df52..36023073e9 100644
index 318035a48e..879a491920 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1,5 +1,6 @@
@ -59,7 +59,7 @@ index ad2c49df52..36023073e9 100644
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
@@ -499,10 +500,15 @@ public class Chunk implements IChunkAccess {
@@ -511,10 +512,15 @@ public class Chunk implements IChunkAccess {
this.tileEntities.remove(blockposition);
// Paper end
} else {
@ -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 0749447184..a50842b13a 100644
index 72435a2c07..373d08b23a 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 0749447184..a50842b13a 100644
import com.google.common.collect.Lists;
import java.io.IOException;
import java.util.Collection;
@@ -681,8 +684,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -719,8 +722,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 0749447184..a50842b13a 100644
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
continue;
@@ -756,8 +762,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -794,8 +800,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
consumer.accept(entity);
} catch (Throwable throwable) {
// Paper start - Prevent tile entity and entity crashes

View File

@ -1,4 +1,4 @@
From 6df96556955d6c64ce8268392e1c82c400137340 Mon Sep 17 00:00:00 2001
From 3585e8276df5489e11fde61e640a57058196b052 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 8 Mar 2016 23:25:45 -0500
Subject: [PATCH] Disable Scoreboards for non players by default

View File

@ -1,4 +1,4 @@
From 4c6f083d51eed6eac3103bbab68c9f92857b04c4 Mon Sep 17 00:00:00 2001
From 23db71afbfe996b7afeed9e005fe8c192eb48cca 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/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 36023073e9..4248a50142 100644
index 879a491920..d246970d3e 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -359,6 +359,7 @@ public class Chunk implements IChunkAccess {
@@ -371,6 +371,7 @@ public class Chunk implements IChunkAccess {
return this.world.getChunkProvider().getLightEngine();
}
@ -17,35 +17,8 @@ index 36023073e9..4248a50142 100644
public int a(BlockPosition blockposition, int i) {
return this.a(blockposition, i, this.world.getWorldProvider().g());
}
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
index 9a98fb4af5..452b2b2d28 100644
--- a/src/main/java/net/minecraft/server/IWorldReader.java
+++ b/src/main/java/net/minecraft/server/IWorldReader.java
@@ -38,6 +38,22 @@ public interface IWorldReader extends IIBlockAccess {
}
int getLightLevel(BlockPosition blockposition, int i);
+ // Paper start
+ default @Nullable
+ IBlockData getTypeIfLoaded(BlockPosition var1) {
+ return isLoaded(var1) ? getType(var1) : null;
+ }
+
+ default @Nullable
+ Block getBlockIfLoaded(BlockPosition var1) {
+ return isLoaded(var1) ? getType(var1).getBlock() : null;
+ }
+
+ default @Nullable
+ Material getMaterialIfLoaded(BlockPosition var1) {
+ return isLoaded(var1) ? getType(var1).getMaterial() : null;
+ }
+ // Paper end
@Nullable
IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index a50842b13a..d4be7e884d 100644
index 373d08b23a..e43b1d27c3 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -46,7 +46,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@ -57,7 +30,7 @@ index a50842b13a..d4be7e884d 100644
protected int j = (new Random()).nextInt();
protected final int k = 1013904223;
protected float lastRainLevel;
@@ -208,6 +208,84 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -208,6 +208,54 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return i < 0 || i >= 256;
}
@ -107,36 +80,6 @@ index a50842b13a..d4be7e884d 100644
+ public IBlockData getTypeIfLoadedAndInBounds(BlockPosition blockposition) {
+ return getWorldBorder().isInBounds(blockposition) ? getTypeIfLoaded(blockposition) : null;
+ }
+ public IBlockData getTypeIfLoaded(BlockPosition blockposition) {
+ // CraftBukkit start - tree generation
+ if (captureTreeGeneration) {
+ for (CraftBlockState previous : capturedBlockStates) {
+ if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) {
+ return previous.getHandle();
+ }
+ }
+ }
+ // CraftBukkit end
+ Chunk chunk = this.getChunkIfLoaded(blockposition);
+ if (chunk != null) {
+ return isValidLocation(blockposition) ? chunk.getType(blockposition) : Blocks.AIR.getBlockData();
+ }
+ return null;
+ }
+ public Block getBlockIfLoaded(BlockPosition blockposition) {
+ IBlockData type = getTypeIfLoaded(blockposition);
+ if (type == null) {
+ return null;
+ }
+ return type.getBlock();
+ }
+ public Material getMaterialIfLoaded(BlockPosition blockposition) {
+ IBlockData type = getTypeIfLoaded(blockposition);
+ if (type == null) {
+ return null;
+ }
+ return type.getBlock().material;
+ }
+ // Paper end
+
public Chunk getChunkAtWorldCoords(BlockPosition blockposition) {

View File

@ -1,4 +1,4 @@
From f9f1fae13e164ae6bf3c806d2d36ddfe22c4e707 Mon Sep 17 00:00:00 2001
From 3cd7aa9e356f4411d171f22dedf7d1c326c48255 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 22 Mar 2016 00:33:47 -0400
Subject: [PATCH] Use a Shared Random for Entities

View File

@ -1,4 +1,4 @@
From e030acb6a8b7237fb2c15de4a837fd5a0d82c548 Mon Sep 17 00:00:00 2001
From b30d0058811703ff694e7762936418b48df12565 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 3 Mar 2016 02:07:55 -0600
Subject: [PATCH] Optimize isValidLocation, getType and getBlockData for inling
@ -52,7 +52,7 @@ index c927d524a8..64700b97c0 100644
public MutableBlockPosition() {
this(0, 0, 0);
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 4248a50142..82361fff08 100644
index d246970d3e..c211f8a43f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -203,12 +203,24 @@ public class Chunk implements IChunkAccess {
@ -98,7 +98,7 @@ index 30701fd7f3..43f75fc837 100644
public ChunkSection(int i) {
this(i, (short) 0, (short) 0, (short) 0);
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d4be7e884d..aef9e2e753 100644
index e43b1d27c3..6e655d292a 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -197,11 +197,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose

View File

@ -1,4 +1,4 @@
From ba19d0291f949d081ce4896fe2c752bbdb812c63 Mon Sep 17 00:00:00 2001
From b357ccc6a79be05c62a42d746988971ba50b21be 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
@ -6,7 +6,7 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java
index 9bf42bb5e..0526af776 100644
index 9bf42bb5ef..0526af776d 100644
--- a/src/main/java/net/minecraft/server/BlockPlant.java
+++ b/src/main/java/net/minecraft/server/BlockPlant.java
@@ -16,7 +16,7 @@ public class BlockPlant extends Block {
@ -19,7 +19,7 @@ index 9bf42bb5e..0526af776 100644
}
}
diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java
index 469a3be05..f2c429f22 100644
index 469a3be057..f2c429f22e 100644
--- a/src/main/java/net/minecraft/server/BlockTallPlant.java
+++ b/src/main/java/net/minecraft/server/BlockTallPlant.java
@@ -55,7 +55,7 @@ public class BlockTallPlant extends BlockPlant {
@ -32,7 +32,7 @@ index 469a3be05..f2c429f22 100644
}
// CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 31c9917f9..85b40ab7e 100644
index 454e28fc47..40b9bff98f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1096,6 +1096,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -44,10 +44,10 @@ index 31c9917f9..85b40ab7e 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 aef9e2e75..668b64f42 100644
index 6e655d292a..7f0a338d64 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -436,7 +436,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -444,7 +444,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 aef9e2e75..668b64f42 100644
BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata));
this.getServer().getPluginManager().callEvent(event);
@@ -548,7 +548,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -556,7 +556,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
try {
// CraftBukkit start
CraftWorld world = ((WorldServer) this).getWorld();
@ -66,7 +66,7 @@ index aef9e2e75..668b64f42 100644
this.getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
index 727faa35d..7c3d2d5de 100644
index 727faa35db..7c3d2d5def 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -68,6 +68,7 @@ public class WorldServer extends World {

View File

@ -1,4 +1,4 @@
From e2de33a4599dd3ac387524a19120ace674d14a08 Mon Sep 17 00:00:00 2001
From 2332bb0de0087ed2a7468fd651307f121ae8270a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 28 Mar 2016 20:46:14 -0400
Subject: [PATCH] Configurable Chunk Inhabited Time
@ -35,10 +35,10 @@ index 2a71381dae..e43866991c 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 82361fff08..2218552ba1 100644
index c211f8a43f..2da7c4531f 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -806,7 +806,7 @@ public class Chunk implements IChunkAccess {
@@ -818,7 +818,7 @@ public class Chunk implements IChunkAccess {
@Override
public long q() {

View File

@ -1,11 +1,11 @@
From 435410e1e7631cb7e5b169d2b0a7f6b8bad0992e Mon Sep 17 00:00:00 2001
From 8db9736ba4a038348d72fba78248990a7a89d97d 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 Pathfinding
diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java
index 2c9bf7d00..281f5f04f 100644
index ccbc1dde09..34e743716b 100644
--- a/src/main/java/net/minecraft/server/ChunkCache.java
+++ b/src/main/java/net/minecraft/server/ChunkCache.java
@@ -25,7 +25,7 @@ public class ChunkCache implements IWorldReader {
@ -13,43 +13,34 @@ index 2c9bf7d00..281f5f04f 100644
for (k = this.a; k <= i; ++k) {
for (l = this.b; l <= j; ++l) {
- this.c[k - this.a][l - this.b] = world.getChunkAt(k, l, ChunkStatus.FULL, false);
+ this.c[k - this.a][l - this.b] = world.getChunkIfLoaded(k, l); // Paper
+ this.c[k - this.a][l - this.b] = world.getChunkIfLoadedImmediately(k, l); // Paper
}
}
@@ -91,7 +91,7 @@ public class ChunkCache implements IWorldReader {
int k = i - this.a;
int l = j - this.b;
- return k >= 0 && k < this.c.length && l >= 0 && l < this.c[k].length;
+ return k >= 0 && k < this.c.length && l >= 0 && l < this.c[k].length && this.c[k][l] != null; // Paper - We don't always load chunks
}
@Override
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index d04eb1bbf..4a91e0d8c 100644
index d04eb1bbfe..ed69eaa176 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -22,8 +22,9 @@ public abstract class NavigationAbstract {
@@ -22,7 +22,7 @@ public abstract class NavigationAbstract {
protected long n;
protected PathfinderAbstract o;
private BlockPosition q;
- private Pathfinder r;
+ private Pathfinder r; public Pathfinder getPathfinder() { return r; } // Paper - OBFHELPER
+ private void setWorld() { if (getPathfinder() != null && getPathfinder().getPathfinder() != null) getPathfinder().getPathfinder().world = getEntity().world; } // Paper
public NavigationAbstract(EntityInsentient entityinsentient, World world) {
this.g = Vec3D.a;
this.h = Vec3D.a;
@@ -32,6 +33,7 @@ public abstract class NavigationAbstract {
this.b = world;
this.p = entityinsentient.getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
this.r = this.a(MathHelper.floor(this.p.getValue() * 16.0D));
+ setWorld(); // Paper
}
public BlockPosition h() {
@@ -177,6 +179,7 @@ public abstract class NavigationAbstract {
}
public void c() {
+ setWorld(); // Paper
++this.e;
if (this.m) {
this.k();
diff --git a/src/main/java/net/minecraft/server/Pathfinder.java b/src/main/java/net/minecraft/server/Pathfinder.java
index 359d9a11c..262fa5585 100644
index 359d9a11c0..262fa55850 100644
--- a/src/main/java/net/minecraft/server/Pathfinder.java
+++ b/src/main/java/net/minecraft/server/Pathfinder.java
@@ -12,7 +12,7 @@ public class Pathfinder {
@ -61,28 +52,8 @@ index 359d9a11c..262fa5585 100644
public Pathfinder(PathfinderAbstract pathfinderabstract, int i) {
this.e = pathfinderabstract;
diff --git a/src/main/java/net/minecraft/server/PathfinderAbstract.java b/src/main/java/net/minecraft/server/PathfinderAbstract.java
index 92df34aba..e773bef61 100644
--- a/src/main/java/net/minecraft/server/PathfinderAbstract.java
+++ b/src/main/java/net/minecraft/server/PathfinderAbstract.java
@@ -7,6 +7,7 @@ public abstract class PathfinderAbstract {
protected IWorldReader a;
protected EntityInsentient b;
+ public World world; // Paper
protected final Int2ObjectMap<PathPoint> c = new Int2ObjectOpenHashMap();
protected int d;
protected int e;
@@ -19,6 +20,7 @@ public abstract class PathfinderAbstract {
public void a(IWorldReader iworldreader, EntityInsentient entityinsentient) {
this.a = iworldreader;
+ if (iworldreader instanceof World) world = (World) iworldreader; // Paper
this.b = entityinsentient;
this.c.clear();
this.d = MathHelper.d(entityinsentient.getWidth() + 1.0F);
diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java
index d97166f8f..51991b8c8 100644
index d97166f8f0..0cea9db8f5 100644
--- a/src/main/java/net/minecraft/server/PathfinderNormal.java
+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java
@@ -355,7 +355,8 @@ public class PathfinderNormal extends PathfinderAbstract {
@ -90,7 +61,7 @@ index d97166f8f..51991b8c8 100644
if (pathtype == PathType.OPEN && j >= 1) {
- Block block = iblockaccess.getType(new BlockPosition(i, j - 1, k)).getBlock();
+ Block block = world.getBlockIfLoaded(new BlockPosition(i, j - 1, k)); // Paper
+ Block block = iblockaccess.getBlockIfLoaded(new BlockPosition(i, j - 1, k)); // Paper
+ if (block == null) return PathType.BLOCKED; // Paper
PathType pathtype1 = this.b(iblockaccess, i, j - 1, k);
@ -100,7 +71,7 @@ index d97166f8f..51991b8c8 100644
for (int i1 = -1; i1 <= 1; ++i1) {
if (l != 0 || i1 != 0) {
- Block block = iblockaccess.getType(blockposition_pooledblockposition.d(l + i, j, i1 + k)).getBlock();
+ Block block = world.getBlockIfLoaded(blockposition_pooledblockposition.d(l + i, j, i1 + k)); // Paper
+ Block block = iblockaccess.getBlockIfLoaded(blockposition_pooledblockposition.d(l + i, j, i1 + k)); // Paper
- if (block == Blocks.CACTUS) {
+ if (block == null) pathtype = PathType.BLOCKED; // Paper
@ -113,7 +84,7 @@ index d97166f8f..51991b8c8 100644
protected PathType b(IBlockAccess iblockaccess, int i, int j, int k) {
BlockPosition blockposition = new BlockPosition(i, j, k);
- IBlockData iblockdata = iblockaccess.getType(blockposition);
+ IBlockData iblockdata = world.getTypeIfLoaded(blockposition); // Paper
+ IBlockData iblockdata = iblockaccess.getTypeIfLoaded(blockposition); // Paper
+ if (iblockdata == null) return PathType.BLOCKED; // Paper
Block block = iblockdata.getBlock();
Material material = iblockdata.getMaterial();

View File

@ -1,4 +1,4 @@
From 87bce7598f50c3155e874eea128e934660a451bd Mon Sep 17 00:00:00 2001
From 27a39fec91cc911138b2e076b4268aee75bcdfc3 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 c31585f92f..801923c758 100644
index 7f0a338d64..8ad4fbff21 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -588,6 +588,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -596,6 +596,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
if (blockposition.getY() >= 256) {
blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ());
}

View File

@ -1,14 +1,14 @@
From 622849f3160bcae3ad5763d2ba408cf679364397 Mon Sep 17 00:00:00 2001
From 0fbc89449c74ab4d1a538d060a61a914888c7a0c 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 801923c758..d13cf1014d 100644
index 8ad4fbff21..b5e8de64ce 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -506,6 +506,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -514,6 +514,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
public void m(BlockPosition blockposition) {}
public void applyPhysics(BlockPosition blockposition, Block block) {

View File

@ -1,4 +1,4 @@
From 00b367a9cebfde5f675a34b83738c65cf3389278 Mon Sep 17 00:00:00 2001
From 97a894ab9f9e161d6809ad9e228899da61e50341 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 be18e029d..02ef71bb4 100644
index b5e8de64ce..aaf22401b0 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 be18e029d..02ef71bb4 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
@@ -688,9 +688,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -696,9 +696,9 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}, tileentity::getPosition});
}
@ -30,7 +30,7 @@ index be18e029d..02ef71bb4 100644
this.tileEntityListTick.add(tileentity);
}
@@ -726,7 +726,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -734,7 +734,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 be18e029d..02ef71bb4 100644
this.tileEntityListUnload.clear();
}
@@ -787,7 +787,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -795,7 +795,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
tilesThisCycle--;
this.tileEntityListTick.remove(tileTickPosition--);
// Spigot end
@ -48,7 +48,7 @@ index be18e029d..02ef71bb4 100644
if (this.isLoaded(tileentity.getPosition())) {
this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition());
}
@@ -817,7 +817,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -825,7 +825,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 be18e029d..02ef71bb4 100644
this.a(tileentity1);
}
// CraftBukkit end
@@ -1085,7 +1085,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -1093,7 +1093,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
} else {
if (tileentity != null) {
this.tileEntityListPending.remove(tileentity);

View File

@ -1,4 +1,4 @@
From 7f41234639b4cb4cf2b7ccfa93b6a1c0f7e1f2fa Mon Sep 17 00:00:00 2001
From 1a85f5369bbc8c7836c9599c5ad64dfcc7abddd5 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sun, 22 May 2016 20:20:55 -0500
Subject: [PATCH] Optional TNT doesn't move in water

View File

@ -1,4 +1,4 @@
From 64e061c48b6aa274b065227f41097124e74dbcdf Mon Sep 17 00:00:00 2001
From 73179058d09632fc4c845c480aad2ba42fe43e1a Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Wed, 5 Oct 2016 16:27:36 -0500
Subject: [PATCH] Option to remove corrupt tile entities
@ -19,10 +19,10 @@ index 92ab55182f..eed454bf40 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 2218552ba1..1964dd5faa 100644
index 2da7c4531f..7bd5a0a8cd 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -521,6 +521,12 @@ public class Chunk implements IChunkAccess {
@@ -533,6 +533,12 @@ public class Chunk implements IChunkAccess {
"Chunk coordinates: " + (this.loc.x * 16) + "," + (this.loc.z * 16));
e.printStackTrace();
ServerInternalException.reportInternalException(e);

View File

@ -1,4 +1,4 @@
From bd7ba68c3a9b35a34b430b27c0dc13421cac44ad Mon Sep 17 00:00:00 2001
From cad43ec9f2d9613bb004d977dfb6ab644004d670 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 19 Dec 2016 23:07:42 -0500
Subject: [PATCH] Prevent Pathfinding out of World Border
@ -6,10 +6,10 @@ Subject: [PATCH] Prevent Pathfinding out of World Border
This prevents Entities from trying to run outside of the World Border
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 4a91e0d8c..6cc142383 100644
index ed69eaa176..a473c03b9d 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -97,6 +97,7 @@ public abstract class NavigationAbstract {
@@ -95,6 +95,7 @@ public abstract class NavigationAbstract {
@Nullable
protected PathEntity a(BlockPosition blockposition, double d0, double d1, double d2, int i, boolean flag) { return this.a(blockposition, null, d0, d1, d2, i, flag); }
@Nullable protected PathEntity a(BlockPosition blockposition, Entity target, double d0, double d1, double d2, int i, boolean flag) {

View File

@ -1,4 +1,4 @@
From 8b2735474079bee3b5f7ff822ae037878ea7de5f Mon Sep 17 00:00:00 2001
From 3bfabae664d81e585174144586f077d50f08b505 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Wed, 21 Dec 2016 11:47:25 -0600
Subject: [PATCH] Add API methods to control if armour stands can move

View File

@ -1,4 +1,4 @@
From 72c7052d3f51fdb340450988e62aa07e363ee434 Mon Sep 17 00:00:00 2001
From ea1c3c3a55a8766a2ee6e55f27455620358b057a Mon Sep 17 00:00:00 2001
From: Alfie Cleveland <alfeh@me.com>
Date: Sun, 8 Jan 2017 04:31:36 +0000
Subject: [PATCH] Don't allow entities to ride themselves - #572

View File

@ -1,4 +1,4 @@
From 502dbd3de7735c337e09cf6bc8e0ab4c7768a270 Mon Sep 17 00:00:00 2001
From 06c825ad40db674576530530ebcae132c01246f4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 19 Dec 2017 16:31:46 -0500
Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player

View File

@ -1,4 +1,4 @@
From 496893f3f0e79fcbe4e8bd1e56c9e0d87a18e468 Mon Sep 17 00:00:00 2001
From f78c4709a8e3fcb9903cbcd51b1d838f8aeba7a7 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 7 Feb 2017 16:55:35 -0600
Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue

View File

@ -1,4 +1,4 @@
From 54c7ea62a3f9f63adbf48b11b52c6f71f5b3ae8c Mon Sep 17 00:00:00 2001
From 8fea9a77074a96d162428e31992ca045043601e6 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 18 Feb 2017 19:29:58 -0600
Subject: [PATCH] Do not let armorstands drown

View File

@ -1,4 +1,4 @@
From e3b6f70a01b369169f8350c3e00eea145efa2c32 Mon Sep 17 00:00:00 2001
From bae762930f9cd951d3d9e47e48866a1b478b2d41 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 18 Jun 2017 18:17:05 -0500
Subject: [PATCH] Entity#fromMobSpawner()

View File

@ -1,14 +1,14 @@
From 4a06cdf0e8a73013b84c46cd67d12b3cec8cbfb4 Mon Sep 17 00:00:00 2001
From b27774888fd71a46840514dfbe7365bd5b3a7e96 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 8ac081bef..f9413dd68 100644
index 6b2769343a..3e5c76d320 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -730,7 +730,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -738,7 +738,11 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
gameprofilerfiller.enter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {

View File

@ -1,4 +1,4 @@
From ed6075e3d366248adb9544ca2a8beb353ac27237 Mon Sep 17 00:00:00 2001
From e7cb55b9daedaadf7d829281d5b1fd6c20bbd32e 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
@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
index 05942fb7e..b97e34163 100644
index 05942fb7ed..b97e341635 100644
--- a/src/main/java/net/minecraft/server/EntityHuman.java
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
@@ -941,6 +941,15 @@ public abstract class EntityHuman extends EntityLiving {
@ -72,10 +72,10 @@ index 05942fb7e..b97e34163 100644
entity.extinguish();
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 3fa218a32..37884a606 100644
index 3e5c76d320..80e4b1184b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -667,6 +667,10 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -675,6 +675,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);
}

View File

@ -1,4 +1,4 @@
From 1e9ef944858c7c6d5a27733a67f1015f72a55fdc Mon Sep 17 00:00:00 2001
From dc14b767e4ac680892daed467628dfcaf97ab900 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 37884a606..e3de63489 100644
index 80e4b1184b..eed3fa615f 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -344,7 +344,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -352,7 +352,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
// CraftBukkit start - capture blockstates
CraftBlockState blockstate = null;
if (this.captureBlockStates) {

View File

@ -1,4 +1,4 @@
From cc7a1c0d1bb31906629c1987144297f4119ce6f3 Mon Sep 17 00:00:00 2001
From 87d7cc421201c5f02eb7239f622105656d7da142 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 14 Jan 2018 17:36:02 -0500
Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent

View File

@ -1,4 +1,4 @@
From 4f5eeec8eaa5f7aa6c737e15cc9d6edf27b5d611 Mon Sep 17 00:00:00 2001
From c9fe4ab598f91f6f0766aa0410bd5c6bc120e31d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 15 Aug 2017 22:29:12 -0400
Subject: [PATCH] Expand World.spawnParticle API and add Builder

View File

@ -1,4 +1,4 @@
From b03c5a441be0f76f6457a3893f45a669a1d00c9c Mon Sep 17 00:00:00 2001
From 49401a6fbf671bfeefc6345ccb5a41939e31cfac Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 4 Jun 2018 20:39:20 -0400
Subject: [PATCH] Allow spawning Item entities with World.spawnEntity

View File

@ -1,4 +1,4 @@
From c18eb58048bc05e38c7ad5114107e310372bc643 Mon Sep 17 00:00:00 2001
From a83e67078718ca23e078c070d46b1ece98d53db4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Jun 2018 23:17:24 -0400
Subject: [PATCH] Expand Explosions API

View File

@ -1,4 +1,4 @@
From 832fa176b42391c11fb25b3faf2d7f6bf1640614 Mon Sep 17 00:00:00 2001
From 327a00bc3afedc3657767dbda2e569561225f2d4 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 3 Jul 2018 16:08:14 +0200
Subject: [PATCH] Implement World.getEntity(UUID) API

View File

@ -1,4 +1,4 @@
From 69ad0de1285782fe479cbfb72b06049ee9c70181 Mon Sep 17 00:00:00 2001
From 00207f39a4fde43b78c2b2bac17875745a96ccbc Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 19 Jul 2018 01:13:28 -0400
Subject: [PATCH] add more information to Entity.toString()

View File

@ -1,4 +1,4 @@
From da44e0393b8daafae8dbb629791234d94b7bafcb Mon Sep 17 00:00:00 2001
From bfc9c19acdc9fbe4f30d639349845ba52d5bb8d2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 08:25:40 -0400
Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues
@ -40,7 +40,7 @@ index ed9e2e3e18..047d6df9c1 100644
protected void g() {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index e3de634893..db0c520394 100644
index eed3fa615f..f93e3faae2 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -68,6 +68,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose

View File

@ -1,4 +1,4 @@
From c47e8542bbaffdfc8674841dd389cce19be740b5 Mon Sep 17 00:00:00 2001
From 8bbb87374ea587a7f8569a0fc0cf6f1c976f72c6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 22 Jul 2018 21:21:41 -0400
Subject: [PATCH] Don't save Proto Chunks

View File

@ -1,4 +1,4 @@
From f8153d56e39989b43ad547558d86ae105f3a3aab Mon Sep 17 00:00:00 2001
From 01aa2958b9b145420ae4c3f8e52eb6de7e8322c6 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 db0c520394..8bb2e1bf0f 100644
index f93e3faae2..1f2e2cd873 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -869,6 +869,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -877,6 +877,14 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
}

View File

@ -1,11 +1,11 @@
From 54f403eda4d084c655c020e7a1d549c08c93d011 Mon Sep 17 00:00:00 2001
From b888645445f5dcb5604850e8540b19f5b0582f5e Mon Sep 17 00:00:00 2001
From: Hugo Manrique <hugmanrique@gmail.com>
Date: Mon, 23 Jul 2018 14:22:26 +0200
Subject: [PATCH] Vanished players don't have rights
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 54d025bf7..e3b1ebe62 100644
index 54d025bf7d..e3b1ebe629 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -97,7 +97,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
@ -18,7 +18,7 @@ index 54d025bf7..e3b1ebe62 100644
protected int j;
private Entity vehicle;
diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java
index ee22bb038..e5a013ffd 100644
index ee22bb0387..e5a013ffd2 100644
--- a/src/main/java/net/minecraft/server/IEntityAccess.java
+++ b/src/main/java/net/minecraft/server/IEntityAccess.java
@@ -22,9 +22,18 @@ public interface IEntityAccess {
@ -41,10 +41,10 @@ index ee22bb038..e5a013ffd 100644
return VoxelShapes.c(voxelshape, VoxelShapes.a(entity1.getBoundingBox()), OperatorBoolean.AND);
});
diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java
index 452b2b2d2..7019d4ae9 100644
index 17dac8dfa4..5b422eaa2d 100644
--- a/src/main/java/net/minecraft/server/IWorldReader.java
+++ b/src/main/java/net/minecraft/server/IWorldReader.java
@@ -99,7 +99,12 @@ public interface IWorldReader extends IIBlockAccess {
@@ -84,7 +84,12 @@ public interface IWorldReader extends IIBlockAccess {
return ChunkStatus.EMPTY;
}
@ -58,7 +58,7 @@ index 452b2b2d2..7019d4ae9 100644
return voxelshape.isEmpty() || this.a((Entity) null, voxelshape.a((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()));
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
index 59b1e6ce2..b90cc6652 100644
index 59b1e6ce2e..b90cc6652b 100644
--- a/src/main/java/net/minecraft/server/ItemBlock.java
+++ b/src/main/java/net/minecraft/server/ItemBlock.java
@@ -126,7 +126,8 @@ public class ItemBlock extends Item {
@ -72,7 +72,7 @@ index 59b1e6ce2..b90cc6652 100644
BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index dc83a90a4..063ad48ce 100644
index dc83a90a4d..063ad48ce7 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1122,6 +1122,14 @@ public class CraftEventFactory {

View File

@ -1,4 +1,4 @@
From 9ae42f54bcec6951749c513209a487757b2ebbe4 Mon Sep 17 00:00:00 2001
From 8695afeaff8a60bc42ea5aca6cf889515b0f9a43 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:18:31 -0400
Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
@ -6,10 +6,10 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 1964dd5faa..5a49b015c2 100644
index 7bd5a0a8cd..f2ca391bfe 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -404,6 +404,7 @@ public class Chunk implements IChunkAccess {
@@ -416,6 +416,7 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
entity.chunkZ = this.loc.z;
this.entitySlices[k].add(entity);
@ -17,7 +17,7 @@ index 1964dd5faa..5a49b015c2 100644
}
@Override
@@ -430,6 +431,7 @@ public class Chunk implements IChunkAccess {
@@ -442,6 +443,7 @@ public class Chunk implements IChunkAccess {
return;
}
entityCounts.decrement(entity.getMinecraftKeyString());

View File

@ -1,4 +1,4 @@
From c31c302a1df2cfde830efcbb00dc7ea5400a7bf5 Mon Sep 17 00:00:00 2001
From 2797bf80829c701816bee734e542f0ea1021bd25 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:44:23 -0400
Subject: [PATCH] Add some Debug to Chunk Entity slices
@ -9,10 +9,10 @@ This should hopefully avoid duplicate entities ever being created
if the entity was to end up in 2 different chunk slices
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 5a49b015c2..fc455e1f04 100644
index f2ca391bfe..2cb3e36965 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -396,6 +396,25 @@ public class Chunk implements IChunkAccess {
@@ -408,6 +408,25 @@ public class Chunk implements IChunkAccess {
if (k >= this.entitySlices.length) {
k = this.entitySlices.length - 1;
}
@ -38,7 +38,7 @@ index 5a49b015c2..fc455e1f04 100644
if (!entity.inChunk || entity.getCurrentChunk() != this) entityCounts.increment(entity.getMinecraftKeyString()); // Paper
entity.inChunk = true;
@@ -404,6 +423,7 @@ public class Chunk implements IChunkAccess {
@@ -416,6 +435,7 @@ public class Chunk implements IChunkAccess {
entity.chunkY = k;
entity.chunkZ = this.loc.z;
this.entitySlices[k].add(entity);
@ -46,7 +46,7 @@ index 5a49b015c2..fc455e1f04 100644
this.markDirty(); // Paper
}
@@ -427,6 +447,9 @@ public class Chunk implements IChunkAccess {
@@ -439,6 +459,9 @@ public class Chunk implements IChunkAccess {
}
// Paper start
if (entity.currentChunk != null && entity.currentChunk.get() == this) entity.setCurrentChunk(null);

View File

@ -1,4 +1,4 @@
From 608144b1f17c60148bec514354e2b9a4fdb00df7 Mon Sep 17 00:00:00 2001
From dafb3b539a1907f09d784e4f34f7c5dd3f3f5ab7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 28 Jul 2018 12:18:27 -0400
Subject: [PATCH] Ignore Dead Entities in entityList iteration
@ -23,10 +23,10 @@ index ce190d88d6..352a39dcb3 100644
MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap()));
ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ());
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index fc455e1f04..836b012474 100644
index 2cb3e36965..1ba855786c 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -645,6 +645,7 @@ public class Chunk implements IChunkAccess {
@@ -657,6 +657,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
Entity entity1 = (Entity) iterator.next();
@ -34,7 +34,7 @@ index fc455e1f04..836b012474 100644
if (entity1.getBoundingBox().c(axisalignedbb) && entity1 != entity) {
if (predicate == null || predicate.test(entity1)) {
@@ -682,6 +683,7 @@ public class Chunk implements IChunkAccess {
@@ -694,6 +695,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@ -42,7 +42,7 @@ index fc455e1f04..836b012474 100644
if ((entitytypes == null || entity.getEntityType() == entitytypes) && entity.getBoundingBox().c(axisalignedbb) && predicate.test(entity)) {
list.add(entity);
@@ -703,6 +705,7 @@ public class Chunk implements IChunkAccess {
@@ -715,6 +717,7 @@ public class Chunk implements IChunkAccess {
while (iterator.hasNext()) {
T t0 = (T) iterator.next(); // CraftBukkit - decompile error

View File

@ -1,4 +1,4 @@
From 1eaf954ce8e5c95466ed46b72f336e8b4b2c7f35 Mon Sep 17 00:00:00 2001
From a25ee60e64f1c2292035ce111496ae6711ee80dd Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 15 Aug 2018 01:16:34 -0400
Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots

View File

@ -1,4 +1,4 @@
From 6c269acf14e06741777171922a63739499f20986 Mon Sep 17 00:00:00 2001
From d856f2df81c023c4f1d10cb63069c925327dc733 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Wed, 15 Aug 2018 01:26:09 -0700
Subject: [PATCH] Allow disabling armour stand ticking

View File

@ -1,4 +1,4 @@
From 923fa041496dc977c63af2f29150458a05748d44 Mon Sep 17 00:00:00 2001
From 14850d20f5c196db4b2ee557eea55c8339b2c35a Mon Sep 17 00:00:00 2001
From: Mystiflow <mystiflow@gmail.com>
Date: Fri, 6 Jul 2018 13:21:30 +0100
Subject: [PATCH] Send nearby packets from world player list not server list

View File

@ -1,4 +1,4 @@
From fe89300735d0da651bef5654500576c473b2ea8a Mon Sep 17 00:00:00 2001
From 61813151e10f74a0e8e813ca2af9fba5b5526d37 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 2 Sep 2018 19:34:33 -0700
Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted

View File

@ -1,4 +1,4 @@
From da0c7454371fcda017493a09206a4a74bed84adf Mon Sep 17 00:00:00 2001
From e3d9e0889df66a7b3a3d03d8e559237e57a89b00 Mon Sep 17 00:00:00 2001
From: Phoenix616 <mail@moep.tv>
Date: Tue, 21 Aug 2018 01:39:35 +0100
Subject: [PATCH] Improve death events

View File

@ -1,4 +1,4 @@
From 92fba7dfa88a5b65625cbfe0e1eaba59768b1b84 Mon Sep 17 00:00:00 2001
From a5d0a3e78906d23ab5d742ef2189983955d00422 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 8 Sep 2018 18:43:31 -0500
Subject: [PATCH] Allow chests to be placed with NBT data

View File

@ -1,4 +1,4 @@
From ea30d1b969577bd6f08afb4541f442ec4732e353 Mon Sep 17 00:00:00 2001
From 121d7f887740202b19df915eeb349ac5d89f57b5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 9 Sep 2018 13:30:00 -0400
Subject: [PATCH] Mob Pathfinding API
@ -123,10 +123,10 @@ index 0000000000..f68a07cb96
+ }
+}
diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java
index 6cc1423837..1bf7ead714 100644
index a473c03b9d..856ff22b04 100644
--- a/src/main/java/net/minecraft/server/NavigationAbstract.java
+++ b/src/main/java/net/minecraft/server/NavigationAbstract.java
@@ -69,7 +69,7 @@ public abstract class NavigationAbstract {
@@ -67,7 +67,7 @@ public abstract class NavigationAbstract {
}
@Nullable
@ -135,7 +135,7 @@ index 6cc1423837..1bf7ead714 100644
return this.b(new BlockPosition(d0, d1, d2));
}
@@ -85,7 +85,7 @@ public abstract class NavigationAbstract {
@@ -83,7 +83,7 @@ public abstract class NavigationAbstract {
}
@Nullable
@ -144,7 +144,7 @@ index 6cc1423837..1bf7ead714 100644
BlockPosition blockposition = new BlockPosition(entity);
double d0 = entity.locX;
double d1 = entity.getBoundingBox().minY;
@@ -151,6 +151,7 @@ public abstract class NavigationAbstract {
@@ -149,6 +149,7 @@ public abstract class NavigationAbstract {
private int pathfindFailures = 0;
// Paper end
@ -152,7 +152,7 @@ index 6cc1423837..1bf7ead714 100644
public boolean a(@Nullable PathEntity pathentity, double d0) {
if (pathentity == null) {
this.c = null;
@@ -174,7 +175,7 @@ public abstract class NavigationAbstract {
@@ -172,7 +173,7 @@ public abstract class NavigationAbstract {
}
}
@ -161,7 +161,7 @@ index 6cc1423837..1bf7ead714 100644
public PathEntity l() {
return this.c;
}
@@ -261,6 +262,7 @@ public abstract class NavigationAbstract {
@@ -258,6 +259,7 @@ public abstract class NavigationAbstract {
return this.c == null || this.c.b();
}

View File

@ -1,4 +1,4 @@
From d2a70df6e26a1fd7dee1650cc5448d30b828b73a Mon Sep 17 00:00:00 2001
From c2e447783c204162a3c084c8817173f678edcb33 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 10 Sep 2018 23:56:36 -0400
Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks
@ -73,27 +73,6 @@ index b286934aa8..c7e25e2be8 100644
+ return fluid != null && fluid.a(TagsFluid.WATER); // Paper
}
}
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 8bb2e1bf0f..5220ea0994 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -647,6 +647,16 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return chunk.getType(blockposition);
}
}
+ // Paper start
+ public Fluid getFluidIfLoaded(BlockPosition blockposition) {
+ if (blockposition.isInvalidYLocation()) { // Paper
+ return getFluid(blockposition);
+ } else {
+ Chunk chunk = this.getChunkIfLoaded(blockposition);
+ return chunk != null ? chunk.getFluid(blockposition) : null;
+ }
+ }
+ // Paper end
@Override
public Fluid getFluid(BlockPosition blockposition) {
--
2.21.0

View File

@ -1,4 +1,4 @@
From 2b7681ed2e10af2cba8ab2edf5cf385812ff2cf9 Mon Sep 17 00:00:00 2001
From ba069fb3ec9315a3d5860151f681617c1ed2da89 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 22 Sep 2018 15:56:59 -0400
Subject: [PATCH] Catch JsonParseException in Entity and TE names

View File

@ -1,4 +1,4 @@
From 7d3842cf4d49c3efd34b95f750db3d66431f7a22 Mon Sep 17 00:00:00 2001
From 9369be9dc507ddb8928ed6a56838542d50abad44 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 2 Oct 2018 09:57:50 +0100
Subject: [PATCH] Configurable connection throttle kick message

View File

@ -1,4 +1,4 @@
From 0db0f9488989805d477cb83f06042bd49f182bd4 Mon Sep 17 00:00:00 2001
From 7e5af8a33716abcf9ebcec662de098ec17eb8c98 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Wed, 3 Oct 2018 20:09:18 -0400
Subject: [PATCH] Hook into CB plugin rewrites

View File

@ -1,4 +1,4 @@
From da352f96cbfd231081cd04a5da00ea78b31246df Mon Sep 17 00:00:00 2001
From f1681fe836fb4372b4423fb0d870b14be94e7772 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 6 Oct 2018 21:47:44 -0500
Subject: [PATCH] Allow setting the vex's summoner

View File

@ -1,4 +1,4 @@
From 3ba79e77c97bab8dcf2215be1e954cf465625513 Mon Sep 17 00:00:00 2001
From bb46608200343486496988e68b6ec359e891dd0d 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 11652628b1..90923c7536 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 5220ea0994..70e5552cd9 100644
index 1f2e2cd873..163d7f37c9 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -669,6 +669,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -667,6 +667,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
}

View File

@ -1,4 +1,4 @@
From 6859425abc63fb598cf009358c09b6c8083f3713 Mon Sep 17 00:00:00 2001
From b7abe6ba04979e1cedde9ff41593574ff66ebb70 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Wed, 10 Oct 2018 21:22:44 -0500
Subject: [PATCH] Check Drowned for Villager Aggression Config

View File

@ -1,4 +1,4 @@
From 690601f0df4efb5f454a0de8ecbed0fca385e392 Mon Sep 17 00:00:00 2001
From 829d99cc682f515a8e0465ed67d101cd5fc94800 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 12 Oct 2018 01:37:22 -0500
Subject: [PATCH] Here's Johnny!

View File

@ -1,4 +1,4 @@
From 596613ec52387886b54f9a9243c624ae7c194958 Mon Sep 17 00:00:00 2001
From 34da2a3cab5b5559a7408dfd08b622b23caa7541 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 29 Sep 2018 16:08:23 -0500
Subject: [PATCH] Turtle API

View File

@ -1,4 +1,4 @@
From 37c8351104af074650356a7dc5672477383ddfaa Mon Sep 17 00:00:00 2001
From 9fc5f13a395b716bfaf1aae52a2165375a5310cf Mon Sep 17 00:00:00 2001
From: Trigary <trigary0@gmail.com>
Date: Fri, 14 Sep 2018 17:42:08 +0200
Subject: [PATCH] Limit lightning strike effect distance

View File

@ -1,4 +1,4 @@
From 4ee63a89d46c2475c61eeac8edeaf983b0935bf2 Mon Sep 17 00:00:00 2001
From 10b1b03db9330bb0d0b96d612a892779b22e1435 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 17 Oct 2018 19:17:27 -0400
Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles

View File

@ -1,4 +1,4 @@
From 1b0ba06f41e65e1a4140bd44b4af10e0cf5389ac Mon Sep 17 00:00:00 2001
From 4611e03e312ad16587c541642b5edf6819ce9b73 Mon Sep 17 00:00:00 2001
From: Caleb Bassham <caleb.bassham@gmail.com>
Date: Fri, 28 Sep 2018 02:32:19 -0500
Subject: [PATCH] Call player spectator target events

View File

@ -1,4 +1,4 @@
From b543eb88b5bd6e6ccab6ecf524072be8522d0ba3 Mon Sep 17 00:00:00 2001
From 381b300d8708d513fbb99b392f64a2f1e897f03e Mon Sep 17 00:00:00 2001
From: Andrew Steinborn <git@steinborn.me>
Date: Mon, 8 Oct 2018 14:36:14 -0400
Subject: [PATCH] Add Velocity IP Forwarding Support

View File

@ -1,4 +1,4 @@
From b176c2be62be6a3c2657676c1070a26ddb9a66e4 Mon Sep 17 00:00:00 2001
From 761a1274842ea4d6324083164916b56ea3925570 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 12 Oct 2018 14:10:46 -0500
Subject: [PATCH] Add more Witch API

View File

@ -1,4 +1,4 @@
From c0a62dfce82db9577af0453144b86466acb8b8ba Mon Sep 17 00:00:00 2001
From 28acedbe36fa7727e1a151ac97d1ecbd5887ff93 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 19 Oct 2018 19:38:45 -0500
Subject: [PATCH] Fix MC-93764

View File

@ -1,4 +1,4 @@
From 4a8c9bb5813d00985b6b80c6f234cab04e0d5634 Mon Sep 17 00:00:00 2001
From f1683e79b45cd1fa6785059d3f3d2a45e9a8a501 Mon Sep 17 00:00:00 2001
From: Gabriele C <sgdc3.mail@gmail.com>
Date: Mon, 22 Oct 2018 17:34:10 +0200
Subject: [PATCH] Add option to prevent players from moving into unloaded

View File

@ -1,4 +1,4 @@
From 378a782578c405a98c97d149b9e424181485f569 Mon Sep 17 00:00:00 2001
From 7696bfb71fd64aa2f863ee12ae55027ab50cf60b Mon Sep 17 00:00:00 2001
From: GreenMeanie <GreenMeanieMC@gmail.com>
Date: Sat, 20 Oct 2018 22:34:02 -0400
Subject: [PATCH] Reset players airTicks on respawn

View File

@ -1,4 +1,4 @@
From d7aa704a36270d8a211c86be9d94633632b7fd16 Mon Sep 17 00:00:00 2001
From 47cd3f5ce2c63b5ad23cf4921080dafa88d87d33 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Tue, 23 Oct 2018 20:53:43 -0400
Subject: [PATCH] Strip private area unicode characters from signs

View File

@ -1,4 +1,4 @@
From d85618b21ca55efa8898e6734b9d8418f6b6f677 Mon Sep 17 00:00:00 2001
From b4ee01ca744d07be91ef950dfcbfd7029e32aa22 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 23 Oct 2018 20:25:05 -0400
Subject: [PATCH] Don't sleep after profile lookups if not needed

View File

@ -1,4 +1,4 @@
From 62a2276ba4f68423d8219fe1a10d879e7eaae29c Mon Sep 17 00:00:00 2001
From b4bd9456ff2c621dbf0c29ec6c251c44e844d982 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 23 Oct 2018 23:14:38 -0400
Subject: [PATCH] Use more reasonable thread count default for bootstrap

View File

@ -1,4 +1,4 @@
From 659e995f3d68ba6cdb4e8c90755a585c939550fc Mon Sep 17 00:00:00 2001
From 2e3a28385a86ec41fa6c4cc4e1f1865511bf23b9 Mon Sep 17 00:00:00 2001
From: MisterVector <whizkid3000@hotmail.com>
Date: Thu, 1 Nov 2018 14:50:05 -0700
Subject: [PATCH] MC-136865: Use valid item for enchantment checks on block

View File

@ -1,4 +1,4 @@
From f2a5e08671d415085a214f6db1736372657121d3 Mon Sep 17 00:00:00 2001
From 183b805b46cbcebc5fca39e0a3d20457bc3de4f5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 2 Nov 2018 23:11:51 -0400
Subject: [PATCH] Optimize World Time Updates

View File

@ -1,4 +1,4 @@
From 2c07fd4a50bfd746966bda875b7ca8b05f37d16c Mon Sep 17 00:00:00 2001
From efb81ba7e3ce6e4579527cb42e252c93e46f1308 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Mon, 5 Nov 2018 04:23:51 +0000
Subject: [PATCH] Restore custom InventoryHolder support

View File

@ -1,4 +1,4 @@
From 7d96e66012a0c1672ab15a87d9edbb49c4a2c86b Mon Sep 17 00:00:00 2001
From d4d24addafbe9cc10946d514c6ce807f480ba5f1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 8 Nov 2018 21:33:09 -0500
Subject: [PATCH] Use Vanilla Minecart Speeds

View File

@ -1,4 +1,4 @@
From d5809d56b1675e8aecdb5098b5b4d833bb00ea4d Mon Sep 17 00:00:00 2001
From 1eb671b66b367e279d12bbe309a3108ff633fafe Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 10 Nov 2018 05:15:21 +0000
Subject: [PATCH] Fix SpongeAbsortEvent handling

View File

@ -1,4 +1,4 @@
From 987b27d4beed5b49317ad424505f24c8b3b8ed6c Mon Sep 17 00:00:00 2001
From 9f3d70e52efe6d239769232b0e385bdf4ed5bf65 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 11 Nov 2018 21:01:09 +0000
Subject: [PATCH] Don't allow digging into unloaded chunks

View File

@ -1,4 +1,4 @@
From b990778d9e771f99514d739f93e7b23793e45de2 Mon Sep 17 00:00:00 2001
From e0cd7adf613a995721814ad8bff58f90a6f20ab7 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 da903f74b6..aa35e0d061 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 70e5552cd9..d20077892b 100644
index 163d7f37c9..3425f034c8 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -548,6 +548,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -556,6 +556,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
}
@ -1135,7 +1135,7 @@ index 70e5552cd9..d20077892b 100644
public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (!this.isClientSide) {
IBlockData iblockdata = this.getType(blockposition);
@@ -1304,6 +1305,7 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -1302,6 +1303,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))));
}

View File

@ -1,4 +1,4 @@
From a4b6407b3594e7d93d59ace1a8be23d7b60f90ee Mon Sep 17 00:00:00 2001
From 9de336b7403dc0d8519df139cbe9360be9c162c6 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 15 Nov 2018 13:38:37 +0000
Subject: [PATCH] force entity dismount during teleportation

View File

@ -1,4 +1,4 @@
From 06a9565bdf6252f34736bad3a31b96fd7af8d840 Mon Sep 17 00:00:00 2001
From 2e1bbe500cf316fdc9d43efb43c515bdbfcdcf7f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 16 Nov 2018 23:08:50 -0500
Subject: [PATCH] Book Size Limits

View File

@ -1,4 +1,4 @@
From 1f02d93234d4fcf4192513792a85ee84f56e9bae Mon Sep 17 00:00:00 2001
From 989e90cf5780bdc6ac562c0b9a9804d3ef963660 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 18 Nov 2018 19:49:56 +0000
Subject: [PATCH] Make the default permission message configurable

View File

@ -1,4 +1,4 @@
From e9aac9d0eee1722ec3f54ccf47b003f9f20943da Mon Sep 17 00:00:00 2001
From 38d1696fcf324d1e290120399948fa79fb81ed10 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sun, 7 Oct 2018 04:29:59 -0500
Subject: [PATCH] Add more Zombie API

View File

@ -1,4 +1,4 @@
From fe8bbf3a3d68f8d28fba3fe328e3265cd60517e7 Mon Sep 17 00:00:00 2001
From 9b61494eaa31126974f10637653cf39c1fcca4d2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 26 Nov 2018 19:21:58 -0500
Subject: [PATCH] Prevent rayTrace from loading chunks
@ -7,10 +7,10 @@ ray tracing into an unloaded chunk should be treated as a miss
this saves a ton of lag for when AI tries to raytrace near unloaded chunks.
diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java
index 6e365f402c..b1423a3c8d 100644
index 577b227758..c5586e44d4 100644
--- a/src/main/java/net/minecraft/server/IBlockAccess.java
+++ b/src/main/java/net/minecraft/server/IBlockAccess.java
@@ -27,7 +27,15 @@ public interface IBlockAccess {
@@ -41,7 +41,15 @@ public interface IBlockAccess {
default MovingObjectPositionBlock rayTrace(RayTrace raytrace) {
return (MovingObjectPositionBlock) a(raytrace, (raytrace1, blockposition) -> {

View File

@ -1,4 +1,4 @@
From 024bead5390ee6da9c568bb7fcea7f7d4c622709 Mon Sep 17 00:00:00 2001
From 5d9c6194fb0111c19e6f4898f2f320f13a6d6e6e Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 27 Nov 2018 21:18:06 -0500
Subject: [PATCH] Handle Large Packets disconnecting client

View File

@ -1,4 +1,4 @@
From 070edbb804f4e729db9769ea1d4328193ed1e64b Mon Sep 17 00:00:00 2001
From 1eae9651c00449affd6c0fdba6c2a3bf3fa67865 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Tue, 11 Dec 2018 22:25:07 -0500
Subject: [PATCH] Lazy init world storage in CraftOfflinePlayer

View File

@ -1,4 +1,4 @@
From 407ab0e7727628357667a57aca6b106cec825832 Mon Sep 17 00:00:00 2001
From fcf594bad553b6f165af034d325b4062edbb55d3 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 7 Oct 2018 12:05:28 -0700
Subject: [PATCH] Add PlayerConnectionCloseEvent

View File

@ -1,4 +1,4 @@
From 6f1a89ab8eebfbfbe65ee5614a680eeef4d79c06 Mon Sep 17 00:00:00 2001
From da02e594ba25f6dd6fad129ca695a5d0acefb775 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 18 Dec 2018 02:15:08 +0000
Subject: [PATCH] Prevent Enderman from loading chunks

View File

@ -1,4 +1,4 @@
From 2e94d3290943ab6c44c5638944eaaaf052b49ede Mon Sep 17 00:00:00 2001
From 27165ddde31cb7ca45ad96981e26eef277bd48ed Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Wed, 2 Jan 2019 00:35:43 -0600
Subject: [PATCH] Add APIs to replace OfflinePlayer#getLastPlayed

View File

@ -1,4 +1,4 @@
From 49cfbfcb59324b88f46e7b81901afb79b97a0959 Mon Sep 17 00:00:00 2001
From 75c388ae8efdabad3fb9a599baa74263f32113c4 Mon Sep 17 00:00:00 2001
From: Michael Himing <mhiming@gmail.com>
Date: Sun, 16 Dec 2018 13:07:33 +1100
Subject: [PATCH] Fix PlayerEditBookEvent

View File

@ -1,4 +1,4 @@
From abce431e6f4d621444140426b81e1d231721c3c2 Mon Sep 17 00:00:00 2001
From a05976de516ef8433d2116731f04852d7c5c4730 Mon Sep 17 00:00:00 2001
From: connorhartley <vectrixu+gh@gmail.com>
Date: Mon, 7 Jan 2019 14:43:48 -0600
Subject: [PATCH] Workaround for vehicle tracking issue on disconnect

View File

@ -1,4 +1,4 @@
From 337c8ee898a441c2fc15dc36d571dd6e041a69b9 Mon Sep 17 00:00:00 2001
From 09f0f1e10341b6b3ff895713bb2f67cceec79e7d Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Thu, 31 Jan 2019 16:33:36 -0500
Subject: [PATCH] Fire BlockPistonRetractEvent for all empty pistons

View File

@ -1,4 +1,4 @@
From 2ac407162a5fd4200642ba66592488e1b83ca039 Mon Sep 17 00:00:00 2001
From b2d8db60f5a9a45204395def23dba33639082503 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Mon, 4 Feb 2019 23:33:24 -0500
Subject: [PATCH] Block Entity#remove from being called on Players

View File

@ -1,4 +1,4 @@
From 9ba87df328f8b499250bef748c30b090e681b844 Mon Sep 17 00:00:00 2001
From 8fe59ba0e9e5ea59b6886dd20bd9eb72a1abe87f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 15 Feb 2019 01:08:19 -0500
Subject: [PATCH] Allow Saving of Oversized Chunks

View File

@ -1,4 +1,4 @@
From 0dd7839f11b0dff4ab0910e6246b8b6d2311f0f3 Mon Sep 17 00:00:00 2001
From 5cf57792306a23fa4b0472b61bfe4715d96a3b6b 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 d20077892b..774bb4d0d7 100644
index 3425f034c8..4280fdf807 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -478,8 +478,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
@@ -486,8 +486,20 @@ public abstract class World implements IIBlockAccess, GeneratorAccess, AutoClose
return false;
} else {
Fluid fluid = this.getFluid(blockposition);

Some files were not shown because too many files have changed in this diff Show More