aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch
new file mode 100644
index 0000000000..df7a925c0b
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java.patch
@@ -0,0 +1,45 @@
+--- a/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
++++ b/net/minecraft/world/entity/projectile/ThrownExperienceBottle.java
+@@ -12,6 +12,7 @@
+ import net.minecraft.world.phys.HitResult;
+
+ public class ThrownExperienceBottle extends ThrowableItemProjectile {
++
+ public ThrownExperienceBottle(EntityType<? extends ThrownExperienceBottle> entityType, Level level) {
+ super(entityType, level);
+ }
+@@ -20,8 +21,8 @@
+ super(EntityType.EXPERIENCE_BOTTLE, shooter, level);
+ }
+
+- public ThrownExperienceBottle(Level level, double x, double y, double z) {
+- super(EntityType.EXPERIENCE_BOTTLE, x, y, z, level);
++ public ThrownExperienceBottle(Level level, double x, double d1, double y) {
++ super(EntityType.EXPERIENCE_BOTTLE, x, d1, y, level);
+ }
+
+ @Override
+@@ -38,10 +39,21 @@
+ 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();
+ }
++
+ }
+ }