From 87a87738ba2fdcfd4bd8002155668c474608d8fb Mon Sep 17 00:00:00 2001 From: Bob Date: Mon, 29 May 2023 16:50:51 +0200 Subject: [PATCH] train coupling, pulling physics --- .../java/com/hbm/crafting/PowderRecipes.java | 6 +- .../hbm/entity/train/EntityRailCarBase.java | 248 ++++++++++++++---- .../com/hbm/entity/train/TrainCargoTram.java | 1 + .../entity/train/TrainCargoTramTrailer.java | 1 + .../inventory/recipes/AssemblerRecipes.java | 22 +- .../recipes/CrystallizerRecipes.java | 1 + .../java/com/hbm/main/CraftingManager.java | 16 +- .../java/com/hbm/main/ModEventHandler.java | 6 + .../items/battery_schrabidium_cell.png | Bin 182 -> 168 bytes .../items/battery_schrabidium_cell_2.png | Bin 213 -> 202 bytes .../items/battery_schrabidium_cell_4.png | Bin 288 -> 312 bytes .../items/battery_schrabidium_new.png | Bin 319 -> 287 bytes 12 files changed, 245 insertions(+), 56 deletions(-) diff --git a/src/main/java/com/hbm/crafting/PowderRecipes.java b/src/main/java/com/hbm/crafting/PowderRecipes.java index 6c6845ed9..22200d0ef 100644 --- a/src/main/java/com/hbm/crafting/PowderRecipes.java +++ b/src/main/java/com/hbm/crafting/PowderRecipes.java @@ -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() }); diff --git a/src/main/java/com/hbm/entity/train/EntityRailCarBase.java b/src/main/java/com/hbm/entity/train/EntityRailCarBase.java index e33f02380..163adc596 100644 --- a/src/main/java/com/hbm/entity/train/EntityRailCarBase.java +++ b/src/main/java/com/hbm/entity/train/EntityRailCarBase.java @@ -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 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 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 links = new ArrayList(); + Set 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; + } + } + } + } } } diff --git a/src/main/java/com/hbm/entity/train/TrainCargoTram.java b/src/main/java/com/hbm/entity/train/TrainCargoTram.java index abb278066..af8bbe587 100644 --- a/src/main/java/com/hbm/entity/train/TrainCargoTram.java +++ b/src/main/java/com/hbm/entity/train/TrainCargoTram.java @@ -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; } diff --git a/src/main/java/com/hbm/entity/train/TrainCargoTramTrailer.java b/src/main/java/com/hbm/entity/train/TrainCargoTramTrailer.java index 6e771e40a..e077a14da 100644 --- a/src/main/java/com/hbm/entity/train/TrainCargoTramTrailer.java +++ b/src/main/java/com/hbm/entity/train/TrainCargoTramTrailer.java @@ -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; } diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java index 5464b4581..f93ba08bc 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java @@ -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), diff --git a/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java b/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java index b47ad8804..69c7652e1 100644 --- a/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java @@ -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)); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 0b25b3eb3..1b8d0b48a 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -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() }); diff --git a/src/main/java/com/hbm/main/ModEventHandler.java b/src/main/java/com/hbm/main/ModEventHandler.java index 00d3a9f64..c7554d48d 100644 --- a/src/main/java/com/hbm/main/ModEventHandler.java +++ b/src/main/java/com/hbm/main/ModEventHandler.java @@ -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) { diff --git a/src/main/resources/assets/hbm/textures/items/battery_schrabidium_cell.png b/src/main/resources/assets/hbm/textures/items/battery_schrabidium_cell.png index d9e92ed00771268b01586299c63e9a19addd6e41..96af24f72ea2ec62560df404deba642d855d6b94 100644 GIT binary patch delta 123 zcmV->0EGXx0jL3xG<07{L_t(Ijm?w64Ztu61Fdf08Q6dkG6$=Y5xSE5>Nknt6MvCU zwuFJ}Wo9ayNy;UWEJ7lLOd+BMASp9zBmjPMy@E^23eS%5&bhpA0X{|#aDRfOND7&) dKj>}YL?5-iDHZ!5UR?kH002ovPDHLkV1j>MGGqV% delta 138 zcmV;50CoSU0k#24S+BV1P{b0Opp;Who{IOlx*XSKtatePmh!Y zl7?$s*gn~k4ZmjxbvGwakd(S5X2M;V6$Mjkf)%)ctx&tv1m`1u$4o)0t}wS8N6yuJ sQxIYt6a0UIDhY)9z$G&H3vajqf}MzHRI34YT;%Cikqf~};4^`jUe zi4i|Kzky>}jyvG9n3-DMgruA#k}7%5SPDqqBgF`K4**KQ>GRyzz|1ZUa_`|7R>f}! zK~54vP|-7nTE-e<({BUZG&TKC4fe&=8WbTZEX(B%a_{2RFBd#v1I*-7$zID*6#xJL M07*qoM6N<$g1P=gzyJUM delta 169 zcmV;a09OCX0o4JJG=GdqL_t(Ijn$K}4TCTcMIRBPFo8#4j%!%KgQQGL!x}IG1vR_; zG(<7zuoKZFud$xx`#M>7@UuKXInNS7K~mg`j-FDv31*_}pzq&zFCT_ojT;a_4X^@t zsE(e#t-XMyaF#Jskc63BPq>|B%+r+hVnArytp8I7+sB=C;35)1jN@(+Q~!udyYLN9 XXgN&^&4nQd00000NkvXXu0mjf-DXPl diff --git a/src/main/resources/assets/hbm/textures/items/battery_schrabidium_cell_4.png b/src/main/resources/assets/hbm/textures/items/battery_schrabidium_cell_4.png index b35ac68822dc4421f01f6cfcdb2896a9c66d8bc3..fe84f7e26e8eb81ae6d33a4fa0254261d9b9d7f8 100644 GIT binary patch delta 269 zcmV+o0rLK!0=NQ@G=J|&L_t(Ijm49(Zo)7WMGvJLLwVUy2Snb+g4Fzhzl{D8QbyQW zio(P|GL|i7L1N-{XoG@dl}c6BJNekx*YC+T{DoB2zT>-_HP1~|Ez2?sIrKk<6Xkde zMS;{cPy0P}lHgk`Nn+mnUgPhF0dhRfpLaXno#QYZaz35V#ed?4*=}DOe=iIGOhf=k z)0C>Jt_uyfE9lBO(>%AYAOkwwws%@!GMW3q07fIG>ote6#9uBq+-~6^R)o%G0KBbM zQEn?5P!K`% TH$V{p0000|%0c?LS4)t%EM*C@1##J}AG;5GrD(Kf z3hYFf!V4EeX;P3Jge()PO31Pf+w~*YU=9)i5ikSJz}4Z6^=+>+!bvGiSz?~W20CnO z(wQNOR<|JF5{BHh=Fl|U+V+JpX8kq+K%6819P8T4w!8+7)&MM&^75d;e-oru7q_D? ufmb<50YX(t@mwsMKXU=x-S^$X*Lnb_Hh-EkmJ?0@0000prVdP zNOgU-K;D26(o!dH5+440~p5<0HTl})@D*ld3^PGo?)#GdX7>oB0|@7 zUM$*zT@CGs&MZq^_PKJTc%#5aCXe~bF=w}KVsw(c?qX(XzQ(pi~YqbCX002ov JPDHLkV1n11)~B!2;OQb$4nuFf3k00004XF*Lt006O%3;baP00009a7bBm000id z000id0mpBsWB>pF)Ja4^R5(w?lCcfKFc3wLER)g_5*si>ipU#;8JGY%Mo58c+H8=* zNk`a%364AKoIq>`1O-nz-M8fbeU=V>WhFge3xFaW&BEOPHh*JL-~kcWR9B^N9+s?D`(=)Z2Go@e^==t~1q!O0JDWC*arfJa^||7@(uqZ=^3& z^9eHPBTZF_n#`V7Yf%$H08@6IsENHXqF#vxFh??QP-(5J6v=>3`F}v1s&Z@0Tgcl8 q#vo`NUFGyv%^eMOy}W_n0q_7Rg=2W?_clTR0000