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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
package gtPlusPlus.core.proxy;
import java.net.URL;
import java.util.HashSet;
import java.util.Scanner;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.GTplusplus;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.australia.entity.model.ModelBoar;
import gtPlusPlus.australia.entity.model.ModelDingo;
import gtPlusPlus.australia.entity.model.ModelOctopus;
import gtPlusPlus.australia.entity.render.RenderAustralianSpider;
import gtPlusPlus.australia.entity.render.RenderBoar;
import gtPlusPlus.australia.entity.render.RenderDingo;
import gtPlusPlus.australia.entity.render.RenderOctopus;
import gtPlusPlus.australia.entity.type.EntityAustralianSpiderBase;
import gtPlusPlus.australia.entity.type.EntityBoar;
import gtPlusPlus.australia.entity.type.EntityDingo;
import gtPlusPlus.australia.entity.type.EntityOctopus;
import gtPlusPlus.core.client.model.ModelGiantChicken;
import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer;
import gtPlusPlus.core.client.renderer.RenderDecayChest;
import gtPlusPlus.core.client.renderer.RenderGiantChicken;
import gtPlusPlus.core.client.renderer.RenderMiningExplosivesPrimed;
import gtPlusPlus.core.client.renderer.RenderPlasmaBolt;
import gtPlusPlus.core.client.renderer.RenderSickBlaze;
import gtPlusPlus.core.client.renderer.RenderStaballoyConstruct;
import gtPlusPlus.core.client.renderer.RenderToxinball;
import gtPlusPlus.core.common.CommonProxy;
import gtPlusPlus.core.common.compat.COMPAT_PlayerAPI;
import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
import gtPlusPlus.core.entity.EntityTeslaTowerLightning;
import gtPlusPlus.core.entity.monster.EntityGiantChickenBase;
import gtPlusPlus.core.entity.monster.EntitySickBlaze;
import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
import gtPlusPlus.core.entity.projectile.EntityHydrofluoricAcidPotion;
import gtPlusPlus.core.entity.projectile.EntitySulfuricAcidPotion;
import gtPlusPlus.core.entity.projectile.EntityToxinballSmall;
import gtPlusPlus.core.handler.render.FirepitRender;
import gtPlusPlus.core.item.ModItems;
import gtPlusPlus.core.lib.CORE.ConfigSwitches;
import gtPlusPlus.core.lib.LoadedMods;
import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
import gtPlusPlus.core.tileentities.general.TileEntityFirepit;
import gtPlusPlus.core.util.minecraft.particles.EntityParticleFXMysterious;
import gtPlusPlus.xmod.gregtech.common.render.GTPP_CapeRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.entity.Entity;
public class ClientProxy extends CommonProxy implements Runnable{
private final GTPP_CapeRenderer mCapeRenderer;
@SideOnly(Side.CLIENT)
public static boolean mFancyGraphics = false;
public ClientProxy(){
mCapeRenderer = new GTPP_CapeRenderer();
//Get Graphics Mode.
mFancyGraphics = Minecraft.isFancyGraphicsEnabled();
}
@SubscribeEvent
public void receiveRenderSpecialsEvent(net.minecraftforge.client.event.RenderPlayerEvent.Specials.Pre aEvent) {
if (ConfigSwitches.enableCustomCapes){
mCapeRenderer.receiveRenderSpecialsEvent(aEvent);
}
}
@SideOnly(Side.CLIENT)
public static String playerName = "";
@Override
public void preInit(final FMLPreInitializationEvent e) {
super.preInit(e);
if (ConfigSwitches.enableCustomCapes){
onPreLoad();
}
//Do this weird things for textures.
GTplusplus.loadTextures();
//We boot up the sneak manager.
if (LoadedMods.PlayerAPI){
this.init_PlayerAPI_PRE();
}
}
@Override
public void init(final FMLInitializationEvent e) {
if (LoadedMods.PlayerAPI){
this.init_PlayerAPI_INIT();
}
/**
* Custom Block Renderers
*/
new CustomOreBlockRenderer();
super.init(e);
}
@Override
public void postInit(final FMLPostInitializationEvent e) {
super.postInit(e);
}
@Override
public void registerRenderThings(){
// Standard GT++
/**
* Entities
*/
RenderingRegistry.registerEntityRenderingHandler(EntityPrimedMiningExplosive.class, new RenderMiningExplosivesPrimed());
RenderingRegistry.registerEntityRenderingHandler(EntitySickBlaze.class, new RenderSickBlaze());
RenderingRegistry.registerEntityRenderingHandler(EntityStaballoyConstruct.class, new RenderStaballoyConstruct());
RenderingRegistry.registerEntityRenderingHandler(EntityToxinballSmall.class, new RenderToxinball(1F));
RenderingRegistry.registerEntityRenderingHandler(EntitySulfuricAcidPotion.class, new RenderSnowball(ModItems.itemSulfuricPotion));
RenderingRegistry.registerEntityRenderingHandler(EntityHydrofluoricAcidPotion.class, new RenderSnowball(ModItems.itemHydrofluoricPotion));
RenderingRegistry.registerEntityRenderingHandler(EntityTeslaTowerLightning.class, new RenderPlasmaBolt());
RenderingRegistry.registerEntityRenderingHandler(EntityGiantChickenBase.class, new RenderGiantChicken(new ModelGiantChicken(), 1f));
/**
* Tiles
*/
Logger.INFO("Registering Custom Renderer for the Fire Pit.");
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFirepit.class, new FirepitRender());
Logger.INFO("Registering Custom Renderer for the Lead Lined Chest.");
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecayablesChest.class, new RenderDecayChest());
//GT++ Australia
/**
* Entities
*/
RenderingRegistry.registerEntityRenderingHandler(EntityAustralianSpiderBase.class, new RenderAustralianSpider());
RenderingRegistry.registerEntityRenderingHandler(EntityBoar.class, new RenderBoar(new ModelBoar(), new ModelBoar(0.5F), 0.7F));
RenderingRegistry.registerEntityRenderingHandler(EntityDingo.class, new RenderDingo(new ModelDingo(), new ModelDingo(), 0.5F));
RenderingRegistry.registerEntityRenderingHandler(EntityOctopus.class, new RenderOctopus(new ModelOctopus(), 0.7F));
}
@Override
public int addArmor(final String armor){
return RenderingRegistry.addNewArmourRendererPrefix(armor);
}
@Override
public void generateMysteriousParticles(final Entity theEntity)
{
final double motionX = theEntity.worldObj.rand.nextGaussian() * 0.02D;
final double motionY = theEntity.worldObj.rand.nextGaussian() * 0.02D;
final double motionZ = theEntity.worldObj.rand.nextGaussian() * 0.02D;
final EntityFX particleMysterious = new EntityParticleFXMysterious(
theEntity.worldObj,
(theEntity.posX + (theEntity.worldObj.rand.nextFloat() * theEntity.width
* 2.0F)) - theEntity.width,
theEntity.posY + 0.5D + (theEntity.worldObj.rand.nextFloat()
* theEntity.height),
(theEntity.posZ + (theEntity.worldObj.rand.nextFloat() * theEntity.width
* 2.0F)) - theEntity.width,
motionX,
motionY,
motionZ);
Minecraft.getMinecraft().effectRenderer.addEffect(particleMysterious);
}
@Override
public void serverStarting(final FMLServerStartingEvent e)
{
}
@Optional.Method(modid = "PlayerAPI")
private void init_PlayerAPI_PRE(){
//Register player instance
COMPAT_PlayerAPI.clientProxy.initPre();
}
@Optional.Method(modid = "PlayerAPI")
private void init_PlayerAPI_INIT(){
//Register player instance
COMPAT_PlayerAPI.clientProxy.Init();
}
public void onPreLoad() {
/*if (ConfigSwitches.enableCustomCapes){
String arr$[] = {
"draknyte1", "fobius"
};
int len$ = arr$.length;
for (int i$ = 0; i$ < len$; i$++) {
String tName = arr$[i$];
mCapeList.add(tName.toLowerCase());
}
(new Thread(this)).start();
}*/
}
@Override
public void run() {
/*try {
if (ConfigSwitches.enableCustomCapes){
Logger.INFO("GT++ Mod: Downloading Cape List.");
@SuppressWarnings("resource")
Scanner tScanner = new Scanner(new URL("https://github.com/draknyte1/GTplusplus/blob/master/SupporterList.txt").openStream());
while (tScanner.hasNextLine()) {
String tName = tScanner.nextLine();
if (!this.mCapeList.contains(tName.toLowerCase())) {
this.mCapeList.add(tName.toLowerCase());
}
}
}
} catch (Throwable e) {
Logger.INFO("Failed to download GT++ cape list.");
}*/
}
@Override
public void onLoadComplete(FMLLoadCompleteEvent event) {
GTplusplus.tryPatchTurbineTextures();
super.onLoadComplete(event);
}
}
|