Add source to PlayerExpChangeEvent
This commit is contained in:
@@ -1168,6 +1168,17 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
// Paper start - Add orb
|
||||
public static PlayerExpChangeEvent callPlayerExpChangeEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb entityOrb) {
|
||||
Player player = (Player) entity.getBukkitEntity();
|
||||
ExperienceOrb source = (ExperienceOrb) entityOrb.getBukkitEntity();
|
||||
int expAmount = source.getExperience();
|
||||
PlayerExpChangeEvent event = new PlayerExpChangeEvent(player, source, expAmount);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
return event;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
public static boolean handleBlockGrowEvent(Level world, BlockPos pos, net.minecraft.world.level.block.state.BlockState block) {
|
||||
return CraftEventFactory.handleBlockGrowEvent(world, pos, block, 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user