Merge pull request #406 from Arcaratus/bloodmagic1.8
Add BlockRender code
This commit is contained in:
commit
cd5a52c7fb
|
@ -288,6 +288,8 @@ import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
|
|||
@Mod(modid = "AWWayofTime", name = "AlchemicalWizardry", version = "v1.3.3", guiFactory = "WayofTime.alchemicalWizardry.client.gui.ConfigGuiFactory")
|
||||
public class AlchemicalWizardry
|
||||
{
|
||||
public static String MODID = "AWWayofTime"; //Temporary
|
||||
|
||||
public static boolean parseTextFiles = false;
|
||||
|
||||
public static boolean doMeteorsDestroyBlocks = true;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package WayofTime.alchemicalWizardry;
|
||||
|
||||
import WayofTime.alchemicalWizardry.client.BlockRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
@ -171,6 +172,8 @@ public class ModBlocks
|
|||
GameRegistry.registerBlock(block, unlocalizedName);
|
||||
}
|
||||
|
||||
BlockRenderer.registerBlock(block);
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
|
@ -191,6 +194,8 @@ public class ModBlocks
|
|||
GameRegistry.registerBlock(block, itemBlockClass, unlocalizedName);
|
||||
}
|
||||
|
||||
BlockRenderer.registerBlock(block);
|
||||
|
||||
return block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package WayofTime.alchemicalWizardry.client;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class BlockRenderer
|
||||
{
|
||||
public static void registerBlock(Block block)
|
||||
{
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation("alchemicalwizardry:" + block.getUnlocalizedName().substring(5), "inventory"));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue