aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch
new file mode 100644
index 0000000000..d3ab8c972a
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch
@@ -0,0 +1,24 @@
+--- a/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
++++ b/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
+@@ -38,9 +39,19 @@
+ protected void onHit(HitResult result) {
+ super.onHit(result);
+ if (this.level() instanceof ServerLevel) {
+- this.level().levelEvent(2002, this.blockPosition(), PotionUtils.getColor(Potions.WATER));
++ // CraftBukkit - moved to after event
++ // this.level().levelEvent(2002, this.blockPosition(), PotionUtil.getColor(Potions.WATER));
+ int i = 3 + this.level().random.nextInt(5) + this.level().random.nextInt(5);
+- ExperienceOrb.award((ServerLevel)this.level(), this.position(), i);
++
++ // CraftBukkit start
++ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, result, i);
++ i = event.getExperience();
++ if (event.getShowEffect()) {
++ this.level().levelEvent(2002, this.blockPosition(), PotionUtils.getColor(Potions.WATER));
++ }
++ // CraftBukkit end
++
++ ExperienceOrb.award((ServerLevel) this.level(), this.position(), i);
+ this.discard();
+ }
+ }