Skip to content

Commit

Permalink
TC5 stats API endpoints added.
Browse files Browse the repository at this point in the history
- Endpoints only used by the item. need to go back over all the rest of the calls to TrainRecord and redirect them to the new system. which also redirects to TrainRecord but can be overridden TC5 style.
- Small optimization to how XMLBuilder works.
- New DepreciatedUtil class for all the stuff that gets nuked on the 4.5 move, like the old color system.
  • Loading branch information
EternalBlueFlame committed Dec 1, 2023
1 parent 6b6dc3e commit a448dfc
Show file tree
Hide file tree
Showing 127 changed files with 742 additions and 541 deletions.
8 changes: 8 additions & 0 deletions src/main/java/ebf/XmlBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public XmlBuilder(String str){
buildString=str;
buildXML();
}

public XmlBuilder updateData(String str){
if(str.hashCode()!=buildString.hashCode()){
buildString=str;
buildXML();
}
return this;
}
public XmlBuilder(){}
/*
*----------put Section----------
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/train/client/render/RenderRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,7 @@ public static void renderTheMinecart(EntityRollingStock cart, double x, double y
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;
float var13 = (((var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
float var14 = (((var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F;
GL11.glTranslatef(var12, var13, var14);

double var15 = cart.lastTickPosX + (cart.posX - cart.lastTickPosX) * time;
double var17 = cart.lastTickPosY + (cart.posY - cart.lastTickPosY) * time;
double var19 = cart.lastTickPosZ + (cart.posZ - cart.lastTickPosZ) * time;
Expand Down Expand Up @@ -204,10 +199,10 @@ public static void renderTheMinecart(EntityRollingStock cart, double x, double y

//GL11.glRotatef(180.0F - yaw, 0.0F, 1.0F, 0.0F);
if (cart.bogieLoco != null) {// || cart.bogieUtility[0]!=null){
GL11.glRotatef((float) -cart.anglePitchClient, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(-cart.anglePitchClient, 0.0F, 0.0F, 1.0F);
} else {
if (renderYVect != null) {
pitch = (float) cart.anglePitchClient / 60;
pitch = cart.anglePitchClient / 60;
if (cart.rotationYawClientReal > -5 && cart.rotationYawClientReal < 5) {
pitch = -pitch;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import fexcraft.tmt.slim.ModelRendererTurbo;
import fexcraft.tmt.slim.Tessellator;
import train.common.api.AbstractTrains;
import train.common.core.util.DepreciatedUtil;
import train.common.library.Info;

public class Model29080DOT111 extends ModelConverter //Same as Filename
Expand Down Expand Up @@ -469,7 +470,7 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
bodyModel[i].render(f5);
}

if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==15){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==15){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70Ton_Black.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70Ton_Greyish.png"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import fexcraft.tmt.slim.ModelRendererTurbo;
import fexcraft.tmt.slim.Tessellator;
import train.common.api.AbstractTrains;
import train.common.core.util.DepreciatedUtil;
import train.common.library.Info;

public class Model40highcube extends ModelConverter //Same as Filename
Expand Down Expand Up @@ -378,7 +379,7 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
GL11.glTranslated(2.055,0,0.03);
bogie.render(entity,f,f1,f2,f3,f4,f5);
GL11.glPopMatrix();*/
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==3 || entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==8){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==3 || entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==8){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70Ton_Greyish.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70Ton_Black.png"));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/train/client/render/models/Model440R_Back.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import fexcraft.tmt.slim.ModelRendererTurbo;
import fexcraft.tmt.slim.Tessellator;
import train.common.api.AbstractTrains;
import train.common.core.util.DepreciatedUtil;
import train.common.library.Info;

public class Model440R_Back extends ModelConverter //Same as Filename
Expand Down Expand Up @@ -1429,7 +1430,7 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
}


