mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-01-13 19:21:46 +01:00
show the name, not displayname
This commit is contained in:
parent
490f9406c3
commit
365e23d863
@ -291,19 +291,4 @@ public class Utils {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void fixDurability(final ItemStack item) {
|
||||
if (item == null || item.getType().getMaxDurability() == 0)
|
||||
return;
|
||||
final short old = item.getDurability();
|
||||
plugin.getServer().getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
int diff = old - item.getDurability();
|
||||
if (diff != 0) {
|
||||
item.setDurability((short) (item.getDurability() + diff));
|
||||
}
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.*;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class AuthMeEntityListener implements Listener {
|
||||
|
||||
@ -29,11 +28,6 @@ public class AuthMeEntityListener implements Listener {
|
||||
if (Utils.checkAuth(player)) {
|
||||
return;
|
||||
}
|
||||
for (ItemStack item : player.getInventory().getArmorContents()) {
|
||||
if (item != null) {
|
||||
Utils.fixDurability(item);
|
||||
}
|
||||
}
|
||||
player.setFireTicks(0);
|
||||
event.setDamage(0.0);
|
||||
event.setCancelled(true);
|
||||
@ -66,7 +60,6 @@ public class AuthMeEntityListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Utils.fixDurability(player.getItemInHand());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@ -153,7 +146,6 @@ public class AuthMeEntityListener implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Utils.fixDurability(player.getItemInHand());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.Action;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
@ -404,11 +403,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
if (player == null || Utils.checkAuth(player))
|
||||
return;
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
Utils.fixDurability(player.getItemInHand());
|
||||
}
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@ -530,7 +524,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
if (player == null || Utils.checkAuth(player))
|
||||
return;
|
||||
Utils.fixDurability(player.getItemInHand());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
@ -539,7 +532,6 @@ public class AuthMePlayerListener implements Listener {
|
||||
Player player = event.getPlayer();
|
||||
if (player == null || Utils.checkAuth(player))
|
||||
return;
|
||||
Utils.fixDurability(player.getItemInHand());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
|
||||
// Player is now logout... Time to fire event !
|
||||
Bukkit.getServer().getPluginManager().callEvent(new LogoutEvent(player));
|
||||
m.send(player, "logout");
|
||||
ConsoleLogger.info(player.getDisplayName() + " logged out");
|
||||
ConsoleLogger.info(player.getName() + " logged out");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user