Skip to content

Commit

Permalink
fix precise_target and bounding_box
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 15, 2019
1 parent 6579e59 commit df125e9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -2317,7 +2317,7 @@ else if (mtr.angle == BlockFace.EAST) {
if (range < 1) {
range = 200;
}
RayTraceResult result = object.getWorld().rayTraceEntities(object.getEyeLocation(), object.getEyeLocation().getDirection(), range, (e) -> !e.equals(object.getBukkitEntity()));
RayTraceResult result = object.getWorld().rayTrace(object.getEyeLocation(), object.getEyeLocation().getDirection(), range, FluidCollisionMode.NEVER, true, 0, (e) -> !e.equals(object.getBukkitEntity()));
if (result != null && result.getHitEntity() != null) {
return new EntityTag(result.getHitEntity());
}
Expand All @@ -2336,7 +2336,7 @@ else if (mtr.angle == BlockFace.EAST) {
if (range < 1) {
range = 200;
}
RayTraceResult result = object.getWorld().rayTraceEntities(object.getEyeLocation(), object.getEyeLocation().getDirection(), range, (e) -> !e.equals(object.getBukkitEntity()));
RayTraceResult result = object.getWorld().rayTrace(object.getEyeLocation(), object.getEyeLocation().getDirection(), range, FluidCollisionMode.NEVER, true, 0, (e) -> !e.equals(object.getBukkitEntity()));
if (result != null) {
return new LocationTag(object.getWorld(), result.getHitPosition());
}
Expand Down
Expand Up @@ -2556,7 +2556,7 @@ public void adjust(Mechanism mechanism) {
// @name award_advancement
// @input Element
// @description
// Awards an achievement to the player.
// Awards an advancement to the player.
// @tags
// <PlayerTag.has_advancement[<name>]>
// -->
Expand Down
Expand Up @@ -61,8 +61,8 @@ private EntityBoundingBox(EntityTag entity) {
private ListTag getBoundingBox() {
BoundingBox boundingBox = NMSHandler.getEntityHelper().getBoundingBox(entity.getBukkitEntity());
ListTag list = new ListTag();
list.add(new LocationTag(boundingBox.getLow().toLocation(entity.getWorld())).identify());
list.add(new LocationTag(boundingBox.getHigh().toLocation(entity.getWorld())).identify());
list.addObject(new LocationTag(boundingBox.getLow().toLocation(entity.getWorld())));
list.addObject(new LocationTag(boundingBox.getHigh().toLocation(entity.getWorld())));
return list;
}

Expand Down

0 comments on commit df125e9

Please sign in to comment.