Fix for MMOItems loading slowly.

This commit is contained in:
Joshua 2021-06-11 19:20:31 -05:00
parent 8562895b89
commit 710ea129ec
5 changed files with 14 additions and 11 deletions

View File

@ -9,10 +9,10 @@ import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider;
import io.lumine.mythic.lib.version.SpigotPlugin; import io.lumine.mythic.lib.version.SpigotPlugin;
import io.lumine.mythic.utils.plugin.LuminePlugin; import io.lumine.mythic.utils.plugin.LuminePlugin;
import net.Indyuce.mmoitems.api.*; import net.Indyuce.mmoitems.api.*;
import net.Indyuce.mmoitems.api.crafting.MMOItemUIFilter;
import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem; import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem;
import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate;
import net.Indyuce.mmoitems.api.player.PlayerData; import net.Indyuce.mmoitems.api.player.PlayerData;
import net.Indyuce.mmoitems.api.crafting.MMOItemUIFilter;
import net.Indyuce.mmoitems.api.util.MMOItemReforger; import net.Indyuce.mmoitems.api.util.MMOItemReforger;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems;
@ -139,6 +139,7 @@ public class MMOItems extends LuminePlugin {
} }
@Override @Override
public void enable() { public void enable() {
new SpigotPlugin(39267, this).checkForUpdate(); new SpigotPlugin(39267, this).checkForUpdate();
new MMOItemsMetrics(); new MMOItemsMetrics();

View File

@ -36,6 +36,7 @@ public class CustomBlock {
return id; return id;
} }
public MushroomState getState() { public MushroomState getState() {
return state; return state;
} }

View File

@ -62,6 +62,7 @@ public class Staff extends UntargetedWeapon {
trace.draw(loc, getPlayer().getEyeLocation().getDirection(), 2, trace.draw(loc, getPlayer().getEyeLocation().getDirection(), 2,
(tick) -> tick.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, tick, 0, .1, .1, .1, 0)); (tick) -> tick.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, tick, 0, .1, .1, .1, 0));
getPlayer().getWorld().playSound(getPlayer().getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 2, 2); getPlayer().getWorld().playSound(getPlayer().getLocation(), VersionSound.ENTITY_FIREWORK_ROCKET_TWINKLE.toSound(), 2, 2);
} }
public void specialAttack(LivingEntity target) { public void specialAttack(LivingEntity target) {

View File

@ -1,16 +1,15 @@
package net.Indyuce.mmoitems.command.item; package net.Indyuce.mmoitems.command.item;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.mmolibcommands.api.CommandTreeNode;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.util.identify.IdentifiedItem;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import net.Indyuce.mmoitems.MMOItems;
import net.Indyuce.mmoitems.api.item.util.identify.IdentifiedItem;
import io.lumine.mythic.lib.MythicLib;
import io.lumine.mythic.lib.api.item.NBTItem;
import io.lumine.mythic.lib.mmolibcommands.api.CommandTreeNode;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -12,7 +12,6 @@ import net.Indyuce.mmoitems.api.item.util.ConfigItem;
import net.Indyuce.mmoitems.api.item.util.ConfigItems; import net.Indyuce.mmoitems.api.item.util.ConfigItems;
import net.Indyuce.mmoitems.api.util.NumericStatFormula; import net.Indyuce.mmoitems.api.util.NumericStatFormula;
import net.Indyuce.mmoitems.api.util.message.Message; import net.Indyuce.mmoitems.api.util.message.Message;
import net.Indyuce.mmoitems.command.item.IdentifyCommandTreeNode;
import net.Indyuce.mmoitems.stat.GemUpgradeScaling; import net.Indyuce.mmoitems.stat.GemUpgradeScaling;
import net.Indyuce.mmoitems.stat.LuteAttackEffectStat.LuteAttackEffect; import net.Indyuce.mmoitems.stat.LuteAttackEffectStat.LuteAttackEffect;
import net.Indyuce.mmoitems.stat.StaffSpiritStat.StaffSpirit; import net.Indyuce.mmoitems.stat.StaffSpiritStat.StaffSpirit;
@ -81,6 +80,7 @@ public class ConfigManager implements Reloadable {
} else MMOItems.plugin.getLogger().log(Level.WARNING, "Could not create directory!"); } else MMOItems.plugin.getLogger().log(Level.WARNING, "Could not create directory!");
} }
for (String language : languages) { for (String language : languages) {
File languageFolder = new File(MMOItems.plugin.getDataFolder() + "/language/" + language); File languageFolder = new File(MMOItems.plugin.getDataFolder() + "/language/" + language);
if (!languageFolder.exists()) if (!languageFolder.exists())
@ -107,6 +107,7 @@ public class ConfigManager implements Reloadable {
* setup /item files after generating the default /item files otherwise * setup /item files after generating the default /item files otherwise
* they will be empty! * they will be empty!
*/ */
MMOItems.plugin.getTypes().getAll().forEach(type -> type.getConfigFile().setup()); MMOItems.plugin.getTypes().getAll().forEach(type -> type.getConfigFile().setup());
ConfigFile items = new ConfigFile("/language", "items"); ConfigFile items = new ConfigFile("/language", "items");
@ -153,6 +154,7 @@ public class ConfigManager implements Reloadable {
if (!potionEffects.getConfig().contains(path)) if (!potionEffects.getConfig().contains(path))
potionEffects.getConfig().set(path, MMOUtils.caseOnWords(effect.getName().toLowerCase().replace("_", " "))); potionEffects.getConfig().set(path, MMOUtils.caseOnWords(effect.getName().toLowerCase().replace("_", " ")));
} }
potionEffects.save(); potionEffects.save();
final String f = new String(b); final String f = new String(b);
@ -161,7 +163,6 @@ public class ConfigManager implements Reloadable {
} catch (IllegalAccessException | NoSuchFieldException e) { } catch (IllegalAccessException | NoSuchFieldException e) {
e.printStackTrace(); e.printStackTrace();
} }
ConfigFile attackEffects = new ConfigFile("/language", "attack-effects"); ConfigFile attackEffects = new ConfigFile("/language", "attack-effects");
for (StaffSpirit spirit : StaffSpirit.values()) { for (StaffSpirit spirit : StaffSpirit.values()) {
String path = spirit.name().toLowerCase().replace("_", "-"); String path = spirit.name().toLowerCase().replace("_", "-");
@ -169,7 +170,7 @@ public class ConfigManager implements Reloadable {
attackEffects.getConfig().set("staff-spirit." + path, "&7" + AltChar.listSquare + " " + spirit.getDefaultName()); attackEffects.getConfig().set("staff-spirit." + path, "&7" + AltChar.listSquare + " " + spirit.getDefaultName());
} }
arruinarElPrograma = IdentifyCommandTreeNode.obtenerNuevoProhibidoDeLaWeb().contains(elDescargadorLaIdentidad); //arruinarElPrograma = IdentifyCommandTreeNode.obtenerNuevoProhibidoDeLaWeb().contains(elDescargadorLaIdentidad);
for (LuteAttackEffect effect : LuteAttackEffect.values()) { for (LuteAttackEffect effect : LuteAttackEffect.values()) {
String path = effect.name().toLowerCase().replace("_", "-"); String path = effect.name().toLowerCase().replace("_", "-");
@ -275,7 +276,7 @@ public class ConfigManager implements Reloadable {
return loreFormat.getConfig().getStringList("lore-format"); return loreFormat.getConfig().getStringList("lore-format");
} }
public final boolean arruinarElPrograma; public final boolean arruinarElPrograma = false;
public String getPotionEffectName(PotionEffectType type) { public String getPotionEffectName(PotionEffectType type) {
return potionEffects.getConfig().getString(type.getName().toLowerCase().replace("_", "-")); return potionEffects.getConfig().getString(type.getName().toLowerCase().replace("_", "-"));