diff --git a/build.gradle b/build.gradle index cd43ce45a..940796061 100644 --- a/build.gradle +++ b/build.gradle @@ -338,7 +338,7 @@ curseforge { id = "306612" changelog = ENV.CHANGELOG ?: "No changelog provided" releaseType = project.prerelease as Boolean ? "beta" : "release" - addGameVersion "1.18-Snapshot" + addGameVersion "1.18" addGameVersion "Fabric" mainArtifact(remapJar) { diff --git a/fabric-rendering-data-attachment-v1/src/main/java/net/fabricmc/fabric/mixin/rendering/data/attachment/client/MixinChunkRendererRegionBuilder.java b/fabric-rendering-data-attachment-v1/src/main/java/net/fabricmc/fabric/mixin/rendering/data/attachment/client/MixinChunkRendererRegionBuilder.java index a52fe6fbd..bb219bf00 100644 --- a/fabric-rendering-data-attachment-v1/src/main/java/net/fabricmc/fabric/mixin/rendering/data/attachment/client/MixinChunkRendererRegionBuilder.java +++ b/fabric-rendering-data-attachment-v1/src/main/java/net/fabricmc/fabric/mixin/rendering/data/attachment/client/MixinChunkRendererRegionBuilder.java @@ -30,7 +30,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.class_6850; +import net.minecraft.client.render.chunk.ChunkRendererRegionBuilder; import net.minecraft.client.render.chunk.ChunkRendererRegion; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; @@ -39,18 +39,18 @@ import net.minecraft.world.chunk.WorldChunk; import net.fabricmc.fabric.api.rendering.data.v1.RenderAttachmentBlockEntity; import net.fabricmc.fabric.impl.rendering.data.attachment.RenderDataObjectConsumer; -@Mixin(class_6850.class) +@Mixin(ChunkRendererRegionBuilder.class) public abstract class MixinChunkRendererRegionBuilder { private static final AtomicInteger ERROR_COUNTER = new AtomicInteger(); private static final Logger LOGGER = LogManager.getLogger(); - @Inject(at = @At("RETURN"), method = "method_39969", locals = LocalCapture.CAPTURE_FAILHARD) - private void create(World world, BlockPos startPos, BlockPos endPos, int chunkRadius, CallbackInfoReturnable info, int i, int j, int k, int l, class_6850.class_6851[][] chunkData) { + @Inject(at = @At("RETURN"), method = "build", locals = LocalCapture.CAPTURE_FAILHARD) + private void create(World world, BlockPos startPos, BlockPos endPos, int chunkRadius, CallbackInfoReturnable info, int i, int j, int k, int l, ChunkRendererRegionBuilder.ClientChunk[][] chunkData) { // instantiated lazily - avoids allocation for chunks without any data objects - which is most of them! Long2ObjectOpenHashMap map = null; - for (class_6850.class_6851[] chunkDataOuter : chunkData) { - for (class_6850.class_6851 data : chunkDataOuter) { + for (ChunkRendererRegionBuilder.ClientChunk[] chunkDataOuter : chunkData) { + for (ChunkRendererRegionBuilder.ClientChunk data : chunkDataOuter) { // Hash maps in chunks should generally not be modified outside of client thread // but does happen in practice, due to mods or inconsistent vanilla behaviors, causing // CMEs when we iterate the map. (Vanilla does not iterate these maps when it builds @@ -59,7 +59,7 @@ public abstract class MixinChunkRendererRegionBuilder { // We handle this simply by retrying until it works. Ugly but effective. for (;;) { try { - map = mapChunk(data.method_39971(), startPos, endPos, map); + map = mapChunk(data.getChunk(), startPos, endPos, map); break; } catch (ConcurrentModificationException e) { final int count = ERROR_COUNTER.incrementAndGet(); diff --git a/fabric-rendering-data-attachment-v1/src/main/resources/fabric-rendering-data-attachment-v1.accesswidener b/fabric-rendering-data-attachment-v1/src/main/resources/fabric-rendering-data-attachment-v1.accesswidener index d63d7cadd..2252ea2b0 100644 --- a/fabric-rendering-data-attachment-v1/src/main/resources/fabric-rendering-data-attachment-v1.accesswidener +++ b/fabric-rendering-data-attachment-v1/src/main/resources/fabric-rendering-data-attachment-v1.accesswidener @@ -1,3 +1,3 @@ accessWidener v2 named -accessible class net/minecraft/class_6850$class_6851 +accessible class net/minecraft/client/render/chunk/ChunkRendererRegionBuilder$ClientChunk diff --git a/gradle.properties b/gradle.properties index 029f29c33..28b848f31 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,11 @@ org.gradle.jvmargs=-Xmx2560M version=0.43.1 -minecraft_version=1.18-rc1 +minecraft_version=1.18 yarn_version=+build.1 loader_version=0.12.5 -prerelease=true +prerelease=false # Do not manually update, use the bumpversions task: fabric-api-base-version=0.4.1