mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-24 22:26:46 +01:00
Missed a few merges
This commit is contained in:
parent
4b6e2c35b2
commit
3eb160a794
@ -7,7 +7,6 @@ import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
|
@ -19,6 +19,7 @@ import org.bukkit.entity.Player;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class SkillCommand implements TabExecutor {
|
||||
@ -131,7 +132,7 @@ public abstract class SkillCommand implements TabExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
player.sendMessage(pluginRef.getLocaleManager().getString("Guides.Available", skillName, skillName.toLowerCase()));
|
||||
player.sendMessage(pluginRef.getLocaleManager().getString("Guides.Available", skillName, skillName.toLowerCase(Locale.ENGLISH)));
|
||||
}
|
||||
|
||||
private void sendSkillCommandHeader(Player player, McMMOPlayer mcMMOPlayer, int skillValue) {
|
||||
|
@ -4,11 +4,13 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class SkillConfigFactory {
|
||||
|
||||
protected static SerializedConfigLoader initSkillConfig(mcMMO pluginRef, PrimarySkillType primarySkillType, Class<?> clazz) {
|
||||
return new SerializedConfigLoader(pluginRef, clazz,
|
||||
primarySkillType.toString().toLowerCase() + ".conf",
|
||||
primarySkillType.toString().toLowerCase(Locale.ENGLISH) + ".conf",
|
||||
StringUtils.getCapitalized(primarySkillType.toString()),
|
||||
null);
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ public enum SubSkillType {
|
||||
*/
|
||||
public String getPermissionNodeAddress(mcMMO pluginRef) {
|
||||
//TODO: This could be optimized
|
||||
return "mcmmo.ability." + getParentSkill(pluginRef).toString().toLowerCase() + "." + getConfigName(toString()).toLowerCase(Locale.ENGLISH);
|
||||
return "mcmmo.ability." + getParentSkill(pluginRef).toString().toLowerCase(Locale.ENGLISH) + "." + getConfigName(toString()).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -253,7 +253,7 @@
|
||||
// if (target.equals("II")) { // hacks
|
||||
// return target;
|
||||
// }
|
||||
// return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase();
|
||||
// return target.substring(0, 1).toUpperCase() + target.substring(1).toLowerCase(Locale.ENGLISH);
|
||||
// }
|
||||
//
|
||||
// private static String getName(PotionEffectType type) {
|
||||
|
@ -59,16 +59,9 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
|
||||
//Prevent entities from giving XP if they target endermite
|
||||
<<<<<<< HEAD:mcmmo-core/src/main/java/com/gmail/nossr50/listeners/EntityListener.java
|
||||
if (event.getTarget() instanceof Endermite) {
|
||||
if (event.getEntity().hasMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY))
|
||||
if (!event.getEntity().hasMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY))
|
||||
event.getEntity().setMetadata(MetadataConstants.UNNATURAL_MOB_METAKEY, MetadataConstants.metadataValue);
|
||||
=======
|
||||
if(event.getTarget() instanceof Endermite)
|
||||
{
|
||||
if(!event.getEntity().hasMetadata(mcMMO.entityMetadataKey))
|
||||
event.getEntity().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
>>>>>>> 550a3df6169b457fdea552b58861bb42c53420c2:src/main/java/com/gmail/nossr50/listeners/EntityListener.java
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,29 +794,6 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
|
||||
/**
|
||||
<<<<<<< HEAD:mcmmo-core/src/main/java/com/gmail/nossr50/listeners/EntityListener.java
|
||||
* Handle EntityExplode events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
public void onEntityExplodeMonitor(EntityExplodeEvent event) {
|
||||
/* WORLD BLACKLIST CHECK */
|
||||
if (pluginRef.getDynamicSettingsManager().isWorldBlacklisted(event.getEntity().getWorld().getName()))
|
||||
return;
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof TNTPrimed) || !entity.hasMetadata(MetadataConstants.SAFE_TNT_METAKEY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.blockList().clear();
|
||||
}
|
||||
|
||||
/**
|
||||
=======
|
||||
>>>>>>> 550a3df6169b457fdea552b58861bb42c53420c2:src/main/java/com/gmail/nossr50/listeners/EntityListener.java
|
||||
* Handle FoodLevelChange events that involve modifying the event.
|
||||
*
|
||||
* @param event The event to modify
|
||||
|
@ -65,6 +65,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class mcMMO extends JavaPlugin {
|
||||
/* Managers */
|
||||
@ -378,9 +379,9 @@ public class mcMMO extends JavaPlugin {
|
||||
* @return the ServerSoftwareType which likely matches the server
|
||||
*/
|
||||
private ServerSoftwareType getServerSoftware() {
|
||||
if (Bukkit.getVersion().toLowerCase().contains("paper"))
|
||||
if (Bukkit.getVersion().toLowerCase(Locale.ENGLISH).contains("paper"))
|
||||
return ServerSoftwareType.PAPER;
|
||||
else if (Bukkit.getVersion().toLowerCase().contains("spigot"))
|
||||
else if (Bukkit.getVersion().toLowerCase(Locale.ENGLISH).contains("spigot"))
|
||||
return ServerSoftwareType.SPIGOT;
|
||||
else
|
||||
return ServerSoftwareType.CRAFTBUKKIT;
|
||||
|
@ -2,7 +2,6 @@ package com.gmail.nossr50.runnables;
|
||||
|
||||
import com.gmail.nossr50.core.MetadataConstants;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
|
@ -18,6 +18,8 @@ import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.SimplePluginManager;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public final class PermissionTools {
|
||||
private final mcMMO pluginRef;
|
||||
|
||||
@ -175,7 +177,7 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean mctop(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.commands.mctop." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean mmoedit(Permissible permissible) {
|
||||
@ -195,7 +197,7 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean skillreset(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.commands.skillreset." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean skillresetOthers(Permissible permissible) {
|
||||
@ -203,11 +205,11 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean skillresetOthers(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.commands.skillreset.others." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean xplock(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.commands.xplock." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean xprateSet(Permissible permissible) {
|
||||
@ -257,32 +259,32 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean lucky(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.lucky." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
/* XP PERKS */
|
||||
public boolean quadrupleXp(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.xp.quadruple." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean tripleXp(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.xp.triple." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean doubleAndOneHalfXp(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.xp.150percentboost." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean doubleXp(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean hasCustomXPPerk(Permissible permissible, CustomXPPerk customXPPerk) {
|
||||
@ -320,11 +322,11 @@ public final class PermissionTools {
|
||||
*/
|
||||
|
||||
public boolean skillEnabled(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.skills." + skill.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean vanillaXpBoost(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".vanillaxpboost");
|
||||
return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".vanillaxpboost");
|
||||
}
|
||||
|
||||
public boolean isSubSkillEnabled(Permissible permissible, SubSkillType subSkillType) {
|
||||
@ -336,7 +338,7 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean bonusDamage(Permissible permissible, PrimarySkillType skill) {
|
||||
return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase() + ".bonusdamage");
|
||||
return permissible.hasPermission("mcmmo.ability." + skill.toString().toLowerCase(Locale.ENGLISH) + ".bonusdamage");
|
||||
}
|
||||
|
||||
/* ACROBATICS */
|
||||
@ -386,11 +388,11 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean greenThumbBlock(Permissible permissible, Material material) {
|
||||
return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.blocks." + material.toString().replace("_", "").toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean greenThumbPlant(Permissible permissible, Material material) {
|
||||
return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.ability.herbalism.greenthumb.plants." + material.toString().replace("_", "").toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
/* MINING */
|
||||
@ -412,11 +414,11 @@ public final class PermissionTools {
|
||||
|
||||
/* REPAIR */
|
||||
public boolean repairItemType(Permissible permissible, ItemType repairItemType) {
|
||||
return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase() + "repair");
|
||||
return permissible.hasPermission("mcmmo.ability.repair." + repairItemType.toString().toLowerCase(Locale.ENGLISH) + "repair");
|
||||
}
|
||||
|
||||
public boolean repairMaterialType(Permissible permissible, ItemMaterialCategory repairItemMaterialCategory) {
|
||||
return permissible.hasPermission("mcmmo.ability.repair." + repairItemMaterialCategory.toString().toLowerCase() + "repair");
|
||||
return permissible.hasPermission("mcmmo.ability.repair." + repairItemMaterialCategory.toString().toLowerCase(Locale.ENGLISH) + "repair");
|
||||
}
|
||||
|
||||
/* SALVAGE */
|
||||
@ -429,11 +431,11 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean salvageItemType(Permissible permissible, ItemType salvageItemType) {
|
||||
return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase() + "salvage");
|
||||
return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemType.toString().toLowerCase(Locale.ENGLISH) + "salvage");
|
||||
}
|
||||
|
||||
public boolean salvageMaterialType(Permissible permissible, ItemMaterialCategory salvageItemMaterialCategory) {
|
||||
return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemMaterialCategory.toString().toLowerCase() + "salvage");
|
||||
return permissible.hasPermission("mcmmo.ability.salvage." + salvageItemMaterialCategory.toString().toLowerCase(Locale.ENGLISH) + "salvage");
|
||||
}
|
||||
|
||||
/* SMELTING */
|
||||
@ -452,7 +454,7 @@ public final class PermissionTools {
|
||||
|
||||
/* TAMING */
|
||||
public boolean callOfTheWild(Permissible permissible, EntityType type) {
|
||||
return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.ability.taming.callofthewild." + type.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
/* UNARMED */
|
||||
@ -477,7 +479,7 @@ public final class PermissionTools {
|
||||
}
|
||||
|
||||
public boolean partySubcommand(Permissible permissible, PartySubcommandType subcommand) {
|
||||
return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase());
|
||||
return permissible.hasPermission("mcmmo.commands.party." + subcommand.toString().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public boolean friendlyFire(Permissible permissible) {
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* This class handles many of the JSON components that mcMMO makes and uses
|
||||
@ -537,7 +538,7 @@ public class TextComponentFactory {
|
||||
TextComponent unlockMessage = new TextComponent("");
|
||||
unlockMessage.setText(pluginRef.getLocaleManager().getString("JSON.SkillUnlockMessage", subSkillType.getLocaleName(pluginRef), pluginRef.getRankTools().getRank(player, subSkillType)));
|
||||
unlockMessage.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, getSubSkillHoverComponent(player, subSkillType)));
|
||||
unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + pluginRef.getSkillTools().getPrimarySkillBySubSkill(subSkillType).toString().toLowerCase()));
|
||||
unlockMessage.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + pluginRef.getSkillTools().getPrimarySkillBySubSkill(subSkillType).toString().toLowerCase(Locale.ENGLISH)));
|
||||
return unlockMessage;
|
||||
}
|
||||
}
|
@ -25,6 +25,7 @@ import org.bukkit.command.PluginCommand;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class CommandRegistrationManager {
|
||||
private final mcMMO pluginRef;
|
||||
@ -37,8 +38,8 @@ public final class CommandRegistrationManager {
|
||||
|
||||
private void registerSkillCommands() {
|
||||
for (PrimarySkillType primarySkillType : PrimarySkillType.values()) {
|
||||
String commandName = primarySkillType.toString().toLowerCase();
|
||||
String localizedName = pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType).toLowerCase();
|
||||
String commandName = primarySkillType.toString().toLowerCase(Locale.ENGLISH);
|
||||
String localizedName = pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType).toLowerCase(Locale.ENGLISH);
|
||||
|
||||
PluginCommand command;
|
||||
|
||||
|
@ -12,6 +12,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class CommandTools {
|
||||
private final mcMMO pluginRef;
|
||||
@ -288,7 +289,7 @@ public final class CommandTools {
|
||||
break;
|
||||
}
|
||||
|
||||
if (playerName.toLowerCase().contains(partialName.toLowerCase())) {
|
||||
if (playerName.toLowerCase(Locale.ENGLISH).contains(partialName.toLowerCase(Locale.ENGLISH))) {
|
||||
// Partial match
|
||||
matchedPlayers.add(playerName);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user