Exemplo n.º 1
0
 @EventHandler
 public void onPlayerDropItem(PlayerDropItemEvent e) {
   Player p = e.getPlayer();
   if (p.getLocation()
       .getWorld()
       .getName()
       .equals(settings.getConfig().getString("spawn.world"))) {
     if (!p.hasPermission("hub.editinventory")) {
       e.setCancelled(true);
     }
   }
 }
Exemplo n.º 2
0
public class PlayerDropItem implements Listener {

  SettingsManager settings = SettingsManager.getInstance();

  @EventHandler
  public void onPlayerDropItem(PlayerDropItemEvent e) {
    Player p = e.getPlayer();
    if (p.getLocation()
        .getWorld()
        .getName()
        .equals(settings.getConfig().getString("spawn.world"))) {
      if (!p.hasPermission("hub.editinventory")) {
        e.setCancelled(true);
      }
    }
  }
}