From df9d2fbe2fcd427cbec30a781cfd49ee644cdca3 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 2 Aug 2023 22:08:01 -0400 Subject: [PATCH] Remove default impl from ModernFixPlatformHooks --- .../platform/ModernFixPlatformHooks.java | 88 ++++--------------- 1 file changed, 19 insertions(+), 69 deletions(-) diff --git a/common/src/main/java/org/embeddedt/modernfix/platform/ModernFixPlatformHooks.java b/common/src/main/java/org/embeddedt/modernfix/platform/ModernFixPlatformHooks.java index 0a89c5f8..9fc41e05 100644 --- a/common/src/main/java/org/embeddedt/modernfix/platform/ModernFixPlatformHooks.java +++ b/common/src/main/java/org/embeddedt/modernfix/platform/ModernFixPlatformHooks.java @@ -18,92 +18,42 @@ import java.util.function.Consumer; public interface ModernFixPlatformHooks { ModernFixPlatformHooks INSTANCE = PlatformHookLoader.findInstance(); - default boolean isClient() { - throw new AssertionError(); - } - + boolean isClient(); - default boolean isDedicatedServer() { - throw new AssertionError(); - } - + boolean isDedicatedServer(); - default String getVersionString() { - throw new AssertionError(); - } + String getVersionString(); + boolean modPresent(String modId); - default boolean modPresent(String modId) { - throw new AssertionError(); - } + boolean isDevEnv(); - - default boolean isDevEnv() { - throw new AssertionError(); - } + void injectPlatformSpecificHacks(); - - default void injectPlatformSpecificHacks() { - throw new AssertionError(); - } + void applyASMTransformers(String mixinClassName, ClassNode targetClass); - - default void applyASMTransformers(String mixinClassName, ClassNode targetClass) { - throw new AssertionError(); - } + MinecraftServer getCurrentServer(); - - default MinecraftServer getCurrentServer() { - throw new AssertionError(); - } + boolean isEarlyLoadingNormally(); - - default boolean isEarlyLoadingNormally() { - throw new AssertionError(); - } + boolean isLoadingNormally(); - - default boolean isLoadingNormally() { - throw new AssertionError(); - } - - - default TextureAtlasSprite loadTextureAtlasSprite(TextureAtlas atlasTexture, + TextureAtlasSprite loadTextureAtlasSprite(TextureAtlas atlasTexture, ResourceManager resourceManager, TextureAtlasSprite.Info textureInfo, Resource resource, int atlasWidth, int atlasHeight, int spriteX, int spriteY, int mipmapLevel, - NativeImage image) { - throw new AssertionError(); - } + NativeImage image); + Path getGameDirectory(); + + void sendPacket(ServerPlayer player, Object packet); - default Path getGameDirectory() { - throw new AssertionError(); - } + void onServerCommandRegister(Consumer> handler); - - default void sendPacket(ServerPlayer player, Object packet) { - throw new AssertionError(); - } + Multimap getCustomModOptions(); - - default void onServerCommandRegister(Consumer> handler) { - throw new AssertionError(); - } + void onLaunchComplete(); - - default Multimap getCustomModOptions() { - throw new AssertionError(); - } - - - default void onLaunchComplete() { - - } - - - default String getPlatformName() { - throw new AssertionError(); - } + String getPlatformName(); }