mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 00:50:41 +01:00
Remove TODO on Add ray tracing methods to LivingEntity
Note: The entity parameter stays 'this' since we want the block the entity is targetting. This can change based on the block the player has in their hand (see scaffholding). With a scaffhold in hand, the scaffhold blocks in the world become solid 1x1x1 cubes, and without they follow their model's shape.
This commit is contained in:
parent
dc97f7d401
commit
a22dfd8c16
1 changed files with 4 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
|||
From 3c8e8c977b0c2ef612338ddd52872ae7931f4c70 Mon Sep 17 00:00:00 2001
|
||||
From 8cd16e4b0496b005088c39361fd4396d734445b5 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Mon, 3 Sep 2018 18:20:03 -0500
|
||||
Subject: [PATCH] Add ray tracing methods to LivingEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index f115686f4a..78b7ab59b9 100644
|
||||
index f115686f4..9638cd62e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -3170,6 +3170,23 @@ public abstract class EntityLiving extends Entity {
|
||||
|
@ -24,7 +24,7 @@ index f115686f4a..78b7ab59b9 100644
|
|||
+ Vec3D start = new Vec3D(locX, locY + getHeadHeight(), locZ);
|
||||
+ org.bukkit.util.Vector dir = getBukkitEntity().getLocation().getDirection().multiply(maxDistance);
|
||||
+ Vec3D end = new Vec3D(start.x + dir.getX(), start.y + dir.getY(), start.z + dir.getZ());
|
||||
+ RayTrace raytrace = new RayTrace(start, end, RayTrace.BlockCollisionOption.OUTLINE, fluidCollisionOption, this); // TODO review these options
|
||||
+ RayTrace raytrace = new RayTrace(start, end, RayTrace.BlockCollisionOption.OUTLINE, fluidCollisionOption, this);
|
||||
+
|
||||
+ return world.rayTrace(raytrace);
|
||||
+ }
|
||||
|
@ -33,7 +33,7 @@ index f115686f4a..78b7ab59b9 100644
|
|||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 00fae68408..4233ffe654 100644
|
||||
index 00fae6840..4233ffe65 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -179,6 +179,28 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
|
Loading…
Reference in a new issue