Merge branch 'master' into master

This commit is contained in:
pheo 2025-05-01 10:15:52 +01:00 committed by GitHub
commit 6b6c9635a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 69 additions and 40 deletions

View File

@ -1,11 +1,21 @@
## Added
* Infinite ammo bag
* Identical to the regular ammo bag, but ammo is never depleted
* Provides 9,999 units of ammo for the purposes of reloading/belts, meaning that even a single bullet in the bag allows a full reload
* Obviously creative-only
## Changed
* Nerfed AP and DU round damage multiplier
* Effective damage is still much higher than on gunmetal ammo due to the armor piercing effect
* Increased flamethrower turret detection range from 32 to 48 blocks
* Flamethrower turrets now use the green fire effect when using balefire fuel
* Flamethrower turrets and chemthrower now use the green fire effect when using balefire fuel
* Flamethrower turret projectile damage is now capped to 20
* Balefire fuel should no longer instantly vaporize bosses
* Tobacco and Hemp plants are now biome tinted and are no longer radioactive green
* Most chemthrower ammo types with variable damage output are now capped to 15 damage per shot (that is still a ton)
* Chemthrower combustible liquids now use SEDNA type fire particles
* Halved recoil on the zebra rifle
* The laser pistols now make a click when dry firing
## Fixed
* Fixed a potential crash caused by cargo dropships landing on cargo docks with no satellite chip installed
@ -13,3 +23,4 @@
* Fixed errors thrown when loading in old system bullet entities
* Fixed dupe regarding breaking transport drones
* Fixed 12 gauge flechette DT negation not being the intended value
* Fixed carbine mistakenly showing a round being chambered even after firing the last loaded round

View File

@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.trait.*;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.particle.helper.FlameCreator;
import com.hbm.tileentity.IRepairable;
import com.hbm.tileentity.IRepairable.EnumExtinguishType;
import com.hbm.util.ArmorUtil;
@ -35,7 +36,6 @@ import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -104,12 +104,17 @@ public class EntityChemical extends EntityThrowableNT {
}
} else {
FluidType type = getType();
ChemicalStyle style = getStyle();
if(style == ChemicalStyle.LIQUID) {
if(type == Fluids.BALEFIRE) {
if(MainRegistry.proxy.me().getDistanceToEntity(this) < 100)
FlameCreator.composeEffectClient(worldObj, posX, posY - 0.125, posZ, FlameCreator.META_BALEFIRE);
} else if(style == ChemicalStyle.LIQUID) {
FluidType type = getType();
Color color = new Color(type.getColor());
NBTTagCompound data = new NBTTagCompound();
@ -125,21 +130,11 @@ public class EntityChemical extends EntityThrowableNT {
data.setFloat("g", color.getGreen() / 255F);
data.setFloat("b", color.getBlue() / 255F);
MainRegistry.proxy.effectNT(data);
}
if(style == ChemicalStyle.BURNING) {
double motion = Math.min(Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector(), 0.1);
} else if(style == ChemicalStyle.BURNING) {
for(double d = 0; d < motion; d += 0.0625) {
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("type", "vanillaExt");
nbt.setString("mode", "flame");
nbt.setDouble("posX", (this.lastTickPosX - this.posX) * d + this.posX);
nbt.setDouble("posY", (this.lastTickPosY - this.posY) * d + this.posY);
nbt.setDouble("posZ", (this.lastTickPosZ - this.posZ) * d + this.posZ);
MainRegistry.proxy.effectNT(nbt);
}
if(MainRegistry.proxy.me().getDistanceToEntity(this) < 100)
FlameCreator.composeEffectClient(worldObj, posX, posY - 0.125, posZ, FlameCreator.META_FIRE);
}
}
super.onUpdate();
@ -172,7 +167,7 @@ public class EntityChemical extends EntityThrowableNT {
}
if(type.temperature >= 100) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_boil), 0.25F + (type.temperature - 100) * 0.001F); //.25 damage at 100°C with one extra damage every 1000°C
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_boil), Math.min(0.25F + (type.temperature - 100) * 0.001F, 15F)); //.25 damage at 100°C with one extra damage every 1000°C
if(type.temperature >= 500) {
e.setFire(10); //afterburn for 10 seconds
@ -182,6 +177,7 @@ public class EntityChemical extends EntityThrowableNT {
if(style == ChemicalStyle.LIQUID || style == ChemicalStyle.GAS) {
if(type.temperature < -20) {
if(living != null) { //only living things are affected
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_boil), Math.min(0.25F + (-type.temperature) * 0.01F, 2F));
}
}
@ -213,7 +209,7 @@ public class EntityChemical extends EntityThrowableNT {
if(style == ChemicalStyle.BURNING) {
FT_Combustible trait = type.getTrait(FT_Combustible.class);
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_flamethrower), 0.2F + (trait != null ? (trait.getCombustionEnergy() / 100_000F) : 0));
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_flamethrower), 0.2F + (trait != null ? (Math.min(trait.getCombustionEnergy() / 100_000F, 15F)) : 0));
e.setFire(5);
}
@ -221,7 +217,7 @@ public class EntityChemical extends EntityThrowableNT {
FT_Flammable flammable = type.getTrait(FT_Flammable.class);
FT_Combustible combustible = type.getTrait(FT_Combustible.class);
float heat = Math.max(flammable != null ? flammable.getHeatEnergy() / 50_000F : 0, combustible != null ? combustible.getCombustionEnergy() / 100_000F : 0);
float heat = Math.max(flammable != null ? flammable.getHeatEnergy() / 50_000F : 0, combustible != null ? Math.min(combustible.getCombustionEnergy() / 100_000F, 15F) : 0);
heat *= intensity;
EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_flamethrower), (0.2F + heat) * (float) intensity);
e.setFire((int) Math.ceil(5 * intensity));

