mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 17:44:46 +00:00
Scalable Walrus (#248)
Co-authored-by: Martin Robertz <[email protected]> Co-authored-by: Maya <[email protected]>
This commit is contained in:
3 files changed
+111
-25
No files matched your search
@@ -10,6 +10,7 @@ import net.minecraftforge.client.model.IModelCustom;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.common.tile.TileWalrus;
|
||||
|
||||
public class RenderBlockWalrus extends TileEntitySpecialRenderer {
|
||||
|
||||
@@ -19,16 +20,28 @@ public class RenderBlockWalrus extends TileEntitySpecialRenderer {
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float partialTickTime) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(this.textureWalrus);
|
||||
if (!(tileentity instanceof TileWalrus Tile)) return;
|
||||
float scale = Tile.getWalrusScale();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
int orientation = tileentity.getBlockMetadata();
|
||||
if (orientation == 4) {
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
} else if (orientation == 5) {
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
} else if (orientation == 3) {
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
int orientation = Tile.getBlockMetadata();
|
||||
switch (orientation) {
|
||||
case 2:
|
||||
GL11.glTranslated(x + 0.5, y, z + 1 - scale * .655); // centering walrus model
|
||||
break;
|
||||
case 3:
|
||||
GL11.glTranslated(x + 0.5, y, z + scale * .655);
|
||||
GL11.glRotatef(180, 0, 1, 0);
|
||||
break;
|
||||
case 4:
|
||||
GL11.glTranslated(x + 1 - scale * .655, y, z + 0.5);
|
||||
GL11.glRotatef(90, 0, 1, 0);
|
||||
break;
|
||||
case 5:
|
||||
GL11.glTranslated(x + scale * .655, y, z + 0.5);
|
||||
GL11.glRotatef(-90, 0, 1, 0);
|
||||
break;
|
||||
}
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
this.modelWalrus.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user