diff --git a/build.gradle b/build.gradle index d8d8458238..e0a9ff58f3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.5.28' + id 'fabric-loom' version '0.5-SNAPSHOT' } sourceCompatibility = JavaVersion.VERSION_1_8 @@ -77,4 +77,4 @@ task sourcesJar(type: Jar, dependsOn: classes) { jar { from "LICENSE.txt" -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index f41a6ad511..a8c30e6ea4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.16.4 -yarn_mappings=1.16.4+build.1 +minecraft_version=1.16.1 +yarn_mappings=1.16.1+build.21 loader_version=0.10.6+build.214 # Mod Properties @@ -14,4 +14,4 @@ archives_base_name=sodium-fabric # If true, third-party mods will be loaded during runtime in the developer run configurations use_third_party_mods = true -databreaker_version = 0.2.6 \ No newline at end of file +databreaker_version = 0.2.6 diff --git a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java index 8092771a53..06313ea182 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumGameOptionPages.java @@ -16,7 +16,7 @@ import net.minecraft.client.options.AttackIndicator; import net.minecraft.client.options.GraphicsMode; import net.minecraft.client.options.Option; -import net.minecraft.client.options.ParticlesMode; +import net.minecraft.client.options.ParticlesOption; import net.minecraft.client.util.Window; import java.util.ArrayList; @@ -165,10 +165,10 @@ public static OptionPage quality() { .setBinding((opts, value) -> opts.quality.weatherQuality = value, opts -> opts.quality.weatherQuality) .setImpact(OptionImpact.MEDIUM) .build()) - .add(OptionImpl.createBuilder(ParticlesMode.class, vanillaOpts) + .add(OptionImpl.createBuilder(ParticlesOption.class, vanillaOpts) .setName("Particle Quality") .setTooltip("Controls the maximum number of particles which can be present on screen at any one time.") - .setControl(opt -> new CyclingControl<>(opt, ParticlesMode.class, new String[] { "High", "Medium", "Low" })) + .setControl(opt -> new CyclingControl<>(opt, ParticlesOption.class, new String[] { "High", "Medium", "Low" })) .setBinding((opts, value) -> opts.particles = value, (opts) -> opts.particles) .setImpact(OptionImpact.MEDIUM) .build()) diff --git a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumOptionsGUI.java b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumOptionsGUI.java index e5d8541d38..ed843672cb 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumOptionsGUI.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/gui/SodiumOptionsGUI.java @@ -13,10 +13,9 @@ import net.minecraft.client.gui.screen.VideoOptionsScreen; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.LiteralText; -import net.minecraft.text.OrderedText; +import net.minecraft.text.StringRenderable; import net.minecraft.text.TranslatableText; import net.minecraft.util.Formatting; -import net.minecraft.util.Language; import org.lwjgl.glfw.GLFW; import java.util.ArrayList; @@ -193,12 +192,12 @@ private void renderOptionTooltip(MatrixStack matrixStack, ControlElement elem int boxX = dim.getLimitX() + boxPadding; Option option = element.getOption(); - List tooltip = new ArrayList<>(this.textRenderer.wrapLines(option.getTooltip(), boxWidth - (textPadding * 2))); + List tooltip = new ArrayList<>(this.textRenderer.wrapLines(option.getTooltip(), boxWidth - (textPadding * 2))); OptionImpact impact = option.getImpact(); if (impact != null) { - tooltip.add(Language.getInstance().reorder(new LiteralText(Formatting.GRAY + "Performance Impact: " + impact.toDisplayString()))); + tooltip.add(new LiteralText(Formatting.GRAY + "Performance Impact: " + impact.toDisplayString())); } int boxHeight = (tooltip.size() * 12) + boxPadding; diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/SodiumWorldRenderer.java b/src/main/java/me/jellysquid/mods/sodium/client/render/SodiumWorldRenderer.java index 2640cc7ff4..d2cdad2e70 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/SodiumWorldRenderer.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/SodiumWorldRenderer.java @@ -294,7 +294,7 @@ public void renderTileEntities(MatrixStack matrices, BufferBuilderStorage buffer if (stage >= 0) { MatrixStack.Entry entry = matrices.peek(); - VertexConsumer transformer = new OverlayVertexConsumer(bufferBuilders.getEffectVertexConsumers().getBuffer(ModelLoader.BLOCK_DESTRUCTION_RENDER_LAYERS.get(stage)), entry.getModel(), entry.getNormal()); + VertexConsumer transformer = new TransformingVertexConsumer(bufferBuilders.getEffectVertexConsumers().getBuffer(ModelLoader.BLOCK_DESTRUCTION_RENDER_LAYERS.get(stage)), entry.getModel(), entry.getNormal()); consumer = (layer) -> layer.hasCrumbling() ? VertexConsumers.dual(transformer, immediate.getBuffer(layer)) : immediate.getBuffer(layer); } } diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java index f93349c027..0f0c9577e0 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java @@ -379,9 +379,9 @@ private void unloadChunk(int x, int z) { } private ChunkRenderContainer createChunkRender(long pos) { - int x = ChunkSectionPos.unpackX(pos); - int y = ChunkSectionPos.unpackY(pos); - int z = ChunkSectionPos.unpackZ(pos); + int x = ChunkSectionPos.getX(pos); + int y = ChunkSectionPos.getY(pos); + int z = ChunkSectionPos.getZ(pos); ChunkRenderContainer render = new ChunkRenderContainer<>(this.backend, this.renderer, x, y, z); diff --git a/src/main/java/me/jellysquid/mods/sodium/client/world/SodiumChunkManager.java b/src/main/java/me/jellysquid/mods/sodium/client/world/SodiumChunkManager.java index db315cf553..a918567c69 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/world/SodiumChunkManager.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/world/SodiumChunkManager.java @@ -183,13 +183,13 @@ public void setListener(ChunkStatusListener listener) { private void onChunkLoaded(int x, int z, WorldChunk chunk) { // [VanillaCopy] Mark the chunk as eligible for block and sky lighting LightingProvider lightEngine = this.getLightingProvider(); - lightEngine.setColumnEnabled(new ChunkPos(x, z), true); + lightEngine.setLightEnabled(new ChunkPos(x, z), true); ChunkSection[] sections = chunk.getSectionArray(); // [VanillaCopy] Notify the light engine that this chunk's sections have been updated for (int y = 0; y < sections.length; ++y) { - lightEngine.setSectionStatus(ChunkSectionPos.from(x, y, z), ChunkSection.isEmpty(sections[y])); + lightEngine.updateSectionStatus(ChunkSectionPos.from(x, y, z), ChunkSection.isEmpty(sections[y])); } // Sodium doesn't actually use vanilla's global color cache, but we keep it around for compatibility purposes diff --git a/src/main/java/me/jellysquid/mods/sodium/client/world/WorldSlice.java b/src/main/java/me/jellysquid/mods/sodium/client/world/WorldSlice.java index 48aa546a94..8902773750 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/world/WorldSlice.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/world/WorldSlice.java @@ -193,8 +193,8 @@ public void init(ChunkBuilder builder, World world, ChunkSectionPos chunkPos, ChunkSectionPos sectionPos = ChunkSectionPos.from(chunkX, chunkY, chunkZ); int sectionIdx = getLocalSectionIndex(chunkXLocal, chunkYLocal, chunkZLocal); - this.blockLightArrays[sectionIdx] = blockLightProvider.getLightSection(sectionPos); - this.skyLightArrays[sectionIdx] = skyLightProvider.getLightSection(sectionPos); + this.blockLightArrays[sectionIdx] = blockLightProvider.getLightArray(sectionPos); + this.skyLightArrays[sectionIdx] = skyLightProvider.getLightArray(sectionPos); ChunkSection section = null; diff --git a/src/main/java/me/jellysquid/mods/sodium/mixin/features/chunk_rendering/MixinClientWorld.java b/src/main/java/me/jellysquid/mods/sodium/mixin/features/chunk_rendering/MixinClientWorld.java index 832d3e2f1d..616415168b 100644 --- a/src/main/java/me/jellysquid/mods/sodium/mixin/features/chunk_rendering/MixinClientWorld.java +++ b/src/main/java/me/jellysquid/mods/sodium/mixin/features/chunk_rendering/MixinClientWorld.java @@ -27,7 +27,7 @@ public abstract class MixinClientWorld implements ClientWorldExtended { * Captures the biome generation seed so that our own caches can make use of it. */ @Inject(method = "", at = @At("RETURN")) - private void init(ClientPlayNetworkHandler clientPlayNetworkHandler, ClientWorld.Properties properties, RegistryKey registryKey, DimensionType dimensionType, int i, Supplier supplier, WorldRenderer worldRenderer, boolean bl, long seed, CallbackInfo ci) { + private void init(ClientPlayNetworkHandler clientPlayNetworkHandler, ClientWorld.Properties properties, RegistryKey registryKey, RegistryKey registryKey2, DimensionType dimensionType, int i, Supplier supplier, WorldRenderer worldRenderer, boolean bl, long seed, CallbackInfo ci) { this.biomeSeed = seed; } diff --git a/src/main/java/me/jellysquid/mods/sodium/mixin/features/world_ticking/MixinClientWorld.java b/src/main/java/me/jellysquid/mods/sodium/mixin/features/world_ticking/MixinClientWorld.java index cd8f299bad..e45d9d8fbc 100644 --- a/src/main/java/me/jellysquid/mods/sodium/mixin/features/world_ticking/MixinClientWorld.java +++ b/src/main/java/me/jellysquid/mods/sodium/mixin/features/world_ticking/MixinClientWorld.java @@ -30,8 +30,9 @@ public abstract class MixinClientWorld extends World { protected abstract void addParticle(BlockPos pos, BlockState state, ParticleEffect parameters, boolean bl); protected MixinClientWorld(MutableWorldProperties mutableWorldProperties, RegistryKey registryKey, - DimensionType dimensionType, Supplier profiler, boolean bl, boolean bl2, long l) { - super(mutableWorldProperties, registryKey, dimensionType, profiler, bl, bl2, l); + RegistryKey registryKey2, DimensionType dimensionType, + Supplier profiler, boolean bl, boolean bl2, long l) { + super(mutableWorldProperties, registryKey, registryKey2, dimensionType, profiler, bl, bl2, l); } @Redirect(method = "doRandomBlockDisplayTicks", at = @At(value = "NEW", target = "java/util/Random")) @@ -87,7 +88,7 @@ private void performBiomeParticleDisplayTick(BlockPos pos, Random random) { .orElse(null); if (config != null && config.shouldAddParticle(random)) { - this.addParticle(config.getParticle(), + this.addParticle(config.getParticleType(), pos.getX() + random.nextDouble(), pos.getY() + random.nextDouble(), pos.getZ() + random.nextDouble(),