Java 类org.bukkit.event.entity.ExpBottleEvent 实例源码

项目:Skript    文件:EvtExperienceSpawn.java   
@SuppressWarnings("unchecked")
private final static void registerExecutor() {
    if (registeredExecutor)
        return;
    for (final Class<? extends Event> c : new Class[] {BlockExpEvent.class, EntityDeathEvent.class, ExpBottleEvent.class, PlayerFishEvent.class})
        Bukkit.getPluginManager().registerEvent(c, new Listener() {}, SkriptConfig.defaultEventPriority.value(), executor, Skript.getInstance(), true);
}
项目:GriefPreventionPlus    文件:EntityEventHandler.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onExpBottle(ExpBottleEvent event)
{
    //if in a creative world, cancel the event (don't drop exp on the ground)
    if(GriefPrevention.instance.creativeRulesApply(event.getEntity().getLocation()))
    {
        event.setExperience(0);
    }
}
项目:Merlin    文件:PlayerListener.java   
@EventHandler(priority = EventPriority.NORMAL)
public void onExpBottleEvent (ExpBottleEvent event)
  {
    for (MetadataValue meta : event.getEntity().getMetadata(
        "expbottlelevel"))
      {
        if (meta == null)
          return;
        if (meta.getOwningPlugin() != plugin)
          continue;
        event.setExperience(event.getExperience() * meta.asInt());
        break;
      }
  }
项目:civcraft    文件:DisableXPListener.java   
@EventHandler(priority = EventPriority.LOW)
public void onExpBottleEvent(ExpBottleEvent event) {
    event.setExperience(0);
}