Skip to content

Commit

Permalink
Instantiate custom feature managers only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 12, 2024
1 parent 2e9eb5a commit 9994c33
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.slqmy.template_paper_plugin.custom_entity.CustomEntityManager;
import net.slqmy.template_paper_plugin.custom_item.CustomItem;
import net.slqmy.template_paper_plugin.custom_item.CustomItemManager;
import net.slqmy.template_paper_plugin.custom_multiblock.CustomMultiblock;
import net.slqmy.template_paper_plugin.custom_multiblock.CustomMultiblockManager;
import net.slqmy.template_paper_plugin.data.player.PlayerDataManager;
import net.slqmy.template_paper_plugin.file.FileManager;
Expand Down Expand Up @@ -96,9 +97,15 @@ public void onEnable() {
languageManager = new LanguageManager(this);
resourcePackManager = new ResourcePackManager(this);
httpServerManager = new HttpServerManager(this);
customItemManager = new CustomItemManager(this);
customEntityManager = new CustomEntityManager(this);
customMultiblockManager = new CustomMultiblockManager(this);
if (CustomItem.values().length != 0) {
customItemManager = new CustomItemManager(this);
}
if (CustomEntity.values().length != 0) {
customEntityManager = new CustomEntityManager(this);
}
if (CustomMultiblock.values().length != 0) {
customMultiblockManager = new CustomMultiblockManager(this);
}

new SetLanguageCommand(this);

Expand Down

0 comments on commit 9994c33

Please sign in to comment.