Scalable Walrus (#248)

Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Maya <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-01-04 15:48:13 -07:00
1 parent d8de0e8f27
commit 0b67a8a4e7
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();
}