Skip to content

Commit

Permalink
Band-aid for Fabled loading after
Browse files Browse the repository at this point in the history
(somehow it still can happen, probably if Paper is not used)
  • Loading branch information
Sentropic committed Jul 4, 2024
1 parent dbb643e commit 9a6e1e7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import studio.magemonkey.divinity.hooks.external.*;
import studio.magemonkey.divinity.hooks.external.mythicmobs.MythicMobsHK;
import studio.magemonkey.divinity.hooks.external.mythicmobs.MythicMobsHKv5;
import studio.magemonkey.divinity.modules.list.itemgenerator.ItemGeneratorManager;
import studio.magemonkey.divinity.modules.list.party.PartyManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -73,6 +74,10 @@ public void onPluginEnable(PluginEnableEvent event) {
fabledHook.updateSkills(player);
}
}
ItemGeneratorManager itemgen = Divinity.getInstance()
.getModuleManager()
.getModule(ItemGeneratorManager.class);
if (itemgen != null) itemgen.reload(); // Load missed Fabled attributes
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public FabledHook(@NotNull Divinity plugin) {
super(plugin);
}

public boolean isFabledLoaded() {
return Fabled.isLoaded();
}

@Override
@NotNull
public HookState setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public GeneratorItem(@NotNull Divinity plugin, @NotNull JYML cfg) {
this.addAttributeGenerator(new AttributeGenerator<>(this.plugin,
this,
"generator.fabled-attributes.",
fabledHook == null ? List.of() : fabledHook.getAttributes(),
fabledHook != null && fabledHook.isFabledLoaded() ? fabledHook.getAttributes() : List.of(),
ItemGeneratorManager.PLACE_GEN_FABLED_ATTR));
if (fabledHook != null) {
cfg.addMissing("generator.fabled-attributes", commonItemGenerator.get("generator.fabled-attributes"));
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ provides:
api-version: '1.19'
authors:
- Travja
- Sentropic
- goflish
description: The most advanced, customizable and configurable RPG-Core plugin!
libraries: [ org.apache.commons:commons-lang3:${apache.version} ]
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
main: studio.magemonkey.divinity.Divinity
version: ${project.version}
name: ${project.name}
authors: [ Travja, goflish ]
authors: [ Travja, Sentropic, goflish ]
description: The most advanced, customizable and configurable RPG-Core plugin!
libraries: [ org.apache.commons:commons-lang3:${apache.version} ]
depend: [ Codex ]
Expand Down

0 comments on commit 9a6e1e7

Please sign in to comment.