mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-12-22 04:37:46 +01:00
Final Bug Fixes
This commit is contained in:
parent
4db1a93436
commit
ba1251bbe2
@ -24,7 +24,6 @@ import net.Indyuce.mmocore.comp.region.WorldGuardRegionHandler;
|
||||
import net.Indyuce.mmocore.comp.region.pvpmode.PvPModeListener;
|
||||
import net.Indyuce.mmocore.comp.vault.VaultEconomy;
|
||||
import net.Indyuce.mmocore.comp.vault.VaultMMOLoader;
|
||||
import net.Indyuce.mmocore.gui.api.packets.InventoryPacketListener;
|
||||
import net.Indyuce.mmocore.guild.GuildModule;
|
||||
import net.Indyuce.mmocore.guild.GuildModuleType;
|
||||
import net.Indyuce.mmocore.guild.GuildRelationHandler;
|
||||
@ -264,9 +263,6 @@ public class MMOCore extends JavaPlugin {
|
||||
// load guild data after loading player data
|
||||
dataProvider.getGuildManager().load();
|
||||
|
||||
//TODO: Remove
|
||||
new InventoryPacketListener();
|
||||
|
||||
// Toggleable Commands
|
||||
ToggleableCommand.register();
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class AttributesCommand extends RegisteredCommand {
|
||||
PlayerData data = PlayerData.get((Player) sender);
|
||||
MMOCommandEvent event = new MMOCommandEvent(data, "attributes");
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if(!event.isCancelled()) InventoryManager.ATTRIBUTE_VIEW.newInventory(data).open();
|
||||
if(!event.isCancelled()) InventoryManager.ATTRIBUTE_VIEW.generate(data,null).open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ public class ClassCommand extends RegisteredCommand {
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if(event.isCancelled()) return true;
|
||||
if (data.getProfess().getSubclasses().stream().anyMatch(sub -> sub.getLevel() <= data.getLevel()))
|
||||
InventoryManager.SUBCLASS_SELECT.newInventory(data).open();
|
||||
InventoryManager.SUBCLASS_SELECT.generate(data,null).open();
|
||||
else
|
||||
InventoryManager.CLASS_SELECT.generate(data).open();
|
||||
InventoryManager.CLASS_SELECT.generate(data,null).open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class FriendsCommand extends RegisteredCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
InventoryManager.FRIEND_LIST.newInventory(data).open();
|
||||
InventoryManager.FRIEND_LIST.generate(data,null).open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -70,9 +70,9 @@ public class GuildCommand extends RegisteredCommand {
|
||||
}
|
||||
|
||||
if (data.inGuild())
|
||||
InventoryManager.GUILD_VIEW.newInventory(data).open();
|
||||
InventoryManager.GUILD_VIEW.generate(data, null).open();
|
||||
else
|
||||
InventoryManager.GUILD_CREATION.newInventory(data).open();
|
||||
InventoryManager.GUILD_CREATION.generate(data, null).open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -74,9 +74,9 @@ public class PartyCommand extends RegisteredCommand {
|
||||
}
|
||||
|
||||
if (data.getParty() != null)
|
||||
InventoryManager.PARTY_VIEW.newInventory(data).open();
|
||||
InventoryManager.PARTY_VIEW.generate(data,null).open();
|
||||
else
|
||||
InventoryManager.PARTY_CREATION.newInventory(data).open();
|
||||
InventoryManager.PARTY_CREATION.generate(data,null).open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class PlayerStatsCommand extends RegisteredCommand {
|
||||
PlayerData data = PlayerData.get((Player) sender);
|
||||
MMOCommandEvent event = new MMOCommandEvent(data, "profile");
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) InventoryManager.PLAYER_STATS.generate(data).open();
|
||||
if (!event.isCancelled()) InventoryManager.PLAYER_STATS.generate(data, null).open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class QuestsCommand extends RegisteredCommand {
|
||||
PlayerData data = PlayerData.get((Player) sender);
|
||||
MMOCommandEvent event = new MMOCommandEvent(data, "quests");
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if(!event.isCancelled()) InventoryManager.QUEST_LIST.newInventory(data).open();
|
||||
if(!event.isCancelled()) InventoryManager.QUEST_LIST.generate(data,null).open();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class SkillTreesCommand extends RegisteredCommand {
|
||||
return false;
|
||||
}
|
||||
if (data.getProfess().getSkillTrees().size() != 0) {
|
||||
InventoryManager.TREE_VIEW.generate(data).open();
|
||||
InventoryManager.TREE_VIEW.generate(data, null).open();
|
||||
return true;
|
||||
} else {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("no-skill-tree").send(player);
|
||||
@ -60,7 +60,7 @@ public class SkillTreesCommand extends RegisteredCommand {
|
||||
.filter(skillTree -> UtilityMethods.ymlName(skillTree.getId()).equals(UtilityMethods.ymlName(args[0])))
|
||||
.collect(Collectors.toList())
|
||||
.size() != 0) {
|
||||
InventoryManager.SPECIFIC_TREE_VIEW.get(UtilityMethods.ymlName(args[0])).generate(data).open();
|
||||
InventoryManager.SPECIFIC_TREE_VIEW.get(UtilityMethods.ymlName(args[0])).generate(data, null).open();
|
||||
return true;
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.RED + "Your class does not have a skill tree with id: " + args[0]);
|
||||
|
@ -31,7 +31,7 @@ public class SkillsCommand extends RegisteredCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
InventoryManager.SKILL_LIST.newInventory(data).open();
|
||||
InventoryManager.SKILL_LIST.generate(data,null).open();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -11,18 +11,18 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class WaypointsCommand extends RegisteredCommand {
|
||||
public WaypointsCommand(ConfigurationSection config) {
|
||||
super(config, ToggleableCommand.WAYPOINTS);
|
||||
}
|
||||
public WaypointsCommand(ConfigurationSection config) {
|
||||
super(config, ToggleableCommand.WAYPOINTS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String label, String[] args) {
|
||||
if (sender instanceof Player && sender.hasPermission("mmocore.waypoints")) {
|
||||
PlayerData data = PlayerData.get((Player) sender);
|
||||
MMOCommandEvent event = new MMOCommandEvent(data, "waypoints");
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if(!event.isCancelled()) InventoryManager.WAYPOINTS.generate(data).open();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String label, String[] args) {
|
||||
if (sender instanceof Player && sender.hasPermission("mmocore.waypoints")) {
|
||||
PlayerData data = PlayerData.get((Player) sender);
|
||||
MMOCommandEvent event = new MMOCommandEvent(data, "waypoints");
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) InventoryManager.WAYPOINTS.generate(data, null).open();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -11,24 +11,24 @@ import io.lumine.mythic.lib.command.api.CommandTreeNode;
|
||||
import io.lumine.mythic.lib.command.api.Parameter;
|
||||
|
||||
public class OpenCommandTreeNode extends CommandTreeNode {
|
||||
public OpenCommandTreeNode(CommandTreeNode parent) {
|
||||
super(parent, "open");
|
||||
public OpenCommandTreeNode(CommandTreeNode parent) {
|
||||
super(parent, "open");
|
||||
|
||||
addParameter(Parameter.PLAYER);
|
||||
}
|
||||
addParameter(Parameter.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandResult execute(CommandSender sender, String[] args) {
|
||||
if (args.length < 3)
|
||||
return CommandResult.THROW_USAGE;
|
||||
@Override
|
||||
public CommandResult execute(CommandSender sender, String[] args) {
|
||||
if (args.length < 3)
|
||||
return CommandResult.THROW_USAGE;
|
||||
|
||||
Player player = Bukkit.getPlayer(args[2]);
|
||||
if (player == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Could not find player " + args[2]);
|
||||
return CommandResult.FAILURE;
|
||||
}
|
||||
Player player = Bukkit.getPlayer(args[2]);
|
||||
if (player == null) {
|
||||
sender.sendMessage(ChatColor.RED + "Could not find player " + args[2]);
|
||||
return CommandResult.FAILURE;
|
||||
}
|
||||
|
||||
InventoryManager.WAYPOINTS.generate(PlayerData.get(player)).open();
|
||||
return CommandResult.SUCCESS;
|
||||
}
|
||||
InventoryManager.WAYPOINTS.generate(PlayerData.get(player), null).open();
|
||||
return CommandResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class ForceClassProfileDataModule implements ProfileDataModule, Listener
|
||||
}
|
||||
|
||||
final PlayerData playerData = PlayerData.get(event.getPlayerData().getPlayer());
|
||||
InventoryManager.CLASS_SELECT.generate(playerData, () -> event.validate(this)).open();
|
||||
InventoryManager.CLASS_SELECT.generate(playerData, () -> event.validate(this), null).open();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,8 +62,7 @@ public class ForceClassProfileDataModule implements ProfileDataModule, Listener
|
||||
if (!event.hasProfileEvent()) {
|
||||
Validate.isTrue(MythicLib.plugin.getProfileMode() == ProfileMode.PROXY, "Listened to a data load event with no profile event attached but proxy-based profiles are disabled");
|
||||
if (playerData.getProfess().equals(MMOCore.plugin.classManager.getDefaultClass()))
|
||||
InventoryManager.CLASS_SELECT.generate(playerData, () -> {
|
||||
}).open();
|
||||
InventoryManager.CLASS_SELECT.generate(playerData, null).open();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -71,7 +70,7 @@ public class ForceClassProfileDataModule implements ProfileDataModule, Listener
|
||||
|
||||
// Validate if necessary
|
||||
if (playerData.getProfess().equals(MMOCore.plugin.classManager.getDefaultClass()))
|
||||
InventoryManager.CLASS_SELECT.generate(playerData, () -> event1.validate(this)).open();
|
||||
InventoryManager.CLASS_SELECT.generate(playerData, () -> event1.validate(this), null).open();
|
||||
else event1.validate(this);
|
||||
}
|
||||
}
|
||||
|
@ -42,10 +42,10 @@ public class ClassSelect extends EditableInventory<PlayerData> {
|
||||
}
|
||||
|
||||
public GeneratedInventory generate(PlayerData playerData, @Nullable GeneratedInventory generatedInventory) {
|
||||
return generate(playerData, null, null);
|
||||
return generate(playerData, ()->{}, null);
|
||||
}
|
||||
|
||||
public GeneratedInventory generate(PlayerData playerData, @Nullable GeneratedInventory generatedInventory, @Nullable Runnable profileRunnable) {
|
||||
public GeneratedInventory generate(PlayerData playerData, @Nullable Runnable profileRunnable, @Nullable GeneratedInventory generatedInventory) {
|
||||
return new ProfessSelectionInventory(playerData, this, profileRunnable);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ import net.Indyuce.mmocore.party.AbstractParty;
|
||||
import net.Indyuce.mmocore.player.stats.StatInfo;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
@ -125,7 +126,7 @@ public class PlayerStats extends EditableInventory<PlayerData> {
|
||||
final net.Indyuce.mmocore.api.player.stats.PlayerStats stats = inv.target.getStats();
|
||||
|
||||
@Override
|
||||
public String apply(Player player, String str) {
|
||||
public String apply(OfflinePlayer player, String str) {
|
||||
String explored = str;
|
||||
// Internal placeholders
|
||||
while (explored.contains("{") && explored.substring(explored.indexOf("{")).contains("}")) {
|
||||
|
@ -60,11 +60,11 @@ public class WaypointViewer extends EditableInventory<PlayerData> {
|
||||
|
||||
@Override
|
||||
public GeneratedInventory generate(PlayerData data, @Nullable GeneratedInventory generatedInventory) {
|
||||
return newInventory(data, null, null);
|
||||
return generate(data, null, null);
|
||||
}
|
||||
|
||||
public GeneratedInventory newInventory(PlayerData data, Waypoint waypoint, @Nullable GeneratedInventory generatedInventory) {
|
||||
return new WaypointViewerInventory(data, this, waypoint);
|
||||
public GeneratedInventory generate(PlayerData data, Waypoint waypoint, @Nullable GeneratedInventory prev) {
|
||||
return new WaypointViewerInventory(data, this, waypoint, prev);
|
||||
}
|
||||
|
||||
public class WaypointItem extends SimpleItem<WaypointViewerInventory> {
|
||||
@ -182,8 +182,8 @@ public class WaypointViewer extends EditableInventory<PlayerData> {
|
||||
|
||||
private int page;
|
||||
|
||||
public WaypointViewerInventory(PlayerData playerData, EditableInventory editable, Waypoint current) {
|
||||
super(playerData, editable);
|
||||
public WaypointViewerInventory(PlayerData playerData, EditableInventory editable, Waypoint current, @Nullable GeneratedInventory prev) {
|
||||
super(playerData, editable, prev);
|
||||
|
||||
this.current = current;
|
||||
if (current != null)
|
||||
|
@ -10,7 +10,7 @@ import com.comphenix.protocol.ProtocolLibrary;
|
||||
import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import com.comphenix.protocol.wrappers.WrappedChatComponent;
|
||||
|
||||
/*
|
||||
public class InventoryPacketListener {
|
||||
|
||||
|
||||
@ -100,10 +100,10 @@ public class InventoryPacketListener {
|
||||
return;
|
||||
} else {
|
||||
super.write(ctx,packetObj,promise);
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
@ -71,8 +71,8 @@ public class EditableFriendList extends EditableInventory<PlayerData> {
|
||||
|
||||
|
||||
public static class OfflineFriendItem extends InventoryItem<FriendListInventory> {
|
||||
public OfflineFriendItem(FriendItem parent, ConfigurationSection config) {
|
||||
super(parent, config);
|
||||
public OfflineFriendItem(ConfigurationSection config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -98,8 +98,8 @@ public class EditableFriendList extends EditableInventory<PlayerData> {
|
||||
}
|
||||
|
||||
public static class OnlineFriendItem extends SimpleItem<FriendListInventory> {
|
||||
public OnlineFriendItem(FriendItem parent, ConfigurationSection config) {
|
||||
super(parent, config);
|
||||
public OnlineFriendItem(ConfigurationSection config) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -138,8 +138,8 @@ public class EditableFriendList extends EditableInventory<PlayerData> {
|
||||
Validate.notNull(config.contains("online"), "Could not load online config");
|
||||
Validate.notNull(config.contains("offline"), "Could not load offline config");
|
||||
|
||||
online = new OnlineFriendItem(this, config.getConfigurationSection("online"));
|
||||
offline = new OfflineFriendItem(this, config.getConfigurationSection("offline"));
|
||||
online = new OnlineFriendItem(config.getConfigurationSection("online"));
|
||||
offline = new OfflineFriendItem(config.getConfigurationSection("offline"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,7 +95,7 @@ public class EditableGuildView extends EditableInventory<PlayerData> {
|
||||
private final MemberDisplayItem member;
|
||||
|
||||
public MemberItem(ConfigurationSection config) {
|
||||
super(Material.BARRIER, config);
|
||||
super(config, Material.BARRIER);
|
||||
|
||||
Validate.notNull(config.contains("empty"), "Could not load empty config");
|
||||
Validate.notNull(config.contains("member"), "Could not load member config");
|
||||
|
@ -1,5 +1,7 @@
|
||||
package net.Indyuce.mmocore.guild.provided;
|
||||
|
||||
import io.lumine.mythic.lib.data.PlayerProvider;
|
||||
import io.lumine.mythic.lib.gui.framework.PluginInventory;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.ConfigMessage;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
@ -63,7 +65,7 @@ public class Guild implements AbstractGuild {
|
||||
public void removeMember(UUID uuid, boolean disband) {
|
||||
PlayerData data = PlayerData.get(uuid);
|
||||
if (data != null && data.isOnline() && data.getPlayer().getOpenInventory() != null && data.getPlayer().getOpenInventory().getTopInventory().getHolder() instanceof EditableGuildView.GuildViewInventory)
|
||||
InventoryManager.GUILD_CREATION.newInventory(data).open();
|
||||
InventoryManager.GUILD_CREATION.generate(data, null).open();
|
||||
|
||||
if (!disband)
|
||||
members.remove(uuid);
|
||||
@ -103,7 +105,7 @@ public class Guild implements AbstractGuild {
|
||||
for (UUID uuid : members) {
|
||||
PlayerData member = PlayerData.get(uuid);
|
||||
if (member != null && member.isOnline() && member.getPlayer().getOpenInventory() != null && member.getPlayer().getOpenInventory().getTopInventory().getHolder() instanceof EditableGuildView.GuildViewInventory)
|
||||
((PluginInventory) member.getPlayer().getOpenInventory().getTopInventory().getHolder()).open();
|
||||
((PluginInventory<PlayerData>) member.getPlayer().getOpenInventory().getTopInventory().getHolder()).open();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,6 +39,6 @@ public class GuildInvite extends Request {
|
||||
);
|
||||
|
||||
guild.addMember(getTarget().getUniqueId());
|
||||
InventoryManager.GUILD_VIEW.newInventory(getTarget()).open();
|
||||
InventoryManager.GUILD_VIEW.generate(getTarget(), null).open();
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ import java.util.logging.Level;
|
||||
public class RestrictionManager implements MMOCoreManager {
|
||||
|
||||
/**
|
||||
* Using {@link ItemType#getDisplayedItem()} instead of an ItemType as
|
||||
* Using {@link ItemType#display()} instead of an ItemType as
|
||||
* map key to utilize the HashMap O(1) time complexity of the
|
||||
* get function instead of iterating through the key set.
|
||||
*/
|
||||
@ -51,12 +51,12 @@ public class RestrictionManager implements MMOCoreManager {
|
||||
try {
|
||||
perms.postLoad();
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOCore.log(Level.WARNING, "Could not post-load perm set '" + perms.getTool().getDisplayedItem() + "': " + exception.getMessage());
|
||||
MMOCore.log(Level.WARNING, "Could not post-load perm set '" + perms.getTool().display() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void register(ToolPermissions perms) {
|
||||
map.put(perms.getTool().getDisplayedItem(), perms);
|
||||
map.put(perms.getTool().display(), perms);
|
||||
|
||||
if (perms.isDefault()) {
|
||||
Validate.isTrue(defaultPermissions == null, "There is already a default tool permission set");
|
||||
@ -69,12 +69,12 @@ public class RestrictionManager implements MMOCoreManager {
|
||||
*
|
||||
* @param item The item used to break a block
|
||||
* @return A list of all the blocks an item is allowed to break.
|
||||
* If it was not registered earlier, it returns the default permission
|
||||
* set. If there is no default permission set, returns null
|
||||
* If it was not registered earlier, it returns the default permission
|
||||
* set. If there is no default permission set, returns null
|
||||
*/
|
||||
@Nullable
|
||||
public ToolPermissions getPermissions(ItemStack item) {
|
||||
String mapKey = ItemType.fromItemStack(item).getDisplayedItem();
|
||||
String mapKey = ItemType.fromItemStack(item).display();
|
||||
ToolPermissions found = map.get(mapKey);
|
||||
return found == null ? defaultPermissions : found;
|
||||
}
|
||||
@ -137,7 +137,7 @@ public class RestrictionManager implements MMOCoreManager {
|
||||
|
||||
/**
|
||||
* @return Either parent if provided or default tool permission set if this is
|
||||
* not the default set already, or null otherwise.
|
||||
* not the default set already, or null otherwise.
|
||||
*/
|
||||
public ToolPermissions getParent() {
|
||||
return parent != null ? parent : defaultSet ? null : defaultPermissions;
|
||||
|
@ -1,5 +1,6 @@
|
||||
package net.Indyuce.mmocore.party.provided;
|
||||
|
||||
import io.lumine.mythic.lib.gui.framework.PluginInventory;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.gui.social.party.EditablePartyView;
|
||||
import net.Indyuce.mmocore.manager.InventoryManager;
|
||||
@ -107,7 +108,7 @@ public class Party implements AbstractParty {
|
||||
public void removeMember(PlayerData data, boolean notify) {
|
||||
if (data.isOnline() && data.getPlayer().getOpenInventory() != null
|
||||
&& data.getPlayer().getOpenInventory().getTopInventory().getHolder() instanceof EditablePartyView.PartyViewInventory)
|
||||
InventoryManager.PARTY_CREATION.newInventory(data).open();
|
||||
InventoryManager.PARTY_CREATION.generate(data,null).open();
|
||||
|
||||
members.remove(data);
|
||||
|
||||
|
@ -38,6 +38,6 @@ public class PartyInvite extends Request {
|
||||
if (party.getOwner().isOnline())
|
||||
MMOCore.plugin.configManager.getSimpleMessage("party-joined", "owner", party.getOwner().getPlayer().getName()).send(getTarget().getPlayer());
|
||||
party.addMember(getTarget());
|
||||
InventoryManager.PARTY_VIEW.newInventory(getTarget()).open();
|
||||
InventoryManager.PARTY_VIEW.generate(getTarget(), null).open();
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package net.Indyuce.mmocore.skill;
|
||||
|
||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
||||
import io.lumine.mythic.lib.gui.framework.item.Placeholders;
|
||||
import io.lumine.mythic.lib.player.cooldown.CooldownObject;
|
||||
import io.lumine.mythic.lib.player.modifier.ModifierSource;
|
||||
import io.lumine.mythic.lib.player.skill.PassiveSkill;
|
||||
|
@ -3,6 +3,7 @@ package net.Indyuce.mmocore.skill.cast.listener;
|
||||
import io.lumine.mythic.lib.UtilityMethods;
|
||||
import io.lumine.mythic.lib.api.event.skill.PlayerCastSkillEvent;
|
||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
||||
import io.lumine.mythic.lib.gui.framework.item.Placeholders;
|
||||
import io.lumine.mythic.lib.player.PlayerMetadata;
|
||||
import io.lumine.mythic.lib.skill.trigger.TriggerMetadata;
|
||||
import io.lumine.mythic.lib.skill.trigger.TriggerType;
|
||||
|
@ -3,6 +3,7 @@ package net.Indyuce.mmocore.listener;
|
||||
|
||||
import io.lumine.mythic.lib.UtilityMethods;
|
||||
import io.lumine.mythic.lib.api.event.PlayerAttackEvent;
|
||||
import io.lumine.mythic.lib.gui.framework.PluginInventory;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.event.PlayerResourceUpdateEvent;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
@ -20,24 +21,6 @@ import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
|
||||
public class PlayerListener implements Listener {
|
||||
|
||||
/**
|
||||
* Register custom inventory clicks
|
||||
*/
|
||||
@EventHandler
|
||||
public void registerInventoryClicks(InventoryClickEvent event) {
|
||||
if (event.getInventory().getHolder() instanceof PluginInventory)
|
||||
((PluginInventory) event.getInventory().getHolder()).whenClicked(new InventoryClickEvent(event.getRawSlot(), event.getCurrentItem(), event.getClick(), event, event.getInventory(), (PluginInventory) event.getInventory().getHolder()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register custom inventory close effect
|
||||
*/
|
||||
@EventHandler
|
||||
public void registerInventoryCloses(InventoryCloseEvent event) {
|
||||
if (event.getInventory().getHolder() instanceof PluginInventory)
|
||||
((PluginInventory) event.getInventory().getHolder()).whenClosed(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the player's combat log data every time he hits an entity, or
|
||||
* gets hit by an entity or a projectile sent by another entity
|
||||
|
@ -42,7 +42,7 @@ public class WaypointsListener implements Listener {
|
||||
|
||||
if (waypoint.hasOption(WaypointOption.ENABLE_MENU)) {
|
||||
player.setSneaking(false);
|
||||
InventoryManager.WAYPOINTS.newInventory(data, waypoint).open();
|
||||
InventoryManager.WAYPOINTS.generate(data, waypoint, null).open();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,6 @@ public class PlayerProfileCheck implements Listener {
|
||||
if (event.getRightClicked().getType() != EntityType.PLAYER || !event.getPlayer().isSneaking() || !MythicLib.plugin.getEntities().canTarget(event.getPlayer(), event.getRightClicked(), InteractionType.SUPPORT_ACTION))
|
||||
return;
|
||||
|
||||
InventoryManager.PLAYER_STATS.generate(PlayerData.get((Player) event.getRightClicked()), PlayerData.get(event.getPlayer())).open();
|
||||
InventoryManager.PLAYER_STATS.generate(PlayerData.get((Player) event.getRightClicked()), PlayerData.get(event.getPlayer()), null).open();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user