Throw PlayerLevelChangeEvent and PlayerExpChangeEvent events. Thanks to feildmaster for the PR.

This commit is contained in:
Nathan Adams
2012-01-19 16:06:27 +00:00
parent 1f1c9c0d4b
commit b0f29b1755
4 changed files with 28 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
package net.minecraft.server;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntityExperienceOrb extends Entity {
public int a;
@@ -130,7 +132,7 @@ public class EntityExperienceOrb extends Entity {
entityhuman.x = 2;
this.world.makeSound(this, "random.orb", 0.1F, 0.5F * ((this.random.nextFloat() - this.random.nextFloat()) * 0.7F + 1.8F));
entityhuman.receive(this, 1);
entityhuman.giveExp(this.value);
entityhuman.giveExp(CraftEventFactory.callPlayerExpChangeEvent(entityhuman, this.value).getAmount()); // CraftBukkit - this.value to event.getAmount()
this.die();
}
}