aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0071-Add-World-Util-Methods.patch
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2023-06-07 18:24:39 +0200
committerNassim Jahnke <[email protected]>2023-06-07 19:06:55 +0200
commit965cf53cd5067d9f3facf87eed5132c0c82f9878 (patch)
tree1f8f05afb8e9590389c178778a7132d1c7c21f6b /patches/server/0071-Add-World-Util-Methods.patch
parentbc4a6647c99ae98c52c1c81597834be8fec6aa0d (diff)
downloadPaper-965cf53cd5067d9f3facf87eed5132c0c82f9878.tar.gz
Paper-965cf53cd5067d9f3facf87eed5132c0c82f9878.zip
Start working on 1.20
Diffstat (limited to 'patches/server/0071-Add-World-Util-Methods.patch')
-rw-r--r--patches/server/0071-Add-World-Util-Methods.patch47
1 files changed, 0 insertions, 47 deletions
diff --git a/patches/server/0071-Add-World-Util-Methods.patch b/patches/server/0071-Add-World-Util-Methods.patch
deleted file mode 100644
index 414debe431..0000000000
--- a/patches/server/0071-Add-World-Util-Methods.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Aikar <[email protected]>
-Date: Fri, 18 Mar 2016 20:16:03 -0400
-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/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
-index a08c81030cf4974397205b200d27c559cdb75a12..9e593a50b36a13b45c6ab279a7f6656045ccdf35 100644
---- a/src/main/java/net/minecraft/server/level/ServerLevel.java
-+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
-@@ -217,7 +217,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
- public final LevelStorageSource.LevelStorageAccess convertable;
- public final UUID uuid;
-
-- public LevelChunk getChunkIfLoaded(int x, int z) {
-+ @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI
- return this.chunkSource.getChunk(x, z, false);
- }
-
-diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
-index cff0be79e2dbb761ad2971bc3fcbd0d264505f1d..3b3da7340af0b97f900b5eb7fc2ba90f39c4c503 100644
---- a/src/main/java/net/minecraft/world/level/Level.java
-+++ b/src/main/java/net/minecraft/world/level/Level.java
-@@ -343,6 +343,22 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
- return chunk == null ? null : chunk.getFluidState(blockposition);
- }
-
-+ public final boolean isLoadedAndInBounds(BlockPos blockposition) { // Paper - final for inline
-+ return getWorldBorder().isWithinBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null;
-+ }
-+
-+ public @Nullable LevelChunk getChunkIfLoaded(int x, int z) { // Overridden in WorldServer for ABI compat which has final
-+ return ((ServerLevel) this).getChunkSource().getChunkAtIfLoadedImmediately(x, z);
-+ }
-+ public final @Nullable LevelChunk getChunkIfLoaded(BlockPos blockposition) {
-+ return ((ServerLevel) this).getChunkSource().getChunkAtIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4);
-+ }
-+
-+ // reduces need to do isLoaded before getType
-+ public final @Nullable BlockState getBlockStateIfLoadedAndInBounds(BlockPos blockposition) {
-+ return getWorldBorder().isWithinBounds(blockposition) ? getBlockStateIfLoaded(blockposition) : null;
-+ }
-+
- @Override
- public final ChunkAccess getChunk(int chunkX, int chunkZ, ChunkStatus leastStatus, boolean create) { // Paper - final for inline
- // Paper end