View File

@ -1150,6 +1150,7 @@ public class ModItems {
public static Item plastic_bag;
public static Item ammo_bag;
public static Item ammo_bag_infinite;
public static Item casing_bag;
public static Item test_nuke_igniter;
@ -3541,6 +3542,7 @@ public class ModItems {
plastic_bag = new ItemPlasticBag().setUnlocalizedName("plastic_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plastic_bag");
ammo_bag = new ItemAmmoBag().setUnlocalizedName("ammo_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":ammo_bag");
ammo_bag_infinite = new ItemAmmoBag().setUnlocalizedName("ammo_bag_infinite").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":ammo_bag_infinite");
casing_bag = new ItemCasingBag().setUnlocalizedName("casing_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":casing_bag");
debris_graphite = new Item().setUnlocalizedName("debris_graphite").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_graphite");
@ -6174,6 +6176,7 @@ public class ModItems {
GameRegistry.registerItem(plastic_bag, plastic_bag.getUnlocalizedName());
GameRegistry.registerItem(ammo_bag, ammo_bag.getUnlocalizedName());
GameRegistry.registerItem(ammo_bag_infinite, ammo_bag_infinite.getUnlocalizedName());
GameRegistry.registerItem(casing_bag, casing_bag.getUnlocalizedName());
//Keys and Locks

View File

@ -2,6 +2,7 @@ package com.hbm.items.tool;
import com.hbm.inventory.container.ContainerAmmoBag;
import com.hbm.inventory.gui.GUIAmmoBag;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.util.ItemStackUtil;
@ -46,6 +47,7 @@ public class ItemAmmoBag extends Item implements IGUIProvider {
@Override
public boolean showDurabilityBar(ItemStack stack) {
if(this == ModItems.ammo_bag_infinite) return false;
return !stack.hasTagCompound() || getDurabilityForDisplay(stack) != 0;
}

View File

@ -986,6 +986,10 @@ public class Orchestras {
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1.5F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 1F);
if(timer == 10) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1.25F);

View File

@ -88,7 +88,7 @@ public class XFactory556mm {
.dmg(7.5F).delay(2).auto(true).dry(15).spreadHipfire(0.01F).reload(50).jam(47).sound("hbm:weapon.fire.silenced", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 30).addConfigs(r556_inc_sp, r556_inc_fmj, r556_inc_jhp, r556_inc_ap))
.offset(1, -0.0625 * 2.5, -0.25D)
.setupStandardFire().recoil(LAMBDA_RECOIL_G3))
.setupStandardFire().recoil(LAMBDA_RECOIL_ZEBRA))
.setupStandardConfiguration().ps(Lego.LAMBDA_STANDARD_CLICK_SECONDARY)
.anim(LAMBDA_G3_ANIMS).orchestra(Orchestras.ORCHESTRA_G3)
).setNameMutator(LAMBDA_NAME_G3).setUnlocalizedName("gun_g3_zebra");
@ -133,6 +133,10 @@ public class XFactory556mm {
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.25));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_ZEBRA = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.125), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.125));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_STG = (stack, ctx) -> { };
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_G3_ANIMS = (stack, type) -> {

View File

@ -124,14 +124,15 @@ public class XFactory762mm {
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_LACUNAE = (stack, ctx) -> { };
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_CARBINE_ANIMS = (stack, type) -> {
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= 0;
int ammo = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory);
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= ammo;
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(45, 0, 0, 0).addPos(0, 0, 0, 500, IType.SIN_FULL));
case CYCLE: return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(0, 0, ItemGunBaseNT.getIsAiming(stack) ? -0.25 : -0.5, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_FULL))
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, -1, 50, IType.SIN_DOWN).addPos(0, 0, 0, 100, IType.SIN_UP))
.addBus(empty ? "NULL" : "REL", new BusAnimationSequence().addPos(0, 0, 0.25, 50).addPos(0, 0.125, 1.25, 100, IType.SIN_UP));
.addBus(ammo <= 1 ? "NULL" : "REL", new BusAnimationSequence().addPos(0, 0, 0.25, 50).addPos(0, 0.125, 1.25, 100, IType.SIN_UP));
case CYCLE_DRY: return new BusAnimation()
.addBus("SLIDE", new BusAnimationSequence().addPos(0, 0, 0, 500).addPos(0, 0, -1, 100, IType.SIN_DOWN).addPos(0, 0, -1, 50).addPos(0, 0, 0, 100, IType.SIN_UP));
case RELOAD: return new BusAnimation()

View File

@ -47,7 +47,8 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
if(amount <= 0) return;
}
if(slot.getItem() == ModItems.ammo_bag) {
boolean infBag = slot.getItem() == ModItems.ammo_bag_infinite;
if(slot.getItem() == ModItems.ammo_bag || infBag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
@ -56,7 +57,7 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
if(first.ammo.matchesRecipe(bagslot, true)) {
int toRemove = Math.min(bagslot.stackSize, amount);
amount -= toRemove;
bag.decrStackSize(j, toRemove);
if(!infBag) bag.decrStackSize(j, toRemove);
IMagazine.handleAmmoBag(inventory, first, toRemove);
if(amount <= 0) return;
}
@ -89,13 +90,17 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
if(slot != null) {
if(first.ammo.matchesRecipe(slot, true)) count += slot.stackSize;
if(slot.getItem() == ModItems.ammo_bag) {
boolean infBag = slot.getItem() == ModItems.ammo_bag_infinite;
if(slot.getItem() == ModItems.ammo_bag || infBag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
if(first.ammo.matchesRecipe(bagslot, true)) count += bagslot.stackSize;
if(first.ammo.matchesRecipe(bagslot, true)) {
if(infBag) return 9_999;
count += bagslot.stackSize;
}
}
}
}
@ -132,7 +137,7 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
if(config.ammo.matchesRecipe(slot, true)) return config;
}
if(slot.getItem() == ModItems.ammo_bag) {
if(slot.getItem() == ModItems.ammo_bag || slot.getItem() == ModItems.ammo_bag_infinite) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);

View File

@ -127,7 +127,8 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
}
}
if(slot.getItem() == ModItems.ammo_bag) {
boolean infBag = slot.getItem() == ModItems.ammo_bag_infinite;
if(slot.getItem() == ModItems.ammo_bag || infBag) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
@ -142,9 +143,9 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
if(config.ammo.matchesRecipe(bagslot, true)) {
this.setType(stack, config);
int wantsToLoad = (int) Math.ceil((double) this.getCapacity(stack) / (double) config.ammoReloadCount);
int toLoad = BobMathUtil.min(wantsToLoad, bagslot.stackSize, loadLimit);
int toLoad = BobMathUtil.min(wantsToLoad, infBag ? 9_999 : bagslot.stackSize, loadLimit);
this.setAmount(stack, Math.min(toLoad * config.ammoReloadCount, this.capacity));
bag.decrStackSize(j, toLoad);
if(!infBag) bag.decrStackSize(j, toLoad);
break;
}
}
@ -156,9 +157,9 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
if(config.ammo.matchesRecipe(bagslot, true)) {
int alreadyLoaded = this.getAmount(stack, bag);
int wantsToLoad = (int) Math.ceil((double) (this.getCapacity(stack) - alreadyLoaded) / (double) config.ammoReloadCount);
int toLoad = BobMathUtil.min(wantsToLoad, bagslot.stackSize, loadLimit);
int toLoad = BobMathUtil.min(wantsToLoad, infBag ? 9_999 : bagslot.stackSize, loadLimit);
this.setAmount(stack, Math.min((toLoad * config.ammoReloadCount) + alreadyLoaded, this.capacity));
bag.decrStackSize(j, toLoad);
if(!infBag) bag.decrStackSize(j, toLoad);
}
}
}
@ -176,29 +177,29 @@ public abstract class MagazineSingleTypeBase implements IMagazine<BulletConfig>
ItemStack slot = inventory.getStackInSlot(i);
if(slot != null) {
if(this.getAmount(stack, inventory) == 0) {
if(this.getAmount(stack, null) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(slot, true)) return config;
}
} else {
BulletConfig config = this.getType(stack, inventory);
BulletConfig config = this.getType(stack, null);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); }
if(config.ammo.matchesRecipe(slot, true)) return config;
}
if(slot.getItem() == ModItems.ammo_bag) {
if(slot.getItem() == ModItems.ammo_bag || slot.getItem() == ModItems.ammo_bag_infinite) {
InventoryAmmoBag bag = new InventoryAmmoBag(slot);
for(int j = 0; j < bag.getSizeInventory(); j++) {
ItemStack bagslot = bag.getStackInSlot(j);
if(bagslot != null) {
if(this.getAmount(stack, bag) == 0) {
if(this.getAmount(stack, null) == 0) {
for(BulletConfig config : this.acceptedBullets) {
if(config.ammo.matchesRecipe(bagslot, true)) return config;
}
} else {
BulletConfig config = this.getType(stack, bag);
BulletConfig config = this.getType(stack, null);
if(config == null) { config = this.acceptedBullets.get(0); this.setType(stack, config); }
if(config.ammo.matchesRecipe(bagslot, true)) return config;
}

View File

@ -22,7 +22,7 @@ public class ItemRenderChemthrower extends ItemRenderWeaponBase {
float offset = 0.8F;
standardAimingTransform(stack,
-2F * offset, -2F * offset, 2.5F * offset,
-2.5F * offset, -2.5F * offset, 2.5F * offset,
0, -4.375 / 8D, 1);
}

View File

@ -1031,6 +1031,7 @@ item.ammo_arty_phosgene.name=16" Artilleriegranate (Phosgen)
item.ammo_arty_phosphorus.name=16" Phosphor-Artilleriegranate
item.ammo_arty_phosphorus_multi.name=16" Mehrfach-Phosphor-Artilleriegranate
item.ammo_bag.name=Munitionstasche
item.ammo_bag_infinite.name=Unendliche Munitionstasche
item.ammo_dgk.name=Goalkeeper-Zwilling CIWS 200er Gürtel
item.ammo_fireext.name=Feuerlöscher-Wassertank
item.ammo_fireext_foam.name=Feuerlöscher-Schaumtank

View File

@ -1756,6 +1756,7 @@ item.ammo_arty_phosgene.name=16" Phosgene Artillery Shell
item.ammo_arty_phosphorus.name=16" Phosphorus Shell
item.ammo_arty_phosphorus_multi.name=16" Multi Phosphorus Shell
item.ammo_bag.name=Ammo Bag
item.ammo_bag_infinite.name=Infinite Ammo Bag
item.ammo_container.name=Ammo Container
item.ammo_dgk.name=Goalkeeper Twin CIWS 200 Round Belt
item.ammo_fireext.name=Fire Extinguisher Water Tank

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B