/
ClientProxy.java
54 lines (45 loc) · 1.46 KB
/
ClientProxy.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package slimeknights.tmechworks.client;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.registries.GameData;
import slimeknights.mantle.item.ItemBlockMeta;
import slimeknights.tmechworks.common.CommonProxy;
import slimeknights.tmechworks.common.MechworksContent;
public class ClientProxy extends CommonProxy
{
public void preInit ()
{
super.preInit();
registerModels();
}
public void init ()
{
super.init();
}
public void postInit ()
{
super.postInit();
}
protected void registerModels ()
{
MechworksContent.ingots.registerItemModels();
MechworksContent.nuggets.registerItemModels();
registerItemBlockMeta(MechworksContent.metals);
registerItemBlockMeta(MechworksContent.drawbridge);
registerItemBlockMeta(MechworksContent.firestarter);
}
protected void registerItemBlockMeta (Block block)
{
if (block != null)
{
((ItemBlockMeta) Item.getItemFromBlock(block)).registerItemModels();
}
}
protected void registerItemBlock(Block block) {
if (block != null) {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName().toString(), "inventory"));
}
}
}