mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-01 18:23:00 +00:00
Fix a couple of param issues.
This commit is contained in:
parent
76fd829e8c
commit
9cef107bc3
3 changed files with 12 additions and 3 deletions
|
@ -175,6 +175,11 @@ public class MetaItemStack
|
||||||
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
|
FireworkMeta fmeta = (FireworkMeta)stack.getItemMeta();
|
||||||
final String[] split = splitPattern.split(string, 2);
|
final String[] split = splitPattern.split(string, 2);
|
||||||
|
|
||||||
|
if (split.length < 2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour") || (allowShortName && split[0].equalsIgnoreCase("c")))
|
if (split[0].equalsIgnoreCase("color") || split[0].equalsIgnoreCase("colour") || (allowShortName && split[0].equalsIgnoreCase("c")))
|
||||||
{
|
{
|
||||||
List<Color> primaryColors = new ArrayList<Color>();
|
List<Color> primaryColors = new ArrayList<Color>();
|
||||||
|
|
|
@ -69,7 +69,10 @@ public class Commandbook extends EssentialsCommand
|
||||||
else if (item.getType() == Material.BOOK_AND_QUILL)
|
else if (item.getType() == Material.BOOK_AND_QUILL)
|
||||||
{
|
{
|
||||||
BookMeta bmeta = (BookMeta)item.getItemMeta();
|
BookMeta bmeta = (BookMeta)item.getItemMeta();
|
||||||
bmeta.setAuthor(player);
|
if (!user.isAuthorized("essentals.book.author"))
|
||||||
|
{
|
||||||
|
bmeta.setAuthor(player);
|
||||||
|
}
|
||||||
ItemStack newItem = new ItemStack(Material.WRITTEN_BOOK, item.getAmount());
|
ItemStack newItem = new ItemStack(Material.WRITTEN_BOOK, item.getAmount());
|
||||||
newItem.setItemMeta(bmeta);
|
newItem.setItemMeta(bmeta);
|
||||||
user.setItemInHand(newItem);
|
user.setItemInHand(newItem);
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class Commandfirework extends EssentialsCommand
|
||||||
{
|
{
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
{
|
{
|
||||||
final ItemStack stack = user.getItemInHand();
|
final ItemStack stack = user.getItemInHand();
|
||||||
if (stack.getType() == Material.FIREWORK)
|
if (stack.getType() == Material.FIREWORK)
|
||||||
{
|
{
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
|
@ -65,7 +65,8 @@ public class Commandfirework extends EssentialsCommand
|
||||||
{
|
{
|
||||||
final String[] split = splitPattern.split(arg, 2);
|
final String[] split = splitPattern.split(arg, 2);
|
||||||
mStack.addFireworkMeta(user, true, arg, ess);
|
mStack.addFireworkMeta(user, true, arg, ess);
|
||||||
if (split[0].equalsIgnoreCase("fire") && user.isAuthorized("essentials.firework.fire"))
|
|
||||||
|
if (split.length > 1 && split[0].equalsIgnoreCase("fire") && user.isAuthorized("essentials.firework.fire"))
|
||||||
{
|
{
|
||||||
fire = true;
|
fire = true;
|
||||||
try
|
try
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue