Merge branch 'dev' of https://github.com/RedstonerServer/redstoner-utils into dev
This commit is contained in:
12
adminchat.py
12
adminchat.py
@@ -50,12 +50,12 @@ def get_key(uuid):
|
||||
key = ac_keys.get(uuid)
|
||||
return key if key != None else ac_defaultkey
|
||||
|
||||
@simplecommand("adminchatkey",
|
||||
aliases = ["ackey"],
|
||||
senderLimit = 0,
|
||||
helpNoargs = True,
|
||||
helpSubcmd = True,
|
||||
description = "Sets a key character for adminchat",
|
||||
@simplecommand("adminchatkey",
|
||||
aliases = ["ackey"],
|
||||
senderLimit = 0,
|
||||
helpNoargs = True,
|
||||
helpSubcmd = True,
|
||||
description = "Sets a key character for adminchat",
|
||||
usage = "<key>")
|
||||
def adminchatkey_command(sender, command, label, args):
|
||||
key = " ".join(args)
|
||||
|
||||
@@ -92,7 +92,7 @@ def adminnotes_command(sender, command, label, args):
|
||||
show_an_help(sender)
|
||||
return
|
||||
if not args[1].isdigit():
|
||||
msg(sender, "&cThe ID has to be numeric (check /an if you're unsure)")
|
||||
msg(sender, "&cThe ID has to be numeric (check /an if you're unsure)")
|
||||
return
|
||||
note_id = int(args[1])-1
|
||||
if note_id >= len(notes):
|
||||
|
||||
@@ -20,13 +20,13 @@ def helpMsg(sender, cmd, description, usage, aliases, permission):
|
||||
|
||||
|
||||
def simplecommand(cmd,
|
||||
aliases = [],
|
||||
usage = "[args...]",
|
||||
aliases = [],
|
||||
usage = "[args...]",
|
||||
description = None,
|
||||
senderLimit = -1,
|
||||
amin = 0,
|
||||
amax = -1,
|
||||
helpNoargs = False,
|
||||
senderLimit = -1,
|
||||
amin = 0,
|
||||
amax = -1,
|
||||
helpNoargs = False,
|
||||
helpSubcmd = False):
|
||||
cmd = cmd.lower()
|
||||
permission = "utils." + cmd
|
||||
@@ -107,4 +107,4 @@ class Validate():
|
||||
if not checkargs(sender, args, amin, amax):
|
||||
raise CommandException("")
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ settingInformation = dict( #[setting type, identifying description, detailed des
|
||||
)
|
||||
|
||||
defaults = {
|
||||
0: list,
|
||||
0: list,
|
||||
1: dict,
|
||||
2: list
|
||||
}
|
||||
@@ -87,8 +87,8 @@ def getSettingDetails(arg):
|
||||
raise CommandException(" &cThat setting could not be found.\n For command help, use &o/toggle &cor &o/set")
|
||||
|
||||
@simplecommand("toggle",
|
||||
aliases = ["setting", "set", "config"],
|
||||
usage = "<setting> [value|info]",
|
||||
aliases = ["setting", "set", "config"],
|
||||
usage = "<setting> [value|info]",
|
||||
description = "Toggles or sets your preferences for our redstone \nutilities. The following settings are available:\n" + ", ".join([x for x in settingInformation]),
|
||||
senderLimit = 0,
|
||||
helpNoargs = True,
|
||||
@@ -144,13 +144,13 @@ def toggle_command(sender, command, label, args):
|
||||
if arg2 == "details":
|
||||
return " &aSetting %s:\n &9%s \n&6Accepted arguments: [<slot>|clear|details]" % (setting, details[2])
|
||||
|
||||
slot = int(arg2) if arg2.isdigit() else 0
|
||||
slot = int(arg2) if arg2.isdigit() else 0
|
||||
if not (0 <= slot <= details[4]):
|
||||
return " &cSlot number must be more than or equal to 0 and less than or equal to %s!" % details[4]
|
||||
|
||||
item = fromStack(player.getItemInHand())
|
||||
if item[0] == 0 or item[1] <= 0:
|
||||
if enabled:
|
||||
if enabled:
|
||||
items = values[uuid]
|
||||
if slot in items:
|
||||
del items[slot]
|
||||
@@ -197,16 +197,16 @@ def on_block_place(event):
|
||||
material = block.getType()
|
||||
|
||||
|
||||
if (material in (Material.WOOD_STEP, Material.STEP)
|
||||
and isEnabled("slab", uuid)
|
||||
and player.hasPermission("utils.toggle.slab")
|
||||
if (material in (Material.WOOD_STEP, Material.STEP)
|
||||
and isEnabled("slab", uuid)
|
||||
and player.hasPermission("utils.toggle.slab")
|
||||
and block.getData() < 8
|
||||
):
|
||||
block.setData(block.getData() + 8) # Flip upside down
|
||||
|
||||
|
||||
elif (material == Material.CAULDRON
|
||||
and isEnabled("cauldron", uuid)
|
||||
elif (material == Material.CAULDRON
|
||||
and isEnabled("cauldron", uuid)
|
||||
and player.hasPermission("utils.toggle.cauldron")
|
||||
):
|
||||
block.setData(3) #3 layers of water, 3 signal strength
|
||||
@@ -214,7 +214,7 @@ def on_block_place(event):
|
||||
|
||||
elif ((material == Material.FURNACE and player.hasPermission("utils.toggle.furnace"))
|
||||
or (material == Material.DROPPER and player.hasPermission("utils.toggle.dropper"))
|
||||
or (material == Material.HOPPER and player.hasPermission("utils.toggle.hopper"))
|
||||
or (material == Material.HOPPER and player.hasPermission("utils.toggle.hopper"))
|
||||
):
|
||||
stacks = get(str(material).lower()).get(uuid)
|
||||
if stacks != None: # Enabled
|
||||
@@ -227,7 +227,7 @@ def on_block_place(event):
|
||||
"""
|
||||
elif (material == Material.REDSTONE_TORCH_ON
|
||||
and event.getBlockAgainst().getType() == Material.REDSTONE_BLOCK
|
||||
and isEnabled("torch", uuid)
|
||||
and isEnabled("torch", uuid)
|
||||
and player.hasPermission("utils.toggle.torch")
|
||||
):
|
||||
torches_to_break.append(block)
|
||||
@@ -244,8 +244,8 @@ def on_block_place(event):
|
||||
@hook.event("player.PlayerInteractEvent", "monitor")
|
||||
def on_interact(event):
|
||||
player = event.getPlayer()
|
||||
if (isEnabled("cauldron", uid(player))
|
||||
and player.hasPermission("utils.toggle.cauldron")
|
||||
if (isEnabled("cauldron", uid(player))
|
||||
and player.hasPermission("utils.toggle.cauldron")
|
||||
and is_creative(player)
|
||||
and event.getAction() == Action.RIGHT_CLICK_BLOCK
|
||||
and (not event.hasItem() or event.getItem().getType() == Material.REDSTONE)
|
||||
@@ -269,7 +269,7 @@ def stop_breaking_torches():
|
||||
class torch_breaker(Runnable):
|
||||
|
||||
def run():
|
||||
|
||||
|
||||
try:
|
||||
if break_torches:
|
||||
for i in range(len(torches_to_break)):
|
||||
|
||||
@@ -97,12 +97,12 @@ def on_chat(event):
|
||||
groupchat(sender, msge)
|
||||
event.setCancelled(True)
|
||||
|
||||
@simplecommand("chatgroupkey",
|
||||
aliases = ["cgkey"],
|
||||
senderLimit = 0,
|
||||
helpNoargs = True,
|
||||
helpSubcmd = True,
|
||||
description = "Sets a key character for chatting to your chatgroup",
|
||||
@simplecommand("chatgroupkey",
|
||||
aliases = ["cgkey"],
|
||||
senderLimit = 0,
|
||||
helpNoargs = True,
|
||||
helpSubcmd = True,
|
||||
description = "Sets a key character for chatting to your chatgroup",
|
||||
usage = "<key>")
|
||||
def chatgroupkey_command(sender, command, label, args):
|
||||
key = " ".join(args)
|
||||
|
||||
@@ -126,7 +126,7 @@ def runas(player, cmd):
|
||||
player.chat("/" + cmd)
|
||||
else:
|
||||
server.dispatchCommand(player, cmd)
|
||||
|
||||
|
||||
|
||||
def is_player(obj):
|
||||
"""
|
||||
|
||||
@@ -34,10 +34,10 @@ def matches_thread(password, user):
|
||||
|
||||
|
||||
@simplecommand("cgpass",
|
||||
usage = "<password> <new password>",
|
||||
description = "Changes your password",
|
||||
senderLimit = 0,
|
||||
helpNoargs = True)
|
||||
usage = "<password> <new password>",
|
||||
description = "Changes your password",
|
||||
senderLimit = 0,
|
||||
helpNoargs = True)
|
||||
def change_pass_command(sender, command, label, args):
|
||||
if sender.getName() in logging_in:
|
||||
return "&cYou are not logged in"
|
||||
@@ -52,9 +52,9 @@ def change_pass_command(sender, command, label, args):
|
||||
return "&cYou are not registered"
|
||||
|
||||
@simplecommand("login",
|
||||
usage = "<password>",
|
||||
usage = "<password>",
|
||||
description = "Logs you in if <password> matches your password.",
|
||||
senderLimit = 0,
|
||||
senderLimit = 0,
|
||||
helpNoargs = True)
|
||||
def login_command(sender, command, label, args):
|
||||
password = args[0]
|
||||
@@ -195,7 +195,7 @@ def kick_thread():
|
||||
if name in logging_in:
|
||||
del logging_in[name]
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
||||
thread = threading.Thread(target = kick_thread)
|
||||
|
||||
4
main.py
4
main.py
@@ -38,8 +38,8 @@ shared["load_modules"] = [
|
||||
"adminchat",
|
||||
# Adds /badge, allows to give players achievements
|
||||
"badges",
|
||||
# Adds a few block placement corrections/mods
|
||||
"blockplacemods",
|
||||
# Adds a few block placement corrections/mods
|
||||
"blockplacemods",
|
||||
# Adds /calc, toggles automatic solving of Math expressions in chat
|
||||
"calc",
|
||||
# Plugin to locate laggy chunks. /lc <n> lists chunks with more than n entities
|
||||
|
||||
2
misc.py
2
misc.py
@@ -138,7 +138,7 @@ def on_sudo_command(sender, command, label, args):
|
||||
|
||||
|
||||
|
||||
@simplecommand("me",
|
||||
@simplecommand("me",
|
||||
usage = "[message..]",
|
||||
description = "Sends a message in third person",
|
||||
helpNoargs = True)
|
||||
|
||||
20
player.py
20
player.py
@@ -4,24 +4,24 @@ players = []
|
||||
|
||||
class py_player:
|
||||
|
||||
def __init__(player):
|
||||
self.player = player
|
||||
def __init__(player):
|
||||
self.player = player
|
||||
|
||||
#Properties TODO
|
||||
#Example:
|
||||
self.logging_in = False
|
||||
#Properties TODO
|
||||
#Example:
|
||||
self.logging_in = False
|
||||
|
||||
def get_py_player(player):
|
||||
py_player = players[players.index(player)]
|
||||
return py_player
|
||||
py_player = players[players.index(player)]
|
||||
return py_player
|
||||
|
||||
|
||||
@hook.event("player.PlayerJoinEvent","highest")
|
||||
def on_join(event):
|
||||
player = py_player(event.getPlayer())
|
||||
players.append(player)
|
||||
player = py_player(event.getPlayer())
|
||||
players.append(player)
|
||||
|
||||
|
||||
@hook.event("player.PlayerQuitEvent","highest")
|
||||
def on_leave(event):
|
||||
players.remove(get_py_player(event.getPlayer()))
|
||||
players.remove(get_py_player(event.getPlayer()))
|
||||
|
||||
41
setup.sh
41
setup.sh
@@ -3,6 +3,15 @@
|
||||
# exit on failure
|
||||
set -e
|
||||
|
||||
for cmd in curl java unzip git pip; do
|
||||
if ! which -s "$cmd"; then
|
||||
tput setf 4 >&2
|
||||
echo "Error: please install '$cmd' to proceed" >&2
|
||||
tput sgr0 >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo -e "> This will only set up Spigot and all the plugins, configuration files are still up to you to manage"
|
||||
echo -e "> Press enter to coninue"
|
||||
read
|
||||
@@ -33,19 +42,19 @@ curl --progress-bar -Lo "essentials.jar" "https://github.com/RedstonerServer/Ess
|
||||
echo ">> Downloading essentialschat.jar ..."
|
||||
curl --progress-bar -Lo "essentialschat.jar" "https://hub.spigotmc.org/jenkins/job/Spigot-Essentials/lastSuccessfulBuild/artifact/EssentialsChat/target/EssentialsChat-2.x-SNAPSHOT.jar"
|
||||
echo ">> Downloading imageonmap.jar ..."
|
||||
curl --progress-bar -Lo "imageonmap.jar" "https://dev.bukkit.org/media/files/772/680/imageonmap.jar"
|
||||
curl --progress-bar -Lo "imageonmap.jar." "https://dev.bukkit.org/media/files/772/680/imageonmap.jar"
|
||||
echo ">> Downloading logblock.jar ..."
|
||||
curl --progress-bar -Lo "logblock.jar" "https://dev.bukkit.org/media/files/757/963/LogBlock.jar"
|
||||
curl --progress-bar -Lo "logblock.jar." "https://dev.bukkit.org/media/files/757/963/LogBlock.jar"
|
||||
echo ">> Downloading logblockquestioner.zip ..."
|
||||
curl --progress-bar -Lo "logblockquestioner.zip" "https://cloud.github.com/downloads/DiddiZ/LogBlockQuestioner/LogBlockQuestioner%20v0.03.zip"
|
||||
echo ">> Downloading multiverse-core.jar ..."
|
||||
curl --progress-bar -Lo "multiverse-core.jar" "https://dev.bukkit.org/media/files/588/781/Multiverse-Core-2.4.jar"
|
||||
echo ">> Downloading multiverse-portals.jar ..."
|
||||
curl --progress-bar -Lo "multiverse-portals.jar" "https://dev.bukkit.org/media/files/588/790/Multiverse-Portals-2.4.jar"
|
||||
curl --progress-bar -Lo "multiverse-portals.jar." "https://dev.bukkit.org/media/files/588/790/Multiverse-Portals-2.4.jar"
|
||||
echo ">> Downloading multiverse-netherportals.jar ..."
|
||||
curl --progress-bar -Lo "multiverse-netherportals.jar" "https://dev.bukkit.org/media/files/589/64/Multiverse-NetherPortals-2.4.jar"
|
||||
curl --progress-bar -Lo "multiverse-netherportals.jar." "https://dev.bukkit.org/media/files/589/64/Multiverse-NetherPortals-2.4.jar"
|
||||
echo ">> Downloading multiverse-inventories.jar ..."
|
||||
curl --progress-bar -Lo "multiverse-inventories.jar" "https://dev.bukkit.org/media/files/663/303/Multiverse-Inventories-2.5.jar"
|
||||
curl --progress-bar -Lo "multiverse-inventories.jar." "https://dev.bukkit.org/media/files/663/303/Multiverse-Inventories-2.5.jar"
|
||||
echo ">> Downloading permissionsex.jar ..."
|
||||
curl --progress-bar -Lo "permissionsex.jar" "https://dev.bukkit.org/media/files/882/992/PermissionsEx-1.23.3.jar"
|
||||
echo ">> Downloading plotme.jar ..."
|
||||
@@ -53,15 +62,15 @@ curl --progress-bar -Lo "plotme.jar" "http://ci.worldcretornica.com/job/PlotMe-C
|
||||
echo ">> Downloading plotme-defaultgenerator.jar ..."
|
||||
curl --progress-bar -Lo "plotme-defaultgenerator.jar" "http://ci.worldcretornica.com/job/PlotMe-DefaultGenerator/83/artifact/target/PlotMe-DefaultGenerator.jar"
|
||||
echo ">> Downloading serversigns.jar ..."
|
||||
curl --progress-bar -Lo "serversigns.jar" "https://dev.bukkit.org/media/files/876/381/ServerSigns.jar"
|
||||
curl --progress-bar -Lo "serversigns.jar." "https://dev.bukkit.org/media/files/876/381/ServerSigns.jar"
|
||||
echo ">> Downloading redstoneclockdetector.jar ..."
|
||||
curl --progress-bar -Lo "redstoneclockdetector.jar" "https://dev.bukkit.org/media/files/577/253/RedstoneClockDetector.jar"
|
||||
curl --progress-bar -Lo "redstoneclockdetector.jar." "https://dev.bukkit.org/media/files/577/253/RedstoneClockDetector.jar"
|
||||
echo ">> Downloading vault.jar ..."
|
||||
curl --progress-bar -Lo "vault.jar" "https://dev.bukkit.org/media/files/837/976/Vault.jar"
|
||||
echo ">> Downloading worldborder.jar ..."
|
||||
curl --progress-bar -Lo "worldborder.jar" "https://dev.bukkit.org/media/files/883/629/WorldBorder.jar"
|
||||
curl --progress-bar -Lo "worldborder.jar." "https://dev.bukkit.org/media/files/883/629/WorldBorder.jar"
|
||||
echo ">> Downloading worldguard.jar ..."
|
||||
curl --progress-bar -Lo "worldguard.jar" "https://github.com/RedstonerServer/WorldGuard/releases/download/6.0.0-redstoner/worldguard-6.0.0-REDSTONER.jar"
|
||||
curl --progress-bar -Lo "worldguard.jar." "https://github.com/RedstonerServer/WorldGuard/releases/download/6.0.0-redstoner/worldguard-6.0.0-REDSTONER.jar"
|
||||
echo ">> Downloading worldedit.jar ..."
|
||||
curl --progress-bar -Lo "worldedit.jar" "https://dev.bukkit.org/media/files/880/435/worldedit-bukkit-6.1.jar"
|
||||
echo ">> Downloading pythonpluginloader.jar ..."
|
||||
@@ -70,13 +79,23 @@ curl --progress-bar -Lo "pythonpluginloader.jar" "https://bamboo.gserv.me/browse
|
||||
echo -e "\n> Unpacking LogBlockQuestioner"
|
||||
unzip -q "logblockquestioner.zip" "LogBlockQuestioner.jar"
|
||||
rm "logblockquestioner.zip"
|
||||
mv -v "LogBlockQuestioner.jar" "logblockquestioner.jar"
|
||||
mv -v "LogBlockQuestioner.jar" "logblockquestioner.jar."
|
||||
|
||||
echo -e "\n> Pulling redstoner-utils ..."
|
||||
git clone -q "git@github.com:RedstonerServer/redstoner-utils.git" "redstoner-utils.py.dir" > /dev/null
|
||||
|
||||
echo -e "\n> Installing dependencies"
|
||||
pip install passlib
|
||||
|
||||
echo -e "\n> All plugins downloaded"
|
||||
cd ".."
|
||||
|
||||
cd "redstoner-utils.py.dir"
|
||||
echo -e "\n> Duplicating sample files"
|
||||
for file in ls ./*.example; do
|
||||
cp -v "$file" "$(echo "$file" | rev | cut -d "." -f 2- | rev)"
|
||||
done
|
||||
|
||||
cd "../.."
|
||||
|
||||
mkdir -v "lib"
|
||||
cd "lib"
|
||||
|
||||
42
snowbrawl.py
42
snowbrawl.py
@@ -49,7 +49,7 @@ class Arena(object):
|
||||
self.match_goal = None # amount of deaths or time until the match ends (depends on arena_type)
|
||||
self.arena_type = None # arena type (death or time)
|
||||
self.explosion_damage = None
|
||||
|
||||
|
||||
self.player_stats = {}
|
||||
self.players = Queue()
|
||||
self.spawn_location = []
|
||||
@@ -60,7 +60,7 @@ class Arena(object):
|
||||
self.corner1 = None # The corner1 given by the player (really bad for 3D position compare)
|
||||
self.corner2 = None # The corner2 given by the player (really bad for 3D position compare)
|
||||
self.tpp = None # The top, positive x, positive z corner
|
||||
self.bnn = None # The bottom, negative x, negative z corner
|
||||
self.bnn = None # The bottom, negative x, negative z corner
|
||||
|
||||
#set corners of arena
|
||||
def set_corner(self, sender, type):
|
||||
@@ -75,21 +75,21 @@ class Arena(object):
|
||||
#Compares the corner1 and corner2 locations and figures out tpp and bnn so that we dont have to do it everytime we run in_arena()
|
||||
def update_corner_points(self):
|
||||
self.tpp = None
|
||||
self.bnn = None
|
||||
self.bnn = None
|
||||
if self.corner1 == None or self.corner2 == None:
|
||||
return
|
||||
corn1 = self.corner1.get_location()
|
||||
corn2 = self.corner2.get_location()
|
||||
if not corn1.getWorld().getName() == corn2.getWorld().getName():
|
||||
return
|
||||
|
||||
|
||||
top = corn1.y if corn1.y > corn2.y else corn2.y
|
||||
bottom = corn1.y if corn1.y < corn2.y else corn2.y
|
||||
pos_x = corn1.x if corn1.x > corn2.x else corn2.x
|
||||
pos_z = corn1.z if corn1.z > corn2.z else corn2.z
|
||||
neg_x = corn1.x if corn1.x < corn2.x else corn2.x
|
||||
neg_z = corn1.z if corn1.z < corn2.z else corn2.z
|
||||
|
||||
|
||||
self.tpp = Coords(corn1.getWorld(), pos_x, top, pos_z, 0, 0)
|
||||
self.bnn = Coords(corn2.getWorld(), neg_x, bottom, neg_z, 0, 0)
|
||||
|
||||
@@ -118,9 +118,9 @@ class Arena(object):
|
||||
self.start_match()
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
#remove a player from the queue
|
||||
def remove_player(self, player):
|
||||
def remove_player(self, player):
|
||||
if self.queue.contains(player):
|
||||
self.queue.remove(player)
|
||||
return True
|
||||
@@ -132,7 +132,7 @@ class Arena(object):
|
||||
return False
|
||||
loc_tpp = self.tpp.get_location()
|
||||
loc_bnn = self.bnn.get_location()
|
||||
|
||||
|
||||
if loc.y > loc_tpp.y:
|
||||
return False
|
||||
if loc.y < loc_bnn.y:
|
||||
@@ -179,12 +179,12 @@ class Arena(object):
|
||||
alist[i] = alist[i+1]
|
||||
alist[i+1] = temp
|
||||
return alist
|
||||
|
||||
|
||||
@make_synchronized #Jython synchronized block
|
||||
def end_match(self): #End match, sort the players and print the 3 players with least amount of deaths
|
||||
|
||||
|
||||
sorted_list = self.bubbleSort(self.players.read())
|
||||
|
||||
|
||||
for player in self.players.read():
|
||||
if player.isOnline():
|
||||
loc = self.sign_location[0].get_location().get_location()
|
||||
@@ -256,7 +256,7 @@ class Arena(object):
|
||||
|
||||
def get_click_signs(self):
|
||||
return self.sign_click
|
||||
|
||||
|
||||
#Check if player is in the queue
|
||||
def in_queue(self,player):
|
||||
if self.queue.contains(player):
|
||||
@@ -307,7 +307,7 @@ class Arena(object):
|
||||
sign.get_location().set_location(location)
|
||||
break
|
||||
|
||||
#Remove location out of location
|
||||
#Remove location out of location
|
||||
def delete_location(self, name, type):
|
||||
if type == "spawn":
|
||||
for spawn in self.spawn_location[:]:
|
||||
@@ -472,16 +472,16 @@ class Queue(object):
|
||||
|
||||
def __init__(self):
|
||||
self.queue = []
|
||||
|
||||
|
||||
#Appends to queue
|
||||
def put(self,args):
|
||||
self.queue.append(args)
|
||||
|
||||
|
||||
#Returns the first item in the queue and removes it
|
||||
def get(self):
|
||||
if len(self.queue) > 0:
|
||||
return self.queue.pop(0)
|
||||
|
||||
|
||||
else:
|
||||
return False
|
||||
|
||||
@@ -498,7 +498,7 @@ class Queue(object):
|
||||
if player in self.queue:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
#Clear the queue
|
||||
def clear(self):
|
||||
self.queue = []
|
||||
@@ -532,7 +532,7 @@ class timings_runnable(Runnable):
|
||||
self.arena = arena
|
||||
|
||||
def run(self):
|
||||
self.arena.end_match()
|
||||
self.arena.end_match()
|
||||
|
||||
#timings thread to end arenas if their type is time
|
||||
def timings():
|
||||
@@ -545,10 +545,10 @@ def timings():
|
||||
if arena.start_time + arena.match_goal < current_time:
|
||||
timing = timings_runnable(arena)
|
||||
server.getScheduler().runTask(server.getPluginManager().getPlugin("RedstonerUtils"), timing)
|
||||
|
||||
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
|
||||
timingsThread = threading.Thread(target = timings)
|
||||
timingsThread.daemon = True #Thread dies if main thread dies
|
||||
timingsThread.start()
|
||||
@@ -663,7 +663,7 @@ def on_quit(event):
|
||||
|
||||
##############################################################################################
|
||||
# Command handling
|
||||
##############################################################################################
|
||||
##############################################################################################
|
||||
|
||||
|
||||
def create_arena(sender, args):
|
||||
|
||||
Reference in New Issue
Block a user