diff options
author | Anthony Hilyard <anthony.hilyard@gmail.com> | 2022-06-14 22:24:22 -0700 |
---|---|---|
committer | Anthony Hilyard <anthony.hilyard@gmail.com> | 2022-06-14 22:24:22 -0700 |
commit | ee81f0ac1cb848609a755a875f5df0f5d51fa881 (patch) | |
tree | 76522b793e92f971f324be7935710c4b3b59ba1f /src/main/java/com/anthonyhilyard/iceberg/mixin/ConfigMenusForgeServerConfigUploaderMixin.java | |
parent | 15a3b944d13e54f4241df78b199403d414b9bd69 (diff) | |
download | Iceberg-ee81f0ac1cb848609a755a875f5df0f5d51fa881.tar.gz Iceberg-ee81f0ac1cb848609a755a875f5df0f5d51fa881.tar.bz2 Iceberg-ee81f0ac1cb848609a755a875f5df0f5d51fa881.zip |
Initial port to 1.19.
Disabled Config Menus for Forge support until it has a 1.19 version.
Disabled AutoRegistry since Forge broke it.
Diffstat (limited to 'src/main/java/com/anthonyhilyard/iceberg/mixin/ConfigMenusForgeServerConfigUploaderMixin.java')
-rw-r--r-- | src/main/java/com/anthonyhilyard/iceberg/mixin/ConfigMenusForgeServerConfigUploaderMixin.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/main/java/com/anthonyhilyard/iceberg/mixin/ConfigMenusForgeServerConfigUploaderMixin.java b/src/main/java/com/anthonyhilyard/iceberg/mixin/ConfigMenusForgeServerConfigUploaderMixin.java deleted file mode 100644 index 003251f..0000000 --- a/src/main/java/com/anthonyhilyard/iceberg/mixin/ConfigMenusForgeServerConfigUploaderMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.anthonyhilyard.iceberg.mixin; - -import java.io.ByteArrayOutputStream; - -import com.anthonyhilyard.iceberg.util.ConfigMenusForgeHelper; -import com.electronwill.nightconfig.toml.TomlFormat; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import fuzs.configmenusforge.ConfigMenusForge; -import fuzs.configmenusforge.client.util.ModConfigSync; -import fuzs.configmenusforge.client.util.ServerConfigUploader; -import fuzs.configmenusforge.network.client.message.C2SSendConfigMessage; -import net.minecraft.client.Minecraft; -import net.minecraftforge.fml.config.ModConfig; - -@Mixin(ServerConfigUploader.class) -public class ConfigMenusForgeServerConfigUploaderMixin -{ - @Inject(method = "saveAndUpload", at = @At("HEAD"), remap = false, cancellable = true) - private static void saveAndUpload(ModConfig config, CallbackInfo info) - { - ConfigMenusForgeHelper.save(config.getSpec()); - ModConfigSync.fireReloadingEvent(config); - if (config.getType() == ModConfig.Type.SERVER) - { - final Minecraft minecraft = Minecraft.getInstance(); - if (minecraft.getConnection() != null && !minecraft.isLocalServer()) - { - final ByteArrayOutputStream stream = new ByteArrayOutputStream(); - TomlFormat.instance().createWriter().write(config.getConfigData(), stream); - ConfigMenusForge.NETWORK.sendToServer(new C2SSendConfigMessage(config.getFileName(), stream.toByteArray())); - } - } - info.cancel(); - } -} |