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
|
package tectech.proxy;
import static tectech.TecTech.RANDOM;
import static tectech.thing.casing.TTCasingsContainer.eyeOfHarmonyRenderBlock;
import static tectech.thing.casing.TTCasingsContainer.forgeOfGodsRenderBlock;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiNewChat;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizon.structurelib.entity.fx.WeightlessParticleFX;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import tectech.Reference;
import tectech.rendering.EOH.EOHItemRenderer;
import tectech.rendering.EOH.EOHTileEntitySR;
import tectech.thing.block.BlockGodforgeGlass;
import tectech.thing.block.BlockQuantumGlass;
import tectech.thing.block.RenderForgeOfGods;
import tectech.thing.block.RenderGodforgeGlass;
import tectech.thing.block.RenderQuantumGlass;
import tectech.thing.block.TileEntityEyeOfHarmony;
import tectech.thing.block.TileEntityForgeOfGods;
import tectech.thing.item.ItemRenderForgeOfGods;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderInfo() {
BlockQuantumGlass.renderID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(BlockQuantumGlass.renderID, new RenderQuantumGlass());
MinecraftForgeClient
.registerItemRenderer(Item.getItemFromBlock(eyeOfHarmonyRenderBlock), new EOHItemRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEyeOfHarmony.class, new EOHTileEntitySR());
if (tectech.TecTech.configTecTech.ENABLE_GOD_FORGE) {
BlockGodforgeGlass.renderID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(BlockGodforgeGlass.renderID, new RenderGodforgeGlass());
MinecraftForgeClient
.registerItemRenderer(Item.getItemFromBlock(forgeOfGodsRenderBlock), new ItemRenderForgeOfGods());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityForgeOfGods.class, new RenderForgeOfGods());
}
}
@Override
public void em_particle(IGregTechTileEntity aMuffler, ForgeDirection facing) { // CUTE!
float xPos = facing.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F;
float yPos = facing.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F;
float zPos = facing.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F;
EntityFX particle = new WeightlessParticleFX(
aMuffler.getWorld(),
xPos + RANDOM.nextFloat() * 0.5F,
yPos + RANDOM.nextFloat() * 0.5F,
zPos + RANDOM.nextFloat() * 0.5F,
0,
0,
0);
particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
@Override
public void pollutor_particle(IGregTechTileEntity aMuffler, ForgeDirection facing) {
float xPos = facing.offsetX * 0.76F + aMuffler.getXCoord() + 0.25F;
float yPos = facing.offsetY * 0.76F + aMuffler.getYCoord() + 0.25F;
float zPos = facing.offsetZ * 0.76F + aMuffler.getZCoord() + 0.25F;
float ySpd = facing.offsetY * 0.1F + 0.2F + 0.1F * (float) RANDOM.nextGaussian();
float xSpd;
float zSpd;
if (facing.offsetY == -1) {
float temp = RANDOM.nextFloat() * 2 * (float) Math.PI;
xSpd = (float) Math.sin(temp) * 0.1F * (float) RANDOM.nextGaussian();
zSpd = (float) Math.cos(temp) * 0.1F * (float) RANDOM.nextGaussian();
} else {
xSpd = facing.offsetX * (0.1F + 0.2F * (float) RANDOM.nextGaussian());
zSpd = facing.offsetZ * (0.1F + 0.2F * (float) RANDOM.nextGaussian());
}
aMuffler.getWorld()
.spawnParticle(
"largesmoke",
xPos + RANDOM.nextFloat() * 0.5F,
yPos + RANDOM.nextFloat() * 0.5F,
zPos + RANDOM.nextFloat() * 0.5F,
xSpd,
ySpd,
zSpd);
aMuffler.getWorld()
.spawnParticle(
"largesmoke",
xPos + RANDOM.nextFloat() * 0.5F,
yPos + RANDOM.nextFloat() * 0.5F,
zPos + RANDOM.nextFloat() * 0.5F,
xSpd,
ySpd,
zSpd);
aMuffler.getWorld()
.spawnParticle(
"largesmoke",
xPos + RANDOM.nextFloat() * 0.5F,
yPos + RANDOM.nextFloat() * 0.5F,
zPos + RANDOM.nextFloat() * 0.5F,
xSpd,
ySpd,
zSpd);
}
@Override
public void em_particle(World w, double x, double y, double z) { // CUTE!
EntityFX particle = new WeightlessParticleFX(
w,
x + RANDOM.nextFloat() * 0.5F,
y + RANDOM.nextFloat() * 0.5F,
z + RANDOM.nextFloat() * 0.5F,
0,
0,
0);
particle.setRBGColorF(0, 0.6F * RANDOM.nextFloat(), 0.8f);
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
}
@Override
public void pollutor_particle(World w, double x, double y, double z) {
w.spawnParticle(
"largesmoke",
x + RANDOM.nextFloat() * 0.5F,
y + RANDOM.nextFloat() * 0.5F,
z + RANDOM.nextFloat() * 0.5F,
0,
0,
0);
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
}
@Override
public World getClientWorld() {
return FMLClientHandler.instance()
.getClient().theWorld;
}
@Override
public void printInchat(String... strings) {
GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
for (String s : strings) {
chat.printChatMessage(new ChatComponentText(s));
}
}
@Override
public void playSound(IGregTechTileEntity base, String name) {
base.getWorld()
.playSoundEffect(base.getXCoord(), base.getYCoord(), base.getZCoord(), Reference.MODID + ':' + name, 1, 1);
}
@Override
public void renderAABB(World w, AxisAlignedBB box) {
em_particle(w, box.minX, box.minY, box.minZ);
em_particle(w, box.minX, box.minY, box.maxZ);
em_particle(w, box.minX, box.maxY, box.maxZ);
em_particle(w, box.minX, box.maxY, box.minZ);
em_particle(w, box.maxX, box.maxY, box.minZ);
em_particle(w, box.maxX, box.maxY, box.maxZ);
em_particle(w, box.maxX, box.minY, box.maxZ);
em_particle(w, box.maxX, box.minY, box.minZ);
}
}
|