Work around Base Anvil
This commit is contained in:
parent
8a31310a75
commit
f650f22648
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,7 @@ package ru.bclib.items;
|
||||||
import net.fabricmc.api.EnvType;
|
import net.fabricmc.api.EnvType;
|
||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
import net.minecraft.client.renderer.block.model.BlockModel;
|
import net.minecraft.client.renderer.block.model.BlockModel;
|
||||||
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
import net.minecraft.network.chat.TranslatableComponent;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
@ -49,6 +50,8 @@ public class BaseAnvilItem extends BlockItem implements ItemModelProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
public BlockModel getItemModel(ResourceLocation resourceLocation) {
|
||||||
return ((ItemModelProvider) getBlock()).getItemModel(resourceLocation);
|
Block anvilBlock = getBlock();
|
||||||
|
ResourceLocation blockId = Registry.BLOCK.getKey(anvilBlock);
|
||||||
|
return ((ItemModelProvider) anvilBlock).getItemModel(blockId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue