blob: 1f32d539d661adf4172e7b06aec0e497fe7ec580 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package lv.enes.mc.eris_alchemy.mixin.client;
import lv.enes.mc.eris_alchemy.block.entity.ChestLikeEntity;
import net.minecraft.client.renderer.Sheets;
import net.minecraft.client.resources.model.Material;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.properties.ChestType;
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.CallbackInfoReturnable;
@Mixin(Sheets.class)
public abstract class SheetsMixin {
@Inject(
method = "chooseMaterial(Lnet/minecraft/world/level/block/entity/BlockEntity;Lnet/minecraft/world/level/block/state/properties/ChestType;Z)Lnet/minecraft/client/resources/model/Material;",
at = @At("RETURN"),
cancellable = true
)
private static void chooseMaterial(
BlockEntity entity,
ChestType type,
boolean christmas,
CallbackInfoReturnable<Material> cir
) {
if (entity instanceof ChestLikeEntity chestlike) {
cir.setReturnValue(chestlike.getMaterial());
}
}
}
|