Add magic plugin, more decoders and commands.

This commit is contained in:
Major-
2013-11-03 23:48:17 +00:00
parent ac4c8408a3
commit 82b12e30a2
58 changed files with 1730 additions and 96 deletions
+8 -6
View File
@@ -1,27 +1,29 @@
require 'java'
on :command, :item, RIGHTS_ADMIN do |player, command|
args = command.arguments
if (1..2).include? args.length
id = args[0].to_i
amount = args.length == 2 ? args[1].to_i : 1
player.inventory.add id, amount
player.inventory.add(id, amount)
else
player.send_message "Syntax: ::item [id] [amount=1]"
end
end
on :command, :destroy, RIGHTS_ADMIN do |player, command|
on :command, :remove, RIGHTS_ADMIN do |player, command|
args = command.arguments
if (1..2).include? args.length
id = args[0].to_i
amount = args.length == 2 ? args[1].to_i : 1
player.inventory.remove id, amount
player.inventory.remove(id, amount)
else
player.send_message "Syntax: ::destroy [id] [amount=1]"
player.send_message "Syntax: ::remove [id] [amount=1]"
end
end
on :command, :empty, RIGHTS_ADMIN do |player, command|
on :command, :empty, RIGHTS_MOD do |player, command|
player.inventory.clear
end
end
+2 -2
View File
@@ -3,7 +3,7 @@
<id>cmd-item</id>
<version>1</version>
<name>Item Commands</name>
<description>Adds ::item, ::destroy and ::empty commands.</description>
<description>Adds ::item, ::remove and ::empty commands.</description>
<authors>
<author>Graham</author>
</authors>
@@ -11,4 +11,4 @@
<script>item.rb</script>
</scripts>
<dependencies />
</plugin>
</plugin>