mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-28 08:06:46 +01:00
More API migration
This commit is contained in:
parent
4199ea0095
commit
7e756c4438
@ -2,7 +2,7 @@ package com.gmail.nossr50.api;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
@ -6,7 +6,7 @@ import com.gmail.nossr50.chat.mailer.AdminChatMailer;
|
||||
import com.gmail.nossr50.chat.mailer.PartyChatMailer;
|
||||
import com.gmail.nossr50.config.ChatConfig;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package com.gmail.nossr50.chat;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -4,7 +4,7 @@ import com.gmail.nossr50.chat.author.Author;
|
||||
import com.gmail.nossr50.chat.message.ChatMessage;
|
||||
import com.gmail.nossr50.chat.message.PartyChatMessage;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.events.chat.McMMOChatEvent;
|
||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
@ -2,7 +2,7 @@ package com.gmail.nossr50.chat.message;
|
||||
|
||||
import com.gmail.nossr50.chat.author.Author;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
@ -7,7 +7,7 @@ import co.aikar.commands.annotation.Conditions;
|
||||
import co.aikar.commands.annotation.Default;
|
||||
import com.gmail.nossr50.commands.CommandManager;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.party.PartyManager;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.util.commands.CommandUtils;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.command.Command;
|
||||
|
@ -2,7 +2,7 @@ package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.commands.chat.PartyChatCommand;
|
||||
import com.gmail.nossr50.commands.party.teleport.PtpCommand;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyMember;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyMember;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyMember;
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
|
@ -2,7 +2,7 @@ package com.gmail.nossr50.commands.party.teleport;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
|
@ -6,6 +6,7 @@ import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.util.text.StringUtils;
|
||||
import com.neetgames.mcmmo.MobHealthBarType;
|
||||
import com.neetgames.mcmmo.skill.RootSkill;
|
||||
import com.neetgames.mcmmo.skill.SkillIdentity;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
@ -551,9 +552,15 @@ public class Config extends AutoUpdateConfigLoader {
|
||||
return (cap <= 0) ? Integer.MAX_VALUE : cap;
|
||||
}
|
||||
|
||||
public int getLevelCap(@NotNull SkillIdentity skillIdentity) {
|
||||
public int getLevelCap(@NotNull RootSkill rootSkill) {
|
||||
|
||||
int cap = config.getInt("Skills." + StringUtils.getCapitalized(skillIdentity.getSkillName()) + ".Level_Cap", 0);
|
||||
int cap = config.getInt("Skills." + StringUtils.getCapitalized(rootSkill.getSkillName()) + ".Level_Cap", 0);
|
||||
return (cap <= 0) ? Integer.MAX_VALUE : cap;
|
||||
}
|
||||
|
||||
public int getLevelCap(@NotNull PrimarySkillType primarySkillType) {
|
||||
|
||||
int cap = config.getInt("Skills." + StringUtils.getCapitalized(primarySkillType.toString()) + ".Level_Cap", 0);
|
||||
return (cap <= 0) ? Integer.MAX_VALUE : cap;
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,7 @@ package com.gmail.nossr50.datatypes.experience;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.neetgames.mcmmo.experience.ExperienceHandler;
|
||||
@ -11,9 +10,7 @@ import com.neetgames.mcmmo.experience.XPGainReason;
|
||||
import com.neetgames.mcmmo.experience.XPGainSource;
|
||||
import com.neetgames.mcmmo.player.MMOPlayer;
|
||||
import com.neetgames.mcmmo.player.MMOPlayerData;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.CoreSkills;
|
||||
import com.gmail.nossr50.datatypes.skills.RootSkill;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.party.ShareHandler;
|
||||
import com.gmail.nossr50.skills.child.FamilyTree;
|
||||
@ -27,7 +24,6 @@ import com.neetgames.mcmmo.exceptions.UnknownSkillException;
|
||||
import com.neetgames.mcmmo.skill.RootSkill;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
@ -322,7 +318,7 @@ public class OnlineExperienceProcessor implements ExperienceHandler {
|
||||
if(hasReachedPowerLevelCap()) {
|
||||
NotificationManager.sendPlayerInformationChatOnly(Misc.adaptPlayer(mmoPlayer), "LevelCap.PowerLevel", String.valueOf(Config.getInstance().getPowerLevelCap()));
|
||||
} else if(hasReachedLevelCap(rootSkill)) {
|
||||
NotificationManager.sendPlayerInformationChatOnly(Misc.adaptPlayer(mmoPlayer), "LevelCap.Skill", String.valueOf(Config.getInstance().getLevelCap(rootSkill)), rootSkill.getName());
|
||||
NotificationManager.sendPlayerInformationChatOnly(Misc.adaptPlayer(mmoPlayer), "LevelCap.Skill", String.valueOf(Config.getInstance().getLevelCap(rootSkill)), rootSkill.getSkillName());
|
||||
}
|
||||
|
||||
//Updates from Party sources
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.datatypes.party;
|
||||
|
||||
import com.gmail.nossr50.chat.SamePartyPredicate;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -11,13 +12,13 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class Party {
|
||||
public class PartyImpl implements Party {
|
||||
private final @NotNull Predicate<CommandSender> samePartyPredicate;
|
||||
private final @NotNull PersistentPartyData persistentPartyData;
|
||||
private final @NotNull PartyMemberManager partyMemberManager;
|
||||
private final @NotNull PartyExperienceManager partyExperienceManager;
|
||||
|
||||
public Party(@NotNull PersistentPartyData persistentPartyData) {
|
||||
public PartyImpl(@NotNull PersistentPartyData persistentPartyData) {
|
||||
this.persistentPartyData = persistentPartyData;
|
||||
|
||||
//Initialize Managers
|
||||
@ -59,7 +60,7 @@ public class Party {
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Party party = (Party) o;
|
||||
PartyImpl party = (PartyImpl) o;
|
||||
return samePartyPredicate.equals(party.samePartyPredicate)
|
||||
&& persistentPartyData.equals(party.persistentPartyData)
|
||||
&& partyMemberManager.equals(party.partyMemberManager)
|
@ -1,10 +1,9 @@
|
||||
package com.gmail.nossr50.datatypes.party;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.dirtydata.DirtySet;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.neetgames.mcmmo.exceptions.InvalidPlayerException;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -29,7 +28,7 @@ public class PartyMemberManager {
|
||||
*
|
||||
* @return all party members
|
||||
*/
|
||||
public @NotNull DirtySet<PartyMember> getPartyMembers() {
|
||||
public @NotNull Set<PartyMember> getPartyMembers() {
|
||||
return persistentPartyData.getPartyMembers();
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
package com.gmail.nossr50.datatypes.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.dirtydata.DirtyData;
|
||||
import com.gmail.nossr50.datatypes.dirtydata.DirtySet;
|
||||
import com.gmail.nossr50.datatypes.mutableprimitives.MutableBoolean;
|
||||
import com.gmail.nossr50.datatypes.mutableprimitives.MutableString;
|
||||
import com.neetgames.neetlib.dirtydata.DirtyData;
|
||||
import com.neetgames.neetlib.dirtydata.DirtySet;
|
||||
import com.neetgames.neetlib.mutableprimitives.MutableBoolean;
|
||||
import com.neetgames.neetlib.mutableprimitives.MutableString;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
@ -17,8 +16,7 @@ public class PersistentPartyData {
|
||||
private final @NotNull DirtyData<MutableString> partyName;
|
||||
private final @NotNull DirtySet<PartyMember> partyMembers; //TODO: Add cache for subsets
|
||||
|
||||
public PersistentPartyData(@NotNull String partyName,
|
||||
@NotNull Set<PartyMember> partyMembers) throws RuntimeException {
|
||||
public PersistentPartyData(@NotNull String partyName, @NotNull Set<PartyMember> partyMembers) throws RuntimeException {
|
||||
dirtyFlag = new MutableBoolean(false);
|
||||
this.partyName = new DirtyData<>(new MutableString(partyName), dirtyFlag);
|
||||
this.partyMembers = new DirtySet<>(new HashSet<>(partyMembers), dirtyFlag);
|
||||
@ -28,7 +26,7 @@ public class PersistentPartyData {
|
||||
return partyName.getData().getImmutableCopy();
|
||||
}
|
||||
|
||||
public @NotNull DirtySet<PartyMember> getPartyMembers() {
|
||||
public @NotNull Set<PartyMember> getPartyMembers() {
|
||||
return partyMembers;
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ import com.gmail.nossr50.chat.author.PlayerAuthor;
|
||||
import com.gmail.nossr50.config.ChatConfig;
|
||||
import com.gmail.nossr50.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyTeleportRecord;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
|
||||
@ -33,17 +33,14 @@ import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.experience.MMOExperienceBarManager;
|
||||
import com.gmail.nossr50.util.input.AbilityActivationProcessor;
|
||||
import com.gmail.nossr50.util.input.SuperAbilityManager;
|
||||
import com.neetgames.mcmmo.exceptions.UnknownSkillException;
|
||||
import com.neetgames.mcmmo.player.MMOPlayerData;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.neetgames.mcmmo.skill.RootSkill;
|
||||
import com.neetgames.mcmmo.skill.SkillIdentity;
|
||||
import net.kyori.adventure.identity.Identified;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -57,6 +54,7 @@ public class McMMOPlayer extends PlayerProfile implements OnlineMMOPlayer, Ident
|
||||
private final @NotNull Identity identity;
|
||||
private @Nullable Party playerPartyRef;
|
||||
|
||||
|
||||
//Used in our chat systems for chat messages
|
||||
private final @NotNull PlayerAuthor playerAuthor;
|
||||
private final @NotNull Map<PrimarySkillType, SkillManager> skillManagers = new HashMap<>();
|
||||
@ -481,16 +479,6 @@ public class McMMOPlayer extends PlayerProfile implements OnlineMMOPlayer, Ident
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the experience bars for this player
|
||||
* @param skillIdentity target skill
|
||||
* @param plugin your {@link Plugin}
|
||||
*/
|
||||
public void updateXPBar(@NotNull SkillIdentity skillIdentity, Plugin plugin) {
|
||||
//XP BAR UPDATES
|
||||
experienceBarManager.updateExperienceBar(skillIdentity, plugin);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not a player can still be in god mode when transitioning between worlds
|
||||
*/
|
||||
@ -502,13 +490,6 @@ public class McMMOPlayer extends PlayerProfile implements OnlineMMOPlayer, Ident
|
||||
}
|
||||
}
|
||||
|
||||
public void checkParty() {
|
||||
if (inParty() && !Permissions.party(player)) {
|
||||
removeParty();
|
||||
player.sendMessage(LocaleLoader.getString("Party.Forbidden"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the time remaining until the superAbilityType's cooldown expires.
|
||||
*
|
||||
@ -647,4 +628,16 @@ public class McMMOPlayer extends PlayerProfile implements OnlineMMOPlayer, Ident
|
||||
public void updateXPBar(@NotNull RootSkill rootSkill) {
|
||||
experienceBarManager.updateExperienceBar(rootSkill, mcMMO.p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateGodMode() {
|
||||
if(!Permissions.mcgod(player)) {
|
||||
godMode = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Party getParty() {
|
||||
return playerPartyRef;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.chat;
|
||||
|
||||
import com.gmail.nossr50.chat.message.PartyChatMessage;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
@ -4,6 +4,7 @@ import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.WorldBlacklist;
|
||||
import com.gmail.nossr50.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.datatypes.skills.SubSkillType;
|
||||
@ -89,12 +90,13 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
|
||||
//Profile not loaded
|
||||
if(mcMMO.getUserManager().queryPlayer(player) == null)
|
||||
{
|
||||
McMMOPlayer mmoPlayer = (McMMOPlayer) mcMMO.getUserManager().queryPlayer(player);
|
||||
|
||||
if(mmoPlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mcMMO.getUserManager().queryPlayer(player).actualizeTeleportATS();
|
||||
mmoPlayer.actualizeTeleportATS();
|
||||
}
|
||||
/**
|
||||
* Handle PlayerDeathEvents at the lowest priority.
|
||||
@ -206,8 +208,12 @@ public class PlayerListener implements Listener {
|
||||
|
||||
OnlineMMOPlayer mmoPlayer = mcMMO.getUserManager().queryPlayer(player);
|
||||
|
||||
mmoPlayer.checkGodMode();
|
||||
mmoPlayer.checkParty();
|
||||
if(mmoPlayer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
mmoPlayer.validateGodMode();
|
||||
mmoPlayer.validateParty();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5,9 +5,10 @@ import com.gmail.nossr50.datatypes.chat.ChatChannel;
|
||||
import com.gmail.nossr50.datatypes.database.UpgradeType;
|
||||
import com.gmail.nossr50.datatypes.interactions.NotificationType;
|
||||
import com.gmail.nossr50.datatypes.party.ItemShareType;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyMember;
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyAllianceChangeEvent;
|
||||
|
@ -3,7 +3,7 @@ package com.gmail.nossr50.party;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.config.party.ItemWeightConfig;
|
||||
import com.gmail.nossr50.datatypes.party.ItemShareType;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.ShareMode;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.runnables.party;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.util;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.neetgames.mcmmo.player.OnlineMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
|
@ -6,6 +6,7 @@ import com.gmail.nossr50.datatypes.experience.FormulaType;
|
||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
@ -15,23 +16,14 @@ public class FormulaManager {
|
||||
private static final File formulaFile = new File(mcMMO.getFlatFileDirectory() + "formula.yml");
|
||||
|
||||
// Experience needed to reach a level, cached values to improve conversion speed
|
||||
private Map<Integer, Integer> experienceNeededRetroLinear;
|
||||
private Map<Integer, Integer> experienceNeededStandardLinear;
|
||||
private Map<Integer, Integer> experienceNeededRetroExponential;
|
||||
private Map<Integer, Integer> experienceNeededStandardExponential;
|
||||
private @NotNull Map<Integer, Integer> experienceNeededRetroLinear;
|
||||
private @NotNull Map<Integer, Integer> experienceNeededStandardLinear;
|
||||
private @NotNull Map<Integer, Integer> experienceNeededRetroExponential;
|
||||
private @NotNull Map<Integer, Integer> experienceNeededStandardExponential;
|
||||
|
||||
private FormulaType previousFormula;
|
||||
|
||||
public FormulaManager() {
|
||||
/* Setting for Classic Mode (Scales a lot of stuff up by * 10) */
|
||||
initExperienceNeededMaps();
|
||||
loadFormula();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize maps used for XP to next level
|
||||
*/
|
||||
private void initExperienceNeededMaps() {
|
||||
experienceNeededRetroLinear = new HashMap<>();
|
||||
experienceNeededRetroExponential = new HashMap<>();
|
||||
experienceNeededStandardLinear = new HashMap<>();
|
||||
|
@ -16,8 +16,8 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ExperienceBarManager handles displaying and updating mcMMO experience bars for players
|
||||
* Each ExperienceBarManager only manages a single player
|
||||
* {@link MMOExperienceBarManager} handles displaying and updating mcMMO experience bars for players
|
||||
* Each {@link MMOExperienceBarManager} only manages a single player
|
||||
*/
|
||||
public class MMOExperienceBarManager {
|
||||
private final McMMOPlayer mmoPlayer;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.util.player;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.datatypes.party.Party;
|
||||
import com.neetgames.mcmmo.party.Party;
|
||||
import com.gmail.nossr50.datatypes.party.PartyFeature;
|
||||
import com.gmail.nossr50.datatypes.party.PartyMember;
|
||||
import org.bukkit.Bukkit;
|
||||
|
Loading…
Reference in New Issue
Block a user