Skip to content

Commit

Permalink
Merge remote-tracking branch 'TheDoctor1138/1.7-Community-4.3' into 1…
Browse files Browse the repository at this point in the history
….7-Community-4.3
  • Loading branch information
EternalBlueFlame committed Nov 27, 2023
2 parents eb9e6ac + 278e8a9 commit 8cebe09
Show file tree
Hide file tree
Showing 23 changed files with 126,597 additions and 889 deletions.
22,752 changes: 22,752 additions & 0 deletions TrackTypes/Normal/Curves/track_curve_29x.obj

Large diffs are not rendered by default.

9,092 changes: 9,092 additions & 0 deletions TrackTypes/Normal/Switches/track_switch_very_large.obj

Large diffs are not rendered by default.

10,983 changes: 10,983 additions & 0 deletions TrackTypes/Normal/Switches/track_switch_very_large_active.obj

Large diffs are not rendered by default.

11,009 changes: 11,009 additions & 0 deletions TrackTypes/Normal/Switches/track_switch_very_large_active_left.obj

Large diffs are not rendered by default.

9,092 changes: 9,092 additions & 0 deletions TrackTypes/Normal/Switches/track_switch_very_large_left.obj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,13 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.TURN_32X32 || item.getTrac
out_0_end = 5;
out_1_0 = 5;
out_1_1 = 5;

} else if (item.getTrackType() == ItemTCRail.TrackTypes.VERY_LARGE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_VERY_LARGE_SWITCH) {
switchType = "very_large_90";
out_0_start = 0;
out_0_end = 0;
out_1_0 = 10;
out_1_1 = 10;
} else if (item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_45DEGREE_SWITCH) {
switchType = "medium_45degree";
out_0_start = 0;
Expand All @@ -338,7 +345,10 @@ else if (item.getTrackType() == ItemTCRail.TrackTypes.TURN_32X32 || item.getTrac
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);
} else {
}

