From 0008981be955f7e57080b4215da7039881246f12 Mon Sep 17 00:00:00 2001 From: GregTao Date: Sun, 12 May 2024 17:28:54 +0800 Subject: [PATCH] =?UTF-8?q?1.20.6=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Fabric-1.20.6/gradle.properties | 12 +++ .../top/gregtao/xibaopp/BackgroundWidget.java | 45 +++++++++++ .../top/gregtao/xibaopp/SnowAnimation.java | 80 +++++++++++++++++++ .../gregtao/xibaopp/XibaoPlusPlusConfig.java | 49 ++++++++++++ .../gregtao/xibaopp/XibaoPlusPlusMain.java | 17 ++++ .../gregtao/xibaopp/XibaoPlusPlusMusic.java | 22 +++++ .../java/top/gregtao/xibaopp/XibaoType.java | 43 ++++++++++ .../mixin/DisconnectedScreenAccessor.java | 17 ++++ .../mixin/DisconnectedScreenMixin.java | 45 +++++++++++ .../xibaopp/mixin/MinecraftClientMixin.java | 27 +++++++ .../gregtao/xibaopp/mixin/ScreenMixin.java | 22 +++++ .../gregtao/xibaopp/util/RenderHelper.java | 35 ++++++++ .../src/main/resources/fabric.mod.json | 38 +++++++++ .../src/main/resources/xibaopp.mixins.json | 17 ++++ build.gradle | 8 ++ .../assets/xibaopp/{sounds => }/README.md | 0 settings.gradle | 1 + 17 files changed, 478 insertions(+) create mode 100644 Fabric-1.20.6/gradle.properties create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/BackgroundWidget.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/SnowAnimation.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusConfig.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMain.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMusic.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoType.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenAccessor.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenMixin.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/MinecraftClientMixin.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/ScreenMixin.java create mode 100644 Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/util/RenderHelper.java create mode 100644 Fabric-1.20.6/src/main/resources/fabric.mod.json create mode 100644 Fabric-1.20.6/src/main/resources/xibaopp.mixins.json rename resources/assets/xibaopp/{sounds => }/README.md (100%) diff --git a/Fabric-1.20.6/gradle.properties b/Fabric-1.20.6/gradle.properties new file mode 100644 index 0000000..b69779f --- /dev/null +++ b/Fabric-1.20.6/gradle.properties @@ -0,0 +1,12 @@ +org.gradle.jvmargs=-Xmx2G +loom.platform=fabric + +minecraft_version=1.20.6 +yarn_mappings=1.20.6+build.1 +loader_version=0.15.11 + +mod_version = 0.2.0-release-mc1.20.6 +maven_group = top.gregtao.xibaopp +archives_base_name = XibaoPlusPlus-Fabric + +fabric_version=0.98.0+1.20.6 \ No newline at end of file diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/BackgroundWidget.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/BackgroundWidget.java new file mode 100644 index 0000000..3b3d74f --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/BackgroundWidget.java @@ -0,0 +1,45 @@ +package top.gregtao.xibaopp; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.Drawable; +import net.minecraft.client.gui.Element; +import net.minecraft.client.gui.Selectable; +import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; +import net.minecraft.client.util.Window; +import top.gregtao.xibaopp.util.RenderHelper; + +public class BackgroundWidget implements Drawable, Element, Selectable { + + @Override + public void render(DrawContext context, int mouseX, int mouseY, float delta) { + MinecraftClient client = MinecraftClient.getInstance(); + Window window = client.getWindow(); + int width = window.getScaledWidth(), height = window.getScaledHeight(); + if (XibaoPlusPlusConfig.showPicture) { + RenderHelper.renderStretchTexture(width, height, 225, + XibaoPlusPlusConfig.type.background); + } + if (XibaoPlusPlusConfig.displaySnow || XibaoPlusPlusConfig.tempSnow) { + SnowAnimation.INSTANCE.tick(width, height, XibaoPlusPlusConfig.type.snows); + } + } + + @Override + public void setFocused(boolean focused) { + } + + @Override + public boolean isFocused() { + return false; + } + + @Override + public SelectionType getType() { + return Selectable.SelectionType.NONE; + } + + @Override + public void appendNarrations(NarrationMessageBuilder builder) { + } +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/SnowAnimation.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/SnowAnimation.java new file mode 100644 index 0000000..cd23cbd --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/SnowAnimation.java @@ -0,0 +1,80 @@ +package top.gregtao.xibaopp; + +import net.minecraft.util.Identifier; +import top.gregtao.xibaopp.util.RenderHelper; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +public class SnowAnimation { + public static SnowAnimation INSTANCE; + private Identifier[] source; + private int lastWidth, lastHeight; + private float amount = 0.1f; + private final Random random; + private final List snows; + + public SnowAnimation(Random random) { + this.random = random; + this.snows = new ArrayList<>(); + } + + public void tick(int width, int height, Identifier[] source) { + this.source = source; + if (width != this.lastWidth || height != this.lastHeight) { + this.snows.clear(); + this.lastWidth = width; + this.lastHeight = height; + } + this.spawnGroup(); + for (Snow snow : this.snows) { + RenderHelper.renderParticle(snow.x, height - snow.y, 4, 4, this.source[snow.source % this.source.length]); + snow.move(); + if (snow.y > height) { + snow.removed = true; + } + } + if (this.snows.size() > 500) { + int i = 0; + while (i < this.snows.size() && this.snows.get(i).removed) this.snows.remove(i); + } + } + + public void spawnGroup() { + this.amount += 0.001f; + float realAmount = Math.min(0.4f, this.amount); + if (realAmount < 1) { + if (this.random.nextInt((int) (1 / realAmount)) == 0) this.spawn(); + } else { + for (int i = 1; i <= realAmount; ++i) this.spawn(); + } + if (this.amount >= 0.6f) this.amount = 0.1f; + } + + public int getSourceIndex() { + return this.random.nextInt(this.source.length); + } + + public void spawn() { + int x = random.nextInt(this.lastWidth); + int k = (random.nextInt(4)) * 2 + 1; + this.snows.add(new Snow(x, random.nextInt(2) == 0 ? -k : k, this.getSourceIndex())); + } + +} + +class Snow { + public int baseX, x, y, k, source; + public boolean removed = false; + public Snow(int x, int k, int source) { + this.baseX = this.x = x; + this.k = k; + this.source = source; + this.y = 0; + } + public void move() { + this.y++; + this.x = this.baseX + this.y / this.k; + } +} \ No newline at end of file diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusConfig.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusConfig.java new file mode 100644 index 0000000..439e0ba --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusConfig.java @@ -0,0 +1,49 @@ +package top.gregtao.xibaopp; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Properties; +import java.util.Random; + +public class XibaoPlusPlusConfig { + private static final File file = new File("xibao_plus_plus.properties"); + + public static boolean shouldPlayMusic = false; + public static boolean tempSnow = false; + public static Random random = new Random(); + + public static boolean playMusic = true; + public static boolean showPicture = true; + public static boolean displaySnow = false; + + public static XibaoType type = XibaoType.XIBAO; + + public static void loadConfig() throws Exception { + if (!file.exists()) { + storeConfig(); + return; + } + Properties properties = new Properties(); + properties.load(new FileInputStream(file)); + playMusic = properties.getOrDefault("playMusic", "true").equals("true"); + showPicture = properties.getOrDefault("showPicture", "true").equals("true"); + displaySnow = properties.getOrDefault("displaySnow", "false").equals("true"); + type = XibaoType.getByString(properties.getProperty("type")); + } + + public static void storeConfig() throws IOException { + Properties properties = new Properties(); + properties.setProperty("playMusic", String.valueOf(playMusic)); + properties.setProperty("showPicture", String.valueOf(showPicture)); + properties.setProperty("displaySnow", String.valueOf(displaySnow)); + properties.setProperty("type", type.type); + properties.store(new FileWriter(file), "Xibao Plus Plus"); + } + + public static void switchAlbum() { + XibaoType[] types = XibaoType.values(); + type = types[(type.ordinal() + 1) % types.length]; + } +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMain.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMain.java new file mode 100644 index 0000000..e919291 --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMain.java @@ -0,0 +1,17 @@ +package top.gregtao.xibaopp; + +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; + +@Environment(EnvType.CLIENT) +public class XibaoPlusPlusMain implements ClientModInitializer { + @Override + public void onInitializeClient() { + try { + XibaoPlusPlusConfig.loadConfig(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} \ No newline at end of file diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMusic.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMusic.java new file mode 100644 index 0000000..7d07343 --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoPlusPlusMusic.java @@ -0,0 +1,22 @@ +package top.gregtao.xibaopp; + +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.sound.MusicSound; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.Identifier; + +public class XibaoPlusPlusMusic { + public static RegistryEntry.Reference XIBAO_SOUND_EVENT = registerReference(new Identifier("xibaopp", "xibao")); + public static MusicSound XIBAO_MUSIC = new MusicSound(XIBAO_SOUND_EVENT, 0, 0, true); + public static RegistryEntry.Reference BEIBAO_SOUND_EVENT = registerReference(new Identifier("xibaopp", "beibao")); + public static MusicSound BEIBAO_MUSIC = new MusicSound(BEIBAO_SOUND_EVENT, 0, 0, true); + + private static RegistryEntry.Reference registerReference(Identifier id) { + return registerReference(id, id); + } + private static RegistryEntry.Reference registerReference(Identifier id, Identifier soundId) { + return Registry.registerReference(Registries.SOUND_EVENT, id, SoundEvent.of(soundId)); + } +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoType.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoType.java new file mode 100644 index 0000000..62a228d --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/XibaoType.java @@ -0,0 +1,43 @@ +package top.gregtao.xibaopp; + +import net.minecraft.sound.MusicSound; +import net.minecraft.util.Identifier; + +public enum XibaoType { + XIBAO( + XibaoPlusPlusMusic.XIBAO_MUSIC, + new Identifier("xibaopp", "textures/xibao.png"), + new Identifier[] { + new Identifier("xibaopp", "textures/yellow_snow.png"), + new Identifier("xibaopp", "textures/red_snow.png") + }, + "xibao" + ), + BEIBAO( + XibaoPlusPlusMusic.BEIBAO_MUSIC, + new Identifier("xibaopp", "textures/beibao.png"), + new Identifier[] { + new Identifier("xibaopp", "textures/white_snow.png") + }, + "beibao" + ) + ; + public final MusicSound music; + public final Identifier background; + public final Identifier[] snows; + public final String type; + + XibaoType(MusicSound music, Identifier background, Identifier[] snows, String type) { + this.music = music; + this.background = background; + this.snows = snows; + this.type = type; + } + + public static XibaoType getByString(String type) { + for (XibaoType xibaoType : values()) { + if (type.equals(xibaoType.type)) return xibaoType; + } + return XIBAO; + } +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenAccessor.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenAccessor.java new file mode 100644 index 0000000..c5e1987 --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenAccessor.java @@ -0,0 +1,17 @@ +package top.gregtao.xibaopp.mixin; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.gui.screen.DisconnectedScreen; +import net.minecraft.text.Text; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Environment(EnvType.CLIENT) +@Mixin(DisconnectedScreen.class) +public interface DisconnectedScreenAccessor { + + @Accessor("reason") + Text getReason(); + +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenMixin.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenMixin.java new file mode 100644 index 0000000..f91504e --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/DisconnectedScreenMixin.java @@ -0,0 +1,45 @@ +package top.gregtao.xibaopp.mixin; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.gui.screen.DisconnectedScreen; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.text.Text; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import top.gregtao.xibaopp.SnowAnimation; +import top.gregtao.xibaopp.BackgroundWidget; +import top.gregtao.xibaopp.XibaoPlusPlusConfig; + +@Environment(EnvType.CLIENT) +@Mixin(DisconnectedScreen.class) +public class DisconnectedScreenMixin extends Screen { + + protected DisconnectedScreenMixin(Text title) { + super(title); + } + + @Inject(method = "init", at = @At("TAIL")) + private void initInject(CallbackInfo ci) { + XibaoPlusPlusConfig.shouldPlayMusic = true; + XibaoPlusPlusConfig.tempSnow = false; + this.addDrawableChild(ButtonWidget.builder(Text.translatable("gui.stopMusic"), + button -> XibaoPlusPlusConfig.shouldPlayMusic = !XibaoPlusPlusConfig.shouldPlayMusic) + .dimensions(this.width / 2 - 100, this.height - 22, 66, 20).build()); + this.addDrawableChild(ButtonWidget.builder( + Text.translatable("gui.dropSnow"), + button -> { + SnowAnimation.INSTANCE = new SnowAnimation(XibaoPlusPlusConfig.random); + XibaoPlusPlusConfig.tempSnow = !XibaoPlusPlusConfig.tempSnow; + }).dimensions(this.width / 2 - 33, this.height - 22, 66, 20).build()); + this.addDrawableChild(ButtonWidget.builder( + Text.translatable("gui.switchAlbum"), + button -> XibaoPlusPlusConfig.switchAlbum()) + .dimensions(this.width / 2 + 34, this.height - 22, 66, 20).build()); + if (XibaoPlusPlusConfig.displaySnow) SnowAnimation.INSTANCE = new SnowAnimation(XibaoPlusPlusConfig.random); + this.addDrawableChild(new BackgroundWidget()); + } +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/MinecraftClientMixin.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/MinecraftClientMixin.java new file mode 100644 index 0000000..f03b69d --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/MinecraftClientMixin.java @@ -0,0 +1,27 @@ +package top.gregtao.xibaopp.mixin; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.DisconnectedScreen; +import net.minecraft.sound.MusicSound; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import top.gregtao.xibaopp.XibaoPlusPlusConfig; + +@Environment(EnvType.CLIENT) +@Mixin(MinecraftClient.class) +public class MinecraftClientMixin { + + @Inject(method = "getMusicType", at = @At("TAIL"), cancellable = true) + public void getMusicTypeInject(CallbackInfoReturnable cir) { + if (XibaoPlusPlusConfig.playMusic && XibaoPlusPlusConfig.shouldPlayMusic) { + if (MinecraftClient.getInstance().currentScreen instanceof DisconnectedScreen) { + cir.setReturnValue(XibaoPlusPlusConfig.type.music); + } + } + } + +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/ScreenMixin.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/ScreenMixin.java new file mode 100644 index 0000000..dc82495 --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/mixin/ScreenMixin.java @@ -0,0 +1,22 @@ +package top.gregtao.xibaopp.mixin; + +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.screen.DisconnectedScreen; +import net.minecraft.client.gui.screen.Screen; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(Screen.class) +public abstract class ScreenMixin { + + @Inject(method = "renderBackground(Lnet/minecraft/client/gui/DrawContext;IIF)V", at = @At("HEAD"), cancellable = true) + public void renderBackgroundInject(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { + Screen screen = MinecraftClient.getInstance().currentScreen; + if (screen instanceof DisconnectedScreen) { + ci.cancel(); + } + } +} diff --git a/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/util/RenderHelper.java b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/util/RenderHelper.java new file mode 100644 index 0000000..1656221 --- /dev/null +++ b/Fabric-1.20.6/src/main/java/top/gregtao/xibaopp/util/RenderHelper.java @@ -0,0 +1,35 @@ +package top.gregtao.xibaopp.util; + +import com.mojang.blaze3d.systems.RenderSystem; +import net.minecraft.client.render.*; +import net.minecraft.util.Identifier; + +public class RenderHelper { + public static void renderStretchTexture(int width, int height, int light, Identifier source) { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); + RenderSystem.setShaderTexture(0, source); + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder.vertex(0.0D, height, -1.0D).texture(0, 1).color(light, light, light, 255).next(); + bufferBuilder.vertex(width, height, -1.0D).texture(1, 1).color(light, light, light, 255).next(); + bufferBuilder.vertex(width, 0.0D, -1.0D).texture(1, 0).color(light, light, light, 255).next(); + bufferBuilder.vertex(0.0D, 0.0D, -1.0D).texture(0, 0).color(light, light, light, 255).next(); + tessellator.draw(); + } + + public static void renderParticle(int x, int y, int width, int height, Identifier source) { + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferBuilder = tessellator.getBuffer(); + RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); + RenderSystem.setShaderTexture(0, source); + RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); + bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); + bufferBuilder.vertex(0.0D + x, height + y, 0.0D).texture(0, 1).color(255, 255, 255, 255).next(); + bufferBuilder.vertex(width + x, height + y, 0.0D).texture(1, 1).color(255, 255, 255, 255).next(); + bufferBuilder.vertex(width + x, 0.0D + y, 0.0D).texture(1, 0).color(255, 255, 255, 255).next(); + bufferBuilder.vertex(0.0D + x, 0.0D + y, 0.0D).texture(0, 0).color(255, 255, 255, 255).next(); + tessellator.draw(); + } +} diff --git a/Fabric-1.20.6/src/main/resources/fabric.mod.json b/Fabric-1.20.6/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..745ead0 --- /dev/null +++ b/Fabric-1.20.6/src/main/resources/fabric.mod.json @@ -0,0 +1,38 @@ +{ + "schemaVersion": 1, + "id": "xibaopp", + "version": "${version}", + + "name": "Xibao", + "description": "Congratulations! You had lost the connection!", + "authors": [ + "GregTao", + "TeaCon(灵感)" + ], + "contact": { + "email": "本模组内容若有侵权请联系gregtaoo@outlook.com删除" + }, + + "license": "GPL v3", + "icon": "assets/xibaopp/textures/logo.png", + + "environment": "*", + "entrypoints": { + "client": [ + "top.gregtao.xibaopp.XibaoPlusPlusMain" + ] + }, + "mixins": [ + "xibaopp.mixins.json" + ], + + "depends": { + "fabricloader": ">=0.14.6", + "fabric": "*", + "minecraft": "1.20.6", + "java": ">=21" + }, + "suggests": { + "another-mod": "*" + } +} diff --git a/Fabric-1.20.6/src/main/resources/xibaopp.mixins.json b/Fabric-1.20.6/src/main/resources/xibaopp.mixins.json new file mode 100644 index 0000000..8b82d9a --- /dev/null +++ b/Fabric-1.20.6/src/main/resources/xibaopp.mixins.json @@ -0,0 +1,17 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "top.gregtao.xibaopp.mixin", + "compatibilityLevel": "JAVA_21", + "mixins": [ + ], + "client": [ + "DisconnectedScreenAccessor", + "DisconnectedScreenMixin", + "MinecraftClientMixin", + "ScreenMixin" + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/build.gradle b/build.gradle index 94f5d32..4eb59b6 100644 --- a/build.gradle +++ b/build.gradle @@ -59,6 +59,14 @@ subprojects { } } +project(":Fabric-1.20.6") { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 + + tasks.withType(JavaCompile).configureEach { + it.options.release = 21 + } +} project(":Fabric-1.20.4") { sourceCompatibility = JavaVersion.VERSION_17 diff --git a/resources/assets/xibaopp/sounds/README.md b/resources/assets/xibaopp/README.md similarity index 100% rename from resources/assets/xibaopp/sounds/README.md rename to resources/assets/xibaopp/README.md diff --git a/settings.gradle b/settings.gradle index ef2de41..0e89620 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,6 +9,7 @@ pluginManagement { rootProject.name = 'Xibao-Fabric' +include 'Fabric-1.20.6' include 'Fabric-1.20.4' include 'Fabric-1.20.1' include 'Fabric-1.20'