train coupling, pulling physics

This commit is contained in:
Bob 2023-05-29 16:50:51 +02:00
parent 428dce6a23
commit 87a87738ba
12 changed files with 245 additions and 56 deletions

View File

@ -41,11 +41,11 @@ public class PowderRecipes {
CraftingManager.addShapelessAuto(new ItemStack(Items.gunpowder, 3), new Object[] { S.dust(), KNO.dust(), new ItemStack(Items.coal, 1, 1) });
//Blends
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_power, 5), new Object[] { REDSTONE.dust(), "dustGlowstone", DIAMOND.dust(), NP237.dust(), MAGTUNG.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_power, 3), new Object[] { "dustGlowstone", DIAMOND.dust(), MAGTUNG.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_nitan_mix, 6), new Object[] { NP237.dust(), I.dust(), TH232.dust(), AT.dust(), ND.dust(), CS.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_nitan_mix, 6), new Object[] { ST.dust(), CO.dust(), BR.dust(), TS.dust(), NB.dust(), CE.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_spark_mix, 5), new Object[] { DESH.dust(), EUPH.dust(), ModItems.powder_meteorite, ModItems.powder_power, ModItems.powder_nitan_mix });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_meteorite, 5), new Object[] { IRON.dust(), CU.dust(), LI.dust(), W.dust(), U.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_spark_mix, 3), new Object[] { DESH.dust(), EUPH.dust(), ModItems.powder_power });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_meteorite, 4), new Object[] { IRON.dust(), CU.dust(), LI.dust(), NETHERQUARTZ.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_thermite, 4), new Object[] { IRON.dust(), IRON.dust(), IRON.dust(), AL.dust() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.powder_desh_mix, 1), new Object[] { B.dustTiny(), B.dustTiny(), LA.dustTiny(), LA.dustTiny(), CE.dustTiny(), CO.dustTiny(), LI.dustTiny(), ND.dustTiny(), NB.dustTiny() });

View File

