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 21, 2023
2 parents aa89efb + a2f1202 commit 6829e43
Show file tree
Hide file tree
Showing 17 changed files with 1,552 additions and 1,595 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ task packApi(type: Jar, dependsOn: "classes") {
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')
excludes.addAll('assets/tc/sounds.json')
}
}

Expand Down
3,032 changes: 1,516 additions & 1,516 deletions src/main/java/train/client/render/RenderEnum.java

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/main/java/train/common/api/EntityBogie.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ protected void func_145821_a(int x, int y, int z, double maxSpeed, double slopeA
private void updateOnTrack(int i, int j, int k, Block l) {

if (canUseRail() && BlockRailBase.func_150051_a(l)) {
super.onUpdate();

int i1 = ((BlockRailBase) l).getBasicRailMetadata(worldObj, this, i, j, k);
super.onUpdate();
meta = i1;

posY = j;
flag = false;
flag1 = l == Blocks.golden_rail;
Expand Down Expand Up @@ -542,7 +542,6 @@ public void onUpdate(){
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;

if (this.worldObj.isRemote) {
if (this.turnProgress > 0) {
double d6 = this.posX + (this.minecartX - this.posX) / this.turnProgress;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/train/common/api/EntityRollingStock.java
Original file line number Diff line number Diff line change
Expand Up @@ -1722,13 +1722,13 @@ else if (!playerEntity.getDisplayName().toLowerCase().equals(this.trainOwner.toL

}

if (itemstack != null && itemstack.getItem() instanceof ItemWrench && this instanceof Locomotive
&& entityplayer.isSneaking() && !worldObj.isRemote) {
if (itemstack != null && itemstack.getItem() instanceof ItemWrench && this instanceof Locomotive && entityplayer.isSneaking() && !worldObj.isRemote) {
destination = "";
entityplayer.addChatMessage(new ChatComponentText("Destination reset"));
return true;
}
if (MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, entityplayer))) { return true; }
if (MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent(this, entityplayer))) {
entityplayer.addChatMessage(new ChatComponentText("test")); }
if (itemstack != null && itemstack.hasTagCompound() && getTicketDestination(itemstack) != null && getTicketDestination(itemstack).length() > 0) {
this.setDestination(itemstack);
/**
Expand Down Expand Up @@ -1772,7 +1772,9 @@ else if (this.acceptedColors != null && this.acceptedColors.size() == 0) {
entityplayer.addChatMessage(new ChatComponentText("No other colors available"));
}
}
else if ((trainsOnClick.onClickWithStake(this, itemstack, playerEntity, worldObj))) { return true; }
if ((trainsOnClick.onClickWithStake(this, itemstack, playerEntity, worldObj))) {
entityplayer.addChatMessage(new ChatComponentText("test"));
return true; }

if (itemstack != null && itemstack.getItem() instanceof ItemPaintbrushThing && entityplayer.isSneaking()) {
if (this.acceptedColors != null && this.acceptedColors.size() > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import net.minecraft.world.World;
import train.common.api.EntityRollingStock;
import train.common.api.IPassenger;
import train.common.api.ISecondBogie;

public class EntityPassengerDB420Middle extends EntityRollingStock implements IPassenger, ISecondBogie {

public class EntityPassengerDB420Middle extends EntityRollingStock implements IPassenger {
public EntityPassengerDB420Middle(World world) {
super(world);
}
Expand All @@ -22,43 +22,15 @@ public EntityPassengerDB420Middle(World world, double d, double d1, double d2){
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;

}

@Override
public void updateRiderPosition() {
if (riddenByEntity == null) {return;}
double pitchRads = this.anglePitchClient * Math.PI / 180.0D;
double distance = 1.5f;
double yOffset = -0.2f;
float rotationCos1 = (float) Math.cos(Math.toRadians(this.renderYaw + 90));
float rotationSin1 = (float) Math.sin(Math.toRadians((this.renderYaw + 90)));
if(side.isServer()){
rotationCos1 = (float) Math.cos(Math.toRadians(this.serverRealRotation + 90));
rotationSin1 = (float) Math.sin(Math.toRadians((this.serverRealRotation + 90)));
anglePitchClient = serverRealPitch*60;
}
float pitch = (float) (posY + ((Math.tan(pitchRads) * distance) + getMountedYOffset())
+ riddenByEntity.getYOffset() + yOffset);
float pitch1 = (float) (posY + getMountedYOffset() + riddenByEntity.getYOffset() + yOffset);
double bogieX1 = (this.posX + (rotationCos1 * distance));
double bogieZ1 = (this.posZ + (rotationSin1* distance));
//System.out.println(rotationCos1+" "+rotationSin1);
if(anglePitchClient>20 && rotationCos1 == 1){
bogieX1-=pitchRads*2;
pitch-=pitchRads*1.2;
}
if(anglePitchClient>20 && rotationSin1 == 1){
bogieZ1-=pitchRads*2 + 1;
pitch-=pitchRads*1.2;
}
if (pitchRads == 0.0) {
riddenByEntity.setPosition(bogieX1, pitch1, bogieZ1);
}
if (pitchRads > -1.01 && pitchRads < 1.01) {
riddenByEntity.setPosition(bogieX1, pitch, bogieZ1);
}
if(riddenByEntity!=null) {
riddenByEntity.setPosition(posX, posY + getMountedYOffset() + riddenByEntity.getYOffset() - 0.1, posZ);
}//ew yucky rider position code, good thing its a passenger car so it doesnt matter! Wheeze.png
}

@Override
public void setDead() {
super.setDead();
Expand Down Expand Up @@ -100,5 +72,5 @@ public boolean isPoweredCart() {
}

@Override
public float getOptimalDistance(EntityMinecart cart) { return 0.9F; }
public float getOptimalDistance(EntityMinecart cart) { return 2.0F; }
}
8 changes: 4 additions & 4 deletions src/main/java/train/common/items/ItemTCRail.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,12 +1251,12 @@ else if (tempType == TrackTypes.MEDIUM_RIGHT_45DEGREE_SWITCH || tempType == Trac
switch (tempType) {
case MEDIUM_RIGHT_45DEGREE_SWITCH:
typeVariantStraight = TrackTypes.SMALL_STRAIGHT.getLabel();
typeVariant90Turn = TrackTypes.MEDIUM_RIGHT_45DEGREE_TURN.getLabel();
typeVariant90Turn = TrackTypes.MEDIUM_RIGHT_TURN.getLabel();
idVariantSwitch = ItemIDs.tcRailMedium45DegreeSwitch.item;
break;
case EMBEDDED_MEDIUM_RIGHT_45DEGREE_SWITCH:
typeVariantStraight = TrackTypes.EMBEDDED_SMALL_STRAIGHT.getLabel();
typeVariant90Turn = TrackTypes.EMBEDDED_MEDIUM_RIGHT_45DEGREE_TURN.getLabel();
typeVariant90Turn = TrackTypes.EMBEDDED_MEDIUM_RIGHT_TURN.getLabel();
idVariantSwitch = ItemIDs.tcRailEmbeddedMedium45DegreeSwitch.item;
break;
}
Expand Down Expand Up @@ -1431,12 +1431,12 @@ else if (tempType == TrackTypes.MEDIUM_LEFT_45DEGREE_SWITCH || tempType == Track
switch (tempType) {
case MEDIUM_LEFT_45DEGREE_SWITCH:
typeVariantStraight = TrackTypes.SMALL_STRAIGHT.getLabel();
typeVariant90Turn = TrackTypes.MEDIUM_LEFT_45DEGREE_TURN.getLabel();
typeVariant90Turn = TrackTypes.MEDIUM_LEFT_TURN.getLabel();
idVariantSwitch = ItemIDs.tcRailMedium45DegreeSwitch.item;
break;
case EMBEDDED_MEDIUM_LEFT_45DEGREE_SWITCH:
typeVariantStraight = TrackTypes.EMBEDDED_SMALL_STRAIGHT.getLabel();
typeVariant90Turn = TrackTypes.EMBEDDED_MEDIUM_LEFT_45DEGREE_TURN.getLabel();
typeVariant90Turn = TrackTypes.EMBEDDED_MEDIUM_LEFT_TURN.getLabel();
idVariantSwitch = ItemIDs.tcRailEmbeddedMedium45DegreeSwitch.item;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/train/common/library/EnumTrains.java
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public enum EnumTrains implements TrainRecord {
Class416Loco("Class416Loco", EntityElectricClass416Loco.class, ItemIDs.minecartClass416Locomotive.item, "electric", 850, 121, 0, 10, 0, 0, 0.7, 0.8, 0, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Cyan", "Green", "Grey", "LightBlue", "Orange"}), 18, -4, "Pack: B.I.P."),
Class416Tail("Class416Tail", EntityPassengerClass416Tail.class, ItemIDs.minecartClass416Tail.item, "passenger", 0, 0, 1, 0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Cyan", "Green", "Grey", "LightBlue", "Orange"}), 18, 0, "Pack: B.I.P." ),
DB420Loco("DB420Loco", EntityElectricDB420Loco.class, ItemIDs.minecartDB420Loco.item, "electric", 800, 120, 0, 10, 0, 100, 0.7, 0.8, 1000, TraincraftUtil.getBytesFromColors(new String[]{"Red", "Yellow"}), 18, -3, "Pack: MetroIM"),
DB420Middle("DB420Middle", EntityPassengerDB420Middle.class, ItemIDs.minecartDB420Middle.item, "passenger", 0, 0, 2, 0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[]{"Red", "Yellow"}), 10, -2.6, "Pack: MetroIM"),
DB420Middle("DB420Middle", EntityPassengerDB420Middle.class, ItemIDs.minecartDB420Middle.item, "passenger", 0, 0, 2, 0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[]{"Red", "Yellow"}), 10, 0, "Pack: MetroIM"),
DB420Tail("DB420Tail", EntityPassengerDB420Tail.class, ItemIDs.minecartDB420Tail.item, "passenger", 0, 0, 2, 0, 0, 0, 0, 0, 0, TraincraftUtil.getBytesFromColors(new String[]{"Red", "Yellow"}), 10, -3, "Pack: MetroIM"),
CattleVan("CattleVan", EntityCattleVan.class, ItemIDs.minecartCattleVan.item, "special", 0, 0, 3.3, 0, 0, 0, 0, 0, 0,null ,18, 0, "pack: B.I.P."),
Class401Engine("Class401Engine",EntityLocoElectricClass401.class, ItemIDs.minecartClass401Loco.item, "electric", 428, 121, 0, 7, 0, 0, 0.5, 0.9, 0, TraincraftUtil.getBytesFromColors(new String[] {"Blue", "Lime", "Green", "Grey"}), 18, -3.4, "Pack: B.I.P."),
Expand Down
Loading

0 comments on commit 6829e43

Please sign in to comment.