turn plotter.py into actual plugin, not cli tool

This commit is contained in:
jomo
2015-08-12 22:00:03 +02:00
parent c521b8fa86
commit 5a80c74b9a

View File

@@ -5,7 +5,8 @@
on hold because the PlotMe developer continued to develop PlotMe on hold because the PlotMe developer continued to develop PlotMe
""" """
import sys from helpers import *
from basecommands import simplecommand
x_plot_size = 3 x_plot_size = 3
z_plot_size = 3 z_plot_size = 3
@@ -23,8 +24,16 @@ def plot_id(x, z):
return [x // (x_plot_size + padding), z // (z_plot_size + padding)] return [x // (x_plot_size + padding), z // (z_plot_size + padding)]
x = int(sys.argv[1]) @simplecommand("plotter",
z = int(sys.argv[2]) aliases = ["pt"],
print "id: %s" % plot_id(x, z) senderLimit = 0,
print "base: %s" % base_coords(x, z) helpSubcmd = True,
print "bounds: %s" % bounds(x, z) description = "Plot commands",
usage = "")
def plotter_command(sender, command, label, args):
loc = sender.getLocation()
x = loc.getX()
z = loc.getZ()
msg(sender, "id: %s" % plot_id(x, z))
msg(sender, "base: %s" % base_coords(x, z))
msg(sender, "bounds: %s" % bounds(x, z))