+ Fixed AnvilGUI duplication bug (Reported by @Jedlicov)
+ Fixed errors on loading plugin
+ Rewritten Command Api
+ Clean up code
Example of Commands Api
Code (Java):
CommandHolder
<CommandSender
> holder
=
CommandStructure.
create
(CommandSender.
class,
(s, perm, tablist
)
->
{
return s.
hasPermission
(perm
)
;
},
(s, structure, args
)
->
{
if
(s
instanceof Player
)
{
new AnvilGUI
(
"Anvil",
(Player
)s
).
setInsertable
(
true
)
;
}
else s.
sendMessage
(
"/anvil [player]"
)
;
}
).
permission
(
"anvil.command"
)
.
fallback
(
(s, structure, args
)
->
{
s.
sendMessage
(
"Oh-h.. player "
+args
[
0
]
+
" not found!"
)
;
}
)
.
selector
(Selector.
PLAYER,
(s, structure, args
)
->
{
new AnvilGUI
(
"Anvil", Bukkit.
getPlayer
(args
[
0
]
)
).
setInsertable
(
true
)
;
}
).
permission
(
"anvil.command.other"
).
build
(
)
;
holder.
register
(
"anvil"
)
;