Invisi-bucket
- Fixed filter slot display issues with Forge's multi-layered item models
This commit is contained in:
parent
af9d6075ff
commit
d1810f5173
1 changed files with 2 additions and 1 deletions
|
@ -16,13 +16,14 @@ import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tags.BlockTags;
|
import net.minecraft.tags.BlockTags;
|
||||||
|
import net.minecraftforge.client.model.ItemMultiLayerBakedModel;
|
||||||
|
|
||||||
public class ValueBoxRenderer {
|
public class ValueBoxRenderer {
|
||||||
|
|
||||||
public static void renderItemIntoValueBox(ItemStack filter, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) {
|
public static void renderItemIntoValueBox(ItemStack filter, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) {
|
||||||
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
|
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
|
||||||
IBakedModel modelWithOverrides = itemRenderer.getModel(filter, Minecraft.getInstance().level, null);
|
IBakedModel modelWithOverrides = itemRenderer.getModel(filter, Minecraft.getInstance().level, null);
|
||||||
boolean blockItem = modelWithOverrides.isGui3d();
|
boolean blockItem = modelWithOverrides.isGui3d() && !(modelWithOverrides instanceof ItemMultiLayerBakedModel);
|
||||||
float scale = (!blockItem ? .5f : 1f) - 1 / 64f;
|
float scale = (!blockItem ? .5f : 1f) - 1 / 64f;
|
||||||
float zOffset = (!blockItem ? -.225f : 0) + customZOffset(filter.getItem());
|
float zOffset = (!blockItem ? -.225f : 0) + customZOffset(filter.getItem());
|
||||||
ms.scale(scale, scale, scale);
|
ms.scale(scale, scale, scale);
|
||||||
|
|
Loading…
Reference in a new issue