Skip to content

Commit

Permalink
Merge branch 'TheDoctor1138' into TC4.5-1.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
EternalBlueFlame committed May 21, 2024
2 parents ca0d6cf + af35f32 commit a21329b
Show file tree
Hide file tree
Showing 123 changed files with 99,376 additions and 59,081 deletions.
47 changes: 30 additions & 17 deletions src/main/java/train/client/core/handlers/CustomRenderHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ private void renderTCRailPreview(EntityClientPlayerMP player, ItemStack stack) {
GL11.glTranslated(x - px, y + 1 - py, z - pz);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glEnable(GL11.GL_BLEND);

blockInfo();
// Straights
if (item.getTrackType().getType() == TCRailTypes.STRAIGHT) {

if (item.getTrackType() == ItemTCRail.TrackTypes.SMALL_ROAD_CROSSING_DYNAMIC) {
blockInfo();
}
int length = 1;
if (item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_STRAIGHT || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_STRAIGHT)
length = 3;
Expand All @@ -85,8 +89,8 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.VERY_LONG_STRAIGHT || item
float dx = dir.getX() * i;
float dz = dir.getY() * i;
if (item.getTrackType().getLabel().contains("EMBEDDED"))
RenderTCRail.modelSmallStraight.render("embedded", facing, dx, 0, dz, r, g, b, a);
else RenderTCRail.modelSmallStraight.render("normal", facing, dx, 0, dz, r, g, b, a);
RenderTCRail.modelSmallStraight.render("embedded", facing, dx, 0, dz, r, g, b, a, ballastMaterial, 16777215);
else RenderTCRail.modelSmallStraight.render("normal", facing, dx, 0, dz, r, g, b, a,ballastMaterial, 16777215);
}
}

Expand Down Expand Up @@ -122,11 +126,14 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.VERY_LONG_STRAIGHT || item

