mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-18 16:35:25 +01:00
expanding the abstraction (this is going to happen a lot)
This commit is contained in:
parent
4461cfacd2
commit
261d571be1
@ -4,7 +4,7 @@ import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -5,7 +5,7 @@ import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.core.util.commands.CommandUtils;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
|
@ -5,7 +5,7 @@ import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -5,7 +5,7 @@ import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.party.PartyManager;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.core.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
@ -26,8 +26,8 @@ import com.gmail.nossr50.core.util.sounds.SoundManager;
|
||||
import com.gmail.nossr50.core.util.sounds.SoundType;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeBlockDamageEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
|
@ -22,9 +22,9 @@ import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityTameEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeEntityTameEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
|
@ -13,7 +13,7 @@ import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.skills.SkillUtils;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.events.fake.FakeBrewEvent;
|
||||
import com.gmail.nossr50.core.events.fake.FakeBrewEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
@ -9,9 +9,9 @@ import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.util.scoreboards.ScoreboardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardManager;
|
||||
import com.gmail.nossr50.core.worldguard.WorldGuardUtils;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
||||
import com.gmail.nossr50.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
|
||||
import com.gmail.nossr50.core.events.experience.McMMOPlayerLevelUpEvent;
|
||||
import com.gmail.nossr50.core.events.experience.McMMOPlayerXpGainEvent;
|
||||
import com.gmail.nossr50.core.events.skills.abilities.McMMOPlayerAbilityActivateEvent;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
@ -1,11 +1,17 @@
|
||||
package com.gmail.nossr50.core;
|
||||
|
||||
import com.gmail.nossr50.core.mcmmo.event.EventCommander;
|
||||
import com.gmail.nossr50.core.mcmmo.plugin.Plugin;
|
||||
import com.gmail.nossr50.core.mcmmo.server.Server;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class McmmoCore {
|
||||
//TODO: Wire all this stuff
|
||||
public static Plugin p;
|
||||
private static EventCommander eventCommander;
|
||||
private static Server server;
|
||||
private static Logger logger;
|
||||
|
||||
/**
|
||||
* Returns our Logger
|
||||
@ -13,6 +19,14 @@ public class McmmoCore {
|
||||
*/
|
||||
public static Logger getLogger()
|
||||
{
|
||||
return logger;
|
||||
}
|
||||
|
||||
public static EventCommander getEventCommander() {
|
||||
return eventCommander;
|
||||
}
|
||||
|
||||
public static Server getServer() {
|
||||
return server;
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,16 @@
|
||||
package com.gmail.nossr50.core.chat;
|
||||
|
||||
import com.gmail.nossr50.core.config.Config;
|
||||
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import com.gmail.nossr50.core.events.chat.McMMOAdminChatEvent;
|
||||
|
||||
public class AdminChatManager extends ChatManager {
|
||||
protected AdminChatManager(Plugin plugin) {
|
||||
super(plugin, Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix());
|
||||
protected AdminChatManager() {
|
||||
super(Config.getInstance().getAdminDisplayNames(), Config.getInstance().getAdminChatPrefix());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleChat(String senderName, String displayName, String message, boolean isAsync) {
|
||||
handleChat(new McMMOAdminChatEvent(plugin, senderName, displayName, message, isAsync));
|
||||
handleChat(new McMMOAdminChatEvent(senderName, displayName, message, isAsync));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,15 +1,14 @@
|
||||
package com.gmail.nossr50.core.chat;
|
||||
|
||||
import com.gmail.nossr50.core.McmmoCore;
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import com.gmail.nossr50.core.events.chat.McMMOChatEvent;
|
||||
import com.gmail.nossr50.core.events.chat.McMMOPartyChatEvent;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.events.chat.McMMOChatEvent;
|
||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import com.gmail.nossr50.core.mcmmo.entity.Player;
|
||||
|
||||
public abstract class ChatManager {
|
||||
protected Plugin plugin;
|
||||
protected boolean useDisplayNames;
|
||||
protected String chatPrefix;
|
||||
|
||||
@ -17,14 +16,13 @@ public abstract class ChatManager {
|
||||
protected String displayName;
|
||||
protected String message;
|
||||
|
||||
protected ChatManager(Plugin plugin, boolean useDisplayNames, String chatPrefix) {
|
||||
this.plugin = plugin;
|
||||
protected ChatManager(boolean useDisplayNames, String chatPrefix) {
|
||||
this.useDisplayNames = useDisplayNames;
|
||||
this.chatPrefix = chatPrefix;
|
||||
}
|
||||
|
||||
protected void handleChat(McMMOChatEvent event) {
|
||||
plugin.getServer().getPluginManager().callEvent(event);
|
||||
McmmoCore.getEventCommander().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
|
@ -147,7 +147,7 @@ public class McMMOPlayer {
|
||||
}
|
||||
|
||||
public void processUnlockNotifications(PrimarySkillType primarySkillType, int skillLevel) {
|
||||
RankUtils.executeSkillUnlockNotifications(primarySkillType, skillLevel);
|
||||
RankUtils.executeSkillUnlockNotifications(this, primarySkillType, skillLevel);
|
||||
}
|
||||
|
||||
public void updateXPBar(PrimarySkillType primarySkillType) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.chat;
|
||||
package com.gmail.nossr50.core.events.chat;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.chat;
|
||||
package com.gmail.nossr50.core.events.chat;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.chat;
|
||||
package com.gmail.nossr50.core.events.chat;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
package com.gmail.nossr50.core.events.experience;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
package com.gmail.nossr50.core.events.experience;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
package com.gmail.nossr50.core.events.experience;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
package com.gmail.nossr50.core.events.experience;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
package com.gmail.nossr50.core.events.experience;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.experience.XPGainReason;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.inventory.BrewEvent;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Functions;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Functions;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.LivingEntity;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
package com.gmail.nossr50.core.events.fake;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.FishHook;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.hardcore;
|
||||
package com.gmail.nossr50.core.events.hardcore;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.hardcore;
|
||||
package com.gmail.nossr50.core.events.hardcore;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.hardcore;
|
||||
package com.gmail.nossr50.core.events.hardcore;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.hardcore;
|
||||
package com.gmail.nossr50.core.events.hardcore;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.items;
|
||||
package com.gmail.nossr50.core.events.items;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
package com.gmail.nossr50.core.events.party;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
package com.gmail.nossr50.core.events.party;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
package com.gmail.nossr50.core.events.party;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
package com.gmail.nossr50.core.events.party;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
package com.gmail.nossr50.core.events.party;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.party.Party;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.scoreboard;
|
||||
package com.gmail.nossr50.core.events.scoreboard;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.scoreboard;
|
||||
package com.gmail.nossr50.core.events.scoreboard;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.scoreboard;
|
||||
package com.gmail.nossr50.core.events.scoreboard;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.scoreboard;
|
||||
package com.gmail.nossr50.core.events.scoreboard;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.scoreboard;
|
||||
package com.gmail.nossr50.core.events.scoreboard;
|
||||
|
||||
public enum ScoreboardEventReason {
|
||||
CREATING_NEW_SCOREBOARD,
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.scoreboard;
|
||||
package com.gmail.nossr50.core.events.scoreboard;
|
||||
|
||||
public enum ScoreboardObjectiveEventReason {
|
||||
UNREGISTER_THIS_OBJECTIVE,
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills;
|
||||
package com.gmail.nossr50.core.events.skills;
|
||||
|
||||
import com.gmail.nossr50.core.datatypes.interactions.NotificationType;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills;
|
||||
package com.gmail.nossr50.core.events.skills;
|
||||
|
||||
import com.gmail.nossr50.core.data.UserManager;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills.abilities;
|
||||
package com.gmail.nossr50.core.events.skills.abilities;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills.abilities;
|
||||
package com.gmail.nossr50.core.events.skills.abilities;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import org.bukkit.entity.Player;
|
@ -1,8 +1,8 @@
|
||||
package com.gmail.nossr50.events.skills.abilities;
|
||||
package com.gmail.nossr50.core.events.skills.abilities;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SuperAbilityType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class McMMOPlayerAbilityEvent extends McMMOPlayerSkillEvent {
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.skills.alchemy;
|
||||
package com.gmail.nossr50.core.events.skills.alchemy;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.BrewingStand;
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.skills.alchemy;
|
||||
package com.gmail.nossr50.core.events.skills.alchemy;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
package com.gmail.nossr50.core.events.skills.fishing;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
package com.gmail.nossr50.core.events.skills.fishing;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
package com.gmail.nossr50.core.events.skills.fishing;
|
||||
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills.fishing;
|
||||
package com.gmail.nossr50.core.events.skills.fishing;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.skills.repair;
|
||||
package com.gmail.nossr50.core.events.skills.repair;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.skills.salvage;
|
||||
package com.gmail.nossr50.core.events.skills.salvage;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
@ -1,9 +1,9 @@
|
||||
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||
package com.gmail.nossr50.core.events.skills.secondaryabilities;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events.skills.secondaryabilities;
|
||||
package com.gmail.nossr50.core.events.skills.secondaryabilities;
|
||||
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
@ -1,7 +1,7 @@
|
||||
package com.gmail.nossr50.events.skills.unarmed;
|
||||
package com.gmail.nossr50.core.events.skills.unarmed;
|
||||
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerSkillEvent;
|
||||
import com.gmail.nossr50.core.events.skills.McMMOPlayerSkillEvent;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
@ -25,6 +25,6 @@ public enum Color {
|
||||
|
||||
Color fromRGB(int r, int g, int b)
|
||||
{
|
||||
|
||||
//TODO: Figure this out later
|
||||
}
|
||||
}
|
||||
|
@ -4,11 +4,12 @@ import com.gmail.nossr50.core.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.core.mcmmo.Nameable;
|
||||
import com.gmail.nossr50.core.mcmmo.inventory.InventoryHolder;
|
||||
import com.gmail.nossr50.core.mcmmo.item.ItemStack;
|
||||
import com.gmail.nossr50.core.mcmmo.permissions.Permissible;
|
||||
|
||||
/**
|
||||
* Players
|
||||
*/
|
||||
public interface Player extends Living, Nameable, InventoryHolder {
|
||||
public interface Player extends Living, Nameable, InventoryHolder, Permissible {
|
||||
|
||||
/**
|
||||
* Players are not always online
|
||||
|
@ -0,0 +1,10 @@
|
||||
package com.gmail.nossr50.core.mcmmo.event;
|
||||
|
||||
public interface EventCommander {
|
||||
/**
|
||||
* Calls an event
|
||||
* @param event the event to call
|
||||
* @return the event after it has been passed around
|
||||
*/
|
||||
Event callEvent(Event event);
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.gmail.nossr50.core.mcmmo.permissions;
|
||||
|
||||
/**
|
||||
* A thing that can have Permissions is a Permissible
|
||||
*/
|
||||
public interface Permissible {
|
||||
/**
|
||||
* Returns whether or not this Permissible has this permission
|
||||
* @param path the permission nodes full path
|
||||
* @return true if the permissible has this permission
|
||||
*/
|
||||
boolean hasPermission(String path);
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.gmail.nossr50.core.mcmmo.server;
|
||||
|
||||
import com.gmail.nossr50.core.mcmmo.entity.Player;
|
||||
import com.gmail.nossr50.core.mcmmo.world.World;
|
||||
|
||||
/**
|
||||
* Represents the server and its state
|
||||
*/
|
||||
public interface Server {
|
||||
/**
|
||||
* Broadcasts a msg to every player on the server
|
||||
* @param msg the message to broadcast
|
||||
*/
|
||||
void broadcast(String msg);
|
||||
|
||||
/**
|
||||
* Gets the online players for this server
|
||||
* @return the online players for this server
|
||||
*/
|
||||
Player[] getOnlinePlayers();
|
||||
|
||||
/**
|
||||
* Gets the worlds for this server
|
||||
* @return the worlds for this server
|
||||
*/
|
||||
World[] getWorlds();
|
||||
}
|
@ -1,11 +1,13 @@
|
||||
package com.gmail.nossr50.core.skills;
|
||||
|
||||
import com.gmail.nossr50.core.McmmoCore;
|
||||
import com.gmail.nossr50.core.config.Config;
|
||||
import com.gmail.nossr50.core.config.experience.ExperienceConfig;
|
||||
import com.gmail.nossr50.core.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.core.mcmmo.colors.Color;
|
||||
import com.gmail.nossr50.core.mcmmo.entity.Entity;
|
||||
import com.gmail.nossr50.core.mcmmo.entity.Player;
|
||||
import com.gmail.nossr50.core.mcmmo.entity.Tameable;
|
||||
import com.gmail.nossr50.core.skills.child.salvage.SalvageManager;
|
||||
import com.gmail.nossr50.core.skills.child.smelting.SmeltingManager;
|
||||
import com.gmail.nossr50.core.skills.primary.acrobatics.AcrobaticsManager;
|
||||
@ -26,9 +28,6 @@ import com.gmail.nossr50.core.util.StringUtils;
|
||||
import com.gmail.nossr50.core.util.skills.ParticleEffectUtils;
|
||||
import com.gmail.nossr50.core.util.skills.RankUtils;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Tameable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -120,7 +119,7 @@ public enum PrimarySkillType {
|
||||
}
|
||||
|
||||
if (!skillName.equalsIgnoreCase("all")) {
|
||||
mcMMO.p.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize
|
||||
McmmoCore.getLogger().warning("Invalid mcMMO skill (" + skillName + ")"); //TODO: Localize
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -1,12 +1,11 @@
|
||||
package com.gmail.nossr50.core.skills;
|
||||
|
||||
import com.gmail.nossr50.core.config.Config;
|
||||
import com.gmail.nossr50.util.BlockUtils;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.entity.Player;
|
||||
import com.gmail.nossr50.core.mcmmo.block.BlockState;
|
||||
import com.gmail.nossr50.core.mcmmo.entity.Player;
|
||||
import com.gmail.nossr50.core.util.BlockUtils;
|
||||
import com.gmail.nossr50.core.util.Permissions;
|
||||
import com.gmail.nossr50.core.util.StringUtils;
|
||||
|
||||
public enum SuperAbilityType {
|
||||
BERSERK(
|
||||
|
@ -1,20 +1,12 @@
|
||||
package com.gmail.nossr50.core.util;
|
||||
|
||||
import com.gmail.nossr50.commands.party.PartySubcommandType;
|
||||
import com.gmail.nossr50.core.mcmmo.permissions.Permissible;
|
||||
import com.gmail.nossr50.core.mcmmo.world.World;
|
||||
import com.gmail.nossr50.core.skills.ItemType;
|
||||
import com.gmail.nossr50.core.skills.MaterialType;
|
||||
import com.gmail.nossr50.core.skills.PrimarySkillType;
|
||||
import com.gmail.nossr50.core.skills.SubSkillType;
|
||||
import com.gmail.nossr50.core.skills.subskills.AbstractSubSkill;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.permissions.Permissible;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
|
||||
public final class Permissions {
|
||||
private Permissions() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user