Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Spigot-API-Patches/0116-Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch
Aikar 835bc39b03
Paper 1.13.1 Update
Updated Upstream (Bukkit/CraftBukkit/Spigot)

Bukkit Changes:
2dcc44dc SPIGOT-4307: Fix hacky API for banners on shields
e0fc6572 SPIGOT-4309: Add "forced" display of particles
efeeab2f Add index to README.md for easier navigation
f502bc6f Update to Minecraft 1.13.1

CraftBukkit Changes:
d0bb0a1d Fix some tests randomly failing
997d378d Fix client stall in specific teleportation scenarios
b3dc2366 SPIGOT-4307: Fix hacky API for banners on shields
2a271162 SPIGOT-4301: Fix more invalid enchants
5d0d83bb SPIGOT-4309: Add "forced" display of particles
a6772578 Add additional tests for CraftBlockData
ce1af0c3 Update to Minecraft 1.13.1

Spigot Changes:
2440e189 Rebuild patches
4ecffced Update to Minecraft 1.13.1
2018-08-26 20:51:39 -04:00

58 Zeilen
2.0 KiB
Diff

From 2bf0516d4ec180c0bbd9f50c67f205a99b8c08ca Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Sat, 30 Jun 2018 05:45:04 +0200
Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the
projectile has hit
diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
index 35f4148bb..db105e764 100644
--- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
+++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java
@@ -12,6 +12,7 @@ public class ProjectileHitEvent extends EntityEvent {
private static final HandlerList handlers = new HandlerList();
private final Entity hitEntity;
private final Block hitBlock;
+ private final org.bukkit.block.BlockFace hitBlockFace; // Paper
public ProjectileHitEvent(final Projectile projectile) {
this(projectile, null, null);
@@ -26,9 +27,16 @@ public class ProjectileHitEvent extends EntityEvent {
}
public ProjectileHitEvent(final Projectile projectile, Entity hitEntity, Block hitBlock) {
+ // Paper Start - Add a constructor that includes a BlockFace parameter
+ this(projectile, hitEntity, hitBlock, null);
+ }
+
+ public ProjectileHitEvent(final Projectile projectile, Entity hitEntity, Block hitBlock, org.bukkit.block.BlockFace hitBlockFace) {
+ // Paper End
super(projectile);
this.hitEntity = hitEntity;
this.hitBlock = hitBlock;
+ this.hitBlockFace = hitBlockFace; // Paper
}
@Override
@@ -45,6 +53,17 @@ public class ProjectileHitEvent extends EntityEvent {
return hitBlock;
}
+ // Paper Start
+ /**
+ * Gets the face of the block that the projectile has hit.
+ *
+ * @return hit block face or else null
+ */
+ public org.bukkit.block.BlockFace getHitBlockFace() {
+ return hitBlockFace;
+ }
+ // Paper End
+
/**
* Gets the entity that was hit, if it was an entity that was hit.
*
--
2.18.0