Allow LEFT_CLICK_AIR in 3.0->4.5 range of entity (#9211)

This commit is contained in:
Moulberry 2023-07-16 23:58:25 +08:00 committed by GitHub
parent b533905cc3
commit c793bd93be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 96 additions and 74 deletions

View file

@ -3480,10 +3480,10 @@ index 0000000000000000000000000000000000000000..cea9c098ade00ee87b8efc8164ab72f5
+}
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
new file mode 100644
index 0000000000000000000000000000000000000000..902317d2dc198a1cbfc679810bcb2173644354cb
index 0000000000000000000000000000000000000000..6779a0cc401231c53545dd22827b404be80b2ad0
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -0,0 +1,517 @@
@@ -0,0 +1,522 @@
+package io.papermc.paper.util;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
@ -3503,6 +3503,7 @@ index 0000000000000000000000000000000000000000..902317d2dc198a1cbfc679810bcb2173
+import org.bukkit.block.BlockFace;
+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.craftbukkit.util.Waitable;
+import org.bukkit.util.Vector;
+import org.spigotmc.AsyncCatcher;
+
+import javax.annotation.Nonnull;
@ -3955,6 +3956,10 @@ index 0000000000000000000000000000000000000000..902317d2dc198a1cbfc679810bcb2173
+ return new BlockPos(pos.blockX(), pos.blockY(), pos.blockZ());
+ }
+
+ public static BlockPos toBlockPosition(Vector vec) {
+ return new BlockPos(vec.getBlockX(), vec.getBlockY(), vec.getBlockZ());
+ }
+
+ public static boolean isEdgeOfChunk(BlockPos pos) {
+ final int modX = pos.getX() & 15;
+ final int modZ = pos.getZ() & 15;