// Crossings
} else if (item.getTrackType() == ItemTCRail.TrackTypes.SMALL_ROAD_CROSSING) {
RenderTCRail.modelSmallStraight.render("crossing", facing, 0, 0, 0, r, g, b, a);
RenderTCRail.modelSmallStraight.render("crossing", facing, 0, 0, 0, r, g, b, a, null, 16777215);
} else if (item.getTrackType() == ItemTCRail.TrackTypes.SMALL_ROAD_CROSSING_1) {
RenderTCRail.modelSmallStraight.render("crossing1", facing, 0, 0, 0, r, g, b, a);
RenderTCRail.modelSmallStraight.render("crossing1", facing, 0, 0, 0, r, g, b, a, null, 16777215);
} else if (item.getTrackType() == ItemTCRail.TrackTypes.SMALL_ROAD_CROSSING_2) {
RenderTCRail.modelSmallStraight.render("crossing2", facing, 0, 0, 0, r, g, b, a);
RenderTCRail.modelSmallStraight.render("crossing2", facing, 0, 0, 0, r, g, b, a, null, 16777215);
} else if (item.getTrackType() == ItemTCRail.TrackTypes.SMALL_ROAD_CROSSING_DYNAMIC) {
blockInfo();
RenderTCRail.modelSmallStraight.render("dynamic", facing, 0, 0, 0, r, g, b, a, ballastMaterial, blockColour);
} else if (item.getTrackType() == ItemTCRail.TrackTypes.DOUBLE_DIAMOND_CROSSING || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_DOUBLE_DIAMOND_CROSSING) {
float dx = dir.getX();
float dz = dir.getY();
Expand All @@ -150,10 +157,10 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.VERY_LONG_STRAIGHT || item
float dz = dir.getY();

RenderTCRail.modelTwoWaysCrossing.render(labelType + "_crossing", dx, 0, dz, facing, r, g, b, a);
RenderTCRail.modelSmallStraight.render(labelType, 0, dx, 0, dz + 1, r, g, b, a);
RenderTCRail.modelSmallStraight.render(labelType, 1, dx + 1, 0, dz, r, g, b, a);
RenderTCRail.modelSmallStraight.render(labelType, 2, dx, 0, dz - 1, r, g, b, a);
RenderTCRail.modelSmallStraight.render(labelType, 3, dx - 1, 0, dz, r, g, b, a);
RenderTCRail.modelSmallStraight.render(labelType, 0, dx, 0, dz + 1, r, g, b, a, null, 16777215);
RenderTCRail.modelSmallStraight.render(labelType, 1, dx + 1, 0, dz, r, g, b, a, null, 16777215);
RenderTCRail.modelSmallStraight.render(labelType, 2, dx, 0, dz - 1, r, g, b, a, null, 16777215);
RenderTCRail.modelSmallStraight.render(labelType, 3, dx - 1, 0, dz, r, g, b, a, null, 16777215);

// Slopes
} else if (item.getTrackType() == ItemTCRail.TrackTypes.SLOPE_BALLAST) {
Expand Down Expand Up @@ -317,7 +324,13 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.TURN_1X1 || item.getTrackT
out_0_start = 5;
out_0_end = 10;
out_1_0 = 10;
} else if (item.getTrackType() == ItemTCRail.TrackTypes.LARGE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_LARGE_SWITCH) {
}
if (item.getTrackType() == ItemTCRail.TrackTypes.LARGE_PARALLEL_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_LARGE_PARALLEL_SWITCH) {
switchType = "large_parallel";
out_0_start = 0;
out_0_end = 0;
out_1_0 = 0;
}else if (item.getTrackType() == ItemTCRail.TrackTypes.LARGE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_LARGE_SWITCH) {
switchType = "large_90";
out_0_start = 5;
out_0_end = 5;
Expand Down Expand Up @@ -351,18 +364,18 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.LARGE_45DEGREE_SWITCH || i

// Render straight tracks
for (int out_0 = out_0_start; out_0 < out_0_end + 1; out_0++) {
RenderTCRail.modelSmallStraight.render(variant, facing, dx * out_0, 0, dz * out_0, r, g, b, a);
RenderTCRail.modelSmallStraight.render(variant, facing, dx * out_0, 0, dz * out_0, r, g, b, a, null, 16777215);
}

if (item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_PARALLEL_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_PARALLEL_SWITCH) {
RenderTCRail.modelSmallStraight.render(variant, facing, 0, 0, 0, r, g, b, a);
RenderTCRail.modelSmallStraight.render(variant, facing, dx * out_1_0 + dx_1 * out_1_1, 0, dz * out_1_0 + dz_1 * out_1_1, r, g, b, a);
RenderTCRail.modelSmallStraight.render(variant, facing, 0, 0, 0, r, g, b, a, null, 16777215);
RenderTCRail.modelSmallStraight.render(variant, facing, dx * out_1_0 + dx_1 * out_1_1, 0, dz * out_1_0 + dz_1 * out_1_1, r, g, b, a, null, 16777215);
}

else if (!(item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.LARGE_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_LARGE_45DEGREE_SWITCH)) {
else if (!(item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.LARGE_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_LARGE_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.LARGE_PARALLEL_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_LARGE_PARALLEL_SWITCH)) {

RenderTCRail.modelSmallStraight.render(variant, facing, 0, 0, 0, r, g, b, a);
RenderTCRail.modelSmallStraight.render(variant, facing_1, dx * out_1_0 + dx_1 * out_1_1, 0, dz * out_1_0 + dz_1 * out_1_1, r, g, b, a);
RenderTCRail.modelSmallStraight.render(variant, facing, 0, 0, 0, r, g, b, a, null, 16777215);
RenderTCRail.modelSmallStraight.render(variant, facing_1, dx * out_1_0 + dx_1 * out_1_1, 0, dz * out_1_0 + dz_1 * out_1_1, r, g, b, a, null, 16777215);
}

else{
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/train/client/render/RenderEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import train.common.library.Info;
import net.minecraft.util.ResourceLocation;

import java.util.ArrayList;

public enum RenderEnum implements TrainRenderRecord {

/**
Expand Down
33 changes: 27 additions & 6 deletions src/main/java/train/client/render/RenderTCRail.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelLeftSwitchTurn.render("medium_parallel", "", railTile, x, y, z);
break;
}
case LARGE_PARALLEL_SWITCH:
case LARGE_RIGHT_PARALLEL_SWITCH: {
modelRightSwitchTurn.render("large_parallel", "", railTile, x, y, z);
break;
}
case LARGE_LEFT_PARALLEL_SWITCH: {
modelLeftSwitchTurn.render("large_parallel", "", railTile, x, y, z);
break;
}
case MEDIUM_45DEGREE_SWITCH:
case MEDIUM_RIGHT_45DEGREE_SWITCH: {
modelRightSwitchTurn.render("medium_45degree", "", railTile, x, y, z);
Expand Down Expand Up @@ -390,6 +399,10 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelRoadCrossing.render("crossing2", railTile, x, y, z);
break;
}
case SMALL_ROAD_CROSSING_DYNAMIC:{
modelRoadCrossing.render("dynamic", railTile, x, y, z);
break;
}
case EMBEDDED_MEDIUM_STRAIGHT:
case EMBEDDED_LONG_STRAIGHT:
case EMBEDDED_VERY_LONG_STRAIGHT: {
Expand Down Expand Up @@ -454,20 +467,20 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
}
case EMBEDDED_TURN_29X29:
case EMBEDDED_RIGHT_TURN_29X29: {
modelRightTurn.render("29x", railTile, x, y, z);
modelRightTurn.render("embedded_29x", railTile, x, y, z);
break;
}
case EMBEDDED_LEFT_TURN_29X29: {
modelLeftTurn.render("29x", railTile, x, y, z);
modelLeftTurn.render("embedded_29x", railTile, x, y, z);
break;
}
case EMBEDDED_TURN_32X32:
case EMBEDDED_RIGHT_TURN_32X32: {
modelRightTurn.render("32x", railTile, x, y, z);
modelRightTurn.render("embedded_32x", railTile, x, y, z);
break;
}
case EMBEDDED_LEFT_TURN_32X32: {
modelLeftTurn.render("32x", railTile, x, y, z);
modelLeftTurn.render("embedded_32x", railTile, x, y, z);
break;
}
case EMBEDDED_MEDIUM_45DEGREE_TURN:
Expand Down Expand Up @@ -534,7 +547,6 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelLeftParallelCurve.render("large", "embedded", railTile, x, y, z);
break;
}

case EMBEDDED_TWO_WAYS_CROSSING: {
modelTwoWaysCrossing.render("embedded_crossing", railTile, x, y, z);
break;
Expand All @@ -547,7 +559,6 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelTwoWaysCrossing.render("embedded_diagonal_crossing", railTile, x, y, z);
break;
}

case EMBEDDED_DIAMOND_CROSSING:
case EMBEDDED_RIGHT_DIAMOND_CROSSING: {
modelRightDiamondCrossing.render("embedded", railTile, x, y, z);
Expand Down Expand Up @@ -597,6 +608,15 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelLeftSwitchTurn.render("medium_parallel", "embedded", railTile, x, y, z);
break;
}
case EMBEDDED_LARGE_PARALLEL_SWITCH:
case EMBEDDED_LARGE_RIGHT_PARALLEL_SWITCH: {
modelRightSwitchTurn.render("large_parallel", "embedded", railTile, x, y, z);
break;
}
case EMBEDDED_LARGE_LEFT_PARALLEL_SWITCH: {
modelLeftSwitchTurn.render("large_parallel", "embedded", railTile, x, y, z);
break;
}
case EMBEDDED_MEDIUM_45DEGREE_SWITCH:
case EMBEDDED_MEDIUM_RIGHT_45DEGREE_SWITCH: {
modelRightSwitchTurn.render("medium_45degree", "embedded", railTile, x, y, z);
Expand All @@ -615,6 +635,7 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelLeftSwitchTurn.render("large_45degree", "embedded", railTile, x, y, z);
break;
}

case EMBEDDED_LARGE_CURVED_SLOPE_DYNAMIC:
case EMBEDDED_LARGE_RIGHT_CURVED_SLOPE_DYNAMIC: {
modelRightCurvedSlope.render("embedded_large", railTile, x, y, z);
Expand Down
Loading

0 comments on commit a21329b

Please sign in to comment.