aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0470-Add-TargetHitEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0470-Add-TargetHitEvent.patch')
-rw-r--r--patches/server/0470-Add-TargetHitEvent.patch8
1 files changed, 4 insertions, 4 deletions
diff --git a/patches/server/0470-Add-TargetHitEvent.patch b/patches/server/0470-Add-TargetHitEvent.patch
index f623f8091b..2afe7f45de 100644
--- a/patches/server/0470-Add-TargetHitEvent.patch
+++ b/patches/server/0470-Add-TargetHitEvent.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Add TargetHitEvent
diff --git a/src/main/java/net/minecraft/world/level/block/TargetBlock.java b/src/main/java/net/minecraft/world/level/block/TargetBlock.java
-index 5ea231aadfafdfc6d08aae472827ff1e3d62f4eb..e885f8defd5fd5059c895ee7906664f9e4561de0 100644
+index 02f6d5b523c3d4185a68adb419b2710768ed249f..da473a8b34e39cecf63fab8f7c4f77d485e5753b 100644
--- a/src/main/java/net/minecraft/world/level/block/TargetBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TargetBlock.java
@@ -42,6 +42,10 @@ public class TargetBlock extends Block {
@@ -16,10 +16,10 @@ index 5ea231aadfafdfc6d08aae472827ff1e3d62f4eb..e885f8defd5fd5059c895ee7906664f9
+ }
+ private static void awardTargetHitCriteria(Projectile projectile, BlockHitResult hit, int i) {
+ // Paper end - Add TargetHitEvent
- Entity entity = projectile.getOwner();
- if (entity instanceof ServerPlayer serverPlayer) {
+ if (projectile.getOwner() instanceof ServerPlayer serverPlayer) {
serverPlayer.awardStat(Stats.TARGET_HIT);
-@@ -53,6 +57,20 @@ public class TargetBlock extends Block {
+ CriteriaTriggers.TARGET_BLOCK_HIT.trigger(serverPlayer, projectile, hit.getLocation(), i);
+@@ -51,6 +55,20 @@ public class TargetBlock extends Block {
private static int updateRedstoneOutput(LevelAccessor world, BlockState state, BlockHitResult hitResult, Entity entity) {
int i = getRedstoneStrength(hitResult, hitResult.getLocation());
int j = entity instanceof AbstractArrow ? 20 : 8;