else if (!(item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_45DEGREE_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);
}
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/train/client/render/RenderTCRail.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,15 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelLeftSwitchTurn.render("large_90", "", railTile, x, y, z);
break;
}
case VERY_LARGE_SWITCH:
case VERY_LARGE_RIGHT_SWITCH: {
modelRightSwitchTurn.render("very_large_90", "", railTile, x, y, z);
break;
}
case VERY_LARGE_LEFT_SWITCH: {
modelLeftSwitchTurn.render("very_large_90", "", railTile, x, y, z);
break;
}
case MEDIUM_PARALLEL_SWITCH:
case MEDIUM_RIGHT_PARALLEL_SWITCH: {
modelRightSwitchTurn.render("medium_parallel", "", railTile, x, y, z);
Expand Down Expand Up @@ -522,6 +531,15 @@ public void renderTileEntityAt(TileEntity var1, double x, double y, double z, fl
modelLeftSwitchTurn.render("large_90", "embedded", railTile, x, y, z);
break;
}
case EMBEDDED_VERY_LARGE_SWITCH:
case EMBEDDED_VERY_LARGE_RIGHT_SWITCH: {
modelRightSwitchTurn.render("very_large_90", "embedded", railTile, x, y, z);
break;
}
case EMBEDDED_VERY_LARGE_LEFT_SWITCH: {
modelLeftSwitchTurn.render("very_large_90", "embedded", railTile, x, y, z);
break;
}
case EMBEDDED_MEDIUM_PARALLEL_SWITCH:
case EMBEDDED_MEDIUM_RIGHT_PARALLEL_SWITCH: {
modelRightSwitchTurn.render("medium_parallel", "embedded", railTile, x, y, z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class ModelLeftSwitchTCTrack extends ModelBase {
private IModelCustom modelLargeLeftSwitchActive;
private IModelCustom modelLargeLeftSwitchInactive;

private IModelCustom modelVeryLargeLeftSwitchActive;
private IModelCustom modelVeryLargeLeftSwitchInactive;
private IModelCustom modelMediumLeft45degreeSwitchActive;
private IModelCustom modelMediumLeft45degreeSwitchInActive;

Expand All @@ -31,7 +33,9 @@ public ModelLeftSwitchTCTrack() {
modelLargeLeftSwitchInactive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_medium_inactive_left.obj"));
modelMediumLeft45degreeSwitchActive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_medium_45degree_active_left.obj"));
modelMediumLeft45degreeSwitchInActive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_medium_45degree_inactive_left.obj"));

modelVeryLargeLeftSwitchActive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_very_large_active_left.obj"));
modelVeryLargeLeftSwitchInactive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_very_large_left.obj"));

}

public void renderMediumActive() {
Expand All @@ -53,6 +57,13 @@ public void renderLarge90Inactive() {
modelLargeLeftSwitchInactive.renderAll();
}

public void renderVeryLarge90Active() {
modelVeryLargeLeftSwitchActive.renderAll();
}
public void renderVeryLarge90Inactive() {
modelVeryLargeLeftSwitchInactive.renderAll();
}

public void renderMedium45degreeActive() {modelMediumLeft45degreeSwitchActive.renderAll();}
public void renderMedium45degreeInActive() {modelMediumLeft45degreeSwitchInActive.renderAll();}

Expand Down Expand Up @@ -83,6 +94,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(0, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, -4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(-90, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(-90, 0, 1, 0);
}
Expand All @@ -101,6 +116,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(180, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, -4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(90, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(90, 0, 1, 0);
}
Expand All @@ -118,9 +137,11 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(90, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, -4.0f);
}
if(type.equals("medium_parallel")){
//do something if needed
if(type.equals("very_large_90")){
GL11.glRotatef(0, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}

if(type.equals("medium_45degree")){
GL11.glRotatef(0, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, 0f);
Expand All @@ -135,6 +156,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(-90, 0, 1, 0);
GL11.glTranslatef(.0f, 0.0f, -4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(180, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(180, 0, 1, 0);
}
Expand All @@ -150,6 +175,8 @@ public void render(String type, String variant, int facing, boolean active, doub
if(type.equals("medium_parallel")&&active)this.renderMediumParallelActive();
if(type.equals("large_90")&&!active)this.renderLarge90Inactive();
if(type.equals("large_90")&&active)this.renderLarge90Active();
if(type.equals("very_large_90")&&!active)this.renderVeryLarge90Inactive();
if(type.equals("very_large_90")&&active)this.renderVeryLarge90Active();
if(type.equals("medium_45degree")&&!active)this.renderMedium45degreeInActive();
if(type.equals("medium_45degree")&&active)this.renderMedium45degreeActive();
//if(type.equals("large"))this.renderLarge();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public class ModelRightSwitchTCTrack extends ModelBase {
private IModelCustom modelLargeRightSwitchActive;
private IModelCustom modelLargeRightSwitchInactive;

private IModelCustom modelVeryLargeRightSwitchActive;
private IModelCustom modelVeryLargeRightSwitchInactive;

private IModelCustom modelMediumRight45degreeSwitchActive;
private IModelCustom modelMediumRight45degreeSwitchInActive;

Expand All @@ -31,8 +34,9 @@ public ModelRightSwitchTCTrack() {
modelLargeRightSwitchInactive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_medium_inactive.obj"));
modelMediumRight45degreeSwitchActive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_medium_45degree_active.obj"));
modelMediumRight45degreeSwitchInActive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_medium_45degree_inactive.obj"));
modelVeryLargeRightSwitchActive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_very_large_active.obj"));
modelVeryLargeRightSwitchInactive = AdvancedModelLoader.loadModel(new ResourceLocation(Info.modelPrefix + "track_switch_very_large.obj"));
}

public void renderMediumActive() {
modelMediumRightSwitchActive.renderAll();
}
Expand All @@ -51,9 +55,18 @@ public void renderLarge90Active() {
public void renderLarge90Inactive() {
modelLargeRightSwitchInactive.renderAll();
}

public void renderMedium45degreeActive() {modelMediumRight45degreeSwitchActive.renderAll();}
public void renderMedium45degreeInActive() {modelMediumRight45degreeSwitchInActive.renderAll();}
public void renderVeryLarge90Active() {
modelVeryLargeRightSwitchActive.renderAll();
}
public void renderVeryLarge90Inactive() {
modelVeryLargeRightSwitchInactive.renderAll();
}
public void renderMedium45degreeActive() {
modelMediumRight45degreeSwitchActive.renderAll();
}
public void renderMedium45degreeInActive() {
modelMediumRight45degreeSwitchInActive.renderAll();
}

public void render(String type, String variant, TileTCRail tcRail, double x, double y, double z) {
int facing = tcRail.getWorldObj().getBlockMetadata(tcRail.xCoord, tcRail.yCoord, tcRail.zCoord);
Expand Down Expand Up @@ -82,6 +95,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(0, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, 4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(-90, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(-90, 0, 1, 0);
}
Expand All @@ -99,6 +116,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(180, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, 4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(90, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(90, 0, 1, 0);
}
Expand All @@ -116,6 +137,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(90, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, 4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(0, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(0, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, 0.0f);
Expand All @@ -136,6 +161,10 @@ public void render(String type, String variant, int facing, boolean active, doub
GL11.glRotatef(-90, 0, 1, 0);
GL11.glTranslatef(0.0f, 0.0f, 4.0f);
}
if(type.equals("very_large_90")){
GL11.glRotatef(180, 0, 1, 0);
GL11.glTranslatef(-0.5f, 0.0f, 0.5f);
}
if(type.equals("medium_parallel")){
GL11.glRotatef(180, 0, 1, 0);
}
Expand All @@ -150,6 +179,8 @@ public void render(String type, String variant, int facing, boolean active, doub
if(type.equals("medium_parallel")&&active)this.renderMediumParallelActive();
if(type.equals("large_90")&&!active)this.renderLarge90Inactive();
if(type.equals("large_90")&&active)this.renderLarge90Active();
if(type.equals("very_large_90")&&!active)this.renderVeryLarge90Inactive();
if(type.equals("very_large_90")&&active)this.renderVeryLarge90Active();
if(type.equals("medium_45degree")&&active)this.renderMedium45degreeActive();
if(type.equals("medium_45degree")&&!active)this.renderMedium45degreeInActive();
//if(type.equals("large"))this.renderLarge();
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/train/common/api/EntityBogie.java
Original file line number Diff line number Diff line change
Expand Up @@ -939,16 +939,20 @@ private void moveOnTC90TurnRail(int j,double r, double cx, double cz){
}
private boolean shouldIgnoreSwitch(TileTCRail tile, int i, int j, int k, int meta) {
if (tile != null
&& (tile.getType().equals(TrackTypes.MEDIUM_RIGHT_TURN.getLabel())
&&(tile.getType().equals(TrackTypes.MEDIUM_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.MEDIUM_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.LARGE_RIGHT_TURN.getLabel()))
|| tile.getType().equals(TrackTypes.VERY_LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.VERY_LARGE_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.MEDIUM_RIGHT_45DEGREE_TURN.getLabel())
|| tile.getType().equals(TrackTypes.MEDIUM_LEFT_45DEGREE_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_LARGE_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_VERY_LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_VERY_LARGE_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_RIGHT_45DEGREE_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_LEFT_45DEGREE_TURN.getLabel())

Expand Down
8 changes: 6 additions & 2 deletions src/main/java/train/common/api/EntityRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import train.common.library.BlockIDs;
import train.common.tile.TileTCRail;
import train.common.tile.TileTCRailGag;
import tv.twitch.chat.Chat;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -1119,7 +1120,6 @@ private void updateOnTrack(int i, int j, int k, Block l) {
if (ItemTCRail.isTCStraightTrack(tile)) {
moveOnTCStraight(i, j, k, tile.xCoord, tile.zCoord, meta);
} else if (ItemTCRail.isTCTurnTrack(tile)) {

if (bogieLoco != null) {
if (!bogieLoco.isOnRail()) {
derailSpeed = 0;
Expand All @@ -1131,6 +1131,7 @@ private void updateOnTrack(int i, int j, int k, Block l) {
} else {

if (shouldIgnoreSwitch(tile, i, j, k, meta)) {

moveOnTCStraight(i, j, k, tile.xCoord, tile.zCoord, meta);
} else {
if (ItemTCRail.isTCTurnTrack(tile))
Expand All @@ -1157,7 +1158,6 @@ private void updateOnTrack(int i, int j, int k, Block l) {
TileTCRailGag tileGag = (TileTCRailGag) worldObj.getTileEntity(i, j, k);
if (worldObj.getTileEntity(tileGag.originX, tileGag.originY, tileGag.originZ) instanceof TileTCRail) {
TileTCRail tile = (TileTCRail) worldObj.getTileEntity(tileGag.originX, tileGag.originY, tileGag.originZ);

if (ItemTCRail.isTCTurnTrack(tile)) {
moveOnTC90TurnRail(i, j, k, tile.r, tile.cx, tile.cz);
}
Expand Down Expand Up @@ -1189,12 +1189,16 @@ private boolean shouldIgnoreSwitch(TileTCRail tile, int i, int j, int k, int met
|| tile.getType().equals(TrackTypes.MEDIUM_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.LARGE_RIGHT_TURN.getLabel()))
|| tile.getType().equals(TrackTypes.VERY_LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.VERY_LARGE_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.MEDIUM_RIGHT_45DEGREE_TURN.getLabel())
|| tile.getType().equals(TrackTypes.MEDIUM_LEFT_45DEGREE_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_LARGE_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_VERY_LARGE_LEFT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_VERY_LARGE_RIGHT_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_RIGHT_45DEGREE_TURN.getLabel())
|| tile.getType().equals(TrackTypes.EMBEDDED_MEDIUM_LEFT_45DEGREE_TURN.getLabel())

Expand Down
Loading

0 comments on commit 8cebe09

Please sign in to comment.