use uid(player) helper method

This commit is contained in:
jomo
2014-07-17 22:24:45 +02:00
parent ebf8a22bae
commit 8db6085d63
10 changed files with 32 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ def on_cycler_command(sender, args):
return True
cmd = args[0].lower()
pid = str(sender.getUniqueId())
pid = uid(sender)
nop = pid in no_cyclers
if cmd == "on":
if nop:
@@ -44,7 +44,7 @@ def on_cycler_command(sender, args):
@hook.event("player.PlayerItemHeldEvent", "normal")
def on_slot_change(event):
player = event.getPlayer()
if is_creative(player) and str(player.getUniqueId()) not in no_cyclers and not player.isSneaking():
if is_creative(player) and uid(player) not in no_cyclers and not player.isSneaking():
prev_slot = event.getPreviousSlot()
new_slot = event.getNewSlot()
if (prev_slot == 0 and new_slot == 8): # left -> right