using is_creative helper
This commit is contained in:
2
cycle.py
2
cycle.py
@@ -44,7 +44,7 @@ def on_cycler_command(sender, args):
|
||||
@hook.event("player.PlayerItemHeldEvent", "normal")
|
||||
def on_slot_change(event):
|
||||
player = event.getPlayer()
|
||||
if str(player.getGameMode()) == "CREATIVE" and str(player.getUniqueId()) not in no_cyclers and not player.isSneaking():
|
||||
if is_creative(player) and str(player.getUniqueId()) 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
|
||||
|
||||
@@ -44,7 +44,7 @@ def on_dammnspam_command(sender, args):
|
||||
plugin_header(sender, "DamnSpam")
|
||||
if len(args) in [1,2]:
|
||||
|
||||
if not str(sender.getGameMode()) == "CREATIVE":
|
||||
if not is_creative(sender):
|
||||
msg(sender, "&cYou can only do this in Creative mode.")
|
||||
return True
|
||||
|
||||
|
||||
2
misc.py
2
misc.py
@@ -85,7 +85,7 @@ def on_player_entity_interact(event):
|
||||
last_shear = shear_time
|
||||
sender = event.getPlayer()
|
||||
entity = event.getRightClicked()
|
||||
if is_player(entity) and str(entity.getUniqueId()) == "ae795aa8-6327-408e-92ab-25c8a59f3ba1" and str(sender.getItemInHand().getType()) == "SHEARS" and str(sender.getGameMode()) == "CREATIVE":
|
||||
if is_player(entity) and str(entity.getUniqueId()) == "ae795aa8-6327-408e-92ab-25c8a59f3ba1" and str(sender.getItemInHand().getType()) == "SHEARS" and is_creative(sender):
|
||||
for i in range(5):
|
||||
entity.getWorld().dropItemNaturally(entity.getLocation(), ItemStack(bukkit.Material.getMaterial("REDSTONE")))
|
||||
entity.getWorld().dropItemNaturally(entity.getLocation(), ItemStack(bukkit.Material.getMaterial("WOOL")))
|
||||
|
||||
Reference in New Issue
Block a user