Skip to content

Commit

Permalink
transparency fixes
Browse files Browse the repository at this point in the history
sorta other render fixes, but not really.
  • Loading branch information
EternalBlueFlame committed Nov 27, 2023
1 parent 5649c64 commit eb9e6ac
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 19 deletions.
11 changes: 11 additions & 0 deletions src/main/java/train/client/render/RenderRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import train.common.Traincraft;
import train.common.api.TrainRenderRecord;

import static org.lwjgl.opengl.GL11.*;

@SideOnly(Side.CLIENT)
public class RenderRollingStock extends Render {
private static final Random random = new Random();
Expand All @@ -39,6 +41,15 @@ public RenderRollingStock() {
public static void renderTheMinecart(EntityRollingStock cart, double x, double y, double z, float yaw, float time) {
Tessellator.bindTexture(getTexture(cart));
GL11.glPushMatrix();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
GL11.glLightModelf(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
GL11.glShadeModel(GL_SMOOTH);
GL11.glEnable(GL_NORMALIZE);
long var10 = cart.getEntityId() * 493286711L;
var10 = var10 * var10 * 4392167121L + var10 * 98761L;
float var12 = (((var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
// Copyright (C) 2018 Minecraft-SMP.de
// This file is for Flan's Flying Mod Version 4.0.x+

// Model:
// Model:
// Model Creator:
// Created on:11.06.2018 - 13:28:00
// Last changed on: 11.06.2018 - 13:28:00

package train.client.render.models;

import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11;
import fexcraft.tmt.slim.ModelBase;
import fexcraft.tmt.slim.ModelRendererTurbo;
import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11;

public class ModelPassenger_DB_oriental extends ModelBase
{
Expand Down Expand Up @@ -399,33 +399,26 @@ public ModelPassenger_DB_oriental()
passenger_db_orientalModel[83].rotateAngleX = -6.09119909F;
passenger_db_orientalModel[83].rotateAngleY = -3.14159265F;

fixRotation(passenger_db_orientalModel, false, true, true);

fixRotation(passenger_db_orientalModel,false,true,true);
bodyModel=passenger_db_orientalModel;
}

ModelPassenger_DB_oriental_bogie bogie = new ModelPassenger_DB_oriental_bogie();

@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
for(int i = 0; i < 84; i++)
{
passenger_db_orientalModel[i].render(f5);
}
GL11.glPushMatrix();
GL11.glTranslated(0,0.0,0);
super.render(entity, f, f1, f2, f3, f4, f5);
GL11.glPushMatrix();
GL11.glTranslated(0,0.0,0);
bogie.render(entity, f, f1, f2, f3, f4, f5);
GL11.glPopMatrix();

GL11.glPushMatrix();
GL11.glTranslated(2.15,0,0);
bogie.render(entity, f, f1, f2, f3, f4, f5);
GL11.glPopMatrix();

}
GL11.glPushMatrix();
GL11.glTranslated(2.15,0,0);
bogie.render(entity, f, f1, f2, f3, f4, f5);
GL11.glPopMatrix();

public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
}

public ModelRendererTurbo passenger_db_orientalModel[];
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/train/common/api/AbstractTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ public TrainRecord getSpec() {
return trainSpec;
}

//@Override
// public boolean shouldRenderInPass(int pass){return pass==1;}
/**
* The name of the train based on the item name
*/
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/train/common/blocks/BlockTCRail.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
return false;
}


@SideOnly(Side.CLIENT)
public int getRenderBlockPass()
{
return 1;
}

@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
TileTCRail tileEntity = (TileTCRail) world.getTileEntity(x, y, z);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit eb9e6ac

Please sign in to comment.