From b9fc3a97027eb94632b15cc126104f838ea87614 Mon Sep 17 00:00:00 2001 From: Yao Chung Hu <30311066+FlashyReese@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:15:41 +0800 Subject: [PATCH] change: Update for 1.21-rc1 --- build.gradle | 4 +- gradle.properties | 8 +- .../sodiumextra/client/ClientTickHandler.java | 2 +- .../client/SodiumExtraClientMod.java | 2 +- .../gui/SodiumExtraGameOptionPages.java | 14 +- .../client/gui/SodiumExtraHud.java | 4 +- .../vertex/formats/TextureColorVertex.java | 9 +- .../render/vertex/formats/WeatherVertex.java | 5 +- .../mods/sodiumextra/compat/IrisCompat.java | 3 +- .../ModelVertexToTerrainSerializer.java | 2 +- .../animation/MixinSpriteAtlasTexture.java | 80 ++++----- .../mixin/fog/MixinBackgroundRenderer.java | 2 +- .../MixinBeaconBlockEntityRenderer.java | 16 +- .../draw_helpers/MixinDrawContext.java | 8 +- .../fast_weather/MixinWorldRenderer.java | 162 ++++++++++-------- .../mixin/particle/MixinFireworkParticle.java | 2 +- .../profiler/MixinEntityRenderDispatcher.java | 4 +- .../MixinBeaconBlockEntityRenderer.java | 6 +- .../entity/MixinItemFrameEntityRenderer.java | 1 - .../entity/MixinLivingEntityRenderer.java | 1 - .../mixin/sun_moon/MixinWorldRenderer.java | 8 +- src/main/resources/fabric.mod.json | 4 +- src/main/resources/sodium-extra.mixins.json | 4 +- 23 files changed, 184 insertions(+), 167 deletions(-) diff --git a/build.gradle b/build.gradle index 1c518621..132402ec 100644 --- a/build.gradle +++ b/build.gradle @@ -58,8 +58,8 @@ dependencies { mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - //modImplementation "me.jellysquid.mods:sodium-fabric:0.5.6+git.d2b4c1f" - modImplementation "maven.modrinth:sodium:${project.sodium_version}" + modImplementation "me.jellysquid.mods:sodium:0.5.9-snapshot+mc1.21-pre3-build.9" + //modImplementation "maven.modrinth:sodium:${project.sodium_version}" /*modImplementation("me.flashyreese.mods:reeses-sodium-options:${project.reeses_sodium_options}") { exclude group: "net.coderbot.iris_mc1_19", module: "iris" }*/ diff --git a/gradle.properties b/gradle.properties index a284a32a..f41a45c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html - minecraft_version=1.20.6 - yarn_mappings=1.20.6+build.1 - loader_version=0.15.10 + minecraft_version=1.21-rc1 + yarn_mappings=1.21-rc1+build.1 + loader_version=0.15.11 # Mod Properties mod_version=0.5.5 @@ -14,5 +14,5 @@ org.gradle.jvmargs=-Xmx1G # Dependencies reeses_sodium_options=1.7.3+mc1.20.5-build.74 sodium_version=mc1.20.6-0.5.8 - fabric_version=0.97.8+1.20.6 + fabric_version=0.100.1+1.21 crowdin_translate=1.4+1.19.3 diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/client/ClientTickHandler.java b/src/main/java/me/flashyreese/mods/sodiumextra/client/ClientTickHandler.java index 518223c2..fb747d11 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/client/ClientTickHandler.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/client/ClientTickHandler.java @@ -8,8 +8,8 @@ import java.util.Queue; public class ClientTickHandler { - private int averageFps, lowestFps, highestFps; private final Queue fpsQueue = EvictingQueue.create(200); + private int averageFps, lowestFps, highestFps; public void onClientInitialize() { ClientTickEvents.START_CLIENT_TICK.register(minecraftClient -> { diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/client/SodiumExtraClientMod.java b/src/main/java/me/flashyreese/mods/sodiumextra/client/SodiumExtraClientMod.java index 57e9cafd..0da8ba5a 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/client/SodiumExtraClientMod.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/client/SodiumExtraClientMod.java @@ -1,7 +1,7 @@ package me.flashyreese.mods.sodiumextra.client; -import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraHud; import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraGameOptions; +import me.flashyreese.mods.sodiumextra.client.gui.SodiumExtraHud; import net.caffeinemc.caffeineconfig.CaffeineConfig; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.EnvType; diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraGameOptionPages.java b/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraGameOptionPages.java index e50fc1a0..3022cdef 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraGameOptionPages.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraGameOptionPages.java @@ -439,13 +439,13 @@ public static OptionPage extra() { ) .build()); groups.add(OptionGroup.createBuilder() - .add(OptionImpl.createBuilder(boolean.class, vanillaOpts) - .setName(Text.translatable("sodium-extra.option.advanced_item_tooltips")) - .setTooltip(Text.translatable("sodium-extra.option.advanced_item_tooltips.tooltip")) - .setControl(TickBoxControl::new) - .setBinding((opts, value) -> opts.advancedItemTooltips = value, opts -> opts.advancedItemTooltips) - .build() - ) + .add(OptionImpl.createBuilder(boolean.class, vanillaOpts) + .setName(Text.translatable("sodium-extra.option.advanced_item_tooltips")) + .setTooltip(Text.translatable("sodium-extra.option.advanced_item_tooltips.tooltip")) + .setControl(TickBoxControl::new) + .setBinding((opts, value) -> opts.advancedItemTooltips = value, opts -> opts.advancedItemTooltips) + .build() + ) .build()); groups.add(OptionGroup.createBuilder() .add(OptionImpl.createBuilder(boolean.class, sodiumExtraOpts) diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraHud.java b/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraHud.java index 850fe02a..bd69f087 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraHud.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/client/gui/SodiumExtraHud.java @@ -7,6 +7,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; +import net.minecraft.client.render.RenderTickCounter; import net.minecraft.text.Text; import net.minecraft.util.math.Vec3d; @@ -46,8 +47,9 @@ public void onStartTick(MinecraftClient client) { this.textList.add(text); } } + @Override - public void onHudRender(DrawContext drawContext, float tickDelta) { + public void onHudRender(DrawContext drawContext, RenderTickCounter renderTickCounter) { if (!this.client.getDebugHud().shouldShowDebugHud() && !this.client.options.hudHidden) { SodiumExtraGameOptions.OverlayCorner overlayCorner = SodiumExtraClientMod.options().extraSettings.overlayCorner; // Calculate starting position based on the overlay corner diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/TextureColorVertex.java b/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/TextureColorVertex.java index c985f510..e77a775a 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/TextureColorVertex.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/TextureColorVertex.java @@ -8,13 +8,13 @@ import org.lwjgl.system.MemoryUtil; public class TextureColorVertex { - public static final VertexFormatDescription FORMAT = VertexFormatRegistry.instance().get(VertexFormats.POSITION_COLOR_TEXTURE); + public static final VertexFormatDescription FORMAT = VertexFormatRegistry.instance().get(VertexFormats.POSITION_TEXTURE_COLOR); public static final int STRIDE = 24; private static final int OFFSET_POSITION = 0; - private static final int OFFSET_COLOR = 12; - private static final int OFFSET_TEXTURE = 16; + private static final int OFFSET_TEXTURE = 12; + private static final int OFFSET_COLOR = 20; public static void write(long ptr, Matrix4f matrix, float x, float y, float z, int color, float u, float v) { float xt = MatrixHelper.transformPositionX(matrix, x, y, z); @@ -29,9 +29,10 @@ public static void write(long ptr, float x, float y, float z, int color, float u MemoryUtil.memPutFloat(ptr + OFFSET_POSITION + 4, y); MemoryUtil.memPutFloat(ptr + OFFSET_POSITION + 8, z); - MemoryUtil.memPutInt(ptr + OFFSET_COLOR, color); MemoryUtil.memPutFloat(ptr + OFFSET_TEXTURE, u); MemoryUtil.memPutFloat(ptr + OFFSET_TEXTURE + 4, v); + + MemoryUtil.memPutInt(ptr + OFFSET_COLOR, color); } } diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/WeatherVertex.java b/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/WeatherVertex.java index 1add9c3b..f9975d82 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/WeatherVertex.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/client/render/vertex/formats/WeatherVertex.java @@ -7,7 +7,6 @@ import net.caffeinemc.mods.sodium.api.vertex.format.VertexFormatDescription; import net.caffeinemc.mods.sodium.api.vertex.format.VertexFormatRegistry; import net.minecraft.client.render.VertexFormats; -import org.lwjgl.system.MemoryStack; import org.lwjgl.system.MemoryUtil; public final class WeatherVertex { @@ -18,14 +17,14 @@ public final class WeatherVertex { private static final int OFFSET_COLOR = 20; private static final int OFFSET_LIGHT = 24; - public static void put(long ptr, float x, float y, float z, int color, float u, float v, int light) { + public static void put(long ptr, float x, float y, float z, float u, float v, int color, int light) { PositionAttribute.put(ptr + OFFSET_POSITION, x, y, z); TextureAttribute.put(ptr + OFFSET_TEXTURE, u, v); ColorAttribute.set(ptr + OFFSET_COLOR, color); LightAttribute.set(ptr + OFFSET_LIGHT, light); } - public static void put(long ptr, float x, float y, float z, int color, float u, float v, int lightU, int lightV) { + public static void put(long ptr, float x, float y, float z, float u, float v, int color, int lightU, int lightV) { PositionAttribute.put(ptr + OFFSET_POSITION, x, y, z); TextureAttribute.put(ptr + OFFSET_TEXTURE, u, v); ColorAttribute.set(ptr + OFFSET_COLOR, color); diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/compat/IrisCompat.java b/src/main/java/me/flashyreese/mods/sodiumextra/compat/IrisCompat.java index 6bbc6782..00b24ab9 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/compat/IrisCompat.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/compat/IrisCompat.java @@ -25,7 +25,8 @@ public class IrisCompat { terrainFormat = (VertexFormat) terrainField.get(null); irisPresent = true; - } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | IllegalAccessException | InvocationTargetException e) { + } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException | IllegalAccessException | + InvocationTargetException e) { irisPresent = false; } } diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/compat/ModelVertexToTerrainSerializer.java b/src/main/java/me/flashyreese/mods/sodiumextra/compat/ModelVertexToTerrainSerializer.java index 83193ff5..a6a21ece 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/compat/ModelVertexToTerrainSerializer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/compat/ModelVertexToTerrainSerializer.java @@ -7,7 +7,7 @@ public class ModelVertexToTerrainSerializer implements VertexSerializer { @Override public void serialize(long src, long dst, int vertexCount) { - for(int i = 0; i < vertexCount; ++i) { + for (int i = 0; i < vertexCount; ++i) { MemoryUtil.memCopy(src, dst, 24); // Copies position, color and texture // todo: overlay src + 24L MemoryUtil.memCopy(src + 28L, dst + 24L, 8); // Copies light and normal diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/animation/MixinSpriteAtlasTexture.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/animation/MixinSpriteAtlasTexture.java index d21a89d9..ae2994ea 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/animation/MixinSpriteAtlasTexture.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/animation/MixinSpriteAtlasTexture.java @@ -19,56 +19,56 @@ public abstract class MixinSpriteAtlasTexture extends AbstractTexture { @Unique private final Map, List> animatedSprites = Map.of( () -> SodiumExtraClientMod.options().animationSettings.water, List.of( - new Identifier("minecraft", "block/water_still"), - new Identifier("minecraft", "block/water_flow") + Identifier.of("minecraft", "block/water_still"), + Identifier.of("minecraft", "block/water_flow") ), () -> SodiumExtraClientMod.options().animationSettings.lava, List.of( - new Identifier("minecraft", "block/lava_still"), - new Identifier("minecraft", "block/lava_flow") + Identifier.of("minecraft", "block/lava_still"), + Identifier.of("minecraft", "block/lava_flow") ), () -> SodiumExtraClientMod.options().animationSettings.portal, List.of( - new Identifier("minecraft", "block/nether_portal") + Identifier.of("minecraft", "block/nether_portal") ), () -> SodiumExtraClientMod.options().animationSettings.fire, List.of( - new Identifier("minecraft", "block/fire_0"), - new Identifier("minecraft", "block/fire_1"), - new Identifier("minecraft", "block/soul_fire_0"), - new Identifier("minecraft", "block/soul_fire_1"), - new Identifier("minecraft", "block/campfire_fire"), - new Identifier("minecraft", "block/campfire_log_lit"), - new Identifier("minecraft", "block/soul_campfire_fire"), - new Identifier("minecraft", "block/soul_campfire_log_lit") + Identifier.of("minecraft", "block/fire_0"), + Identifier.of("minecraft", "block/fire_1"), + Identifier.of("minecraft", "block/soul_fire_0"), + Identifier.of("minecraft", "block/soul_fire_1"), + Identifier.of("minecraft", "block/campfire_fire"), + Identifier.of("minecraft", "block/campfire_log_lit"), + Identifier.of("minecraft", "block/soul_campfire_fire"), + Identifier.of("minecraft", "block/soul_campfire_log_lit") ), () -> SodiumExtraClientMod.options().animationSettings.blockAnimations, List.of( - new Identifier("minecraft", "block/magma"), - new Identifier("minecraft", "block/lantern"), - new Identifier("minecraft", "block/sea_lantern"), - new Identifier("minecraft", "block/soul_lantern"), - new Identifier("minecraft", "block/kelp"), - new Identifier("minecraft", "block/kelp_plant"), - new Identifier("minecraft", "block/seagrass"), - new Identifier("minecraft", "block/tall_seagrass_top"), - new Identifier("minecraft", "block/tall_seagrass_bottom"), - new Identifier("minecraft", "block/warped_stem"), - new Identifier("minecraft", "block/crimson_stem"), - new Identifier("minecraft", "block/blast_furnace_front_on"), - new Identifier("minecraft", "block/smoker_front_on"), - new Identifier("minecraft", "block/stonecutter_saw"), - new Identifier("minecraft", "block/prismarine"), - new Identifier("minecraft", "block/respawn_anchor_top"), - new Identifier("minecraft", "entity/conduit/wind"), - new Identifier("minecraft", "entity/conduit/wind_vertical") + Identifier.of("minecraft", "block/magma"), + Identifier.of("minecraft", "block/lantern"), + Identifier.of("minecraft", "block/sea_lantern"), + Identifier.of("minecraft", "block/soul_lantern"), + Identifier.of("minecraft", "block/kelp"), + Identifier.of("minecraft", "block/kelp_plant"), + Identifier.of("minecraft", "block/seagrass"), + Identifier.of("minecraft", "block/tall_seagrass_top"), + Identifier.of("minecraft", "block/tall_seagrass_bottom"), + Identifier.of("minecraft", "block/warped_stem"), + Identifier.of("minecraft", "block/crimson_stem"), + Identifier.of("minecraft", "block/blast_furnace_front_on"), + Identifier.of("minecraft", "block/smoker_front_on"), + Identifier.of("minecraft", "block/stonecutter_saw"), + Identifier.of("minecraft", "block/prismarine"), + Identifier.of("minecraft", "block/respawn_anchor_top"), + Identifier.of("minecraft", "entity/conduit/wind"), + Identifier.of("minecraft", "entity/conduit/wind_vertical") ), () -> SodiumExtraClientMod.options().animationSettings.sculkSensor, List.of( - new Identifier("minecraft", "block/sculk"), - new Identifier("minecraft", "block/sculk_catalyst_top_bloom"), - new Identifier("minecraft", "block/sculk_catalyst_side_bloom"), - new Identifier("minecraft", "block/sculk_shrieker_inner_top"), - new Identifier("minecraft", "block/sculk_vein"), - new Identifier("minecraft", "block/sculk_shrieker_can_summon_inner_top"), - new Identifier("minecraft", "block/sculk_sensor_tendril_inactive"), - new Identifier("minecraft", "block/sculk_sensor_tendril_active"), - new Identifier("minecraft", "vibration") + Identifier.of("minecraft", "block/sculk"), + Identifier.of("minecraft", "block/sculk_catalyst_top_bloom"), + Identifier.of("minecraft", "block/sculk_catalyst_side_bloom"), + Identifier.of("minecraft", "block/sculk_shrieker_inner_top"), + Identifier.of("minecraft", "block/sculk_vein"), + Identifier.of("minecraft", "block/sculk_shrieker_can_summon_inner_top"), + Identifier.of("minecraft", "block/sculk_sensor_tendril_inactive"), + Identifier.of("minecraft", "block/sculk_sensor_tendril_active"), + Identifier.of("minecraft", "vibration") ) ); diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/fog/MixinBackgroundRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/fog/MixinBackgroundRenderer.java index 603d66d8..7e79ceef 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/fog/MixinBackgroundRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/fog/MixinBackgroundRenderer.java @@ -2,9 +2,9 @@ import com.mojang.blaze3d.systems.RenderSystem; import me.flashyreese.mods.sodiumextra.client.SodiumExtraClientMod; +import net.minecraft.block.enums.CameraSubmersionType; import net.minecraft.client.render.BackgroundRenderer; import net.minecraft.client.render.Camera; -import net.minecraft.client.render.CameraSubmersionType; import net.minecraft.entity.Entity; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/beacon_beam_rendering/MixinBeaconBlockEntityRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/beacon_beam_rendering/MixinBeaconBlockEntityRenderer.java index 9ad137b0..b4ff4881 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/beacon_beam_rendering/MixinBeaconBlockEntityRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/beacon_beam_rendering/MixinBeaconBlockEntityRenderer.java @@ -2,7 +2,6 @@ import me.flashyreese.mods.sodiumextra.compat.IrisCompat; import net.caffeinemc.mods.sodium.api.math.MatrixHelper; -import net.caffeinemc.mods.sodium.api.util.ColorABGR; import net.caffeinemc.mods.sodium.api.vertex.buffer.VertexBufferWriter; import net.caffeinemc.mods.sodium.api.vertex.format.common.ModelVertex; import net.minecraft.block.entity.BeaconBlockEntity; @@ -12,6 +11,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.Identifier; import net.minecraft.util.math.Box; +import net.minecraft.util.math.ColorHelper; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RotationAxis; import org.joml.Matrix3f; @@ -30,8 +30,8 @@ public abstract class MixinBeaconBlockEntityRenderer { * @author FlashyReese * @reason Use optimized vertex writer, also avoids unnecessary allocations */ - @Inject(method = "renderBeam(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/util/Identifier;FFJII[FFF)V", at = @At(value = "HEAD"), cancellable = true) - private static void optimizeRenderBeam(MatrixStack matrices, VertexConsumerProvider vertexConsumerProvider, Identifier textureId, float tickDelta, float heightScale, long worldTime, int yOffset, int maxY, float[] color, float innerRadius, float outerRadius, CallbackInfo ci) { + @Inject(method = "renderBeam(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/util/Identifier;FFJIIIFF)V", at = @At(value = "HEAD"), cancellable = true) + private static void optimizeRenderBeam(MatrixStack matrices, VertexConsumerProvider vertexConsumerProvider, Identifier textureId, float tickDelta, float heightScale, long worldTime, int yOffset, int maxY, int color, float innerRadius, float outerRadius, CallbackInfo ci) { ci.cancel(); if (IrisCompat.isIrisPresent()) { if (IrisCompat.isRenderingShadowPass()) { @@ -45,9 +45,6 @@ private static void optimizeRenderBeam(MatrixStack matrices, VertexConsumerProvi float time = (float) Math.floorMod(worldTime, 40) + tickDelta; float negativeTime = maxY < 0 ? time : -time; float fractionalPart = MathHelper.fractionalPart(negativeTime * 0.2F - (float) MathHelper.floor(negativeTime * 0.1F)); - float red = color[0]; - float green = color[1]; - float blue = color[2]; matrices.push(); matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(time * 2.25F - 45.0F)); float innerX1; @@ -57,13 +54,10 @@ private static void optimizeRenderBeam(MatrixStack matrices, VertexConsumerProvi float innerV2 = -1.0F + fractionalPart; float innerV1 = (float) maxY * heightScale * (0.5F / innerRadius) + innerV2; - int colorNoneTranslucent = ColorABGR.pack(red, green, blue, 1.0F); - int colorTranslucent = ColorABGR.pack(red, green, blue, 0.125F); - try (MemoryStack stack = MemoryStack.stackPush()) { long buffer = stack.nmalloc(2 * 16 * ModelVertex.STRIDE); long ptr = buffer; - ptr = writeBeamLayerVertices(ptr, matrices, colorNoneTranslucent, yOffset, height, 0.0F, innerRadius, innerRadius, 0.0F, innerX3, 0.0F, 0.0F, innerZ4, innerV1, innerV2); + ptr = writeBeamLayerVertices(ptr, matrices, color, yOffset, height, 0.0F, innerRadius, innerRadius, 0.0F, innerX3, 0.0F, 0.0F, innerZ4, innerV1, innerV2); VertexBufferWriter.of(vertexConsumerProvider.getBuffer(RenderLayer.getBeaconBeam(textureId, false))).push(stack, buffer, 16, ModelVertex.FORMAT); matrices.pop(); @@ -75,7 +69,7 @@ private static void optimizeRenderBeam(MatrixStack matrices, VertexConsumerProvi innerV1 = (float) maxY * heightScale + innerV2; buffer = ptr; - ptr = writeBeamLayerVertices(ptr, matrices, colorTranslucent, yOffset, height, innerX1, outerZ1, outerRadius, innerZ2, innerX3, outerRadius, outerRadius, outerRadius, innerV1, innerV2); + ptr = writeBeamLayerVertices(ptr, matrices, ColorHelper.Argb.withAlpha(32, color), yOffset, height, innerX1, outerZ1, outerRadius, innerZ2, innerX3, outerRadius, outerRadius, outerRadius, innerV1, innerV2); VertexBufferWriter.of(vertexConsumerProvider.getBuffer(RenderLayer.getBeaconBeam(textureId, true))).push(stack, buffer, 16, ModelVertex.FORMAT); } matrices.pop(); diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/draw_helpers/MixinDrawContext.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/draw_helpers/MixinDrawContext.java index d4fda853..032cf083 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/draw_helpers/MixinDrawContext.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/draw_helpers/MixinDrawContext.java @@ -119,8 +119,7 @@ public void drawTexturedQuad(Identifier texture, int x1, int x2, int y1, int y2, RenderSystem.setShaderTexture(0, texture); RenderSystem.setShader(GameRenderer::getPositionTexProgram); Matrix4f matrix4f = this.matrices.peek().getPositionMatrix(); - BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); + BufferBuilder bufferBuilder = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE); VertexBufferWriter writer = VertexBufferWriter.of(bufferBuilder); try (MemoryStack stack = MemoryStack.stackPush()) { final long buffer = stack.nmalloc(4 * TextureVertex.STRIDE); @@ -151,11 +150,10 @@ public void drawTexturedQuad(Identifier texture, int x1, int x2, int y1, int y2, @Inject(method = "drawTexturedQuad(Lnet/minecraft/util/Identifier;IIIIIFFFFFFFF)V", at = @At(value = "HEAD"), cancellable = true) public void drawTexturedQuad(Identifier texture, int x1, int x2, int y1, int y2, int z, float u1, float u2, float v1, float v2, float red, float green, float blue, float alpha, CallbackInfo ci) { RenderSystem.setShaderTexture(0, texture); - RenderSystem.setShader(GameRenderer::getPositionColorTexProgram); + RenderSystem.setShader(GameRenderer::getPositionTexColorProgram); RenderSystem.enableBlend(); Matrix4f matrix4f = this.matrices.peek().getPositionMatrix(); - BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR_TEXTURE); + BufferBuilder bufferBuilder = Tessellator.getInstance().begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR); VertexBufferWriter writer = VertexBufferWriter.of(bufferBuilder); int color = ColorABGR.pack(red, green, blue, alpha); try (MemoryStack stack = MemoryStack.stackPush()) { diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/fast_weather/MixinWorldRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/fast_weather/MixinWorldRenderer.java index 3e16a2da..16753318 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/fast_weather/MixinWorldRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/optimizations/fast_weather/MixinWorldRenderer.java @@ -49,119 +49,123 @@ public class MixinWorldRenderer { @Final private float[] NORMAL_LINE_DZ; + @Inject(method = "renderWeather", at = @At(value = "HEAD"), cancellable = true) public void sodiumExtra$renderWeather(LightmapTextureManager manager, float tickDelta, double cameraX, double cameraY, double cameraZ, CallbackInfo ci) { assert this.client.world != null; - float f = this.client.world.getRainGradient(tickDelta); - if (!(f <= 0.0F)) { + float rainGradient = this.client.world.getRainGradient(tickDelta); + if (rainGradient > 0.0F) { manager.enable(); World world = this.client.world; - int abX = MathHelper.floor(cameraX); - int abY = MathHelper.floor(cameraY); - int abZ = MathHelper.floor(cameraZ); + int cameraPosX = MathHelper.floor(cameraX); + int cameraPosY = MathHelper.floor(cameraY); + int cameraPosZ = MathHelper.floor(cameraZ); Tessellator tessellator = Tessellator.getInstance(); - BufferBuilder bufferBuilder = tessellator.getBuffer(); + BufferBuilder bufferBuilder = null; RenderSystem.disableCull(); RenderSystem.enableBlend(); RenderSystem.enableDepthTest(); - int l = 5; - if (MinecraftClient.isFancyGraphicsOrBetter()) { - l = 10; - } + int range = MinecraftClient.isFancyGraphicsOrBetter() ? 10 : 5; RenderSystem.depthMask(MinecraftClient.isFabulousGraphicsOrBetter()); - int m = -1; - float g = (float) this.ticks + tickDelta; + int precipitationType = -1; + float time = (float) this.ticks + tickDelta; RenderSystem.setShader(GameRenderer::getParticleProgram); BlockPos.Mutable mutable = new BlockPos.Mutable(); - for (int z = abZ - l; z <= abZ + l; ++z) { - for (int x = abX - l; x <= abX + l; ++x) { - int p = (z - abZ + 16) * 32 + x - abX + 16; - double d = (double) this.NORMAL_LINE_DX[p] * 0.5; - double e = (double) this.NORMAL_LINE_DZ[p] * 0.5; + for (int z = cameraPosZ - range; z <= cameraPosZ + range; ++z) { + for (int x = cameraPosX - range; x <= cameraPosX + range; ++x) { + int positionIndex = (z - cameraPosZ + 16) * 32 + x - cameraPosX + 16; + double offsetX = (double) this.NORMAL_LINE_DX[positionIndex] * 0.5; + double offsetZ = (double) this.NORMAL_LINE_DZ[positionIndex] * 0.5; mutable.set(x, cameraY, z); + long biomePacked = Utils.packPosition(x, z); Biome biome = this.biomeLong2ReferenceMap.computeIfAbsent(biomePacked, key -> world.getBiome(mutable).value()); if (biome.hasPrecipitation()) { - int q = world.getTopY(Heightmap.Type.MOTION_BLOCKING, x, z); - int r = abY - l; - int s = abY + l; - if (r < q) { - r = q; + int topY = world.getTopY(Heightmap.Type.MOTION_BLOCKING, x, z); + int minY = cameraPosY - range; + int maxY = cameraPosY + range; + if (minY < topY) { + minY = topY; } - if (s < q) { - s = q; + if (maxY < topY) { + maxY = topY; } - int t = Math.max(q, abY); + int adjustedTopY = Math.max(topY, cameraPosY); - if (r != s) { + if (minY != maxY) { Random random = Random.create((long) x * x * 3121 + x * 45238971L ^ (long) z * z * 418711 + z * 13761L); - mutable.set(x, r, z); + mutable.set(x, minY, z); Biome.Precipitation precipitation = biome.getPrecipitation(mutable); if (precipitation == Biome.Precipitation.RAIN) { - if (m != 0) { - if (m >= 0) { - tessellator.draw(); + if (precipitationType != 0) { + if (precipitationType >= 0) { + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } - m = 0; + precipitationType = 0; RenderSystem.setShaderTexture(0, RAIN); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR_LIGHT); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR_LIGHT); } - int u = this.ticks + x * x * 3121 + x * 45238971 + z * z * 418711 + z * 13761 & 31; - float rainOffset = -((float) u + tickDelta) / 32.0F * (3.0F + random.nextFloat()); - double v = (double) x + 0.5 - cameraX; - double w = (double) z + 0.5 - cameraZ; - float distance = (float) Math.sqrt(v * v + w * w) / (float) l; - float y = ((1.0F - distance * distance) * 0.5F + 0.5F) * f; - mutable.set(x, t, z); + int ticksModulus = this.ticks & 131071; + int randomOffset = x * x * 3121 + x * 45238971 + z * z * 418711 + z * 13761 & 0xFF; + float dropLength = 3.0F + random.nextFloat(); + float dropTimeOffset = -((float) (ticksModulus + randomOffset) + tickDelta) / 32.0F * dropLength; + float dropTextureOffset = dropTimeOffset % 32.0F; + + double relativeX = (double) x + 0.5 - cameraX; + double relativeZ = (double) z + 0.5 - cameraZ; + float distance = (float) Math.sqrt(relativeX * relativeX + relativeZ * relativeZ) / (float) range; + float alpha = ((1.0F - distance * distance) * 0.5F + 0.5F) * rainGradient; + mutable.set(x, adjustedTopY, z); + int color = ColorABGR.pack(1.0F, 1.0F, 1.0F, alpha); int light = getLightmapCoordinates(world, mutable); VertexBufferWriter writer = VertexBufferWriter.of(bufferBuilder); - - int color = ColorABGR.pack(1.0F, 1.0F, 1.0F, y); - - writeVertices(cameraX, cameraY, cameraZ, z, x, d, e, r, s, rainOffset, light, writer, color); + write(writer, cameraX, cameraY, cameraZ, x, z, offsetX, offsetZ, minY, maxY, 0, dropTextureOffset, color, light); } else if (precipitation == Biome.Precipitation.SNOW) { - if (m != 1) { - if (m >= 0) { - tessellator.draw(); + if (precipitationType != 1) { + if (precipitationType >= 0) { + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } - m = 1; + precipitationType = 1; RenderSystem.setShaderTexture(0, SNOW); - bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR_LIGHT); + bufferBuilder = tessellator.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE_COLOR_LIGHT); } - float snowOffset = (float) (random.nextDouble() + (double) g * 0.01 * (double) ((float) random.nextGaussian())); - double ac = (double) x + 0.5 - cameraX; - double ad = (double) z + 0.5 - cameraZ; - float y = (float) Math.sqrt(ac * ac + ad * ad) / (float) l; - float ae = ((1.0F - y * y) * 0.3F + 0.5F) * f; - mutable.set(x, t, z); - int af = getLightmapCoordinates(world, mutable); - int ag = af >> 16 & 65535; - int ah = af & 65535; - int ai = (ag * 3 + 240) / 4; - int aj = (ah * 3 + 240) / 4; + float snowFallSpeed = -((float) (this.ticks & 511) + tickDelta) / 512.0F; + float snowTextureOffsetX = (float) (random.nextDouble() + (double) time * 0.01 * (double) ((float) random.nextGaussian())); + float snowTextureOffsetY = (float) (random.nextDouble() + (double) (time * (float) random.nextGaussian()) * 0.001); + + double relativeX = (double) x + 0.5 - cameraX; + double relativeZ = (double) z + 0.5 - cameraZ; + float distance = (float) Math.sqrt(relativeX * relativeX + relativeZ * relativeZ) / (float) range; + float alpha = ((1.0F - distance * distance) * 0.3F + 0.5F) * rainGradient; + mutable.set(x, adjustedTopY, z); + int light = getLightmapCoordinates(world, mutable); + int blockLight = light >> 16 & (LightmapTextureManager.MAX_BLOCK_LIGHT_COORDINATE | 65295); + int skyLight = light & (LightmapTextureManager.MAX_BLOCK_LIGHT_COORDINATE | 65295); + int adjustedBlockLight = (blockLight * 3 + LightmapTextureManager.MAX_BLOCK_LIGHT_COORDINATE) / 4; + int adjustedSkyLight = (skyLight * 3 + LightmapTextureManager.MAX_BLOCK_LIGHT_COORDINATE) / 4; VertexBufferWriter writer = VertexBufferWriter.of(bufferBuilder); - int color = ColorABGR.pack(1.0F, 1.0F, 1.0F, ae); - int light = Utils.packLight(aj, ai); - writeVertices(cameraX, cameraY, cameraZ, z, x, d, e, r, s, snowOffset, light, writer, color); + int color = ColorABGR.pack(1.0F, 1.0F, 1.0F, alpha); + int packedLight = Utils.packLight(adjustedSkyLight, adjustedBlockLight); + write(writer, cameraX, cameraY, cameraZ, x, z, offsetX, offsetZ, minY, maxY, snowTextureOffsetX, snowFallSpeed + snowTextureOffsetY, color, packedLight); } } } } } - if (m >= 0) { - tessellator.draw(); + if (precipitationType >= 0) { + BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); } RenderSystem.enableCull(); @@ -177,21 +181,41 @@ private void postReload(CallbackInfo ci) { } @Unique - private void writeVertices(double cameraX, double cameraY, double cameraZ, int n, int o, double d, double e, int r, int s, float h, int light, VertexBufferWriter writer, int color) { + private void write(VertexBufferWriter writer, double cameraX, double cameraY, double cameraZ, int x, int z, double offsetX, double offsetZ, int minY, int maxY, float textureOffsetX, float textureOffsetY, int color, int light) { try (MemoryStack stack = MemoryStack.stackPush()) { long buffer = stack.nmalloc(4 * WeatherVertex.STRIDE); long ptr = buffer; - WeatherVertex.put(ptr, (float) (o - cameraX - d + 0.5), (float) (s - cameraY), (float) (n - cameraZ - e + 0.5), color, 0.0F, (float) r * 0.25F + h, light); + WeatherVertex.put(ptr, + (float) ((double) x - cameraX - offsetX + 0.5), (float) ((double) maxY - cameraY), (float) ((double) z - cameraZ - offsetZ + 0.5), + 0.0F + textureOffsetX, (float) minY * 0.25F + textureOffsetY, + color, + light + ); ptr += WeatherVertex.STRIDE; - WeatherVertex.put(ptr, (float) (o - cameraX + d + 0.5), (float) (s - cameraY), (float) (n - cameraZ + e + 0.5), color, 1.0F, (float) r * 0.25F + h, light); + WeatherVertex.put(ptr, + (float) ((double) x - cameraX + offsetX + 0.5), (float) ((double) maxY - cameraY), (float) ((double) z - cameraZ + offsetZ + 0.5), + 1.0F + textureOffsetX, (float) minY * 0.25F + textureOffsetY, + color, + light + ); ptr += WeatherVertex.STRIDE; - WeatherVertex.put(ptr, (float) (o - cameraX + d + 0.5), (float) (r - cameraY), (float) (n - cameraZ + e + 0.5), color, 1.0F, (float) s * 0.25F + h, light); + WeatherVertex.put(ptr, + (float) ((double) x - cameraX + offsetX + 0.5), (float) ((double) minY - cameraY), (float) ((double) z - cameraZ + offsetZ + 0.5), + 1.0F + textureOffsetX, (float) maxY * 0.25F + textureOffsetY, + color, + light + ); ptr += WeatherVertex.STRIDE; - WeatherVertex.put(ptr, (float) (o - cameraX - d + 0.5), (float) (r - cameraY), (float) (n - cameraZ - e + 0.5), color, 0.0F, (float) s * 0.25F + h, light); + WeatherVertex.put(ptr, + (float) ((double) x - cameraX - offsetX + 0.5), (float) ((double) minY - cameraY), (float) ((double) z - cameraZ - offsetZ + 0.5), + 0.0F + textureOffsetX, (float) maxY * 0.25F + textureOffsetY, + color, + light + ); ptr += WeatherVertex.STRIDE; writer.push(stack, buffer, 4, WeatherVertex.FORMAT); diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/particle/MixinFireworkParticle.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/particle/MixinFireworkParticle.java index b348fe3e..fbbaed13 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/particle/MixinFireworkParticle.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/particle/MixinFireworkParticle.java @@ -15,7 +15,7 @@ @Mixin(FireworksSparkParticle.FireworkParticle.class) public class MixinFireworkParticle { @Unique - private final Identifier fireworkIdentifier = new Identifier("minecraft", "firework"); + private final Identifier fireworkIdentifier = Identifier.of("minecraft", "firework"); @Inject(method = "addExplosionParticle", at = @At(value = "HEAD"), cancellable = true) public void addExplosionParticle(double x, double y, double z, double velocityX, double velocityY, double velocityZ, IntList colors, IntList targetColors, boolean trail, boolean flicker, CallbackInfo ci) { diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/profiler/MixinEntityRenderDispatcher.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/profiler/MixinEntityRenderDispatcher.java index c555ffa1..e0a4cefd 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/profiler/MixinEntityRenderDispatcher.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/profiler/MixinEntityRenderDispatcher.java @@ -16,11 +16,11 @@ @Mixin(EntityRenderDispatcher.class) public abstract class MixinEntityRenderDispatcher { + private static final WeakHashMap, String> names = new WeakHashMap<>(); + @Shadow public abstract EntityRenderer getRenderer(T entity); - private static final WeakHashMap, String> names = new WeakHashMap<>(); - @Inject(at = @At("HEAD"), method = "render") private void onRender(E entity, double x, double y, double z, float yaw, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) { World world = entity.getWorld(); diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/block/entity/MixinBeaconBlockEntityRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/block/entity/MixinBeaconBlockEntityRenderer.java index d5b2704d..ab749f13 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/block/entity/MixinBeaconBlockEntityRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/block/entity/MixinBeaconBlockEntityRenderer.java @@ -19,7 +19,7 @@ public class MixinBeaconBlockEntityRenderer { @Shadow - private static void renderBeam(MatrixStack matrices, VertexConsumerProvider vertexConsumers, float tickDelta, long worldTime, int yOffset, int maxY, float[] color) { + private static void renderBeam(MatrixStack matrices, VertexConsumerProvider vertexConsumers, float tickDelta, long worldTime, int yOffset, int maxY, int color) { } @Inject(method = "render(Lnet/minecraft/block/entity/BeaconBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At(value = "HEAD"), cancellable = true) @@ -29,8 +29,8 @@ public void render(BeaconBlockEntity beaconBlockEntity, float f, MatrixStack mat } @Coerce - @Redirect(method = "render(Lnet/minecraft/block/entity/BeaconBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/BeaconBlockEntityRenderer;renderBeam(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;FJII[F)V")) - private void modifyMaxY(MatrixStack matrices, VertexConsumerProvider vertexConsumers, float tickDelta, long worldTime, int yOffset, int maxY, float[] color, BeaconBlockEntity beaconBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) { + @Redirect(method = "render(Lnet/minecraft/block/entity/BeaconBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/BeaconBlockEntityRenderer;renderBeam(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;FJIII)V")) + private void modifyMaxY(MatrixStack matrices, VertexConsumerProvider vertexConsumers, float tickDelta, long worldTime, int yOffset, int maxY, int color, BeaconBlockEntity beaconBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) { if (maxY == 1024 && SodiumExtraClientMod.options().renderSettings.limitBeaconBeamHeight) { int lastSegment = beaconBlockEntity.getPos().getY() + yOffset; maxY = Objects.requireNonNull(beaconBlockEntity.getWorld()).getTopY() - lastSegment; diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinItemFrameEntityRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinItemFrameEntityRenderer.java index 04bf8150..ebf0a25b 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinItemFrameEntityRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinItemFrameEntityRenderer.java @@ -4,7 +4,6 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.entity.ItemFrameEntityRenderer; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.entity.LivingEntity; import net.minecraft.entity.decoration.ItemFrameEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinLivingEntityRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinLivingEntityRenderer.java index 235afb32..d9e97d71 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinLivingEntityRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/render/entity/MixinLivingEntityRenderer.java @@ -11,7 +11,6 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.decoration.ArmorStandEntity; -import net.minecraft.entity.decoration.ItemFrameEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/sun_moon/MixinWorldRenderer.java b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/sun_moon/MixinWorldRenderer.java index 783af726..f8828451 100644 --- a/src/main/java/me/flashyreese/mods/sodiumextra/mixin/sun_moon/MixinWorldRenderer.java +++ b/src/main/java/me/flashyreese/mods/sodiumextra/mixin/sun_moon/MixinWorldRenderer.java @@ -47,11 +47,11 @@ public float[] redirectGetFogColorOverride(DimensionEffects instance, float skyA ) private void postWorldRendererReload(CallbackInfo ci) { if (SodiumExtraClientMod.options().detailSettings.sunMoon) { - MOON_PHASES = new Identifier("textures/environment/moon_phases.png"); - SUN = new Identifier("textures/environment/sun.png"); + MOON_PHASES = Identifier.of("textures/environment/moon_phases.png"); + SUN = Identifier.of("textures/environment/sun.png"); } else { - MOON_PHASES = new Identifier("sodium-extra", "textures/transparent.png"); - SUN = new Identifier("sodium-extra", "textures/transparent.png"); + MOON_PHASES = Identifier.of("sodium-extra", "textures/transparent.png"); + SUN = Identifier.of("sodium-extra", "textures/transparent.png"); } } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index c7e4f2f0..fd3256ce 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -54,10 +54,10 @@ "sodium-extra.mixins.json" ], "depends": { - "fabricloader": ">=0.14", + "fabricloader": ">=0.15", "fabric-api": "*", "sodium": ">=0.5.8", - "minecraft": ">=1.20.5" + "minecraft": ">=1.20.6" }, "breaks": { "iris": "<1.7.0", diff --git a/src/main/resources/sodium-extra.mixins.json b/src/main/resources/sodium-extra.mixins.json index d2eda6d0..510dc19a 100644 --- a/src/main/resources/sodium-extra.mixins.json +++ b/src/main/resources/sodium-extra.mixins.json @@ -20,9 +20,9 @@ "optimizations.beacon_beam_rendering.WorldRendererAccessor", "optimizations.draw_helpers.MixinDrawContext", "optimizations.fast_weather.MixinWorldRenderer", + "particle.MixinFireworkParticle", "particle.MixinParticleManager", "particle.MixinWorldRenderer", - "particle.MixinFireworkParticle", "prevent_shaders.MixinGameRenderer", "profiler.MixinBlockEntityRenderDispatcher", "profiler.MixinEntityRenderDispatcher", @@ -44,10 +44,10 @@ "stars.MixinWorldRenderer", "steady_debug_hud.MixinDebugHud", "sun_moon.MixinWorldRenderer", - "toasts.MixinToastManager", "toasts.MixinAdvancementToast", "toasts.MixinRecipeToast", "toasts.MixinSystemToast", + "toasts.MixinToastManager", "toasts.MixinTutorialToast" ], "injectors": {