Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yoink from doc #678

18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ minecraft {
replace "@VERSION1@", config.modVersion.toString()
}

task packApi(type: Jar, dependsOn: "classes") {
// Jar will always be updated
outputs.upToDateWhen {false}
// Set the jar's base name
baseName = "Traincraft"

from (sourceSets.main.output) {
excludes.addAll('**/*.info')
excludes.addAll('assets/tc/textures/trains')
excludes.addAll('assets/tc/textures/items/trains')
excludes.addAll('assets/tc/sounds')
}
}





repositories {
maven {
name "gt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ else if ( item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_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 );
}
if ( item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_45DEGREE_SWITCH )
else if ( item.getTrackType() == ItemTCRail.TrackTypes.MEDIUM_45DEGREE_SWITCH || item.getTrackType() == ItemTCRail.TrackTypes.EMBEDDED_MEDIUM_45DEGREE_SWITCH )
{

}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/train/client/gui/GuiCrafterTier.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import train.common.library.EnumTrains;
import train.common.library.Info;
import train.common.library.ItemIDs;
import train.common.Traincraft;
import train.common.api.TrainRecord;

import java.util.List;

Expand Down Expand Up @@ -110,7 +112,7 @@ protected void drawGuiContainerBackgroundLayer(float f, int t, int g) {
GL11.glTranslatef(guiLeft-70, this.guiTop+170, 100);

RenderHelper.enableGUIStandardItemLighting();
EnumTrains train = EnumTrains.getCurrentTrain(currentKnownItem);
TrainRecord train = Traincraft.instance.traincraftRegistry.findTrainRecordByItem(currentKnownItem);
renderEntity = train.getEntity(mc.theWorld);
if(renderEntity!=null && !Item.itemRegistry.getNameForObject(currentKnownItem).equals(Item.itemRegistry.getNameForObject(previousItem))){
previousItem = currentKnownItem;
Expand Down
32 changes: 28 additions & 4 deletions src/main/java/train/client/render/RenderEnum.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
import train.common.entity.rollingStock.*;

import java.util.ArrayList;
import train.common.api.TrainRenderRecord;
import train.common.library.Info;
import net.minecraft.util.ResourceLocation;

public enum RenderEnum {
import java.util.ArrayList;

public enum RenderEnum implements TrainRenderRecord {

/** Passengers */
passengerCartBlue(EntityPassengerBlue.class, new ModelPassenger6(), "passenger_", true, new float[] { 0.0F, -0.47F, 0.0F }, null, null, "", 0, null, "", null, 0, false),
Expand Down Expand Up @@ -1425,11 +1430,12 @@ public enum RenderEnum {
this.explosionFXIterations = explosionFXIterations;
this.hasSmokeOnSlopes = hasSmokeOnSlopes;
}

@Override
public Class<? extends AbstractTrains> getEntityClass() {
return entityClass;
}

@Override
public ModelBase getModel() {
return model;
}
Expand All @@ -1438,55 +1444,73 @@ public boolean getIsMultiTextured() {
return multiTexture;
}

@Override
public boolean hasSmoke() {
return smokeType.length() > 0;
}

@Override
public boolean hasSmokeOnSlopes() {
return hasSmokeOnSlopes;
}

@Override
public String getSmokeType() {
return smokeType;
}

@Override
public ArrayList<double[]> getSmokeFX() {
return smokeFX;
}

@Override
public String getExplosionType() {
return explosionType;
}

@Override
public boolean hasExplosion() {
return explosionType.length() > 0;
}

@Override
public ArrayList<double[]> getExplosionFX() {
return explosionFX;
}

@Override
public float[] getTrans() {
return trans;
}

@Override
public float[] getRotate() {
return rotate;
}

@Override
public float[] getScale() {
return scale;
}

public String getTexture() {
return texture;
@Override
public ResourceLocation getTextureFile(String colorString) {
if (multiTexture) {
return new ResourceLocation(Info.resourceLocation, Info.trainsPrefix + texture + colorString + ".png");
} else {
return new ResourceLocation(Info.resourceLocation, Info.trainsPrefix + texture + ".png");
}
}

@Override
public int getSmokeIterations() {
return smokeIterations;
}

@Override
public int getExplosionFXIterations() {
return explosionFXIterations;
}
}

Loading
Loading