Skip to content

Commit

Permalink
Merge branch 'mc1.18/fabric/dev' into mc1.19/fabric/dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/com/simibubi/create/foundation/mixin/client/MapRendererMapInstanceMixin.java
  • Loading branch information
IThundxr committed Mar 17, 2024
2 parents 6b6bd60 + 2551fd4 commit 22b55af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file added .idea/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static void addStochasticTooltip(List<Widget> itemStacks, List<Processing

ClientEntryStacks.setTooltipProcessor(slot.getCurrentEntry(), (entryStack, tooltip) -> {
int outputIndex = slotIndex - startIndex;
if (slotIndex < startIndex || outputIndex > results.size())
if (slotIndex < startIndex || outputIndex >= results.size())
return tooltip;
ProcessingOutput output = results.get(outputIndex);
float chance = output.getChance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public class MapRendererMapInstanceMixin {
private MapItemSavedData data;

// @Group(name = "custom_decoration_rendering", min = 1, max = 1)
@Inject(method = "draw(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ZI)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;pushPose()V", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD)
// fabric: we inject in a different place compared to forge as otherwise porting lib will skip our rendering entirely
// heads up the warnings aren't real, this injects in a location that exists at runtime but not compile time so mcdev will lie
@Inject(method = "draw(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ZI)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/saveddata/maps/MapDecoration;render(I)Z", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD)
private void onDraw(PoseStack poseStack, MultiBufferSource bufferSource, boolean active, int packedLight, CallbackInfo ci, int i, int j, float f, Matrix4f matrix4f, VertexConsumer vertexConsumer, int index, Iterator<MapDecoration> iterator, MapDecoration decoration) {
if (decoration instanceof CustomRenderedMapDecoration renderer) {
renderer.render(poseStack, bufferSource, active, packedLight, data, index);
Expand Down

0 comments on commit 22b55af

Please sign in to comment.