forked from Upstream/mmocore
!Moved some classes
This commit is contained in:
parent
b4ea446430
commit
fb86db6437
@ -1,4 +1,4 @@
|
||||
package net.Indyuce.mmocore.api.player;
|
||||
package net.Indyuce.mmocore.api.experience;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -18,19 +18,19 @@ import com.google.gson.JsonObject;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.ConfigMessage;
|
||||
import net.Indyuce.mmocore.api.event.PlayerLevelUpEvent;
|
||||
import net.Indyuce.mmocore.api.experience.Profession;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.util.math.particle.SmallParticleEffect;
|
||||
|
||||
public class Professions {
|
||||
public class PlayerProfessions {
|
||||
private final Map<String, Integer> exp = new HashMap<>();
|
||||
private final Map<String, Integer> level = new HashMap<>();
|
||||
private final PlayerData playerData;
|
||||
|
||||
public Professions(PlayerData playerData) {
|
||||
public PlayerProfessions(PlayerData playerData) {
|
||||
this.playerData = playerData;
|
||||
}
|
||||
|
||||
public Professions load(ConfigurationSection config) {
|
||||
public PlayerProfessions load(ConfigurationSection config) {
|
||||
for (String key : config.getKeys(false))
|
||||
if (MMOCore.plugin.professionManager.has(key)) {
|
||||
exp.put(key, config.getInt(key + ".exp"));
|
@ -47,7 +47,7 @@ public class Profession {
|
||||
try {
|
||||
MMOCore.plugin.professionManager.registerExpSource(MMOCore.plugin.loadManager.loadExperienceSource(new MMOLineConfig(key), this));
|
||||
} catch (MMOLoadException exception) {
|
||||
exception.printConsole("Professions", "exp source");
|
||||
exception.printConsole("PlayerProfessions", "exp source");
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ public class Profession {
|
||||
PotionType type = PotionType.valueOf(key.toUpperCase().replace("-", "_").replace(" ", "_"));
|
||||
MMOCore.plugin.alchemyManager.registerBaseExperience(type, config.getDouble("alchemy-experience.effects." + key));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOCore.log(Level.WARNING, "[Professions:" + id + "] Could not read potion type from " + key);
|
||||
MMOCore.log(Level.WARNING, "[PlayerProfessions:" + id + "] Could not read potion type from " + key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public class Profession {
|
||||
Enchantment enchant = MMOLib.plugin.getVersion().getWrapper().getEnchantmentFromString(key.toLowerCase().replace("-", "_"));
|
||||
MMOCore.plugin.enchantManager.registerBaseExperience(enchant, config.getDouble("base-enchant-exp." + key));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOCore.log(Level.WARNING, "[Professions:" + id + "] Could not read enchant from " + key);
|
||||
MMOCore.log(Level.WARNING, "[PlayerProfessions:" + id + "] Could not read enchant from " + key);
|
||||
}
|
||||
|
||||
if (config.contains("repair-exp"))
|
||||
@ -93,7 +93,7 @@ public class Profession {
|
||||
Material material = Material.valueOf(key.toUpperCase().replace("-", "_").replace(" ", "_"));
|
||||
MMOCore.plugin.smithingManager.registerBaseExperience(material, config.getDouble("repair-exp." + key));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOCore.log(Level.WARNING, "[Professions:" + id + "] Could not read material from " + key);
|
||||
MMOCore.log(Level.WARNING, "[PlayerProfessions:" + id + "] Could not read material from " + key);
|
||||
}
|
||||
|
||||
// if (config.contains("effect-weight"))
|
||||
@ -103,7 +103,7 @@ public class Profession {
|
||||
// MMOCore.plugin.alchemyManager.registerEffectWeight(PotionEffectType.getByName(key.toUpperCase().replace("-",
|
||||
// "_").replace(" ", "_")), config.getDouble("effect-weight." + key));
|
||||
// } catch (IllegalArgumentException exception) {
|
||||
// MMOCore.log(Level.WARNING, "[Professions:" + id + "] Could not read
|
||||
// MMOCore.log(Level.WARNING, "[PlayerProfessions:" + id + "] Could not read
|
||||
// potion effect type from " + key);
|
||||
// }
|
||||
|
||||
|
@ -29,6 +29,7 @@ import net.Indyuce.mmocore.api.event.PlayerCastSkillEvent;
|
||||
import net.Indyuce.mmocore.api.event.PlayerExperienceGainEvent;
|
||||
import net.Indyuce.mmocore.api.event.PlayerLevelUpEvent;
|
||||
import net.Indyuce.mmocore.api.event.PlayerRegenResourceEvent;
|
||||
import net.Indyuce.mmocore.api.experience.PlayerProfessions;
|
||||
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
|
||||
import net.Indyuce.mmocore.api.player.attribute.PlayerAttributes;
|
||||
import net.Indyuce.mmocore.api.player.profess.PlayerClass;
|
||||
@ -40,6 +41,8 @@ import net.Indyuce.mmocore.api.player.social.Party;
|
||||
import net.Indyuce.mmocore.api.player.social.guilds.Guild;
|
||||
import net.Indyuce.mmocore.api.player.stats.PlayerStats;
|
||||
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
||||
import net.Indyuce.mmocore.api.skill.PlayerSkillData;
|
||||
import net.Indyuce.mmocore.api.skill.Skill;
|
||||
import net.Indyuce.mmocore.api.skill.Skill.SkillInfo;
|
||||
import net.Indyuce.mmocore.api.skill.SkillResult;
|
||||
@ -77,7 +80,7 @@ public class PlayerData extends OfflinePlayerData {
|
||||
private final Set<String> waypoints = new HashSet<>();
|
||||
private final Map<String, Integer> skills = new HashMap<>();
|
||||
private final List<SkillInfo> boundSkills = new ArrayList<>();
|
||||
private final Professions collectSkills = new Professions(this);
|
||||
private final PlayerProfessions collectSkills = new PlayerProfessions(this);
|
||||
private final PlayerSkillData skillData = new PlayerSkillData(this);
|
||||
private final PlayerAttributes attributes = new PlayerAttributes(this);
|
||||
private final Map<String, SavedClassInformation> classSlots = new HashMap<>();
|
||||
@ -146,7 +149,7 @@ public class PlayerData extends OfflinePlayerData {
|
||||
return friends;
|
||||
}
|
||||
|
||||
public Professions getCollectionSkills() {
|
||||
public PlayerProfessions getCollectionSkills() {
|
||||
return collectSkills;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package net.Indyuce.mmocore.api.player;
|
||||
package net.Indyuce.mmocore.api.quest;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@ -19,8 +19,7 @@ import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.quest.Quest;
|
||||
import net.Indyuce.mmocore.api.quest.QuestProgress;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.mmogroup.mmolib.MMOLib;
|
||||
|
||||
public class PlayerQuests {
|
@ -1,12 +1,11 @@
|
||||
package net.Indyuce.mmocore.api.player;
|
||||
package net.Indyuce.mmocore.api.skill;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import net.Indyuce.mmocore.api.skill.Skill;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.skill.Skill.SkillInfo;
|
||||
import net.Indyuce.mmocore.api.skill.SkillResult;
|
||||
import net.Indyuce.mmocore.comp.mythicmobs.MythicMobSkill;
|
||||
|
||||
public class PlayerSkillData {
|
@ -9,8 +9,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.experience.Profession;
|
||||
import net.Indyuce.mmocore.api.experience.PlayerProfessions;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.player.Professions;
|
||||
import net.Indyuce.mmocore.command.api.CommandEnd;
|
||||
import net.Indyuce.mmocore.command.api.CommandMap;
|
||||
import net.Indyuce.mmocore.command.api.Parameter;
|
||||
@ -25,9 +25,9 @@ public class ExperienceCommandMap extends CommandMap {
|
||||
|
||||
public class ActionCommandMap extends CommandEnd {
|
||||
private final BiConsumer<PlayerData, Integer> main;
|
||||
private final TriConsumer<Professions, Profession, Integer> profession;
|
||||
private final TriConsumer<PlayerProfessions, Profession, Integer> profession;
|
||||
|
||||
public ActionCommandMap(CommandMap parent, String type, BiConsumer<PlayerData, Integer> main, TriConsumer<Professions, Profession, Integer> profession) {
|
||||
public ActionCommandMap(CommandMap parent, String type, BiConsumer<PlayerData, Integer> main, TriConsumer<PlayerProfessions, Profession, Integer> profession) {
|
||||
super(parent, type);
|
||||
|
||||
this.main = main;
|
||||
|
@ -9,8 +9,8 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.experience.Profession;
|
||||
import net.Indyuce.mmocore.api.experience.PlayerProfessions;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.player.Professions;
|
||||
import net.Indyuce.mmocore.command.api.CommandEnd;
|
||||
import net.Indyuce.mmocore.command.api.CommandMap;
|
||||
import net.Indyuce.mmocore.command.api.Parameter;
|
||||
@ -25,9 +25,9 @@ public class LevelCommandMap extends CommandMap {
|
||||
|
||||
public class ActionCommandMap extends CommandEnd {
|
||||
private final BiConsumer<PlayerData, Integer> main;
|
||||
private final TriConsumer<Professions, Profession, Integer> profession;
|
||||
private final TriConsumer<PlayerProfessions, Profession, Integer> profession;
|
||||
|
||||
public ActionCommandMap(CommandMap parent, String type, BiConsumer<PlayerData, Integer> main, TriConsumer<Professions, Profession, Integer> profession) {
|
||||
public ActionCommandMap(CommandMap parent, String type, BiConsumer<PlayerData, Integer> main, TriConsumer<PlayerProfessions, Profession, Integer> profession) {
|
||||
super(parent, type);
|
||||
|
||||
this.main = main;
|
||||
|
@ -6,7 +6,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.player.PlayerQuests;
|
||||
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
||||
import net.Indyuce.mmocore.command.api.CommandEnd;
|
||||
import net.Indyuce.mmocore.command.api.CommandMap;
|
||||
import net.Indyuce.mmocore.command.api.Parameter;
|
||||
|
@ -7,7 +7,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.player.PlayerQuests;
|
||||
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
||||
import net.Indyuce.mmocore.api.quest.Quest;
|
||||
import net.Indyuce.mmocore.command.api.CommandEnd;
|
||||
import net.Indyuce.mmocore.command.api.CommandMap;
|
||||
|
@ -9,10 +9,10 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.AltChar;
|
||||
import net.Indyuce.mmocore.api.experience.Profession;
|
||||
import net.Indyuce.mmocore.api.experience.PlayerProfessions;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.player.PlayerQuests;
|
||||
import net.Indyuce.mmocore.api.player.Professions;
|
||||
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
||||
|
||||
public class RPGPlaceholders
|
||||
extends PlaceholderExpansion /** implements Relational */
|
||||
@ -55,7 +55,7 @@ public class RPGPlaceholders
|
||||
return PlayerData.get(player).getProfess().getName();
|
||||
|
||||
else if (identifier.startsWith("profession_percent_")) {
|
||||
Professions professions = PlayerData.get(player).getCollectionSkills();
|
||||
PlayerProfessions professions = PlayerData.get(player).getCollectionSkills();
|
||||
String name = identifier.substring(19).replace(" ", "-").replace("_", "-").toLowerCase();
|
||||
Profession profession = MMOCore.plugin.professionManager.get(name);
|
||||
double current = professions.getExperience(profession),
|
||||
|
Loading…
Reference in New Issue
Block a user