mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 16:12:18 -07:00
Add ray tracing methods to LivingEntity (#1410)
This method will return the Block a player is looking at while taking into consideration the AABB of each block in the path. For example, you can look through the 1/4 space of air in a Stair block and get the block behind it instead of the Stair block you are looking past.
This commit is contained in:
@@ -5,23 +5,17 @@ Subject: [PATCH] String based Action Bar API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
index 9f9341c98f..966309a07d 100644
|
||||
index faec94722..dce1417af 100644
|
||||
--- a/src/main/java/net/minecraft/server/MCUtil.java
|
||||
+++ b/src/main/java/net/minecraft/server/MCUtil.java
|
||||
@@ -0,0 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
||||
|
||||
import com.destroystokyo.paper.block.TargetBlockInfo;
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
+import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.Location;
|
||||
+import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.util.Waitable;
|
||||
import org.spigotmc.AsyncCatcher;
|
||||
|
||||
+import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
@@ -0,0 +0,0 @@ public final class MCUtil {
|
||||
|
||||
private MCUtil() {}
|
||||
@@ -47,22 +41,8 @@ index 9f9341c98f..966309a07d 100644
|
||||
|
||||
public static boolean isMainThread() {
|
||||
return MinecraftServer.getServer().isMainThread();
|
||||
@@ -0,0 +0,0 @@ public final class MCUtil {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
+
|
||||
+ @Nonnull
|
||||
+ public static World getNMSWorld(@Nonnull org.bukkit.World world) {
|
||||
+ return ((CraftWorld) world).getHandle();
|
||||
+ }
|
||||
+
|
||||
+ public static World getNMSWorld(@Nonnull org.bukkit.entity.Entity entity) {
|
||||
+ return getNMSWorld(entity.getWorld());
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 291b664b66..478f027848 100644
|
||||
index 291b664b6..478f02784 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
Reference in New Issue
Block a user