geforkt von Mirrors/Paper
18c3716c49
This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. We also store counts by type to further enable other performance optimizations in later patches.
24 Zeilen
1.3 KiB
Diff
24 Zeilen
1.3 KiB
Diff
From e66cac106ad45ebee9efc27046d70074f702add0 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 9b19c055d..248873fb4 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -836,7 +836,7 @@ public class CraftEventFactory {
|
|
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;
|
|
}
|
|
--
|
|
2.18.0
|
|
|