Files
2019-02-24 22:29:41 +08:00

21 lines
1013 B
Diff

--- ../src-base/minecraft/net/minecraft/entity/item/EntityExpBottle.java
+++ ../src-work/minecraft/net/minecraft/entity/item/EntityExpBottle.java
@@ -40,9 +40,16 @@
{
if (!this.world.isRemote)
{
- this.world.playEvent(2002, new BlockPos(this), PotionUtils.getPotionColor(PotionTypes.WATER));
+ // CraftBukkit - moved to after event
+ // this.world.playEvent(2002, new BlockPos(this), PotionUtils.getPotionColor(PotionTypes.WATER));
int i = 3 + this.world.rand.nextInt(5) + this.world.rand.nextInt(5);
+ org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, i);
+ i = event.getExperience();
+ if (event.getShowEffect()) {
+ this.world.playEvent(2002, new BlockPos(this), PotionUtils.getPotionColor(PotionTypes.WATER));
+ }
+
while (i > 0)
{
int j = EntityXPOrb.getXPSplit(i);