2.1.0 is probably playable now, but not unfinished

This commit is contained in:
nossr50
2019-01-15 02:43:44 -08:00
parent 0acde4a8af
commit 4a30fcc2de
22 changed files with 489 additions and 396 deletions

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.commands.skills;
import com.gmail.nossr50.datatypes.json.McMMOUrl;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils;
public enum McMMOWebLinks {
@ -20,4 +21,25 @@ public enum McMMOWebLinks {
{
return StringUtils.getCapitalized(toString());
}
public String getLocaleDescription()
{
switch (this)
{
case WEBSITE:
return LocaleLoader.getString( "JSON.URL.Website");
case DISCORD:
return LocaleLoader.getString( "JSON.URL.Discord");
case PATREON:
return LocaleLoader.getString( "JSON.URL.Patreon");
case HELP_TRANSLATE:
return LocaleLoader.getString( "JSON.URL.Translation");
case SPIGOT:
return LocaleLoader.getString("JSON.URL.Spigot");
case WIKI:
return LocaleLoader.getString("JSON.URL.Wiki");
default:
return "";
}
}
}

View File

@ -22,6 +22,9 @@ public class MmoInfoCommand implements TabExecutor {
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
/*
* Only allow players to use this command
*/
if(commandSender instanceof Player)
{
if(args.length < 1)
@ -33,8 +36,14 @@ public class MmoInfoCommand implements TabExecutor {
if(args == null || args[0] == null)
return false;
//Real skill
if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0]))
if(args[0].equalsIgnoreCase( "???"))
{
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Header"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.SubSkillHeader", "???"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.DetailsHeader"));
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.Mystery"));
return true;
} else if(InteractionManager.getAbstractByName(args[0]) != null || PrimarySkillType.SUBSKILL_NAMES.contains(args[0]))
{
displayInfo(player, args[0]);
return true;
@ -42,8 +51,10 @@ public class MmoInfoCommand implements TabExecutor {
//Not a real skill
player.sendMessage(LocaleLoader.getString("Commands.MmoInfo.NoMatch"));
return true;
}
}
return false;
}
@ -59,8 +70,6 @@ public class MmoInfoCommand implements TabExecutor {
private void displayInfo(Player player, String subSkillName)
{
System.out.println("[mcMMO] Debug: Grabbing info for skill "+subSkillName);
//Check to see if the skill exists in the new system
AbstractSubSkill abstractSubSkill = InteractionManager.getAbstractByName(subSkillName);
if(abstractSubSkill != null)

View File

@ -174,7 +174,7 @@ public class TamingCommand extends SkillCommand {
protected List<TextComponent> getTextComponents(Player player) {
List<TextComponent> textComponents = new ArrayList<>();
TextComponentFactory.getSubSkillTextComponents(player, textComponents, PrimarySkillType.TAMING);
TextComponentFactory.getSubSkillTextComponents(player, textComponents, this.skill);
return textComponents;
}

View File

@ -6,6 +6,7 @@ import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.TextComponentFactory;
import com.gmail.nossr50.util.skills.RankUtils;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.entity.Player;
@ -40,12 +41,7 @@ public class WoodcuttingCommand extends SkillCommand {
// DOUBLE DROPS
if (canDoubleDrop) {
if(AdvancedConfig.getInstance().isSubSkillClassic(SubSkillType.WOODCUTTING_HARVEST_LUMBER))
setDoubleDropClassicChanceStrings(skillValue, isLucky);
else
{
//TODO: Set up datastrings for new harvest
}
setDoubleDropClassicChanceStrings(skillValue, isLucky);
}
}
@ -58,7 +54,7 @@ public class WoodcuttingCommand extends SkillCommand {
@Override
protected void permissionsCheck(Player player) {
canTreeFell = Permissions.treeFeller(player);
canDoubleDrop = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled();
canDoubleDrop = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) && !skill.getDoubleDropsDisabled() && RankUtils.getRank(player, SubSkillType.WOODCUTTING_HARVEST_LUMBER) >= 1;
canLeafBlow = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_LEAF_BLOWER);
canSplinter = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_SPLINTER);
canBarkSurgeon = Permissions.isSubSkillEnabled(player, SubSkillType.WOODCUTTING_BARK_SURGEON);