-
Notifications
You must be signed in to change notification settings - Fork 497
/
RenderRobot.java
50 lines (35 loc) · 1.22 KB
/
RenderRobot.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
package buildcraft.core.render;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import buildcraft.core.DefaultProps;
import buildcraft.core.EntityRobot;
public class RenderRobot extends Render {
protected ModelBase model = new ModelBase() {
};
private ModelRenderer box;
public RenderRobot() {
box = new ModelRenderer(model, 0, 0);
box.addBox(-4F, -4F, -4F, 8, 8, 8);
box.rotationPointX = 0;
box.rotationPointY = 0;
box.rotationPointZ = 0;
}
@Override
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
doRender((EntityRobot) entity, x, y, z, f, f1);
}
private void doRender(EntityRobot laser, double x, double y, double z, float f, float f1) {
GL11.glPushMatrix();
GL11.glDisable(2896 /* GL_LIGHTING */);
GL11.glTranslated(x, y, z);
renderManager.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_ENTITIES + "/robot.png");
float factor = (float) (1.0 / 16.0);
box.render(factor);
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();
}
}