forked from Chocohead/OptiFabric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes Chocohead#849
- Loading branch information
Showing
5 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...a/me/modmuss50/optifabric/compat/sandwichable/mixin/BuiltinModelItemRendererNewMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package me.modmuss50.optifabric.compat.sandwichable.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import net.minecraft.client.render.VertexConsumerProvider; | ||
import net.minecraft.client.render.item.BuiltinModelItemRenderer; | ||
import net.minecraft.client.render.model.json.ModelTransformation.Mode; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import me.modmuss50.optifabric.compat.InterceptingMixin; | ||
import me.modmuss50.optifabric.compat.Shim; | ||
|
||
@Mixin(BuiltinModelItemRenderer.class) | ||
@InterceptingMixin("io/github/foundationgames/sandwichable/mixin/BuiltinModelItemRendererMixin") | ||
abstract class BuiltinModelItemRendererNewMixin { | ||
@Shim | ||
private native void sandwichable$renderSandwichGui(ItemStack stack, Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo call); | ||
|
||
@Inject(method = "renderRaw", remap = false, | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/item/BlockItem;getBlock()Lnet/minecraft/block/Block;", shift = At.Shift.AFTER, remap = true)) | ||
private void sandwich_render(ItemStack stack, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo call) { | ||
sandwichable$renderSandwichGui(stack, Mode.GROUND, matrices, vertexConsumers, light, overlay, call); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/resources/optifabric.compat.sandwichable.new-mixins.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"parent": "optifabric.mixins.json", | ||
"package": "me.modmuss50.optifabric.compat.sandwichable.mixin", | ||
"plugin": "me.modmuss50.optifabric.compat.sandwichable.SandwichableMixinPlugin", | ||
"mixins": [ | ||
"BuiltinModelItemRendererNewMixin" | ||
] | ||
} |