Dev #29

Closed
Evanus wants to merge 13 commits from dev into dev
2 changed files with 10 additions and 12 deletions
Showing only changes of commit 0ecdb5f5ab - Show all commits

12
bpm.py
View File

@ -1,11 +1,7 @@
from helpers import * from helpers import *
import org.bukkit.Material as Material import org.bukkit.Material as Material
""" tog_perm = "utils.toggle"
remake of dicodes blockplacemods
"""
togPerm = "utils.toggle"
@hook.event("block.BlockPlaceEvent", "low") @hook.event("block.BlockPlaceEvent", "low")
def block_place(event): def block_place(event):
@ -20,8 +16,8 @@ def block_place(event):
@hook.event("player.PlayerInteractEvent", "high") @hook.event("player.PlayerInteractEvent", "high")
def on_interact(event): def on_interact(event):
block = event.getClickedBlock() block = event.getClickedBlock()
sender = event.getPlayer() sender = event.getPlayer()
py_player = get_py_player(sender) py_player = get_py_player(sender)
if str(event.getAction()) != "RIGHT_CLICK_BLOCK": if str(event.getAction()) != "RIGHT_CLICK_BLOCK":
return return
@ -40,7 +36,7 @@ def help(sender):
@hook.command("toggle") @hook.command("toggle")
def toggle_command(sender, cmd, label, args): def toggle_command(sender, cmd, label, args):
py_player = get_py_player(sender) py_player = get_py_player(sender)
if sender.hasPermission(togPerm) and sender.getWorld().getName() == "creative": if sender.hasPermission(tog_perm) and sender.getWorld().getName() == "creative":
if len(args) > 0: if len(args) > 0:
if str(args[0]) == "slab": if str(args[0]) == "slab":
if py_player.slab_toggle == True: if py_player.slab_toggle == True:

View File

@ -4,10 +4,12 @@ py_players = []
class py_player: class py_player:
def __init__(self,player): def __init__(self,player):
self.player = player self.player = player
self.logging_in = False self.logging_in = False
self.login_time = 0 self.login_time = 0
self.slab_toggle = False
self.cauldron_toggle = False
def get_py_player(player): def get_py_player(player):
#py_player = py_players[py_players.index(player)] #py_player = py_players[py_players.index(player)]