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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -24,10 +24,6 @@ public interface ImageManager extends Reloadable, ConfigSectionParser {
|
||||
return CONFIG_SECTION_NAME;
|
||||
}
|
||||
|
||||
void delayedLoad();
|
||||
|
||||
void delayedInit();
|
||||
|
||||
default int loadingSequence() {
|
||||
return LoadingSequence.FONT;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,5 @@ public interface ItemManager<T> extends Reloadable, ModelGenerator, ConfigSectio
|
||||
|
||||
Collection<Suggestion> cachedSuggestions();
|
||||
|
||||
void delayedInit();
|
||||
|
||||
Object encodeJava(Key componentType, @Nullable Object component);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -19,7 +19,5 @@ public interface VanillaLootManager extends ConfigSectionParser, Reloadable {
|
||||
return CONFIG_SECTION_NAME;
|
||||
}
|
||||
|
||||
void delayedInit();
|
||||
|
||||
Optional<VanillaLoot> getBlockLoot(int blockState);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ public interface PackManager extends Reloadable {
|
||||
}
|
||||
}
|
||||
|
||||
void delayedInit();
|
||||
|
||||
void generateResourcePack();
|
||||
|
||||
Path resourcePackPath();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,4 +19,10 @@ public interface Reloadable {
|
||||
default void disable() {
|
||||
unload();
|
||||
}
|
||||
|
||||
default void delayedLoad() {
|
||||
}
|
||||
|
||||
default void delayedInit() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,4 @@ import net.momirealms.craftengine.core.plugin.Reloadable;
|
||||
public interface GuiManager extends Reloadable {
|
||||
|
||||
Inventory createInventory(Gui gui, int size);
|
||||
|
||||
void delayedInit();
|
||||
}
|
||||
|
||||
@@ -53,6 +53,4 @@ public interface ClientLangManager extends Reloadable, ConfigSectionParser {
|
||||
}
|
||||
|
||||
void addTranslation(String langId, Map<String, String> translations);
|
||||
|
||||
void delayedLoad();
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -16,6 +16,4 @@ public interface JukeboxSongManager extends Reloadable, ConfigSectionParser {
|
||||
default String[] sectionId() {
|
||||
return CONFIG_SECTION_NAME;
|
||||
}
|
||||
|
||||
void delayedLoad();
|
||||
}
|
||||
|
||||
@@ -13,8 +13,6 @@ public interface WorldManager extends Reloadable {
|
||||
|
||||
CEWorld getWorld(UUID uuid);
|
||||
|
||||
void delayedInit();
|
||||
|
||||
void loadWorld(World world);
|
||||
|
||||
void loadWorld(CEWorld world);
|
||||
|
||||
Reference in New Issue
Block a user