craftbukkit/nms-patches/net/minecraft/world/entity/projectile/EntityThrownExpBottle.patch

23 lines
1.2 KiB
Diff
Raw Normal View History

2021-03-16 09:00:00 +11:00
--- a/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
+++ b/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
2021-06-11 15:00:00 +10:00
@@ -39,9 +39,18 @@
2021-11-22 09:00:00 +11:00
protected void onHit(MovingObjectPosition movingobjectposition) {
super.onHit(movingobjectposition);
2021-06-11 15:00:00 +10:00
if (this.level instanceof WorldServer) {
2021-11-22 09:00:00 +11:00
- this.level.levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
+ // CraftBukkit - moved to after event
2021-11-22 09:00:00 +11:00
+ // this.level.levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
2021-06-11 15:00:00 +10:00
int i = 3 + this.level.random.nextInt(5) + this.level.random.nextInt(5);
2015-02-26 22:41:06 +00:00
+ // CraftBukkit start
+ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, i);
+ i = event.getExperience();
+ if (event.getShowEffect()) {
2021-11-22 09:00:00 +11:00
+ this.level.levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
+ }
+ // CraftBukkit end
2015-02-26 22:41:06 +00:00
+
2021-11-22 09:00:00 +11:00
EntityExperienceOrb.award((WorldServer) this.level, this.position(), i);
this.discard();
2021-06-11 15:00:00 +10:00
}