PaperMC/paper-server/patches/sources/net/minecraft/world/item/SplashPotionItem.java.patch
2024-12-14 12:50:23 -08:00

21 lines
789 B
Diff

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