PaperMC/paper-server/patches/sources/net/minecraft/world/item/SplashPotionItem.java.patch

22 lines
789 B
Diff
Raw Normal View History

2018-07-21 10:11:03 +02:00
--- a/net/minecraft/world/item/SplashPotionItem.java
+++ b/net/minecraft/world/item/SplashPotionItem.java
2024-12-14 21:50:20 +01:00
@@ -14,6 +_,10 @@
2018-07-21 10:11:03 +02:00
@Override
2024-12-14 21:50:20 +01:00
public InteractionResult use(Level level, Player player, InteractionHand hand) {
2018-07-21 10:11:03 +02:00
+ // Paper start - PlayerLaunchProjectileEvent
2024-12-14 21:50:20 +01:00
+ final InteractionResult wrapper = super.use(level, player, hand);
2018-07-21 10:11:03 +02:00
+ if (wrapper instanceof InteractionResult.Fail) return wrapper;
+ // Paper end - PlayerLaunchProjectileEvent
2024-12-14 21:50:20 +01:00
level.playSound(
2018-07-21 10:11:03 +02:00
null,
2024-12-14 21:50:20 +01:00
player.getX(),
@@ -24,6 +_,6 @@
2018-07-21 10:11:03 +02:00
0.5F,
2024-12-14 21:50:20 +01:00
0.4F / (level.getRandom().nextFloat() * 0.4F + 0.8F)
2018-07-21 10:11:03 +02:00
);
2024-12-14 21:50:20 +01:00
- return super.use(level, player, hand);
2018-07-21 10:11:03 +02:00
+ return wrapper; // Paper - PlayerLaunchProjectileEvent
}
}