9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-04 15:41:38 +00:00

change methods

This commit is contained in:
XiaoMoMi
2025-04-03 21:10:22 +08:00
parent 9c8d1c6a8a
commit 0e45cad3f0
16 changed files with 13 additions and 39 deletions

View File

@@ -420,7 +420,7 @@ public class BukkitRecipeManager implements RecipeManager<ItemStack> {
}
@Override
public CompletableFuture<Void> delayedLoad() {
public CompletableFuture<Void> asyncDelayedLoad() {
if (!ConfigManager.enableRecipeSystem()) return CompletableFuture.completedFuture(null);
return this.processVanillaRecipes().thenRun(() -> {
try {

View File

@@ -20,6 +20,10 @@ public interface BlockManager extends Reloadable, ModelGenerator, ConfigSectionP
return CONFIG_SECTION_NAME;
}
default int loadingSequence() {
return LoadingSequence.BLOCK;
}
Collection<ModelGeneration> modelsToGenerate();
Map<Key, Map<String, JsonElement>> blockOverrides();
@@ -35,12 +39,4 @@ public interface BlockManager extends Reloadable, ModelGenerator, ConfigSectionP
Map<Key, Key> soundMapper();
void initSuggestions();
void delayedLoad();
void delayedInit();
default int loadingSequence() {
return LoadingSequence.BLOCK;
}
}

View File

@@ -13,14 +13,10 @@ public interface FurnitureManager extends Reloadable, ConfigSectionParser {
String[] CONFIG_SECTION_NAME = new String[] { "furniture" };
String FURNITURE_ADMIN_NODE = "craftengine.furniture.admin";
void delayedLoad();
void initSuggestions();
Collection<Suggestion> cachedSuggestions();
void delayedInit();
@Override
default String[] sectionId() {
return CONFIG_SECTION_NAME;

View File

@@ -24,10 +24,6 @@ public interface ImageManager extends Reloadable, ConfigSectionParser {
return CONFIG_SECTION_NAME;
}
void delayedLoad();
void delayedInit();
default int loadingSequence() {
return LoadingSequence.FONT;
}

View File

@@ -85,7 +85,5 @@ public interface ItemManager<T> extends Reloadable, ModelGenerator, ConfigSectio
Collection<Suggestion> cachedSuggestions();
void delayedInit();
Object encodeJava(Key componentType, @Nullable Object component);
}

View File

@@ -35,9 +35,7 @@ public interface RecipeManager<T> extends Reloadable, ConfigSectionParser {
@Nullable Recipe<T> getRecipe(Key type, RecipeInput input, @Nullable Key lastRecipe);
CompletableFuture<Void> delayedLoad();
void delayedInit();
CompletableFuture<Void> asyncDelayedLoad();
default int loadingSequence() {
return LoadingSequence.RECIPE;

View File

@@ -19,7 +19,5 @@ public interface VanillaLootManager extends ConfigSectionParser, Reloadable {
return CONFIG_SECTION_NAME;
}
void delayedInit();
Optional<VanillaLoot> getBlockLoot(int blockState);
}

View File

@@ -22,8 +22,6 @@ public interface PackManager extends Reloadable {
}
}
void delayedInit();
void generateResourcePack();
Path resourcePackPath();

View File

@@ -132,7 +132,7 @@ public abstract class CraftEngine implements Plugin {
this.debugger = (s) -> {};
}
} finally {
this.recipeManager.delayedLoad().thenRun(() -> this.isReloading = false);
this.recipeManager.asyncDelayedLoad().thenRun(() -> this.isReloading = false);
}
}

View File

@@ -19,4 +19,10 @@ public interface Reloadable {
default void disable() {
unload();
}
default void delayedLoad() {
}
default void delayedInit() {
}
}

View File

@@ -5,6 +5,4 @@ import net.momirealms.craftengine.core.plugin.Reloadable;
public interface GuiManager extends Reloadable {
Inventory createInventory(Gui gui, int size);
void delayedInit();
}

View File

@@ -53,6 +53,4 @@ public interface ClientLangManager extends Reloadable, ConfigSectionParser {
}
void addTranslation(String langId, Map<String, String> translations);
void delayedLoad();
}

View File

@@ -24,8 +24,6 @@ public interface TranslationManager extends Reloadable, ConfigSectionParser {
void forcedLocale(Locale locale);
void delayedLoad();
String miniMessageTranslation(String key, @Nullable Locale locale);
default Component render(Component component) {

View File

@@ -11,8 +11,6 @@ import java.util.Map;
public interface SoundManager extends Reloadable, ConfigSectionParser {
String[] CONFIG_SECTION_NAME = new String[] {"sounds", "sound"};
void delayedLoad();
Map<Key, SoundEvent> sounds();
JukeboxSongManager jukeboxSongManager();

View File

@@ -16,6 +16,4 @@ public interface JukeboxSongManager extends Reloadable, ConfigSectionParser {
default String[] sectionId() {
return CONFIG_SECTION_NAME;
}
void delayedLoad();
}

View File

@@ -13,8 +13,6 @@ public interface WorldManager extends Reloadable {
CEWorld getWorld(UUID uuid);
void delayedInit();
void loadWorld(World world);
void loadWorld(CEWorld world);