2018-12-08 11:09:55 +01:00
|
|
|
From 60a79fd7ebc61e53da457fbc62b43064f962b9f8 Mon Sep 17 00:00:00 2001
|
2018-06-30 05:50:17 +02:00
|
|
|
From: Brokkonaut <hannos17@gmx.de>
|
|
|
|
Date: Sat, 30 Jun 2018 05:45:39 +0200
|
|
|
|
Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
|
|
|
|
projectile has hit
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2018-12-08 11:09:55 +01:00
|
|
|
index 3f17fbd37..dfedd4c30 100644
|
2018-06-30 05:50:17 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2018-12-08 11:09:55 +01:00
|
|
|
@@ -921,7 +921,7 @@ public class CraftEventFactory {
|
2018-06-30 05:50:17 +02:00
|
|
|
hitBlock = entity.getBukkitEntity().getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
|
|
}
|
|
|
|
|
|
|
|
- ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), position.entity == null ? null : position.entity.getBukkitEntity(), hitBlock);
|
|
|
|
+ ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity(), position.entity == null ? null : position.entity.getBukkitEntity(), hitBlock, position.direction == null ? null : CraftBlock.notchToBlockFace(position.direction)); // Paper - add BlockFace parameter
|
|
|
|
entity.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
return event;
|
|
|
|
}
|
|
|
|
--
|
2018-12-08 11:09:55 +01:00
|
|
|
2.19.2
|
2018-06-30 05:50:17 +02:00
|
|
|
|