diff --git a/README.md b/README.md index 5839a44..ffe7f11 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Redstoner's custom plugins, written in python. # Installation / Set-up 1-line-install-script for bash: -`wget -O install.sh "http://pastie.org/pastes/9310905/download?key=6byp4mrqmiui8yqeo3s6yw"; md5sum --check <<<"3499671c0832e561bc9c7d476d2167cb install.sh" && sh install.sh` +`wget -O install.sh "http://pastie.org/pastes/9310905/download?key = 6byp4mrqmiui8yqeo3s6yw"; md5sum --check <<<"3499671c0832e561bc9c7d476d2167cb install.sh" && sh install.sh` Detailed description: @@ -14,7 +14,7 @@ Detailed description: 0. Download [the latest spigot](http://ci.md-5.net/job/Spigot/lastStableBuild/artifact/Spigot-Server/target/spigot.jar) 0. Run it once inside redstoner, then shut it down again 0. Create a new directory (inside redstoner) called 'lib' -0. Download [jython](http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7-b2/jython-standalone-2.7-b2.jar) and save it as 'jython.jar' inside lib +0. Download [jython](http://search.maven.org/remotecontent?filepath = org/python/jython-standalone/2.7-b2/jython-standalone-2.7-b2.jar) and save it as 'jython.jar' inside lib 0. Download [mysql-connector](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.30.zip), extract 'mysql-connector-java-X.X.XX-bin.jar ' and save it as 'mysql-connector.jar' inside lib 0. Download [PyPluginLoader](http://gserv.me/static/PyPluginLoader-0.3.5.jar) (we're using [this fork](https://github.com/gdude2002/Python-Plugin-Loader)) into the plugins directory diff --git a/abot.py b/abot.py index 0cac639..44ec8a6 100644 --- a/abot.py +++ b/abot.py @@ -23,9 +23,9 @@ def list_answers(sender): msg(sender, "&e{") msg(sender, " &eregex:") for regex in answer["regex"]: - msg(sender, " " + regex.pattern, basecolor="a", usecolor=False) + msg(sender, " " + regex.pattern, basecolor="a", usecolor = False) msg(sender, " &epermission:") - msg(sender, " " + str(answer["hide-perm"]), basecolor="a", usecolor=False) + msg(sender, " " + str(answer["hide-perm"]), basecolor="a", usecolor = False) msg(sender, " &emessage:") msg(sender, " " + "\n ".join(answer["message"].split("\n"))) msg(sender, "&e}") diff --git a/adminchat.py b/adminchat.py index e57108c..7cce9d0 100644 --- a/adminchat.py +++ b/adminchat.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 from helpers import * ac_permission = "utils.ac" diff --git a/chatgroups.py b/chatgroups.py index d5c59df..76eb8b2 100644 --- a/chatgroups.py +++ b/chatgroups.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 from helpers import * from java.util.UUID import fromString as juuid import json @@ -67,7 +67,7 @@ def on_cgt_command(sender, args): return True -def groupchat(sender, message, ann=False): +def groupchat(sender, message, ann = False): #try: group = groups.get(str(sender.getUniqueId())) if group == None: diff --git a/damnspam.py b/damnspam.py index 9f3b558..1bf2f03 100644 --- a/damnspam.py +++ b/damnspam.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 from helpers import * from time import time as now import org.bukkit.event.block.BlockBreakEvent as BlockBreakEvent diff --git a/forcefield.py b/forcefield.py index b36e107..69c17e8 100644 --- a/forcefield.py +++ b/forcefield.py @@ -2,11 +2,10 @@ from helpers import * from java.util.UUID import fromString as java_uuid forcefield_permissions = ["utils.forcefield", "utils.forcefield.ignore"] -forcefield_prefix = "&8[&aFF&8]" -fd = 4 # forcefield distance - -forcefield_toggle = [] -forcefield_whitelist = {} +forcefield_prefix = "&8[&aFF&8]" +forcefield_toggle = [] +forcefield_whitelist = {} +fd = 4 # forcefield distance @hook.command("forcefield") @@ -77,7 +76,7 @@ def whitelist_list(sender, sender_id): if not sender_id in forcefield_whitelist or len(forcefield_whitelist[sender_id]) == 0: msg(sender, "&c Your whitelist has no entries.") else: - c=0 + c = 0 for uid in forcefield_whitelist[sender_id]: c+=1 msg(sender, "&a %s. &f%s" % (c, server.getPlayer(java_uuid(uid)).getDisplayName())) @@ -145,10 +144,10 @@ def on_move(event): def set_velocity_away(player, entity): #Moves entity away from player player_loc = player.getLocation() entity_loc = entity.getLocation() - dx = entity_loc.getX() - player_loc.getX() - dy = entity_loc.getY() - player_loc.getY() - dz = entity_loc.getZ() - player_loc.getZ() - negator = fd/2 + dx = entity_loc.getX() - player_loc.getX() + dy = entity_loc.getY() - player_loc.getY() + dz = entity_loc.getZ() - player_loc.getZ() + negator = fd/2 entity.setVelocity(negator/dx, negator/dy, negator/dz) @@ -157,7 +156,7 @@ def set_velocity_away(player, entity): #Moves entity away from player @hook.event("player.PlayerQuitEvent") def on_quit(event): - try: - forcefield_toggle.remove(str(event.getPlayer().getUniqueId())) - except: - pass \ No newline at end of file + player = event.getPlayer() + uid = str(player.getUniqueId()) + if uid in forcefield_toggle: + forcefield_toggle.remove(uid) \ No newline at end of file diff --git a/helpers.py b/helpers.py index 8fc523d..771b01a 100644 --- a/helpers.py +++ b/helpers.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 from re import sub import org.bukkit as bukkit import org.bukkit.Location as Location @@ -54,7 +54,7 @@ def safetp(player, world, x, y, z, yaw = 0, pitch = 0): safetp(player, world, x, y+1, z, yaw, pitch) -def plugin_header(sender=None, name="Redstoner Utils"): +def plugin_header(sender = None, name="Redstoner Utils"): """ sends the recipient a "Plugin Header", in the format of: diff --git a/lagchunks.py b/lagchunks.py index db45aa3..163d22f 100644 --- a/lagchunks.py +++ b/lagchunks.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 import org.bukkit as bukkit from helpers import * @@ -21,7 +21,7 @@ def scan_chunks(amount): ents = chunk.getEntities() # [0]world [1]X [2]Y [3]Z [4]amount chunks.append([chunk.getWorld(), int(ents[-1].getLocation().getX()), int(ents[0].getLocation().getY()), int(ents[0].getLocation().getZ()), len(ents)]) - chunks.sort(key=lambda entry: entry[4], reverse=True) + chunks.sort(key = lambda entry: entry[4], reverse = True) lagchunks = chunks except Exception, e: error(e) diff --git a/misc.py b/misc.py index ac64ea0..3448acb 100644 --- a/misc.py +++ b/misc.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 from helpers import * from time import time as now import thread @@ -100,7 +100,7 @@ def on_player_entity_interact(event): def on_pluginversions_command(sender, args): plugin_header(sender, "Plugin versions") plugins = list(server.getPluginManager().getPlugins()) - plugins.sort(key=lambda pl: pl.getDescription().getName()) + plugins.sort(key = lambda pl: pl.getDescription().getName()) msg(sender, "&3Listing all " + str(len(plugins)) + " plugins and their version:") for plugin in plugins: msg(sender, "&6" + plugin.getDescription().getName() + "&r: &e" + plugin.getDescription().getVersion()) diff --git a/motd.py b/motd.py index f41e4d8..c238b20 100644 --- a/motd.py +++ b/motd.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 from helpers import * motd = server.getMotd() @@ -7,7 +7,7 @@ motd = server.getMotd() @hook.command("getmotd") def on_getmotd_command(sender, args): plugin_header(sender, "MOTD") - msg(sender, motd, usecolor=False) + msg(sender, motd, usecolor = False) @hook.command("setmotd") diff --git a/mysqlhack.py b/mysqlhack.py index 9b8a7ba..64821a1 100644 --- a/mysqlhack.py +++ b/mysqlhack.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 import java.lang.reflect.Method import java.io.File import java.net.URL diff --git a/skullclick.py b/skullclick.py index 4bdf24c..09fe13f 100644 --- a/skullclick.py +++ b/skullclick.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 import org.bukkit as bukkit from helpers import msg diff --git a/tilehelper.py b/tilehelper.py index 6ce88b0..0258131 100644 --- a/tilehelper.py +++ b/tilehelper.py @@ -1,4 +1,4 @@ -#pylint: disable=F0401 +#pylint: disable = F0401 import org.bukkit.event.block.BlockPlaceEvent as BlockPlaceEvent import org.bukkit.event.block.BlockBreakEvent as BlockBreakEvent import org.bukkit.event.player.PlayerInteractEvent as PlayerInteractEvent diff --git a/webtoken.py b/webtoken.py index 33cf58e..d01ba75 100644 --- a/webtoken.py +++ b/webtoken.py @@ -1,5 +1,5 @@ -#pylint: disable=F0401 -import mysqlhack #pylint: disable=unused-import +#pylint: disable = F0401 +import mysqlhack #pylint: disable = unused-import import thread from re import match from com.ziclix.python.sql import zxJDBC @@ -17,7 +17,7 @@ from random import randrange # string "email", null: false -def mysql_query(query, args, fetch=True): +def mysql_query(query, args, fetch = True): conn = zxJDBC.connect(mysql_database, mysql_user, mysql_pass, "com.mysql.jdbc.Driver") curs = conn.cursor() curs.execute(query, args)