fix compile issues

This commit is contained in:
Aurora 2021-06-14 17:10:25 +02:00
parent 21effd6c48
commit b87c54f843
No known key found for this signature in database
GPG Key ID: 89839F67B53656AD
2 changed files with 8 additions and 8 deletions

View File

@ -13,7 +13,7 @@ Replace all calls to the new place to the unnecessary forward.
Optimize getType and getBlockData to manually inline and optimize the calls Optimize getType and getBlockData to manually inline and optimize the calls
diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java
index f4b5792e080d5181184eb661d005ce6cab649bf3..c66ae4d9eea993f3b7fcc6e253259db3346229d1 100644 index f4b5792e080d5181184eb661d005ce6cab649bf3..35b26f4a4554541affbf76df38fed0f7e555c9b9 100644
--- a/src/main/java/net/minecraft/core/Vec3i.java --- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java +++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -21,6 +21,15 @@ public class Vec3i implements Comparable<Vec3i> { @@ -21,6 +21,15 @@ public class Vec3i implements Comparable<Vec3i> {
@ -21,11 +21,11 @@ index f4b5792e080d5181184eb661d005ce6cab649bf3..c66ae4d9eea993f3b7fcc6e253259db3
private int z; private int z;
+ // Paper start + // Paper start
+ public boolean isValidLocation(net.minecraft.world.level.Level level) { + public boolean isValidLocation(net.minecraft.world.level.LevelHeightAccessor levelHeightAccessor) {
+ return getX() >= -30000000 && getZ() >= -30000000 && getX() < 30000000 && getZ() < 30000000 && !level.isOutsideBuildHeight(getY()); + return getX() >= -30000000 && getZ() >= -30000000 && getX() < 30000000 && getZ() < 30000000 && !levelHeightAccessor.isOutsideBuildHeight(getY());
+ } + }
+ public boolean isInvalidYLocation(net.minecraft.world.level.Level level) { + public boolean isInvalidYLocation(net.minecraft.world.level.LevelHeightAccessor levelHeightAccessor) {
+ return level.isOutsideBuildHeight(getY()); + return levelHeightAccessor.isOutsideBuildHeight(getY());
+ } + }
+ // Paper end + // Paper end
+ +
@ -90,7 +90,7 @@ index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1
@Override @Override
public FluidState getFluidState(BlockPos pos) { public FluidState getFluidState(BlockPos pos) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 9939c4c39549771afe971a6433dfd57e36050dd8..7e5e16fd61b39d2093459766e8aaa10bb05f6763 100644 index b36a893ded952d1a5ed1a55eae9c3c406848e1f3..092f2cd5806e8609b952e7678c0c38b235c52264 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess { @@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess {

View File

@ -5,14 +5,14 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 1f67c9c5f7161ea687983e7ae0ec7d259da9acd3..0d8ddbc3f8aa22f16907613838ffb9a42f1e6de6 100644 index 1f67c9c5f7161ea687983e7ae0ec7d259da9acd3..1f5086a18b9c1c65dc2b09f44ed7c561ba96a847 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -246,6 +246,7 @@ public class ChunkHolder { @@ -246,6 +246,7 @@ public class ChunkHolder {
} }
public void blockChanged(BlockPos pos) { public void blockChanged(BlockPos pos) {
+ if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks + if (!pos.isValidLocation(levelHeightAccessor)) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks
LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance
if (chunk != null) { if (chunk != null) {