@ -1,14 +1,19 @@
package com.hbm.entity.train;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.hbm.blocks.rail.IRailNTM;
import com.hbm.blocks.rail.IRailNTM.RailContext;
import com.hbm.blocks.rail.IRailNTM.TrackGauge;
import com.hbm.items.ModItems;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.util.fauxpointtwelve.BlockPos;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
@ -23,6 +28,7 @@ import net.minecraft.world.World;
public abstract class EntityRailCarBase extends Entity {
public LogicalTrainUnit ltu;
public boolean isOnRail = true;
private int turnProgress;
/* Clientside position that should be approached with smooth interpolation */
@ -94,12 +100,29 @@ public abstract class EntityRailCarBase extends Entity {
if(neighbor.getCoupledTo(closestNeighborCoupling) != null) continue;
this.couple(closestOwnCoupling, neighbor);
neighbor.couple(closestNeighborCoupling, this);
if(this.ltu != null) this.ltu.dissolve();
if(neighbor.ltu != null) neighbor.ltu.dissolve();
player.swingItem();
return true;
}
}
}
if(this.ltu != null) {
String id = Integer.toHexString(ltu.hashCode());
for(EntityRailCarBase train : ltu.trains) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "debug");
data.setInteger("color", 0x0000ff);
data.setFloat("scale", 1.5F);
data.setString("text", id);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, train.posX, train.posY + 1, train.posZ), new TargetPoint(this.dimension, train.posX, train.posY + 1, train.posZ, 50));
}
}
return false;
}
@ -127,14 +150,7 @@ public abstract class EntityRailCarBase extends Entity {
this.setPosition(this.posX, this.posY, this.posZ);
this.setRotation(this.rotationYaw, this.rotationPitch);
}
/*
* TODO: move movement into the world tick event handler.
* step 1: detect linked trains, move linked units (LTUs) as one later
* step 2: move LTUs together using coupling rules (important to happen first, consistency has to be achieved before major movement)
* step 3: move LTUs based on their engine and gravity speed
* step 4: move LTUs based on collisions between LTUs (important to happen last, collision is most important)
*/
BlockPos anchor = this.getCurentAnchorPos();
Vec3 frontPos = getRelPosAlongRail(anchor, this.getLengthSpan());
Vec3 backPos = getRelPosAlongRail(anchor, -this.getLengthSpan());
@ -150,6 +166,19 @@ public abstract class EntityRailCarBase extends Entity {
}
} else {
if(this.coupledFront != null && this.coupledFront.isDead) {
this.coupledFront = null;
if(this.ltu != null) this.ltu.dissolve();
}
if(this.coupledBack != null && this.coupledBack.isDead) {
this.coupledBack = null;
if(this.ltu != null) this.ltu.dissolve();
}
if(this.ltu == null && (this.coupledFront == null || this.coupledBack == null)) {
LogicalTrainUnit.generate(this);
}
DummyConfig[] definitions = this.getDummies();
@ -172,31 +201,6 @@ public abstract class EntityRailCarBase extends Entity {
this.initDummies = true;
}
BlockPos anchor = this.getCurentAnchorPos();
Vec3 corePos = getRelPosAlongRail(anchor, this.getCurrentSpeed());
if(corePos == null) {
this.derail();
} else {
this.setPosition(corePos.xCoord, corePos.yCoord, corePos.zCoord);
anchor = this.getCurentAnchorPos(); //reset origin to new position
Vec3 frontPos = getRelPosAlongRail(anchor, this.getLengthSpan());
Vec3 backPos = getRelPosAlongRail(anchor, -this.getLengthSpan());
if(frontPos == null || backPos == null) {
this.derail();
return;
} else {
this.renderX = (frontPos.xCoord + backPos.xCoord) / 2D;
this.renderY = (frontPos.yCoord + backPos.yCoord) / 2D;
this.renderZ = (frontPos.zCoord + backPos.zCoord) / 2D;
this.prevRotationYaw = this.rotationYaw;
this.rotationYaw = this.movementYaw = generateYaw(frontPos, backPos);
this.motionX = this.rotationYaw / 360D; // hijacking this crap for easy syncing
this.velocityChanged = true;
}
}
for(int i = 0; i < definitions.length; i++) {
DummyConfig def = definitions[i];
BoundingBoxDummyEntity dummy = dummies[i];
@ -212,15 +216,16 @@ public abstract class EntityRailCarBase extends Entity {
}
public Vec3 getRelPosAlongRail(BlockPos anchor, double distanceToCover) {
float yaw = this.rotationYaw;
return getRelPosAlongRail(anchor, distanceToCover, this.getGauge(), this.worldObj, Vec3.createVectorHelper(posX, posY, posZ), this.rotationYaw);
}
public static Vec3 getRelPosAlongRail(BlockPos anchor, double distanceToCover, TrackGauge gauge, World worldObj, Vec3 next, float yaw) {
if(distanceToCover < 0) {
distanceToCover *= -1;
yaw += 180;
}
Vec3 next = Vec3.createVectorHelper(posX, posY, posZ);
int it = 0;
do {
@ -228,8 +233,6 @@ public abstract class EntityRailCarBase extends Entity {
it++;
if(it > 30) {
worldObj.createExplosion(this, posX, posY, posZ, 5F, false);
this.derail();
return null;
}
@ -250,7 +253,7 @@ public abstract class EntityRailCarBase extends Entity {
boolean flip = distanceToCover < 0;
if(rail.getGauge(worldObj, x, y, z) == this.getGauge()) {
if(rail.getGauge(worldObj, x, y, z) == gauge) {
RailContext info = new RailContext();
Vec3 prev = next;
next = rail.getTravelLocation(worldObj, x, y, z, prev.xCoord, prev.yCoord, prev.zCoord, rot.xCoord, rot.yCoord, rot.zCoord, distanceToCover, info);
@ -271,15 +274,34 @@ public abstract class EntityRailCarBase extends Entity {
return next;
}
public float generateYaw(Vec3 front, Vec3 back) {
public static float generateYaw(Vec3 front, Vec3 back) {
double deltaX = front.xCoord - back.xCoord;
double deltaZ = front.zCoord - back.zCoord;
double radians = -Math.atan2(deltaX, deltaZ);
return (float) MathHelper.wrapAngleTo180_double(radians * 180D / Math.PI);
}
public static void updateMotion(World world) {
Set<LogicalTrainUnit> ltus = new HashSet();
/* gather all LTUs */
for(Object o : world.loadedEntityList) {
if(o instanceof EntityRailCarBase) {
EntityRailCarBase train = (EntityRailCarBase) o;
if(train.ltu != null) ltus.add(train.ltu);
}
}
/* Move carts together with links */
for(LogicalTrainUnit ltu : ltus) ltu.combineLinks();
/* Move carts with unified speed */
for(LogicalTrainUnit ltu : ltus) ltu.moveLinks();
}
/** Returns the amount of blocks that the train should move per tick */
public abstract double getCurrentSpeed();
public abstract double getMaxRailSpeed();
/** Returns the gauge of this train */
public abstract TrackGauge getGauge();
/** Returns the length between the core and one of the bogies */
@ -289,9 +311,9 @@ public abstract class EntityRailCarBase extends Entity {
return this.boundingBox;
}
/** Returns a collision box used for block collisions when derailed */
@Override public AxisAlignedBB getBoundingBox() {
/*@Override public AxisAlignedBB getBoundingBox() {
return this.boundingBox;
}
}*/
/** Returns the "true" position of the train, i.e. the block it wants to snap to */
public BlockPos getCurentAnchorPos() {
@ -437,6 +459,10 @@ public abstract class EntityRailCarBase extends Entity {
return coupling == TrainCoupling.FRONT ? this.coupledFront : coupling == TrainCoupling.BACK ? this.coupledBack : null;
}
public TrainCoupling getCouplingFrom(EntityRailCarBase coupledTo) {
return coupledTo == this.coupledFront ? TrainCoupling.FRONT : coupledTo == this.coupledBack ? TrainCoupling.BACK : null;
}
public void couple(TrainCoupling coupling, EntityRailCarBase to) {
if(coupling == TrainCoupling.FRONT) this.coupledFront = to;
if(coupling == TrainCoupling.BACK) this.coupledBack = to;
@ -444,8 +470,142 @@ public abstract class EntityRailCarBase extends Entity {
public static class LogicalTrainUnit {
List<EntityRailCarBase> trains = new ArrayList();
protected EntityRailCarBase trains[];
//TBI
/** Assumes that the train is an endpoint, i.e. that only one coupling is in use */
public static LogicalTrainUnit generate(EntityRailCarBase train) {
List<EntityRailCarBase> links = new ArrayList();
Set<EntityRailCarBase> brake = new HashSet();
links.add(train);
brake.add(train);
LogicalTrainUnit ltu = new LogicalTrainUnit();
if(train.coupledFront == null && train.coupledFront == null) {
ltu.trains = new EntityRailCarBase[] {train};
train.ltu = ltu;
return ltu;
}
EntityRailCarBase prevCar = train;
EntityRailCarBase nextCar = train.coupledBack == null ? train.coupledFront : train.coupledBack;
while(nextCar != null) {
links.add(nextCar);
brake.add(nextCar);
EntityRailCarBase currentCar = nextCar;
nextCar = nextCar.coupledBack == prevCar ? nextCar.coupledFront : nextCar.coupledBack;
prevCar = currentCar;
if(brake.contains(nextCar)) {
break;
}
}
ltu.trains = new EntityRailCarBase[links.size()];
for(int i = 0; i < ltu.trains.length; i++) {
ltu.trains[i] = links.get(i);
ltu.trains[i].ltu = ltu;
}
return ltu;
}
public void dissolve() {
for(EntityRailCarBase train : trains) {
train.ltu = null;
}
}
public void combineLinks() {
if(trains.length <= 1) return;
boolean odd = trains.length % 2 == 1;
int centerIndex = odd ? trains.length / 2 : trains.length / 2 - 1;
EntityRailCarBase center = trains[centerIndex];
EntityRailCarBase prev = center;
for(int i = centerIndex - 1; i >= 0; i--) {
EntityRailCarBase next = trains[i];
moveTo(prev, next);
prev = next;
}
prev = center;
for(int i = centerIndex + 1; i < trains.length; i++) {
EntityRailCarBase next = trains[i];
moveTo(prev, next);
prev = next;
}
}
public static void moveTo(EntityRailCarBase prev, EntityRailCarBase next) {
TrainCoupling prevCouple = prev.getCouplingFrom(next);
TrainCoupling nextCouple = next.getCouplingFrom(prev);
Vec3 prevLoc = prev.getCouplingPos(prevCouple);
Vec3 nextLoc = next.getCouplingPos(nextCouple);
Vec3 delta = Vec3.createVectorHelper(prevLoc.xCoord - nextLoc.xCoord, 0, prevLoc.zCoord - nextLoc.zCoord);
double len = delta.lengthVector();
len *= 0.25D; //suspension, causes movements to be less rigid
BlockPos anchor = new BlockPos(next.posX, next.posY, next.posZ);
Vec3 trainPos = Vec3.createVectorHelper(next.posX, next.posY, next.posZ);
float yaw = EntityRailCarBase.generateYaw(prevLoc, nextLoc);
Vec3 newPos = EntityRailCarBase.getRelPosAlongRail(anchor, len, next.getGauge(), next.worldObj, trainPos, yaw);
next.setPosition(newPos.xCoord, newPos.yCoord, newPos.zCoord);
}
public void moveLinks() {
EntityRailCarBase prev = trains[0];
TrainCoupling dir = prev.getCouplingFrom(null);
double totalSpeed = 0;
double maxSpeed = Double.POSITIVE_INFINITY;
for(EntityRailCarBase train : this.trains) {
boolean con = train.getCouplingFrom(prev) == dir;
double speed = train.getCurrentSpeed();
if(!con) speed *= -1;
totalSpeed += speed;
maxSpeed = Math.min(maxSpeed, train.getMaxRailSpeed());
prev = train;
}
if(Math.abs(totalSpeed) > maxSpeed) {
totalSpeed = maxSpeed * Math.signum(totalSpeed);
}
for(EntityRailCarBase train : this.trains) {
BlockPos anchor = train.getCurentAnchorPos();
Vec3 corePos = train.getRelPosAlongRail(anchor, totalSpeed);
if(corePos == null) {
train.derail();
this.dissolve();
return;
} else {
train.setPosition(corePos.xCoord, corePos.yCoord, corePos.zCoord);
anchor = train.getCurentAnchorPos(); //reset origin to new position
Vec3 frontPos = train.getRelPosAlongRail(anchor, train.getLengthSpan());
Vec3 backPos = train.getRelPosAlongRail(anchor, -train.getLengthSpan());
if(frontPos == null || backPos == null) {
train.derail();
this.dissolve();
return;
} else {
train.renderX = (frontPos.xCoord + backPos.xCoord) / 2D;
train.renderY = (frontPos.yCoord + backPos.yCoord) / 2D;
train.renderZ = (frontPos.zCoord + backPos.zCoord) / 2D;
train.prevRotationYaw = train.rotationYaw;
train.rotationYaw = train.movementYaw = generateYaw(frontPos, backPos);
train.motionX = train.rotationYaw / 360D; // hijacking this crap for easy syncing
train.velocityChanged = true;
}
}
}
}
}
}

View File

@ -48,6 +48,7 @@ public class TrainCargoTram extends EntityRailCarElectric implements IGUIProvide
@Override public double getPassivBrake() { return 0.95; }
@Override public boolean shouldUseEngineBrake(EntityPlayer player) { return Math.abs(this.engineSpeed) < 0.1; }
@Override public double getMaxPoweredSpeed() { return 0.5; }
@Override public double getMaxRailSpeed() { return 1; }
@Override public TrackGauge getGauge() { return TrackGauge.STANDARD; }
@Override public double getLengthSpan() { return 1.5; }

View File

@ -25,6 +25,7 @@ public class TrainCargoTramTrailer extends EntityRailCarCargo {
this.setSize(5F, 2F);
}
@Override public double getMaxRailSpeed() { return 1; }
@Override public TrackGauge getGauge() { return TrackGauge.STANDARD; }
@Override public double getLengthSpan() { return 1.5; }
@Override public int getSizeInventory() { return 29; }

View File

@ -529,6 +529,26 @@ public class AssemblerRecipes {
new OreDictStack(DIAMOND.dust(), 32)
}, 100);
makeRecipe(new ComparableStack(ModItems.drillbit, 1, EnumDrillType.TCALLOY.ordinal()), new AStack[] {
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 20),
new OreDictStack(DESH.ingot(), 12),
new OreDictStack(RUBBER.ingot(), 8)
}, 200);
makeRecipe(new ComparableStack(ModItems.drillbit, 1, EnumDrillType.TCALLOY_DIAMOND.ordinal()), new AStack[] {
new ComparableStack(ModItems.drillbit, 1, EnumDrillType.TCALLOY.ordinal()),
new OreDictStack(DIAMOND.dust(), 48)
}, 100);
makeRecipe(new ComparableStack(ModItems.drillbit, 1, EnumDrillType.FERRO.ordinal()), new AStack[] {
new OreDictStack(FERRO.ingot(), 24),
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 12),
new OreDictStack(BI.ingot(), 4),
}, 200);
makeRecipe(new ComparableStack(ModItems.drillbit, 1, EnumDrillType.FERRO_DIAMOND.ordinal()), new AStack[] {
new ComparableStack(ModItems.drillbit, 1, EnumDrillType.FERRO.ordinal()),
new OreDictStack(DIAMOND.dust(), 56)
}, 100);
makeRecipe(new ComparableStack(ModBlocks.machine_large_turbine, 1), new AStack[] {
new OreDictStack(STEEL.plate528(), 12),
new OreDictStack(RUBBER.ingot(), 4),
@ -953,7 +973,7 @@ public class AssemblerRecipes {
new ComparableStack(ModItems.sphere_steel, 1),
new ComparableStack(ModItems.pipes_steel, 1),
new ComparableStack(ModItems.motor_desh, 3),
new ComparableStack(ModItems.circuit_gold, 1)
new OreDictStack(KEY_CIRCUIT_BISMUTH, 1)
}, 200);
makeRecipe(new ComparableStack(ModBlocks.machine_catalytic_reformer, 1), new AStack[] {
new OreDictStack(STEEL.plateCast(), 12),

View File

@ -139,6 +139,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 100));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 100));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX)), new CrystallizerRecipe(new ItemStack(ModItems.pellet_charged), 200), new FluidStack(Fluids.IONGEL, 500));
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)), new CrystallizerRecipe(new ItemStack(ModItems.pill_red), 200), new FluidStack(Fluids.ESTRADIOL, 250));

View File

@ -522,7 +522,7 @@ public class CraftingManager {
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_lithium), new Object[] { "A A", "PLP", "PSP", 'A', ModItems.wire_gold, 'P', TI.plate(), 'S', LI.dust(), 'L', CO.dust() });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_schrabidium), new Object[] { " A ", "PNP", "PSP", 'A', ModItems.wire_schrabidium, 'P', SA326.plate(), 'S', SA326.dust(), 'N', NP237.dust() });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_schrabidium), new Object[] { " A ", "PSP", "PNP", 'A', ModItems.wire_schrabidium, 'P', SA326.plate(), 'S', SA326.dust(), 'N', NP237.dust() });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark), new Object[] { " A ", "PSP", "PSP", 'A', ModItems.wire_magnetized_tungsten, 'P', ModItems.plate_dineutronium, 'S', ModItems.powder_spark_mix });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark), new Object[] { "P", "S", "S", 'P', ModItems.plate_dineutronium, 'S', ModItems.powder_spark_mix });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_trixite), new Object[] { " A ", "PSP", "PTP", 'A', ModItems.wire_aluminium, 'P', AL.plate(), 'S', ModItems.powder_power, 'T', ModItems.crystal_trixite });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_trixite), new Object[] { " A ", "PTP", "PSP", 'A', ModItems.wire_aluminium, 'P', AL.plate(), 'S', ModItems.powder_power, 'T', ModItems.crystal_trixite });
addRecipeAuto(ItemBattery.getFullBattery(ModItems.energy_core), new Object[] { "PCW", "TRD", "PCW", 'P', ALLOY.plate(), 'C', ModItems.coil_advanced_alloy, 'W', ModItems.wire_advanced_alloy, 'R', ModItems.cell_tritium, 'D', ModItems.cell_deuterium, 'T', W.ingot() });
@ -544,13 +544,13 @@ public class CraftingManager {
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_advanced_cell_12), new Object[] { "WPW", "BBB", "WPW", 'W', ModItems.wire_red_copper, 'P', CU.plate(), 'B', ItemBattery.getEmptyBattery(ModItems.battery_advanced_cell_4) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_lithium_cell_6), new Object[] { "WPW", "BWB", "WPW", 'W', ModItems.wire_gold, 'P', TI.plate(), 'B', ItemBattery.getEmptyBattery(ModItems.battery_lithium_cell_3) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_schrabidium_cell_4), new Object[] { "WPW", "BWB", "WPW", 'W', ModItems.wire_schrabidium, 'P', SA326.plate(), 'B', ItemBattery.getEmptyBattery(ModItems.battery_schrabidium_cell_2) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_6), new Object[] { "BBW", "BBP", "BBW", 'W', ModItems.wire_magnetized_tungsten, 'P', ModItems.plate_dineutronium, 'B', ItemBattery.getEmptyBattery(ModItems.battery_spark) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_25), new Object[] { " WW", "PCC", "BCC", 'W', ModItems.wire_magnetized_tungsten, 'P', ModItems.plate_dineutronium, 'B', ItemBattery.getEmptyBattery(ModItems.battery_spark), 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_6) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_100), new Object[] { "W W", "BPB", "BPB", 'W', ModItems.wire_magnetized_tungsten, 'P', ModItems.plate_dineutronium, 'B', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_25) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_1000), new Object[] { "CCC", "CSC", "CCC", 'S', ModItems.singularity_spark, 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_100) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_2500), new Object[] { "CVC", "PSP", "CVC", 'S', ModItems.singularity_spark, 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_100), 'V', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_1000), 'P', ModItems.plate_dineutronium });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_10000), new Object[] { "PVP", "VSV", "PVP", 'S', ModItems.singularity_spark, 'V', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_2500), 'P', ModItems.plate_dineutronium });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_power), new Object[] { "CCC", "CSC", "CCC", 'S', ModItems.singularity_spark, 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_10000) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_6), new Object[] { "BW", "PW", "BW", 'W', ModItems.wire_magnetized_tungsten, 'P', ModItems.powder_spark_mix, 'B', ItemBattery.getEmptyBattery(ModItems.battery_spark) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_25), new Object[] { "W W", "SCS", "PSP", 'W', ModItems.wire_magnetized_tungsten, 'P', ModItems.plate_dineutronium, 'S', ModItems.powder_spark_mix, 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_6) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_100), new Object[] { "W W", "BPB", "SSS", 'W', ModItems.wire_magnetized_tungsten, 'P', ModItems.plate_dineutronium, 'S', ModItems.powder_spark_mix, 'B', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_25) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_1000), new Object[] { "PCP", "CSC", "PCP", 'S', ModItems.singularity_spark, 'P', ModItems.powder_spark_mix, 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_100) });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_2500), new Object[] { "SCS", "CVC", "SCS", 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_100), 'V', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_1000), 'S', ModItems.powder_spark_mix });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_10000), new Object[] { "OSO", "SVS", "OSO", 'S', ModItems.singularity_spark, 'V', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_2500), 'O', ModItems.ingot_osmiridium });
addRecipeAuto(ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_power), new Object[] { "YSY", "SCS", "YSY", 'S', ModItems.singularity_spark, 'C', ItemBattery.getEmptyBattery(ModItems.battery_spark_cell_10000), 'Y', ModItems.billet_yharonite });
addRecipeAuto(ItemBattery.getFullBattery(ModItems.battery_su), new Object[] { "P", "R", "C", 'P', Items.paper, 'R', REDSTONE.dust(), 'C', COAL.dust() });
addRecipeAuto(ItemBattery.getFullBattery(ModItems.battery_su), new Object[] { "P", "C", "R", 'P', Items.paper, 'R', REDSTONE.dust(), 'C', COAL.dust() });

View File

@ -28,6 +28,7 @@ import com.hbm.entity.mob.EntityQuackos;
import com.hbm.entity.mob.EntityCreeperTainted;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.entity.projectile.EntityBurningFOEQ;
import com.hbm.entity.train.EntityRailCarBase;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.handler.ArmorModHandler;
@ -692,6 +693,11 @@ public class ModEventHandler {
*/
}
/// RADIATION STUFF END ///
if(event.phase == Phase.END) {
EntityRailCarBase.updateMotion(event.world);
}
}
if(event.phase == Phase.START) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 287 B