Ejemplo n.º 1
0
  @Override
  public void OnPlayerDeathEvent(RunsafePlayerDeathEvent event) {
    IPlayer killer = event.getEntity().getKiller();

    if (killer != null && killer.isInUniverse("survival") && event.getLevelAmount() >= 30)
      award(killer);
  }
Ejemplo n.º 2
0
  @Override
  public void OnPlayerDeathEvent(RunsafePlayerDeathEvent event) {
    List<Hook> hooks = HookHandler.getHooks(HookType.PLAYER_DEATH);

    if (hooks != null) {
      IPlayer player = event.getEntity();

      for (Hook hook : hooks) {
        IWorld hookWorld = hook.getWorld();
        if (hookWorld.isWorld(player.getWorld())) {
          LuaTable table = new LuaTable();
          table.set("player", LuaValue.valueOf(player.getName()));

          hook.execute(table);
        }
      }
    }
  }