summaryrefslogtreecommitdiff
path: root/src/main/java/lance5057/tDefense/proxy/ClientProxy.java
blob: 7f6aef4cbf9c2f611236a71ad85227396120c7c6 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package lance5057.tDefense.proxy;

import lance5057.tDefense.Reference;
import lance5057.tDefense.TD_Commands;
import lance5057.tDefense.armor.proxy.ArmorClientProxy;
import lance5057.tDefense.baubles.BaublesClientProxy;
import lance5057.tDefense.core.CoreClientProxy;
import lance5057.tDefense.core.CoreItems;
import lance5057.tDefense.core.tools.TDTools;
import lance5057.tDefense.holiday.HolidayClientProxy;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.client.model.ModelLoader;
import slimeknights.tconstruct.common.ModelRegisterUtil;
import slimeknights.tconstruct.library.TinkerRegistryClient;
import slimeknights.tconstruct.library.client.ToolBuildGuiInfo;

//import lance5057.tDefense.core.renderer.TestSkinChanger;

public class ClientProxy extends CommonProxy 
{
	//static final ToolModelLoader toolmodel = new ToolModelLoader();
	//public static final ModelSheath sheath = new ModelSheath();
	//ModifierSoulHandler						SoulHandler;

//	public static ModelTinkersTabard		sheath;
//
//	public static ModelTinkersHelm			helm;
//	public static ModelTinkersBreastplate	breastplate;
//	public static ModelTinkersGrieves		grieves;
//	public static ModelTinkersSabatons		sabatons;
//	public static ModelTinkersGauntlets		gauntlets;
//
//	public static ModelTinkersHood			hood;
//	public static ModelTinkersShawl			shawl;
//	public static ModelTinkersRobe			robe;
//	public static ModelTinkersShoes			shoes;
//
//	public static ModelTinkersCoif			coif;
//	public static ModelTinkersHauberk		hauberk;
//	public static ModelTinkersChausses		chausses;
//	public static ModelTinkersBoots			boots;
	
	public static BaublesClientProxy baubles = new BaublesClientProxy();
	
	ToolBuildGuiInfo roundshieldGUI;
	ToolBuildGuiInfo heatershieldGUI;
	
	ToolBuildGuiInfo zweihanderGUI;
	
	public static CoreClientProxy coreProxy = new CoreClientProxy();
	public static HolidayClientProxy holiProxy = new HolidayClientProxy();
	public static ArmorClientProxy armorProxy = new ArmorClientProxy();
	
	@Override
	public void preInit()
	{
		ClientCommandHandler.instance.registerCommand(new TD_Commands());
		registerToolRenderers();
		
		coreProxy.preInit();
		armorProxy.preInit();
		baubles.preInit();
	}
	
	@Override
	public void init()
	{
//		Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
//	    .register(TDTools.heatershield, 0, new ModelResourceLocation("modid:itemname", "inventory"));
//		
		
		createToolGuis();
		setupToolGuis();
		registerToolGuis();
		
		registerItemRenderer(CoreItems.item_aeonsteelIngot, 0, CoreItems.item_aeonsteelIngot.getUnlocalizedName());
		registerItemRenderer(CoreItems.item_dogbeariumIngot, 0, CoreItems.item_dogbeariumIngot.getUnlocalizedName());
		registerItemRenderer(CoreItems.item_queensgoldIngot, 0, CoreItems.item_queensgoldIngot.getUnlocalizedName());
		
		coreProxy.init();
		armorProxy.init();
		holiProxy.Init();
		baubles.init();
	}
	
	public void registerToolRenderers()
	{
		ModelRegisterUtil.registerToolModel(TDTools.roundshield);
		ModelRegisterUtil.registerToolModel(TDTools.heatershield);
		ModelRegisterUtil.registerToolModel(TDTools.zweihander);
		
	}
	
	public void createToolGuis()
	{
		roundshieldGUI = new ToolBuildGuiInfo(TDTools.roundshield);
		heatershieldGUI = new ToolBuildGuiInfo(TDTools.heatershield);
		zweihanderGUI = new ToolBuildGuiInfo(TDTools.zweihander);
	}
	
	public void setupToolGuis()
	{
		roundshieldGUI.addSlotPosition(34, 15+8);
		roundshieldGUI.addSlotPosition(34, 33+8);
		roundshieldGUI.addSlotPosition(34, 51+8);
		
		heatershieldGUI.addSlotPosition(34, 15+8);
		heatershieldGUI.addSlotPosition(25, 33+8);
		heatershieldGUI.addSlotPosition(43, 33+8);
		heatershieldGUI.addSlotPosition(34, 51+8);
		
		zweihanderGUI.addSlotPosition(34, 15+8);
		zweihanderGUI.addSlotPosition(25, 33+8);
		zweihanderGUI.addSlotPosition(43, 33+8);
		zweihanderGUI.addSlotPosition(34, 51+8);
	}
	
	public void registerToolGuis()
	{
		TinkerRegistryClient.addToolBuilding(roundshieldGUI);
		TinkerRegistryClient.addToolBuilding(heatershieldGUI);
		TinkerRegistryClient.addToolBuilding(zweihanderGUI);
	}
	
	@Override
	public void reloadRenderers()
	{
		setToolGuis();
		
		baubles.reloadRenderers();
	}
	
	public void setToolGuis()
	{
		roundshieldGUI.positions.clear();
		roundshieldGUI.addSlotPosition(34, 15);
		roundshieldGUI.addSlotPosition(34, 33);
		roundshieldGUI.addSlotPosition(34, 51);
		
		heatershieldGUI.positions.clear();
		heatershieldGUI.addSlotPosition(34, 15);
		heatershieldGUI.addSlotPosition(25, 33);
		heatershieldGUI.addSlotPosition(43, 33);
		heatershieldGUI.addSlotPosition(34, 51);
		
		zweihanderGUI.positions.clear();
		zweihanderGUI.addSlotPosition(34, 15);
		zweihanderGUI.addSlotPosition(25, 33);
		zweihanderGUI.addSlotPosition(43, 33);
		zweihanderGUI.addSlotPosition(34, 51);
	}
	
	 public static void registerItemRenderer(Item item, int meta, String id) {
		 ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(Reference.MOD_ID + ":" + id, "inventory"));
		 }
}