Okay... They render now...
This commit is contained in:
parent
b45172294d
commit
07b1f36594
|
@ -8,7 +8,10 @@ import WayofTime.alchemicalWizardry.block.BlockRitualHome;
|
|||
import WayofTime.alchemicalWizardry.item.block.ItemBlockRitualHome;
|
||||
import WayofTime.alchemicalWizardry.util.helper.InventoryRenderHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
|
|
|
@ -45,9 +45,6 @@ public class InventoryRenderHelper {
|
|||
* @param name - Name of the model JSON
|
||||
*/
|
||||
public void itemRender(Item item, int meta, String name) {
|
||||
if (item instanceof ItemBlock && name.startsWith("ItemBlock"))
|
||||
name = name.replace("Item", "");
|
||||
|
||||
String resName = domain + name;
|
||||
|
||||
ModelBakery.addVariantName(item, resName);
|
||||
|
@ -61,7 +58,7 @@ public class InventoryRenderHelper {
|
|||
* @param meta - Meta of Item
|
||||
*/
|
||||
public void itemRender(Item item, int meta) {
|
||||
itemRender(item, meta, item.getClass().getSimpleName() + meta);
|
||||
itemRender(item, meta, getClassName(item) + meta);
|
||||
}
|
||||
|
||||
public void itemRender(Item item, String name) {
|
||||
|
@ -74,7 +71,7 @@ public class InventoryRenderHelper {
|
|||
* @param item - Item to register Model for
|
||||
*/
|
||||
public void itemRender(Item item) {
|
||||
itemRender(item, 0, item.getClass().getSimpleName());
|
||||
itemRender(item, 0, getClassName(item));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -88,7 +85,7 @@ public class InventoryRenderHelper {
|
|||
ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return new ModelResourceLocation(domain + toRender.getClass().getSimpleName(), "inventory");
|
||||
return new ModelResourceLocation(domain + getClassName(toRender), "inventory");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -125,4 +122,8 @@ public class InventoryRenderHelper {
|
|||
public static Item getItemFromBlock(Block block) {
|
||||
return Item.getItemFromBlock(block);
|
||||
}
|
||||
|
||||
private static String getClassName(Item item) {
|
||||
return item instanceof ItemBlock ? Block.getBlockFromItem(item).getClass().getSimpleName() : item.getClass().getSimpleName();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,6 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"textures": {
|
||||
"all": "alchemicalwizardry:blocks/MasterRitualStone"
|
||||
},
|
||||
"model": "cube_all",
|
||||
"uvlock": true
|
||||
},
|
||||
"variants": {
|
||||
"meta": {
|
||||
0: {
|
||||
"textures": {
|
||||
"all": "alchemicalwizardry:blocks/MasterRitualStone"
|
||||
}
|
||||
},
|
||||
1: {
|
||||
"textures": {
|
||||
"all": "alchemicalwizardry:blocks/ImperfectRitualStone"
|
||||
}
|
||||
}
|
||||
}
|
||||
"meta=0": { "model": "alchemicalwizardry:BlockRitualHome0" },
|
||||
"meta=1": { "model": "alchemicalwizardry:BlockRitualHome1" }
|
||||
}
|
||||
}
|
|
@ -58,6 +58,9 @@ item.AlchemicalWizardry.sigil.divination.name=Divination Sigil
|
|||
|
||||
# Blocks
|
||||
tile.AlchemicalWizardry.fluid.lifeEssence.name=Life Essence
|
||||
tile.AlchemicalWizardry.stone.ritual.master.name=Master Ritual Stone
|
||||
tile.AlchemicalWizardry.stone.ritual.imperfect.name=Imperfect Ritual Stone
|
||||
tile.AlchemicalWizardry.altar.name=Blood Altar
|
||||
|
||||
# Tooltips
|
||||
tooltip.AlchemicalWizardry.orb.desc=Stores raw Life Essence
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "alchemicalwizardry:blocks/MasterRitualStone"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "alchemicalwizardry:blocks/ImperfectRitualStone"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "alchemicalwizardry:block/BlockRitualHome0",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "alchemicalwizardry:block/BlockRitualHome1",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue