diff --git a/changelog b/changelog index 8778e076f..1f55cd941 100644 --- a/changelog +++ b/changelog @@ -26,4 +26,6 @@ * Fixed animation error on the MAS-36 * Fixed drone docks, requester and provider crates not dropping their contents when broken * Fixed all missing texture errors that appear in the startup log -* Potentially fixed a crash with mekanism during the recipe change phase \ No newline at end of file +* Potentially fixed a crash with mekanism during the recipe change phase +* Removed the coke to heavy oil recipe for allowing infinite oil loops + * Coke to syngas and coalgas recipes should be fine though, so they stay \ No newline at end of file diff --git a/src/main/java/api/hbm/fluidmk2/IFluidConductorMK2.java b/src/main/java/api/hbm/fluidmk2/IFluidConductorMK2.java new file mode 100644 index 000000000..6cdaa1b25 --- /dev/null +++ b/src/main/java/api/hbm/fluidmk2/IFluidConductorMK2.java @@ -0,0 +1,9 @@ +package api.hbm.fluidmk2; + +import com.hbm.inventory.fluid.FluidType; + +public interface IFluidConductorMK2 extends IFluidConnectorMK2 { + + public FluidNetMK2 getPipeNet(FluidType type); + public void setPipeNet(FluidType type, FluidNetMK2 network); +} diff --git a/src/main/java/api/hbm/fluidmk2/IFluidProviderMK2.java b/src/main/java/api/hbm/fluidmk2/IFluidProviderMK2.java index c5316a0be..8bc97797c 100644 --- a/src/main/java/api/hbm/fluidmk2/IFluidProviderMK2.java +++ b/src/main/java/api/hbm/fluidmk2/IFluidProviderMK2.java @@ -4,8 +4,9 @@ import com.hbm.inventory.fluid.FluidType; import com.hbm.uninos.IGenProvider; import com.hbm.uninos.networkproviders.FluidNetProvider; -public interface IFluidProviderMK2 extends IGenProvider { +public interface IFluidProviderMK2 extends IFluidUserMK2, IGenProvider { public void useUpFluid(FluidType type, int pressure, long amount); public long getProviderSpeed(FluidType type, int pressure); + public long getFluidAvailable(FluidType type, int pressure); } diff --git a/src/main/java/api/hbm/fluidmk2/IFluidReceiverMK2.java b/src/main/java/api/hbm/fluidmk2/IFluidReceiverMK2.java index f20fba01e..bfd8cb23a 100644 --- a/src/main/java/api/hbm/fluidmk2/IFluidReceiverMK2.java +++ b/src/main/java/api/hbm/fluidmk2/IFluidReceiverMK2.java @@ -4,9 +4,10 @@ import com.hbm.inventory.fluid.FluidType; import com.hbm.uninos.IGenReceiver; import com.hbm.uninos.networkproviders.FluidNetProvider; -public interface IFluidReceiverMK2 extends IGenReceiver { +public interface IFluidReceiverMK2 extends IFluidUserMK2, IGenReceiver { /** Sends fluid of the desired type and pressure to the receiver, returns the remainder */ public long transferFluid(FluidType type, int pressure, long amount); public long getReceiverSpeed(FluidType type, int pressure); + public long getDemand(FluidType type, int pressure); } diff --git a/src/main/java/api/hbm/fluidmk2/IFluidStandardReceiver.java b/src/main/java/api/hbm/fluidmk2/IFluidStandardReceiver.java new file mode 100644 index 000000000..d6f26b774 --- /dev/null +++ b/src/main/java/api/hbm/fluidmk2/IFluidStandardReceiver.java @@ -0,0 +1,87 @@ +package api.hbm.fluidmk2; + +import com.hbm.inventory.fluid.FluidType; +import com.hbm.inventory.fluid.tank.FluidTank; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toclient.AuxParticlePacketNT; +import com.hbm.util.Compat; +import com.hbm.util.fauxpointtwelve.DirPos; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public interface IFluidStandardReceiver extends IFluidReceiverMK2 { + + public default void trySubscribe(FluidType type, World world, DirPos pos) { trySubscribe(type, world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } + + public default void trySubscribe(FluidType type, World world, int x, int y, int z, ForgeDirection dir) { + + TileEntity te = Compat.getTileStandard(world, x, y, z); + boolean red = false; + + if(te instanceof IFluidConductorMK2) { + IFluidConductorMK2 con = (IFluidConductorMK2) te; + + if(!con.canConnect(type, dir)) return; + + if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this)) + con.getPipeNet(type).addReceiver(this); + + if(con.getPipeNet(type) != null) red = true; + } + + if(particleDebug) { + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "network"); + data.setString("mode", "fluid"); + data.setInteger("color", type.getColor()); + double posX = x + 0.5 + dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25; + double posY = y + 0.5 + dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25; + double posZ = z + 0.5 + dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25; + data.setDouble("mX", -dir.offsetX * (red ? 0.025 : 0.1)); + data.setDouble("mY", -dir.offsetY * (red ? 0.025 : 0.1)); + data.setDouble("mZ", -dir.offsetZ * (red ? 0.025 : 0.1)); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25)); + } + } + + public FluidTank[] getReceivingTanks(); + + @Override + public default long getDemand(FluidType type, int pressure) { + long amount = 0; + for(FluidTank tank : getReceivingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) amount += (tank.getMaxFill() - tank.getFill()); + } + return amount; + } + + @Override + public default long transferFluid(FluidType type, int pressure, long amount) { + int tanks = 0; + for(FluidTank tank : getReceivingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) tanks++; + } + if(tanks > 1) { + int firstRound = (int) Math.floor((double) amount / (double) tanks); + for(FluidTank tank : getReceivingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { + int toAdd = Math.min(firstRound, tank.getMaxFill() - tank.getFill()); + tank.setFill(tank.getFill() + toAdd); + amount -= toAdd; + } + } + } + if(amount > 0) for(FluidTank tank : getReceivingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { + int toAdd = (int) Math.min(amount, tank.getMaxFill() - tank.getFill()); + tank.setFill(tank.getFill() + toAdd); + amount -= toAdd; + } + } + return amount; + } +} diff --git a/src/main/java/api/hbm/fluidmk2/IFluidStandardSenderMK2.java b/src/main/java/api/hbm/fluidmk2/IFluidStandardSenderMK2.java new file mode 100644 index 000000000..b1ddcc906 --- /dev/null +++ b/src/main/java/api/hbm/fluidmk2/IFluidStandardSenderMK2.java @@ -0,0 +1,106 @@ +package api.hbm.fluidmk2; + +import com.hbm.inventory.fluid.tank.FluidTank; +import com.hbm.inventory.fluid.FluidType; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toclient.AuxParticlePacketNT; +import com.hbm.uninos.GenNode; +import com.hbm.uninos.UniNodespace; +import com.hbm.util.Compat; +import com.hbm.util.fauxpointtwelve.DirPos; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public interface IFluidStandardSenderMK2 extends IFluidProviderMK2 { + + public default void tryProvide(FluidTank tank, World world, DirPos pos) { tryProvide(tank.getTankType(), tank.getPressure(), world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } + public default void tryProvide(FluidType type, World world, DirPos pos) { tryProvide(type, 0, world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } + public default void tryProvide(FluidType type, int pressure, World world, DirPos pos) { tryProvide(type, pressure, world, pos.getX(), pos.getY(), pos.getZ(), pos.getDir()); } + + public default void tryProvide(FluidTank tank, World world, int x, int y, int z, ForgeDirection dir) { tryProvide(tank.getTankType(), tank.getPressure(), world, x, y, z, dir); } + public default void tryProvide(FluidType type, World world, int x, int y, int z, ForgeDirection dir) { tryProvide(type, 0, world, x, y, z, dir); } + + public default void tryProvide(FluidType type, int pressure, World world, int x, int y, int z, ForgeDirection dir) { + + TileEntity te = Compat.getTileStandard(world, x, y, z); + boolean red = false; + + if(te instanceof IFluidConductorMK2) { + IFluidConductorMK2 con = (IFluidConductorMK2) te; + if(con.canConnect(type, dir.getOpposite())) { + + GenNode node = UniNodespace.getNode(world, x, y, z, type.getNetworkProvider()); + + if(node != null && node.net != null) { + node.net.addProvider(this); + red = true; + } + } + } + + if(te instanceof IFluidReceiverMK2 && te != this) { + IFluidReceiverMK2 rec = (IFluidReceiverMK2) te; + if(rec.canConnect(type, dir.getOpposite())) { + long provides = Math.min(this.getFluidAvailable(type, pressure), this.getProviderSpeed(type, pressure)); + long receives = Math.min(rec.getDemand(type, pressure), rec.getReceiverSpeed(type, pressure)); + long toTransfer = Math.min(provides, receives); + toTransfer -= rec.transferFluid(type, pressure, toTransfer); + this.useUpFluid(type, pressure, toTransfer); + } + } + + if(particleDebug) { + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "network"); + data.setString("mode", "fluid"); + data.setInteger("color", type.getColor()); + double posX = x + 0.5 - dir.offsetX * 0.5 + world.rand.nextDouble() * 0.5 - 0.25; + double posY = y + 0.5 - dir.offsetY * 0.5 + world.rand.nextDouble() * 0.5 - 0.25; + double posZ = z + 0.5 - dir.offsetZ * 0.5 + world.rand.nextDouble() * 0.5 - 0.25; + data.setDouble("mX", dir.offsetX * (red ? 0.025 : 0.1)); + data.setDouble("mY", dir.offsetY * (red ? 0.025 : 0.1)); + data.setDouble("mZ", dir.offsetZ * (red ? 0.025 : 0.1)); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, posX, posY, posZ), new TargetPoint(world.provider.dimensionId, posX, posY, posZ, 25)); + } + } + + public FluidTank[] getSendingTanks(); + + @Override + public default long getFluidAvailable(FluidType type, int pressure) { + long amount = 0; + for(FluidTank tank : getSendingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) amount += tank.getFill(); + } + return amount; + } + + @Override + public default void useUpFluid(FluidType type, int pressure, long amount) { + int tanks = 0; + for(FluidTank tank : getSendingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) tanks++; + } + if(tanks > 1) { + int firstRound = (int) Math.floor((double) amount / (double) tanks); + for(FluidTank tank : getSendingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { + int toRem = Math.min(firstRound, tank.getFill()); + tank.setFill(tank.getFill() - toRem); + amount -= toRem; + } + } + } + if(amount > 0) for(FluidTank tank : getSendingTanks()) { + if(tank.getTankType() == type && tank.getPressure() == pressure) { + int toRem = (int) Math.min(amount, tank.getFill()); + tank.setFill(tank.getFill() - toRem); + amount -= toRem; + } + } + } +} diff --git a/src/main/java/api/hbm/fluidmk2/IFluidUserMK2.java b/src/main/java/api/hbm/fluidmk2/IFluidUserMK2.java new file mode 100644 index 000000000..b989e99cf --- /dev/null +++ b/src/main/java/api/hbm/fluidmk2/IFluidUserMK2.java @@ -0,0 +1,10 @@ +package api.hbm.fluidmk2; + +import com.hbm.inventory.fluid.tank.FluidTank; + +public interface IFluidUserMK2 extends IFluidConnectorMK2 { + + public static final boolean particleDebug = false; + + public FluidTank[] getAllTanks(); +} diff --git a/src/main/java/com/hbm/explosion/vanillant/standard/EntityProcessorCross.java b/src/main/java/com/hbm/explosion/vanillant/standard/EntityProcessorCross.java index a6843e9a9..c693c4ca6 100644 --- a/src/main/java/com/hbm/explosion/vanillant/standard/EntityProcessorCross.java +++ b/src/main/java/com/hbm/explosion/vanillant/standard/EntityProcessorCross.java @@ -28,6 +28,7 @@ public class EntityProcessorCross implements IEntityProcessor { protected double nodeDist = 2D; protected IEntityRangeMutator range; protected ICustomDamageHandler damage; + protected double knockbackMult = 1D; protected boolean allowSelfDamage = false; public EntityProcessorCross(double nodeDist) { @@ -38,6 +39,11 @@ public class EntityProcessorCross implements IEntityProcessor { this.allowSelfDamage = true; return this; } + + public EntityProcessorCross setKnockback(double mult) { + this.knockbackMult = mult; + return this; + } @Override public HashMap process(ExplosionVNT explosion, World world, double x, double y, double z, float size) { @@ -104,13 +110,13 @@ public class EntityProcessorCross implements IEntityProcessor { double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback); if(!(entity instanceof EntityBulletBaseMK4)) { - entity.motionX += deltaX * enchKnockback; - entity.motionY += deltaY * enchKnockback; - entity.motionZ += deltaZ * enchKnockback; + entity.motionX += deltaX * enchKnockback * knockbackMult; + entity.motionY += deltaY * enchKnockback * knockbackMult; + entity.motionZ += deltaZ * enchKnockback * knockbackMult; } if(entity instanceof EntityPlayer) { - affectedPlayers.put((EntityPlayer) entity, Vec3.createVectorHelper(deltaX * knockback, deltaY * knockback, deltaZ * knockback)); + affectedPlayers.put((EntityPlayer) entity, Vec3.createVectorHelper(deltaX * knockback * knockbackMult, deltaY * knockback * knockbackMult, deltaZ * knockback * knockbackMult)); } } } diff --git a/src/main/java/com/hbm/explosion/vanillant/standard/ExplosionEffectTiny.java b/src/main/java/com/hbm/explosion/vanillant/standard/ExplosionEffectTiny.java new file mode 100644 index 000000000..e821a06ca --- /dev/null +++ b/src/main/java/com/hbm/explosion/vanillant/standard/ExplosionEffectTiny.java @@ -0,0 +1,27 @@ +package com.hbm.explosion.vanillant.standard; + +import com.hbm.explosion.vanillant.ExplosionVNT; +import com.hbm.explosion.vanillant.interfaces.IExplosionSFX; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toclient.AuxParticlePacketNT; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class ExplosionEffectTiny implements IExplosionSFX { + + @Override + public void doEffect(ExplosionVNT explosion, World world, double x, double y, double z, float size) { + if(world.isRemote) return; + + world.playSoundEffect(x, y, z, "hbm:weapon.explosionTiny", 15.0F, 1.0F); + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "vanillaExt"); + data.setString("mode", "largeexplode"); + data.setFloat("size", 1.5F); + data.setByte("count", (byte)1); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(world.provider.dimensionId, x, y, z, 100)); + } +} diff --git a/src/main/java/com/hbm/handler/nei/SatelliteHandler.java b/src/main/java/com/hbm/handler/nei/SatelliteHandler.java index 7206b10b2..c995e9e3d 100644 --- a/src/main/java/com/hbm/handler/nei/SatelliteHandler.java +++ b/src/main/java/com/hbm/handler/nei/SatelliteHandler.java @@ -128,7 +128,6 @@ public class SatelliteHandler extends TemplateRecipeHandler implements ICompatNH public RecipeSet(Object in, List out) { //not the prettiest of solutions but certainly the most pleasant to work with - int inLine = 1; int outLine = 1; int inOX = 0; int inOY = 0; diff --git a/src/main/java/com/hbm/inventory/recipes/PyroOvenRecipes.java b/src/main/java/com/hbm/inventory/recipes/PyroOvenRecipes.java index 1cb68724a..e786dcead 100644 --- a/src/main/java/com/hbm/inventory/recipes/PyroOvenRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/PyroOvenRecipes.java @@ -101,9 +101,6 @@ public class PyroOvenRecipes extends SerializableRecipe { recipes.add(new PyroOvenRecipe(100) .in(new FluidStack(Fluids.HYDROGEN, 500)).in(new OreDictStack(COAL.dust())) .out(new FluidStack(Fluids.HEAVYOIL, 1_000))); - recipes.add(new PyroOvenRecipe(100) - .in(new FluidStack(Fluids.HYDROGEN, 250)).in(new OreDictStack(ANY_COKE.gem())) - .out(new FluidStack(Fluids.HEAVYOIL, 1_000))); //coalgas from coal recipes.add(new PyroOvenRecipe(50) .in(new FluidStack(Fluids.HEAVYOIL, 500)).in(new OreDictStack(COAL.gem())) diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactory.java b/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactory.java index 7429db1ab..3fd164ada 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactory.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactory.java @@ -91,6 +91,7 @@ public class GunFactory { COIL_TUNGSTEN, COIL_FERROURANIUM, NUKE_STANDARD, NUKE_DEMO, NUKE_HIGH, NUKE_TOTS, NUKE_HIVE, G10, G10_SHRAPNEL, G10_DU, G10_SLUG, + R762_HE, //ONLY ADD NEW ENTRIES AT THE BOTTOM TO AVOID SHIFTING! ; @@ -103,7 +104,7 @@ public class GunFactory { P22_SP, P22_FMJ, P22_JHP, P22_AP, P9_SP, P9_FMJ, P9_JHP, P9_AP, R556_SP, R556_FMJ, R556_JHP, R556_AP, - R762_SP, R762_FMJ, R762_JHP, R762_AP, R762_DU, + R762_SP, R762_FMJ, R762_JHP, R762_AP, R762_DU, R762_HE, BMG50_SP, BMG50_FMJ, BMG50_JHP, BMG50_AP, BMG50_DU, B75, B75_INC, B75_EXP, G12_BP, G12_BP_MAGNUM, G12_BP_SLUG, G12, G12_SLUG, G12_FLECHETTE, G12_MAGNUM, G12_EXPLOSIVE, G12_PHOSPHORUS, diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactoryClient.java b/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactoryClient.java index c6aa1a0a4..5be069ac8 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactoryClient.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/GunFactoryClient.java @@ -132,6 +132,7 @@ public class GunFactoryClient { r762_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET); r762_ap.setRenderer(LegoClient.RENDER_AP_BULLET); r762_du.setRenderer(LegoClient.RENDER_DU_BULLET); + r762_he.setRenderer(LegoClient.RENDER_HE_BULLET); bmg50_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET); bmg50_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET); diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/Lego.java b/src/main/java/com/hbm/items/weapon/sedna/factory/Lego.java index d00796660..0da79601b 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/Lego.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/Lego.java @@ -10,6 +10,7 @@ import com.hbm.entity.projectile.EntityBulletBaseMK4CL; import com.hbm.entity.projectile.EntityBulletBeamBase; import com.hbm.explosion.vanillant.ExplosionVNT; import com.hbm.explosion.vanillant.standard.EntityProcessorCrossSmooth; +import com.hbm.explosion.vanillant.standard.ExplosionEffectTiny; import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon; import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard; import com.hbm.interfaces.NotableComments; @@ -33,6 +34,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; +import net.minecraftforge.common.util.ForgeDirection; /** * "LEGO" - i.e. standardized building blocks which can be used to set up gun configs easily. @@ -283,6 +285,20 @@ public class Lego { vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F)); vnt.explode(); } + + public static void tinyExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range) { tinyExplode(bullet, mop, range, 1F); } + public static void tinyExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range, float damageMod) { + ForgeDirection dir = ForgeDirection.getOrientation(mop.sideHit); + double x = mop.hitVec.xCoord + dir.offsetX * 0.25D; + double y = mop.hitVec.yCoord + dir.offsetY * 0.25D; + double z = mop.hitVec.zCoord + dir.offsetZ * 0.25D; + ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, x, y, z, range, bullet.getThrower()); + vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, bullet.damage * damageMod) + .setupPiercing(bullet.config.armorThresholdNegation, bullet.config.armorPiercingPercent).setKnockback(0.25D)); + vnt.setPlayerProcessor(new PlayerProcessorStandard()); + vnt.setSFX(new ExplosionEffectTiny()); + vnt.explode(); + } /** anims for the DEBUG revolver, mostly a copy of the li'lpip but with some fixes regarding the cylinder movement */ @SuppressWarnings("incomplete-switch") public static BiFunction LAMBDA_DEBUG_ANIMS = (stack, type) -> { diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/LegoClient.java b/src/main/java/com/hbm/items/weapon/sedna/factory/LegoClient.java index bd3500d01..01a06960c 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/LegoClient.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/LegoClient.java @@ -62,6 +62,12 @@ public class LegoClient { renderBulletStandard(Tessellator.instance, 0x5CCD41, 0xE9FF8D, length, false); }; + public static BiConsumer RENDER_HE_BULLET = (bullet, interp) -> { + double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp; + if(length <= 0) return; + renderBulletStandard(Tessellator.instance, 0xD8CA00, 0xFFF19D, length, true); + }; + public static BiConsumer RENDER_TRACER_BULLET = (bullet, interp) -> { double length = bullet.prevVelocity + (bullet.velocity - bullet.prevVelocity) * interp; if(length <= 0) return; diff --git a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java index f63275b9a..a22b2f24f 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java +++ b/src/main/java/com/hbm/items/weapon/sedna/factory/XFactory762mm.java @@ -3,6 +3,7 @@ package com.hbm.items.weapon.sedna.factory; import java.util.function.BiConsumer; import java.util.function.BiFunction; +import com.hbm.entity.projectile.EntityBulletBaseMK4; import com.hbm.items.ModItems; import com.hbm.items.ItemEnums.EnumCasingType; import com.hbm.items.weapon.sedna.BulletConfig; @@ -25,6 +26,7 @@ import com.hbm.render.anim.HbmAnimations.AnimType; import com.hbm.util.DamageResistanceHandler.DamageClass; import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; public class XFactory762mm { @@ -33,10 +35,16 @@ public class XFactory762mm { public static BulletConfig r762_jhp; public static BulletConfig r762_ap; public static BulletConfig r762_du; + public static BulletConfig r762_he; public static BulletConfig energy_lacunae; public static BulletConfig energy_lacunae_overcharge; public static BulletConfig energy_lacunae_ir; + + public static BiConsumer LAMBDA_TINY_EXPLODE = (bullet, mop) -> { + if(mop.typeOfHit == mop.typeOfHit.ENTITY && bullet.ticksExisted < 3 && mop.entityHit == bullet.getThrower()) return; + Lego.tinyExplode(bullet, mop, 2F); bullet.setDead(); + }; public static void init() { SpentCasing casing762 = new SpentCasing(CasingType.BOTTLENECK).setColor(SpentCasing.COLOR_CASE_BRASS); @@ -50,6 +58,8 @@ public class XFactory762mm { .setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762ap")); r762_du = new BulletConfig().setItem(EnumAmmo.R762_DU).setCasing(EnumCasingType.SMALL_STEEL, 6).setDoesPenetrate(true).setDamageFalloutByPen(false).setDamage(2.5F).setThresholdNegation(15F).setArmorPiercing(0.25F) .setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762du")); + r762_he = new BulletConfig().setItem(EnumAmmo.R762_HE).setCasing(EnumCasingType.SMALL_STEEL, 6).setDamage(2F).setOnImpact(LAMBDA_TINY_EXPLODE) + .setCasing(casing762.clone().setColor(SpentCasing.COLOR_CASE_44).register("r762he")); energy_lacunae = new BulletConfig().setItem(EnumAmmo.CAPACITOR).setCasing(new ItemStack(ModItems.ingot_polymer, 2), 4 * 40).setupDamageClass(DamageClass.LASER).setBeam().setReloadCount(40).setSpread(0.0F).setLife(5).setRenderRotations(false).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT); energy_lacunae_overcharge = new BulletConfig().setItem(EnumAmmo.CAPACITOR_OVERCHARGE).setCasing(new ItemStack(ModItems.ingot_polymer, 2), 4 * 40).setupDamageClass(DamageClass.LASER).setBeam().setReloadCount(40).setSpread(0.0F).setLife(5).setRenderRotations(false).setDoesPenetrate(true).setOnBeamImpact(BulletConfig.LAMBDA_STANDARD_BEAM_HIT); @@ -59,7 +69,7 @@ public class XFactory762mm { .dura(3_000).draw(10).inspect(31).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE) .rec(new Receiver(0) .dmg(15F).delay(5).dry(15).spread(0.0F).reload(30, 0, 15, 0).jam(60).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F) - .mag(new MagazineFullReload(0, 14).addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du)) + .mag(new MagazineFullReload(0, 14).addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du, r762_he)) .offset(1, -0.0625 * 2.5, -0.25D) .setupStandardFire().recoil(LAMBDA_RECOIL_CARBINE)) .setupStandardConfiguration() @@ -70,7 +80,7 @@ public class XFactory762mm { .dura(50_000).draw(20).inspect(20).crosshair(Crosshair.L_CIRCLE).smoke(LAMBDA_SMOKE) .rec(new Receiver(0) .dmg(6F).delay(1).auto(true).dry(15).spread(0.01F).sound("hbm:weapon.calShoot", 1.0F, 1.0F) - .mag(new MagazineBelt().addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du)) + .mag(new MagazineBelt().addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du, r762_he)) .offset(1, -0.0625 * 2.5, -0.25D) .setupStandardFire().recoil(LAMBDA_RECOIL_MINIGUN)) .setupStandardConfiguration() @@ -91,7 +101,7 @@ public class XFactory762mm { .dura(5_000).draw(20).inspect(31).reloadSequential(true).crosshair(Crosshair.CIRCLE).smoke(LAMBDA_SMOKE) .rec(new Receiver(0) .dmg(30F).delay(25).dry(25).spread(0.0F).reload(43).jam(43).sound("hbm:weapon.fire.rifleHeavy", 1.0F, 1.0F) - .mag(new MagazineFullReload(0, 7).addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du)) + .mag(new MagazineFullReload(0, 7).addConfigs(r762_sp, r762_fmj, r762_jhp, r762_ap, r762_du, r762_he)) .offset(1, -0.0625 * 1.5, -0.25D) .setupStandardFire().recoil(LAMBDA_RECOIL_CARBINE)) .setupStandardConfiguration() diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRotaryFurnace.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRotaryFurnace.java index dffb80700..2c686e662 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRotaryFurnace.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineRotaryFurnace.java @@ -49,11 +49,11 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i public boolean isProgressing; public float progress; public int burnTime; + public double burnHeat = 1D; public int maxBurnTime; public int steamUsed = 0; public boolean isVenting; public MaterialStack output; - public ItemStack lastFuel; public static final int maxOutput = MaterialShapes.BLOCK.q(16); public int anim; @@ -131,14 +131,14 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i if(recipe != null) { if(this.burnTime <= 0 && slots[4] != null && TileEntityFurnace.isItemFuel(slots[4])) { - lastFuel = slots[4]; - this.maxBurnTime = this.burnTime = burnModule.getBurnTime(lastFuel) / 2; + this.burnHeat = burnModule.getMod(slots[4], burnModule.getModHeat()); + this.maxBurnTime = this.burnTime = burnModule.getBurnTime(slots[4]) / 2; this.decrStackSize(4, 1); this.markChanged(); } if(this.canProcess(recipe)) { - float speed = Math.max((float) burnModule.getMod(lastFuel, burnModule.getModHeat()), 1); + float speed = Math.max((float) burnHeat, 1); this.progress += speed / recipe.duration; speed = (float)(13 * Math.log10(speed) + 1); @@ -256,14 +256,12 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i this.tanks[2].readFromNBT(nbt, "t2"); this.progress = nbt.getFloat("prog"); this.burnTime = nbt.getInteger("burn"); + this.burnHeat = nbt.getDouble("heat"); this.maxBurnTime = nbt.getInteger("maxBurn"); if (nbt.hasKey("outType")) { NTMMaterial mat = Mats.matById.get(nbt.getInteger("outType")); this.output = new MaterialStack(mat, nbt.getInteger("outAmount")); } - ItemStack nbtFuel = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("lastFuel")); - if(nbtFuel != null) - this.lastFuel = nbtFuel; } @Override @@ -274,8 +272,8 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i this.tanks[2].writeToNBT(nbt, "t2"); nbt.setFloat("prog", progress); nbt.setInteger("burn", burnTime); + nbt.setDouble("heat", burnHeat); nbt.setInteger("maxBurn", maxBurnTime); - nbt.setTag("lastFuel", lastFuel.writeToNBT(new NBTTagCompound())); if (this.output != null) { nbt.setInteger("outType", this.output.material.id); nbt.setInteger("outAmount", this.output.amount); diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 223210fde..b9ead782f 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -1275,6 +1275,7 @@ item.ammo_standard.r556_sp.name=5,56mm Patrone (Teilmantelgeschoss) item.ammo_standard.r762_ap.name=7,62mm Patrone (Panzerbrechend) item.ammo_standard.r762_du.name=7,62mm Patrone (Urangeschoss) item.ammo_standard.r762_fmj.name=7,62mm Patrone (Vollmantelgeschoss) +item.ammo_standard.r762_he.name=7,62mm Patrone (Explosiv) item.ammo_standard.r762_jhp.name=7,62mm Patrone (Hohlspitz) item.ammo_standard.r762_sp.name=7,62mm Patrone (Teilmantelgeschoss) item.ammo_standard.rocket_demo.name=Abrissrakete diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 565cb2863..4199f185f 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -1999,6 +1999,7 @@ item.ammo_standard.r556_sp.name=5.56mm Round (Soft Point) item.ammo_standard.r762_ap.name=7.62mm Round (Armor Piercing) item.ammo_standard.r762_du.name=7.62mm Round (Depleted Uranium) item.ammo_standard.r762_fmj.name=7.62mm Round (Full Metal Jacket) +item.ammo_standard.r762_he.name=7.62mm Round (High-Explosive) item.ammo_standard.r762_jhp.name=7.62mm Round (Jacketed Hollow Point) item.ammo_standard.r762_sp.name=7.62mm Round (Soft Point) item.ammo_standard.rocket_demo.name=Rocket, Demolition diff --git a/src/main/resources/assets/hbm/sounds.json b/src/main/resources/assets/hbm/sounds.json index 46a6d1429..fff6f6a4b 100644 --- a/src/main/resources/assets/hbm/sounds.json +++ b/src/main/resources/assets/hbm/sounds.json @@ -217,6 +217,7 @@ "weapon.explosionLargeFar": {"category": "player", "sounds": [{"name": "weapon/explosionLargeFar", "stream": false}]}, "weapon.explosionSmallNear": {"category": "player", "sounds": ["weapon/explosionSmallNear1", "weapon/explosionSmallNear2", "weapon/explosionSmallNear3"]}, "weapon.explosionSmallFar": {"category": "player", "sounds": ["weapon/explosionSmallFar1", "weapon/explosionSmallFar2"]}, + "weapon.explosionTiny": {"category": "player", "sounds": ["weapon/explosionTiny1", "weapon/explosionTiny2"]}, "weapon.dFlash": {"category": "player", "sounds": [{"name": "weapon/dFlash", "stream": false}]}, diff --git a/src/main/resources/assets/hbm/sounds/weapon/explosionTiny1.ogg b/src/main/resources/assets/hbm/sounds/weapon/explosionTiny1.ogg new file mode 100644 index 000000000..0600a1438 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/explosionTiny1.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/weapon/explosionTiny2.ogg b/src/main/resources/assets/hbm/sounds/weapon/explosionTiny2.ogg new file mode 100644 index 000000000..f8d45e339 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/explosionTiny2.ogg differ diff --git a/src/main/resources/assets/hbm/textures/items/ammo.png b/src/main/resources/assets/hbm/textures/items/ammo.png index 332f97913..1359f4762 100644 Binary files a/src/main/resources/assets/hbm/textures/items/ammo.png and b/src/main/resources/assets/hbm/textures/items/ammo.png differ diff --git a/src/main/resources/assets/hbm/textures/items/ammo_standard.bmg50_he.png b/src/main/resources/assets/hbm/textures/items/ammo_standard.bmg50_he.png new file mode 100644 index 000000000..46affec4d Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/ammo_standard.bmg50_he.png differ diff --git a/src/main/resources/assets/hbm/textures/items/ammo_standard.r762_he.png b/src/main/resources/assets/hbm/textures/items/ammo_standard.r762_he.png new file mode 100644 index 000000000..ac174ea4d Binary files /dev/null and b/src/main/resources/assets/hbm/textures/items/ammo_standard.r762_he.png differ