2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
|
|
|
|
+++ b/net/minecraft/world/entity/projectile/EntityThrownExpBottle.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -39,9 +39,18 @@
|
2014-11-25 22:32:16 +01:00
|
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
2020-06-25 02:00:00 +02:00
|
|
|
super.a(movingobjectposition);
|
2021-06-11 07:00:00 +02:00
|
|
|
if (this.level instanceof WorldServer) {
|
|
|
|
- this.level.triggerEffect(2002, this.getChunkCoordinates(), PotionUtil.a(Potions.WATER));
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit - moved to after event
|
2021-06-11 07:00:00 +02:00
|
|
|
+ // this.level.triggerEffect(2002, this.getChunkCoordinates(), PotionUtil.a(Potions.WATER));
|
|
|
|
int i = 3 + this.level.random.nextInt(5) + this.level.random.nextInt(5);
|
2015-02-26 23:41:06 +01:00
|
|
|
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit start
|
|
|
|
+ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, i);
|
|
|
|
+ i = event.getExperience();
|
|
|
|
+ if (event.getShowEffect()) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ this.level.triggerEffect(2002, this.getChunkCoordinates(), PotionUtil.a(Potions.WATER));
|
2014-11-25 22:32:16 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2015-02-26 23:41:06 +01:00
|
|
|
+
|
2021-06-11 07:00:00 +02:00
|
|
|
EntityExperienceOrb.a((WorldServer) this.level, this.getPositionVector(), i);
|
|
|
|
this.die();
|
|
|
|
}
|