mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
- /dynamic folder deleted
- fixed /mi update apply 6
This commit is contained in:
parent
4a9133fd59
commit
9e1f211586
4
pom.xml
4
pom.xml
@ -43,8 +43,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>9</source>
|
||||
<target>9</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -6,7 +6,6 @@ import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackMessage;
|
||||
import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider;
|
||||
import io.lumine.mythic.lib.version.SpigotPlugin;
|
||||
import io.lumine.mythic.utils.plugin.LuminePlugin;
|
||||
import net.Indyuce.mmoitems.api.ConfigFile;
|
||||
import net.Indyuce.mmoitems.api.ItemTier;
|
||||
import net.Indyuce.mmoitems.api.SoulboundInfo;
|
||||
import net.Indyuce.mmoitems.api.Type;
|
||||
@ -292,7 +291,7 @@ public class MMOItems extends LuminePlugin {
|
||||
getLogger().log(Level.INFO, "Hooked onto Denizen");
|
||||
}*/
|
||||
|
||||
// compatibility with /reload
|
||||
// Compatibility with /reload
|
||||
Bukkit.getScheduler().runTask(this, () -> Bukkit.getOnlinePlayers().forEach(PlayerData::load));
|
||||
|
||||
boolean book = getConfig().getBoolean("recipes.use-recipe-book");
|
||||
@ -309,18 +308,14 @@ public class MMOItems extends LuminePlugin {
|
||||
recipeManager.load(book, amounts);
|
||||
if (amounts) Bukkit.getPluginManager().registerEvents(new CraftingListener(), this);
|
||||
|
||||
// amount and bukkit recipes
|
||||
// Amount and bukkit recipes
|
||||
getLogger().log(Level.INFO, "Loading recipes, please wait...");
|
||||
recipeManager.loadRecipes();
|
||||
|
||||
// main command
|
||||
// Main command
|
||||
MMOItemsCommandTreeRoot mmoitemsCommand = new MMOItemsCommandTreeRoot();
|
||||
getCommand("mmoitems").setExecutor(mmoitemsCommand);
|
||||
getCommand("mmoitems").setTabCompleter(mmoitemsCommand);
|
||||
|
||||
// update item command DISABLED
|
||||
//getCommand("updateitem").setExecutor(new UpdateItemCommand());
|
||||
//getCommand("updateitem").setTabCompleter(new UpdateItemCompletion());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -330,18 +325,13 @@ public class MMOItems extends LuminePlugin {
|
||||
if (!isEnabled())
|
||||
return;
|
||||
|
||||
// save player data
|
||||
// Save player data
|
||||
PlayerData.getLoaded().forEach(PlayerData::save);
|
||||
|
||||
// save item updater data
|
||||
ConfigFile updater = new ConfigFile("/dynamic", "updater");
|
||||
updater.getConfig().getKeys(false).forEach(key -> updater.getConfig().set(key, null));
|
||||
updater.save();
|
||||
|
||||
// drop abandonned soulbound items
|
||||
// Drop abandonned soulbound items
|
||||
SoulboundInfo.getAbandonnedInfo().forEach(SoulboundInfo::dropItems);
|
||||
|
||||
// close inventories
|
||||
// Close inventories
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
if (player.getOpenInventory() != null && player.getOpenInventory().getTopInventory().getHolder() instanceof PluginInventory)
|
||||
player.closeInventory();
|
||||
|
@ -4,6 +4,7 @@ import io.lumine.mythic.lib.damage.AttackMetadata;
|
||||
import io.lumine.mythic.lib.skill.SkillMetadata;
|
||||
import io.lumine.mythic.lib.skill.custom.variable.VariableList;
|
||||
import io.lumine.mythic.lib.skill.custom.variable.VariableScope;
|
||||
import io.lumine.mythic.lib.skill.handler.SkillHandler;
|
||||
import net.Indyuce.mmoitems.ability.metadata.BackwardsCompatibleAbilityMetadata;
|
||||
import net.Indyuce.mmoitems.skill.RegisteredSkill;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
@ -18,8 +19,6 @@ public class BackwardsCompatibleAbility extends Ability<BackwardsCompatibleAbili
|
||||
super(registeredSkill.getHandler().getId(), registeredSkill.getName());
|
||||
|
||||
this.registeredSkill = registeredSkill;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@ -31,6 +30,6 @@ public class BackwardsCompatibleAbility extends Ability<BackwardsCompatibleAbili
|
||||
|
||||
@Override
|
||||
public void whenCast(AttackMetadata attack, BackwardsCompatibleAbilityMetadata ability) {
|
||||
registeredSkill.getHandler().whenCast(ability.getResult(), ability.getMetadata());
|
||||
((SkillHandler) registeredSkill.getHandler()).whenCast(ability.getResult(), ability.getMetadata());
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,12 @@
|
||||
package net.Indyuce.mmoitems.ability;
|
||||
|
||||
import io.lumine.mythic.lib.damage.AttackMetadata;
|
||||
import net.Indyuce.mmoitems.ability.list.vector.Firebolt;
|
||||
import net.Indyuce.mmoitems.ability.metadata.VectorAbilityMetadata;
|
||||
import net.Indyuce.mmoitems.stat.data.AbilityData;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
|
||||
/**
|
||||
* Ability that requires a direction to be cast. For
|
||||
* instance, a projectile like {@link Firebolt}
|
||||
* Ability that requires a direction to be cast
|
||||
*
|
||||
* @deprecated Abilities were moved over to MythicLib.
|
||||
* Abilities are being replaced by {@link io.lumine.mythic.lib.skill.handler.SkillHandler}
|
||||
|
@ -56,7 +56,6 @@ public class ConfigManager implements Reloadable {
|
||||
|
||||
mkdir("layouts");
|
||||
mkdir("item");
|
||||
mkdir("dynamic");
|
||||
mkdir("language");
|
||||
mkdir("language/lore-formats");
|
||||
mkdir("modifiers");
|
||||
|
@ -237,7 +237,7 @@ public class PluginUpdateManager {
|
||||
|
||||
// Apply old modifier name
|
||||
for (String mod : skill.getHandler().getModifiers())
|
||||
config.set("modifier." + mod, Objects.requireNonNullElse(abilities.getString("modifier." + mod), skill.getModifierName(mod)));
|
||||
config.set("modifier." + mod + ".name", Objects.requireNonNullElse(abilities.getString("modifier." + mod), skill.getModifierName(mod)));
|
||||
|
||||
configFile.save();
|
||||
}
|
||||
|
@ -81,8 +81,11 @@ public class SkillManager {
|
||||
config.save();
|
||||
}
|
||||
|
||||
RegisteredSkill skill = new RegisteredSkill(handler, config.getConfig());
|
||||
this.skills.put(handler.getId(), skill);
|
||||
try {
|
||||
this.skills.put(handler.getId(), new RegisteredSkill(handler, config.getConfig()));
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load skill '" + handler.getId() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class RegisteredSkill {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public SkillHandler getHandler() {
|
||||
public SkillHandler<?> getHandler() {
|
||||
return handler;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user