diff --git a/src/main/java/folk/sisby/antique_atlas/mixin/MixinHeldItemRenderer.java b/src/main/java/folk/sisby/antique_atlas/mixin/MixinHeldItemRenderer.java index 3562d319..d93e7e48 100644 --- a/src/main/java/folk/sisby/antique_atlas/mixin/MixinHeldItemRenderer.java +++ b/src/main/java/folk/sisby/antique_atlas/mixin/MixinHeldItemRenderer.java @@ -5,6 +5,7 @@ import folk.sisby.antique_atlas.WorldAtlasData; import folk.sisby.antique_atlas.gui.AtlasScreen; import folk.sisby.antique_atlas.gui.tiles.TileRenderIterator; +import folk.sisby.antique_atlas.util.ColorUtil; import folk.sisby.antique_atlas.util.DrawBatcher; import folk.sisby.antique_atlas.util.DrawUtil; import folk.sisby.antique_atlas.util.MathUtil; @@ -103,7 +104,7 @@ void renderFirstPersonAtlas(MatrixStack matrices, VertexConsumerProvider vertexC DyeColor color = landmark.color(); Vector2d markerPoint = new Vector2d(markerX, markerY); float alpha = (float) MathHelper.clamp(MathUtil.innerDistanceToEdge(mapArea, markerPoint) / 32.0, 0, 1); - texture.draw(matrices, vertexConsumers, markerX, markerY, 1, tileChunks, color == null ? null : color.getColorComponents(), 1F, alpha, light); + texture.draw(matrices, vertexConsumers, markerX, markerY, 1, tileChunks, color == null ? null : ColorUtil.getColorFromArgb(color.getEntityColor()), 1F, alpha, light); }); matrices.pop(); diff --git a/src/main/java/folk/sisby/antique_atlas/mixin/MixinModelLoader.java b/src/main/java/folk/sisby/antique_atlas/mixin/MixinModelLoader.java index 5c09beb8..fa0a8d53 100644 --- a/src/main/java/folk/sisby/antique_atlas/mixin/MixinModelLoader.java +++ b/src/main/java/folk/sisby/antique_atlas/mixin/MixinModelLoader.java @@ -18,10 +18,10 @@ @Mixin(ModelLoader.class) public abstract class MixinModelLoader { - @Shadow protected abstract void addModel(ModelIdentifier modelId); + @Shadow protected abstract void loadInventoryVariantItemModel(Identifier id); @Inject(method = "", at = @At(value = "INVOKE", target = "Ljava/util/Map;values()Ljava/util/Collection;")) - private void loadAtlasModel(BlockColors blockColors, Profiler profiler, Map jsonUnbakedModels, Map> blockStates, CallbackInfo ci) { - addModel(AntiqueAtlas.ATLAS_MODEL); + private void loadAtlasModel(BlockColors blockColors, Profiler profiler, Map jsonUnbakedModels, Map blockStates, CallbackInfo ci) { + loadInventoryVariantItemModel(AntiqueAtlas.ATLAS_MODEL.id()); } } diff --git a/src/main/java/folk/sisby/antique_atlas/util/DrawBatcher.java b/src/main/java/folk/sisby/antique_atlas/util/DrawBatcher.java index c33b5bfc..19270532 100644 --- a/src/main/java/folk/sisby/antique_atlas/util/DrawBatcher.java +++ b/src/main/java/folk/sisby/antique_atlas/util/DrawBatcher.java @@ -3,6 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.render.BufferBuilder; import net.minecraft.client.render.BufferRenderer; +import net.minecraft.client.render.BuiltBuffer; import net.minecraft.client.render.GameRenderer; import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.Tessellator; @@ -57,6 +58,9 @@ private void innerAdd(int x1, int x2, int y1, int y2, int z, float u1, float u2, @Override public void close() { - if (bufferBuilder != null) BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); + if (bufferBuilder != null) { + BuiltBuffer bb = bufferBuilder.endNullable(); + if (bb != null) BufferRenderer.drawWithGlobalProgram(bb); + } } }