if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==3455){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==3455){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/440_bogie.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/440_bogie.png"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import fexcraft.tmt.slim.ModelRendererTurbo;
import fexcraft.tmt.slim.Tessellator;
import train.common.api.AbstractTrains;
import train.common.core.util.DepreciatedUtil;
import train.common.library.Info;

public class Model440R_Front extends ModelConverter //Same as Filename
Expand Down Expand Up @@ -1577,7 +1578,7 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
}


if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==3455){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==3455){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/440_bogie.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/440_bogie.png"));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/train/client/render/models/Model440R_Mid.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import fexcraft.tmt.slim.ModelRendererTurbo;
import fexcraft.tmt.slim.Tessellator;
import train.common.api.AbstractTrains;
import train.common.core.util.DepreciatedUtil;
import train.common.library.Info;

public class Model440R_Mid extends ModelConverter //Same as Filename
Expand Down Expand Up @@ -1388,7 +1389,7 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
}
}

if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==3455){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==3455){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/440_bogie.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/440_bogie.png"));
Expand Down
39 changes: 20 additions & 19 deletions src/main/java/train/client/render/models/Model60centerbeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import train.client.render.models.loads.Modelwrappedwood;
import train.common.api.AbstractTrains;
import train.common.api.Freight;
import train.common.core.util.DepreciatedUtil;
import train.common.library.Info;

public class Model60centerbeam extends ModelConverter //Same as Filename
Expand Down Expand Up @@ -338,11 +339,11 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
int cargo = ((Freight) entity).getAmmountOfCargo();
if (cargo != 0) {
if(cargo<=9) {
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==0){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==0){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_thickthin.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==7) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==7) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_canfor.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==11) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==11) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_irving.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_portbec.png"));
Expand Down Expand Up @@ -374,11 +375,11 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f
GL11.glPopMatrix();
}
else if(cargo<=18 && cargo>9) {
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==0){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==0){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_thickthin.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==7) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==7) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_canfor.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==11) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==11) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_irving.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_portbec.png"));
Expand Down Expand Up @@ -436,11 +437,11 @@ else if(cargo<=18 && cargo>9) {
GL11.glPopMatrix();
}
else if(cargo<=27 && cargo>18) {
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==0){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==0){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_thickthin.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==7) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==7) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_canfor.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==11) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==11) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_irving.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_portbec.png"));
Expand Down Expand Up @@ -524,11 +525,11 @@ else if(cargo<=27 && cargo>18) {
GL11.glPopMatrix();
}
else if(cargo<=36 && cargo>27) {
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==0){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==0){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_thickthin.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==7) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==7) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_canfor.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==11) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==11) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_irving.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_portbec.png"));
Expand Down Expand Up @@ -630,11 +631,11 @@ else if(cargo<=36 && cargo>27) {
GL11.glPopMatrix();
}
else if(cargo<=45 && cargo>36) {
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==0){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==0){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_thickthin.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==7) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==7) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_canfor.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==11) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==11) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_irving.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_portbec.png"));
Expand Down Expand Up @@ -758,11 +759,11 @@ else if(cargo<=45 && cargo>36) {
GL11.glPopMatrix();
}
else {
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==0) {
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==0) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_thickthin.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==7) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==7) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_canfor.png"));
}else if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==11) {
}else if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==11) {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_irving.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/loads/wrappedwood_portbec.png"));
Expand Down Expand Up @@ -900,7 +901,7 @@ else if(cargo<=45 && cargo>36) {
}
}
//Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70truck_Black.png"));
if(entity instanceof AbstractTrains && AbstractTrains.getColorFromString(((AbstractTrains) entity).getColor())==2){
if(entity instanceof AbstractTrains && DepreciatedUtil.getColorFromString(((AbstractTrains) entity).getColor())==2){
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70Ton_Black.png"));
} else {
Tessellator.bindTexture(new ResourceLocation(Info.resourceLocation, "textures/trains/70Ton_Greyish.png"));
Expand Down
Loading

0 comments on commit a448dfc

Please sign in to comment.