render all storage cells

This commit is contained in:
Raoul Van den Berge
2015-12-26 03:14:57 +01:00
parent 271b19cca1
commit 1ee135376d
11 changed files with 119 additions and 0 deletions

View File

@@ -1,10 +1,17 @@
package storagecraft.proxy; package storagecraft.proxy;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.resources.model.ModelBakery;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import storagecraft.StorageCraftBlocks; import storagecraft.StorageCraftBlocks;
import storagecraft.StorageCraftItems;
import storagecraft.item.ItemStorageCell;
import storagecraft.render.BlockCableRenderer; import storagecraft.render.BlockCableRenderer;
import storagecraft.render.ItemCableRenderer; import storagecraft.render.ItemCableRenderer;
import storagecraft.tile.TileCable; import storagecraft.tile.TileCable;
@@ -16,8 +23,30 @@ public class ClientProxy extends CommonProxy
{ {
super.preInit(e); super.preInit(e);
ModelBakery.addVariantName(StorageCraftItems.STORAGE_CELL,
"storagecraft:1k_storage_cell",
"storagecraft:4k_storage_cell",
"storagecraft:16k_storage_cell",
"storagecraft:64k_storage_cell",
"storagecraft:creative_storage_cell"
);
ClientRegistry.bindTileEntitySpecialRenderer(TileCable.class, new BlockCableRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileCable.class, new BlockCableRenderer());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(StorageCraftBlocks.CABLE), new ItemCableRenderer()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(StorageCraftBlocks.CABLE), new ItemCableRenderer());
} }
@Override
public void init(FMLInitializationEvent e)
{
super.init(e);
ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
mesher.register(StorageCraftItems.STORAGE_CELL, ItemStorageCell.TYPE_1K, new ModelResourceLocation("storagecraft:1k_storage_cell", "inventory"));
mesher.register(StorageCraftItems.STORAGE_CELL, ItemStorageCell.TYPE_4K, new ModelResourceLocation("storagecraft:4k_storage_cell", "inventory"));
mesher.register(StorageCraftItems.STORAGE_CELL, ItemStorageCell.TYPE_16K, new ModelResourceLocation("storagecraft:16k_storage_cell", "inventory"));
mesher.register(StorageCraftItems.STORAGE_CELL, ItemStorageCell.TYPE_64K, new ModelResourceLocation("storagecraft:64k_storage_cell", "inventory"));
mesher.register(StorageCraftItems.STORAGE_CELL, ItemStorageCell.TYPE_CREATIVE, new ModelResourceLocation("storagecraft:creative_storage_cell", "inventory"));
}
} }

View File

@@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "storagecraft:items/16k_storage_cell"
},
"display": {
"thirdperson": {
"rotation": [-90, 0, 0],
"translation": [0, 1, -3],
"scale": [0.55, 0.55, 0.55]
},
"firstperson": {
"rotation": [0, -135, 25],
"translation": [0, 4, 2],
"scale": [1.7, 1.7, 1.7]
}
}
}

View File

@@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "storagecraft:items/1k_storage_cell"
},
"display": {
"thirdperson": {
"rotation": [-90, 0, 0],
"translation": [0, 1, -3],
"scale": [0.55, 0.55, 0.55]
},
"firstperson": {
"rotation": [0, -135, 25],
"translation": [0, 4, 2],
"scale": [1.7, 1.7, 1.7]
}
}
}

View File

@@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "storagecraft:items/4k_storage_cell"
},
"display": {
"thirdperson": {
"rotation": [-90, 0, 0],
"translation": [0, 1, -3],
"scale": [0.55, 0.55, 0.55]
},
"firstperson": {
"rotation": [0, -135, 25],
"translation": [0, 4, 2],
"scale": [1.7, 1.7, 1.7]
}
}
}

View File

@@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "storagecraft:items/64k_storage_cell"
},
"display": {
"thirdperson": {
"rotation": [-90, 0, 0],
"translation": [0, 1, -3],
"scale": [0.55, 0.55, 0.55]
},
"firstperson": {
"rotation": [0, -135, 25],
"translation": [0, 4, 2],
"scale": [1.7, 1.7, 1.7]
}
}
}

View File

@@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "storagecraft:items/creative_storage_cell"
},
"display": {
"thirdperson": {
"rotation": [-90, 0, 0],
"translation": [0, 1, -3],
"scale": [0.55, 0.55, 0.55]
},
"firstperson": {
"rotation": [0, -135, 25],
"translation": [0, 4, 2],
"scale": [1.7, 1.7, 1.7]
}
}
}