mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 23:13:21 +00:00
Started re-write of dim. trans.
This commit is contained in:
1 parent
8ce3b77fb9
commit
b7f9cfb013
41 files changed
+3538
-39
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package crazypants.enderio.machine.transceiver.render;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.AdvancedModelLoader;
|
||||
import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import crazypants.enderio.machine.transceiver.TileTransceiver;
|
||||
import crazypants.render.RenderUtil;
|
||||
|
||||
public class TransceiverModel extends ModelBase implements IModel {
|
||||
|
||||
public static final float SCALE = 1 / 16f;
|
||||
|
||||
private static final String TEXTURE = "enderio:models/transceiver.png";
|
||||
private static final String MODEL = "enderio:models/transceiver.obj";
|
||||
|
||||
private IModelCustom model;
|
||||
|
||||
public TransceiverModel() {
|
||||
model = AdvancedModelLoader.loadModel(new ResourceLocation(MODEL));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(SCALE, SCALE, SCALE);
|
||||
RenderUtil.bindTexture(TEXTURE);
|
||||
model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(TileTransceiver cube, double x, double y, double z) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5f, (float) y + 0.5f, (float) z + 0.5f);
|
||||
render();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user