コード例 #1
0
 // <Index = 3>
 @EventHandler
 public void onPlayerDeath(PlayerDeathEvent event) {
   Player att = event.getEntity().getKiller();
   String pName = event.getEntity().getName();
   if (att instanceof Player && att.getEntityId() != event.getEntity().getEntityId()) {
     String aName = att.getName();
     SQL.addKill(aName);
     SQL.addMoney(aName, SQL.getMoney(pName) > SQL.getMoney(aName) ? 10 : 5);
     ScoreboardHandler.addKill(aName);
   }
   SQL.addDeath(pName);
   event.getDrops().clear();
 }
コード例 #2
0
 @Override
 public void run() {
   for (Player p : Bukkit.getOnlinePlayers()) {
     p.setFoodLevel(Main.lobbyBoolean ? 20 : 16);
     p.setLevel(SQL.getMoney(p.getName()));
   }
 }
コード例 #3
0
 @EventHandler(priority = EventPriority.MONITOR)
 public void onRodUse(PlayerUseRodEvent event) {
   SQL.addRodUsed(event.getPlayer().getName());
 }