mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-03 04:21:37 +00:00
Potion erroring and duration/power fix
This commit is contained in:
parent
5e4659e6ae
commit
ce51a07bf1
15 changed files with 31 additions and 14 deletions
|
@ -362,7 +362,7 @@ public class MetaItemStack
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("invalidPotionEffect", split[1]));
|
||||
throw new Exception(_("invalidPotionMeta", split[1]));
|
||||
}
|
||||
}
|
||||
else if (split[0].equalsIgnoreCase("power") || (allowShortName && split[0].equalsIgnoreCase("p")))
|
||||
|
@ -371,6 +371,14 @@ public class MetaItemStack
|
|||
{
|
||||
validPotionPower = true;
|
||||
power = Integer.parseInt(split[1]);
|
||||
if (power > 0 && power < 4)
|
||||
{
|
||||
power -= 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("invalidPotionMeta", split[1]));
|
||||
}
|
||||
}
|
||||
else if (split[0].equalsIgnoreCase("duration") || (allowShortName && split[0].equalsIgnoreCase("d")))
|
||||
|
@ -380,6 +388,10 @@ public class MetaItemStack
|
|||
validPotionDuration = true;
|
||||
duration = Integer.parseInt(split[1]) * 20; //Duration is in ticks by default, converted to seconds
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception(_("invalidPotionMeta", split[1]));
|
||||
}
|
||||
}
|
||||
|
||||
if (isValidPotion())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue