Skip to content

Commit e506f13

Browse files
fix MC-280220 (#462)
Co-authored-by: Xander <[email protected]>
1 parent 82c3547 commit e506f13

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

PATCHED.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
| Basic | [MC-267376](https://bugs.mojang.com/browse/MC-267376) | You can view through blocks on small scales (near plane clipping) |
4949
| Basic | [MC-267469](https://bugs.mojang.com/browse/MC-267469) | GUI List Entry highlight border not always aligned properly |
5050
| Basic | [MC-268420](https://bugs.mojang.com/browse/MC-268420) | Cooldown indicator flashes when switching items with high attack speed attribute |
51+
| Basic | [MC-280220](https://bugs.mojang.com/browse/MC-280220) | When a Dolphin holds an item, it is rendered upside-down |
5152
| Basic | [MC-298225](https://bugs.mojang.com/browse/MC-298225) | Shapes appear in the end sky with certain distance settings |
5253
| Basic | [MC-298558](https://bugs.mojang.com/browse/MC-298558) | Rain fog calculation can overshoot while game is unresponsive |
5354

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package dev.isxander.debugify.client.mixins.basic.mc280220;
2+
3+
import com.mojang.blaze3d.vertex.PoseStack;
4+
import com.mojang.math.Axis;
5+
import dev.isxander.debugify.fixes.BugFix;
6+
import dev.isxander.debugify.fixes.FixCategory;
7+
import net.minecraft.client.renderer.MultiBufferSource;
8+
import net.minecraft.client.renderer.entity.layers.DolphinCarryingItemLayer;
9+
import net.minecraft.client.renderer.entity.state.DolphinRenderState;
10+
import org.spongepowered.asm.mixin.Mixin;
11+
import org.spongepowered.asm.mixin.injection.At;
12+
import org.spongepowered.asm.mixin.injection.Inject;
13+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14+
15+
@BugFix(id = "MC-280220", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "When a Dolphin holds an item, it is rendered upside-down")
16+
@Mixin(DolphinCarryingItemLayer.class)
17+
public class DolphinCarryingItemLayerMixin {
18+
@Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/client/renderer/entity/state/DolphinRenderState;FF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/item/ItemStackRenderState;render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;II)V"))
19+
private void flipItem(PoseStack poseStack, MultiBufferSource multiBufferSource, int i, DolphinRenderState dolphinRenderState, float f, float g, CallbackInfo ci) {
20+
poseStack.mulPose(Axis.ZP.rotationDegrees(180F));
21+
poseStack.translate(0F, -0.4F, 0F); // Eyeballed value to make items not float
22+
}
23+
}

src/client/resources/debugify.client.mixins.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
"basic.mc251068.WorldSelectionListMixin",
4545
"basic.mc263865.KeyboardHandlerMixin",
4646
"basic.mc267376.GameRendererMixin",
47-
"basic.mc267469.AbstractSelectionListMixin",
4847
"basic.mc268420.GuiMixin",
48+
"basic.mc280220.DolphinCarryingItemLayerMixin",
49+
"basic.mc267469.AbstractSelectionListMixin",
4950
"basic.mc298225.GameRendererMixin",
5051
"basic.mc298558.AtmosphericFogEnvironmentMixin",
5152
"basic.mc35361.MinecraftMixin",

0 commit comments

Comments
 (0)