PaperMC/paper-server/patches/sources/net/minecraft/world/item/LingeringPotionItem.java.patch
2018-07-21 03:11:03 -05:00

21 lines
789 B
Diff

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