Merge remote-tracking branch 'upstream/master' into Optimization

# Conflicts:
#	src/main/java/com/hbm/blocks/ModBlocks.java
#	src/main/java/com/hbm/handler/EntityEffectHandler.java
#	src/main/java/com/hbm/main/ClientProxy.java
#	src/main/java/com/hbm/main/CraftingManager.java
#	src/main/java/com/hbm/main/MainRegistry.java
#	src/main/java/com/hbm/main/ModEventHandlerClient.java
#	src/main/java/com/hbm/main/ModEventHandlerRenderer.java
#	src/main/java/com/hbm/main/NEIConfig.java
#	src/main/java/com/hbm/main/ResourceManager.java
#	src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java
#	src/main/java/com/hbm/tileentity/turret/TileEntityTurretRichard.java
#	src/main/java/com/hbm/tileentity/turret/TileEntityTurretSentry.java
#	src/main/java/com/hbm/tileentity/turret/TileEntityTurretTauon.java
#	src/main/java/com/hbm/util/CompatExternal.java
#	src/main/java/com/hbm/util/CrucibleUtil.java
#	src/main/java/com/hbm/util/EntityDamageUtil.java
This commit is contained in:
BallOfEnergy 2024-12-16 18:18:46 -06:00
commit 2776a6f347
351 changed files with 37234 additions and 20839 deletions

View File

@ -6,6 +6,8 @@
[Official NTM Wiki](https://nucleartech.wiki/wiki/Main_Page)
[Bobcat's Blog (the blag)](https://hbmmods.github.io/), you can find lengthy yapping, upcoming features and some secrets here.
**This is for 1.7.10!** For 1.12, check out these projects:
* NTM Reloaded: https://github.com/TheOriginalGolem/Hbm-s-Nuclear-Tech-GIT/releases

View File

@ -1,70 +1,13 @@
## Gun rework
* Place holder place holder place hooooooooooldeeeeeeeer
## Added
* `/ntmclient`
* Allows some client-only config options to be edited while ingame
* Config is stored in `hbmClient.json` in the `hbmConfig` folder
* Configs can be edited ingame via `/ntmclient set <name> <value>` or in the file and then `/ntmclient reload`
* Available configs include geiger counter HUD position, info system position and orientation, custom main menu splash texts, ore dict display and custom nuke item info
* Check the config file or `/ntmclient list` for a full list of values, the name should make them self-explanatory!
* Liquid lead
* A valid coolant for both PWRs and ICFs
* Has an immense heat transfer speed bonus, allowing ICFs to be cooled even when using higher tier pellets
* Cools quite effectively in PWRs, but has a negative neutron modifier and a small penalty of how much heat ends up usable
* Overall a cheap and very good coolant, just not as efficient as sodium
## Changed
* Updated russian and chinese localization
* The fine soot recipe in the pyrolysis oven now only needs 4 tar
* Overdrive upgrades now use hard plastic/fullerite instead of lithium crystals
* Machines now only send their sync packets once a second instead of once per tick if the values haven't changed, reducing network traffic by a considerable amount
* Tom's explosion no longer causes any block updates on the millions of blocks it deletes which hopefully fixes a majority of the lag caused by the crater
* Overdrive upgrades now increase power usage in pyrolysis ovens (equivalent to 2 speed upgrades per level)
* Due to the increased maximum demand with overdrives + speed upgrades, the energy buffer for the pyrolysis oven has been increased tenfold
* Updated basalt textures
* Scaffold blocks can now be placed horizontally
* Updated the shredder's textures
* The strand caster will now cast its remaining buffer after 10 seconds of inactivity, even if the buffer is not full enough for a batch of 9
* The soldering station now has a toggle for the "refuse to do recipes with no fluid if fluid is present" behavior
* Recipes using the ore dictionary "oreThorium232" are now also generated for "oreThorium"
* Conveyor grabbers can now output onto belts directly
* I could have just made grabbers delete the input and spawn an identical item on the output but simply changing the position makes it look like the item is sucked in and it looks hilarious
* Cable connections (connectors, pylons, substations) now render about 10x faster and no longer have weird inaccuracies where the segments meet
* Cables can be made even faster by setting `RENDER_CABLE_HANG` in the config to `false`
* This causes cable connections to render taut, eliminating the need for multiple segments per pylon side
* Heat exchanging heaters are now set to 24,000mB/t by default
* The ICF GUI now lists the laser input as "per tick"
* Glpyhid hives caught in a fallout zone now turn radioactive
* Glyphids spawned by radioactive hives are immune to fire, twice as fast and five times as strong
* Radioactive glpyhids however are NOT immune to radiation, and typically die quickly
* Radioactive hives are sterile, they will not spawn scouts
* PWR core capacity is now limited to 500%, meaning the maximum amount of heatsinks usable is 80
* Item autogen now generates ingot forms for items that are castable but don't have an ingot form, preventing cases where a material is completely uncastable
* This change makes sodium and strontium castable
* Ore dict recipe autogen for crucible molds now prioritizes NTM's own items over any other ore dict compatible item
* If a cracking tower's input is set to an incorrect type, the input and steam tanks are now preserved instead of being set to NONE
* Removed legacy wire items
* Removed random ore, along with its configs
* DFC emitters are now only 95% efficient instead of 98%
* Oily coal has been removed from worldgen, it no longer spawns in new chunks
* Existing oily coal can be mined risk-free
* Reeds rendering into water can now be toggled with the RENDER_REEDS client config
* This option is usually enabled by default, unless Angelica is installed
* Microwave explosions no longer destroy blocks, only the microwave and nearby players
* Any bullet that can ricochet (or at least runs the code for it) can now also break glass
* Removed the witch taunter achievement for being unobtainable now
* AJR armor plating now uses niobium instead of saturnite, and yields twice as many items per recipe
* Due to the gating change, the saturnite anvil now has a tier equivalent to a bronze anvil
## Fixed
* The conveyor grabber should no longer skip over items when used in long lines
* Fixed a potential crash regarding crucibles
* Fixed compatibility with EndlessIDs, biome changes should no longer crash the game
* Fixed GL state leak caused by fluid tanks, causing some tile entities to be rendered without face culling
* Fixed a bug where using too many PWR heatsinks would cause an overflow, making the heat capacity negative
* Fixed landmines generating into the floor on superflat worlds
* All NTM type explosions are no longer affected by difficulty setting, preventing them from dealing damage in peaceful mode
* There are a few instances of vanilla explosions still being used, those will be phased out in the future
* Fixed tutorial presentations triggering when hitting F1 not just in the inventory but also when looking at the block in question
* Fixed a bug regarding shift clicking in the breeding reactor
* Fixed empty particle capsules not being extractable from the ICF pellet maker
* Fixed issue regarding mass storage filters when using GTNH-NEI
* Fixed DFC emitters calculating their original 98% inefficiency twice when hitting another emitter or tungsten crate
* Fixed the wood burner destroying container items like buckets when using lava as fuel
* Fixed 9mm soft points being called ".9mm"
* Fixed missing localization for the hard plastic autogen material
* Fixed the fat mine's crafting recipe still using the deprecated ammo item
* Removed legacy ammo items from all remaining item pools
* Fixed the rubber grip not having a recipe
* Fixed the coilgun and bolter not being classified correctly

View File

@ -49,7 +49,7 @@ credits=HbMinecraft,\
\ Voxelstice (OpenComputers integration, turbine spinup),\
\ BallOfEnergy1 (OpenComputers integration),\
\ sdddddf80 (recipe configs, chinese localization, custom machine holograms),\
\ Abel1502 (optimization, crate upgrade recipes, strand caster improvements),\
\ Abel1502 (optimization, crate upgrade recipes, strand caster improvements, varous tweaks),\
\ SuperCraftAlex (tooltips)\
\ Ice-Arrow (research reactor tweaks),\
\ 245tt (anvil GUI improvements),\

View File

@ -605,6 +605,7 @@ public class ModBlocks {
public static Block sat_dock;
public static Block soyuz_capsule;
public static Block crate_supply;
public static Block crate_iron;
public static Block crate_steel;
@ -1046,8 +1047,8 @@ public class ModBlocks {
public static Block anvil_lead;
public static Block anvil_steel;
public static Block anvil_desh;
public static Block anvil_saturnite;
public static Block anvil_ferrouranium;
public static Block anvil_saturnite;
public static Block anvil_bismuth_bronze;
public static Block anvil_arsenic_bronze;
public static Block anvil_schrabidate;
@ -2067,6 +2068,7 @@ public class ModBlocks {
sat_dock = new MachineSatDock(Material.iron).setBlockName("sat_dock").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":sat_dock");
soyuz_capsule = new SoyuzCapsule(Material.iron).setBlockName("soyuz_capsule").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":soyuz_capsule");
crate_supply = new BlockSupplyCrate(Material.wood).setBlockName("crate_supply").setStepSound(Block.soundTypeWood).setHardness(1.0F).setResistance(2.5F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":crate_can");
turret_chekhov = new TurretChekhov(Material.iron).setBlockName("turret_chekhov").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
turret_friendly = new TurretFriendly(Material.iron).setBlockName("turret_friendly").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.weaponTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -2216,8 +2218,8 @@ public class ModBlocks {
anvil_lead = new NTMAnvil(Material.iron, NTMAnvil.TIER_IRON).setBlockName("anvil_lead").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_lead");
anvil_steel = new NTMAnvil(Material.iron, NTMAnvil.TIER_STEEL).setBlockName("anvil_steel").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_steel");
anvil_desh = new NTMAnvil(Material.iron, NTMAnvil.TIER_OIL).setBlockName("anvil_desh").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_desh");
anvil_saturnite = new NTMAnvil(Material.iron, NTMAnvil.TIER_OIL).setBlockName("anvil_saturnite").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_saturnite");
anvil_ferrouranium = new NTMAnvil(Material.iron, NTMAnvil.TIER_NUCLEAR).setBlockName("anvil_ferrouranium").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_ferrouranium");
anvil_saturnite = new NTMAnvil(Material.iron, NTMAnvil.TIER_RBMK).setBlockName("anvil_saturnite").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_saturnite");
anvil_bismuth_bronze = new NTMAnvil(Material.iron, NTMAnvil.TIER_RBMK).setBlockName("anvil_bismuth_bronze").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_bismuth_bronze");
anvil_arsenic_bronze = new NTMAnvil(Material.iron, NTMAnvil.TIER_RBMK).setBlockName("anvil_arsenic_bronze").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_arsenic_bronze");
anvil_schrabidate = new NTMAnvil(Material.iron, NTMAnvil.TIER_FUSION).setBlockName("anvil_schrabidate").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_schrabidate");
@ -2852,8 +2854,8 @@ public class ModBlocks {
//Mines
GameRegistry.registerBlock(mine_ap, mine_ap.getUnlocalizedName());
GameRegistry.registerBlock(mine_he, mine_he.getUnlocalizedName());
GameRegistry.registerBlock(mine_shrap, mine_shrap.getUnlocalizedName());
GameRegistry.registerBlock(mine_he, mine_he.getUnlocalizedName());
GameRegistry.registerBlock(mine_fat, mine_fat.getUnlocalizedName());
//Block Bombs
@ -2951,8 +2953,8 @@ public class ModBlocks {
register(anvil_lead);
register(anvil_steel);
register(anvil_desh);
register(anvil_saturnite);
register(anvil_ferrouranium);
register(anvil_saturnite);
register(anvil_bismuth_bronze);
register(anvil_arsenic_bronze);
register(anvil_schrabidate);
@ -3343,6 +3345,7 @@ public class ModBlocks {
GameRegistry.registerBlock(soyuz_launcher, soyuz_launcher.getUnlocalizedName());
GameRegistry.registerBlock(sat_dock, sat_dock.getUnlocalizedName());
GameRegistry.registerBlock(soyuz_capsule, soyuz_capsule.getUnlocalizedName());
GameRegistry.registerBlock(crate_supply, crate_supply.getUnlocalizedName());
GameRegistry.registerBlock(machine_radar, machine_radar.getUnlocalizedName());
GameRegistry.registerBlock(machine_radar_large, machine_radar_large.getUnlocalizedName());
GameRegistry.registerBlock(radar_screen, radar_screen.getUnlocalizedName());

View File

@ -37,7 +37,6 @@ public class Landmine extends BlockContainer implements IBomb {
public Landmine(Material mat, double range, double height) {
super(mat);
this.range = range;
this.height = height;
}
@ -47,20 +46,9 @@ public class Landmine extends BlockContainer implements IBomb {
return new TileEntityLandmine();
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override public int getRenderType() { return -1; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
@Override
public Item getItemDropped(int i, Random rand, int j) {
@ -70,14 +58,10 @@ public class Landmine extends BlockContainer implements IBomb {
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
float f = 0.0625F;
if(this == ModBlocks.mine_ap)
this.setBlockBounds(6 * f, 0.0F, 6 * f, 10 * f, 2 * f, 10 * f);
if(this == ModBlocks.mine_he)
this.setBlockBounds(4 * f, 0.0F, 4 * f, 12 * f, 2 * f, 12 * f);
if(this == ModBlocks.mine_shrap)
this.setBlockBounds(4 * f, 0.0F, 4 * f, 12 * f, 2 * f, 12 * f);
if(this == ModBlocks.mine_fat)
this.setBlockBounds(5 * f, 0.0F, 4 * f, 11 * f, 6 * f, 12 * f);
if(this == ModBlocks.mine_ap) this.setBlockBounds(5 * f, 0.0F, 5 * f, 11 * f, 1 * f, 11 * f);
if(this == ModBlocks.mine_he) this.setBlockBounds(4 * f, 0.0F, 4 * f, 12 * f, 2 * f, 12 * f);
if(this == ModBlocks.mine_shrap) this.setBlockBounds(5 * f, 0.0F, 5 * f, 11 * f, 1 * f, 11 * f);
if(this == ModBlocks.mine_fat) this.setBlockBounds(5 * f, 0.0F, 4 * f, 11 * f, 6 * f, 12 * f);
}
@Override
@ -154,7 +138,7 @@ public class Landmine extends BlockContainer implements IBomb {
if(this == ModBlocks.mine_ap) {
ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 3F);
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, 10F));
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(0.5, 10F).setupPiercing(5F, 0.2F));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectWeapon(5, 1F, 0.5F));
vnt.explode();
@ -162,7 +146,7 @@ public class Landmine extends BlockContainer implements IBomb {
ExplosionVNT vnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 4F);
vnt.setBlockAllocator(new BlockAllocatorStandard());
vnt.setBlockProcessor(new BlockProcessorStandard());
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 35));
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, 35).setupPiercing(15F, 0.2F));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectWeapon(15, 3.5F, 1.25F));
vnt.explode();
@ -182,5 +166,4 @@ public class Landmine extends BlockContainer implements IBomb {
return BombReturnCode.DETONATED;
}
}

View File

@ -3,8 +3,8 @@ package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.Random;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
@ -69,27 +69,22 @@ public class BlockAmmoCrate extends Block {
ret.add(new ItemStack(ModItems.cap_nuka, 12 + rand.nextInt(21)));
ret.add(new ItemStack(ModItems.syringe_metal_stimpak, 1 + rand.nextInt(3)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.P9_SP.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.P9_FMJ.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.M357_SP.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.M357_FMJ.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.M44_SP.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.M44_FMJ.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.R556_SP.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.R556_FMJ.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.R762_SP.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.R762_FMJ.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.G12.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 16 + rand.nextInt(17), EnumAmmo.G12_SLUG.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 2 + rand.nextInt(3), EnumAmmo.G40_HE.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_standard, 2 + rand.nextInt(3), EnumAmmo.ROCKET_HE.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_22lr, 16 + rand.nextInt(17)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_9mm, 6 + rand.nextInt(13)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_12gauge, 6 + rand.nextInt(4)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_20gauge, 3 + rand.nextInt(4)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_357, 10 + rand.nextInt(11)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_357, 12 + rand.nextInt(15), Ammo357Magnum.IRON.ordinal()));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_50bmg, 2 + rand.nextInt(7)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_rocket, 1));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.ammo_grenade, 1 + rand.nextInt(2)));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_12gauge, 3, Ammo12Gauge.INCENDIARY.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge, 3, Ammo20Gauge.INCENDIARY.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge, 3, Ammo20Gauge.CAUSTIC.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge, 3, Ammo20Gauge.FLECHETTE.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_9mm, 7, Ammo9mm.AP.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket, 1, AmmoRocket.INCENDIARY.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket, 1, AmmoRocket.SLEEK.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade, 1, AmmoGrenade.HE.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade, 1, AmmoGrenade.INCENDIARY.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade, 1, AmmoGrenade.SLEEK.ordinal()));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.syringe_metal_super, 2));
return ret;

View File

@ -5,7 +5,7 @@ import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ItemAmmoEnums.Ammo44Magnum;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
import com.hbm.items.ModItems;
import net.minecraft.block.BlockFalling;
@ -52,18 +52,6 @@ public class BlockCrate extends BlockFalling {
// Supply Crate
BlockCrate.addToListWithWeight(crateList, ModItems.syringe_metal_stimpak, 10);
BlockCrate.addToListWithWeight(crateList, ModItems.syringe_antidote, 5);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_revolver_iron, 9);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_revolver, 7);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_revolver_gold, 4);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_revolver_lead, 6);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_revolver_cursed, 5);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_rpg, 5);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_fatman, 1);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_mp40, 7);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_uzi, 7);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_uboinik, 7);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_lever_action, 5);
BlockCrate.addToListWithWeight(crateList, ModItems.clip_bolt_action, 5);
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_generic, 8);
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_strong, 6);
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_mk2, 4);
@ -142,12 +130,12 @@ public class BlockCrate extends BlockFalling {
// Red Crate
BlockCrate.addToListWithWeight(redList, ModItems.mysteryshovel, 1);
BlockCrate.addToListWithWeight(redList, ModItems.gun_revolver_pip, 1);
BlockCrate.addToListWithWeight(redList, ModItems.gun_revolver_blackjack, 1);
BlockCrate.addToListWithWeight(redList, ModItems.gun_revolver_silver, 1);
BlockCrate.addToListWithWeight(redList, ModItems.ammo_44.stackFromEnum(Ammo44Magnum.PIP), 1);
BlockCrate.addToListWithWeight(redList, ModItems.ammo_44.stackFromEnum(Ammo44Magnum.BJ), 1);
BlockCrate.addToListWithWeight(redList, ModItems.ammo_44.stackFromEnum(Ammo44Magnum.SILVER), 1);
BlockCrate.addToListWithWeight(redList, ModItems.gun_heavy_revolver_lilmac, 1);
BlockCrate.addToListWithWeight(redList, ModItems.gun_autoshotgun_sexy, 1);
BlockCrate.addToListWithWeight(redList, ModItems.gun_maresleg_broken, 1);
BlockCrate.addToListWithWeight(redList, new ItemStack(ModItems.ammo_secret, 1, EnumAmmoSecret.M44_EQUESTRIAN.ordinal()), 1);
BlockCrate.addToListWithWeight(redList, new ItemStack(ModItems.ammo_secret, 1, EnumAmmoSecret.G12_EQUESTRIAN.ordinal()), 1);
BlockCrate.addToListWithWeight(redList, new ItemStack(ModItems.ammo_secret, 1, EnumAmmoSecret.BMG50_EQUESTRIAN.ordinal()), 1);
BlockCrate.addToListWithWeight(redList, ModItems.battery_spark, 1);
BlockCrate.addToListWithWeight(redList, ModItems.bottle_sparkle, 1);
BlockCrate.addToListWithWeight(redList, ModItems.bottle_rad, 1);

View File

@ -135,7 +135,7 @@ public class BlockDynamicSlag extends BlockContainer {
TileEntitySlag self = (TileEntitySlag) s;
/* Flow down */
if(world.getBlock(x, y - 1, z).isReplaceable(world, x, y - 1, z)) {
if(world.getBlock(x, y - 1, z).isReplaceable(world, x, y - 1, z) && y > 0) {
world.setBlock(x, y - 1, z, ModBlocks.slag);
TileEntitySlag tile = (TileEntitySlag) Compat.getTileStandard(world, x, y - 1, z);
tile.mat = self.mat;

View File

@ -213,7 +213,9 @@ public class BlockKeyhole extends BlockStone {
public static void spawnPedestalItem(World world, int x, int y, int z) {
world.setBlock(x, y, z, ModBlocks.pedestal);
TileEntityPedestal pedestal = (TileEntityPedestal) world.getTileEntity(x, y, z);
WeightedRandomChestContent content = (WeightedRandomChestContent) WeightedRandom.getRandomItem(world.rand, ItemPool.getPool(ItemPoolsRedRoom.POOL_RED_PEDESTAL));
WeightedRandomChestContent content = world.rand.nextInt(20) == 0 ?
(WeightedRandomChestContent) WeightedRandom.getRandomItem(world.rand, ItemPool.getPool(ItemPoolsRedRoom.POOL_RED_WEAPON)) :
(WeightedRandomChestContent) WeightedRandom.getRandomItem(world.rand, ItemPool.getPool(ItemPoolsRedRoom.POOL_RED_PEDESTAL));
pedestal.item = content.theItemId.copy();
}
}

View File

@ -19,7 +19,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockOreBasalt extends BlockEnumMulti {
@ -65,14 +64,7 @@ public class BlockOreBasalt extends BlockEnumMulti {
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
int meta = world.getBlockMetadata(x, y, z);
if(meta == EnumBasaltOreType.ASBESTOS.ordinal()) for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
if(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.air) {
world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, ModBlocks.gas_asbestos);
}
}
}
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { } //no more BUD outgassing for you, mister
@Override
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune) {

View File

@ -0,0 +1,130 @@
package com.hbm.blocks.generic;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.hbm.items.ModItems;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class BlockSupplyCrate extends BlockContainer {
public BlockSupplyCrate(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntitySupplyCrate();
}
@Override public int getRenderType() { return BlockCanCrate.renderID; }
@Override public boolean isOpaqueCube() { return false; }
@Override public boolean renderAsNormalBlock() { return false; }
@Override public Item getItemDropped(int i, Random rand, int j) { return null; }
@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest) {
ItemStack drop = new ItemStack(this);
TileEntitySupplyCrate inv = (TileEntitySupplyCrate) world.getTileEntity(x, y, z);
NBTTagCompound nbt = new NBTTagCompound();
if(inv != null) {
for(int i = 0; i < inv.items.size(); i++) {
ItemStack stack = inv.items.get(i);
if(stack == null) continue;
NBTTagCompound slot = new NBTTagCompound();
stack.writeToNBT(slot);
nbt.setTag("slot" + i, slot);
}
nbt.setInteger("amount", inv.items.size());
}
if(!nbt.hasNoTags()) drop.stackTagCompound = nbt;
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, drop));
}
return world.setBlockToAir(x, y, z);
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
TileEntitySupplyCrate inv = (TileEntitySupplyCrate) world.getTileEntity(x, y, z);
if(inv != null && stack.hasTagCompound()) {
int amount = stack.stackTagCompound.getInteger("amount");
for(int i = 0; i < amount; i++) {
inv.items.add(ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("slot" + i)));
}
}
super.onBlockPlacedBy(world, x, y, z, player, stack);
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
if(player.getHeldItem() != null && player.getHeldItem().getItem().equals(ModItems.crowbar)) {
if(!world.isRemote) {
dropContents(world, x, y, z);
world.func_147480_a(x, y, z, false);
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
}
return true;
}
return false;
}
public void dropContents(World world, int x, int y, int z) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntitySupplyCrate) {
TileEntitySupplyCrate crate = (TileEntitySupplyCrate) tile;
for(ItemStack item : crate.items) {
this.dropBlockAsItem(world, x, y, z, item);
}
}
}
public static class TileEntitySupplyCrate extends TileEntity {
public List<ItemStack> items = new ArrayList();
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
items.clear();
NBTTagList list = nbt.getTagList("items", 10);
for(int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
items.add(ItemStack.loadItemStackFromNBT(nbt1));
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
NBTTagList list = new NBTTagList();
for(int i = 0; i < items.size(); i++) {
NBTTagCompound nbt1 = new NBTTagCompound();
items.get(i).writeToNBT(nbt1);
list.appendTag(nbt1);
}
nbt.setTag("items", list);
}
}
}

View File

@ -1,16 +1,15 @@
package com.hbm.blocks.machine;
import com.hbm.main.MainRegistry;
import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityMachineAmmoPress;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class MachineAmmoPress extends BlockContainer {
public class MachineAmmoPress extends BlockDummyable {
public MachineAmmoPress() {
super(Material.iron);
@ -18,19 +17,14 @@ public class MachineAmmoPress extends BlockContainer {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityMachineAmmoPress();
return meta >= 12 ? new TileEntityMachineAmmoPress() : new TileEntityProxyCombo().inventory();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) {
return true;
} else if(!player.isSneaking()) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
return true;
} else {
return false;
}
return this.standardOpenBehavior(world, x, y, z, player, 0);
}
@Override public int[] getDimensions() { return new int[] {1, 0, 0, 0, 1, 1}; }
@Override public int getOffset() { return 0; }
}

View File

@ -1,14 +1,21 @@
package com.hbm.commands;
import com.hbm.config.ItemPoolConfigJSON;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.main.MainRegistry;
import com.hbm.util.ChatBuilder;
import com.hbm.util.DamageResistanceHandler;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import java.io.File;
public class CommandReloadRecipes extends CommandBase {
@Override
@ -26,6 +33,9 @@ public class CommandReloadRecipes extends CommandBase {
try {
SerializableRecipe.initialize();
ItemPoolConfigJSON.initialize();
DamageResistanceHandler.init();
Fluids.reloadFluids();
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Reload complete :)"));
} catch(Exception ex) {
sender.addChatMessage(ChatBuilder.start("----------------------------------").color(EnumChatFormatting.GRAY).flush());

View File

@ -30,6 +30,8 @@ public class ClientConfig {
public static ConfigWrapper<Integer> INFO_OFFSET_VERTICAL = new ConfigWrapper(0);
public static ConfigWrapper<Integer> INFO_POSITION = new ConfigWrapper(0);
public static ConfigWrapper<Boolean> GUN_ANIMS_LEGACY = new ConfigWrapper(false);
public static ConfigWrapper<Boolean> GUN_MODEL_FOV = new ConfigWrapper(false);
public static ConfigWrapper<Boolean> GUN_VISUAL_RECOIL = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> ITEM_TOOLTIP_SHOW_OREDICT = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> ITEM_TOOLTIP_SHOW_CUSTOM_NUKE = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> MAIN_MENU_WACKY_SPLASHES = new ConfigWrapper(true);
@ -46,6 +48,8 @@ public class ClientConfig {
configMap.put("INFO_OFFSET_VERTICAL", INFO_OFFSET_VERTICAL);
configMap.put("INFO_POSITION", INFO_POSITION);
configMap.put("GUN_ANIMS_LEGACY", GUN_ANIMS_LEGACY);
configMap.put("GUN_MODEL_FOV", GUN_MODEL_FOV);
configMap.put("GUN_VISUAL_RECOIL", GUN_VISUAL_RECOIL);
configMap.put("ITEM_TOOLTIP_SHOW_OREDICT", ITEM_TOOLTIP_SHOW_OREDICT);
configMap.put("ITEM_TOOLTIP_SHOW_OREDICT", ITEM_TOOLTIP_SHOW_CUSTOM_NUKE);
configMap.put("MAIN_MENU_WACKY_SPLASHES", MAIN_MENU_WACKY_SPLASHES);

View File

@ -62,6 +62,7 @@ public class FalloutConfigJSON {
entries.add(new FalloutEntry() .mB(Blocks.brown_mushroom_block).mM(10) .prim(new Triplet(ModBlocks.waste_log, 0, 1)) .max(woodEffectRange));
entries.add(new FalloutEntry() .mB(Blocks.red_mushroom_block) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));
entries.add(new FalloutEntry() .mB(Blocks.brown_mushroom_block) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));
entries.add(new FalloutEntry() .mB(Blocks.snow_layer) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));
entries.add(new FalloutEntry() .mB(Blocks.planks) .prim(new Triplet(ModBlocks.waste_planks, 0, 1)) .max(woodEffectRange));
/* if it can't be petrified, destroy it */
entries.add(new FalloutEntry() .mMa(Material.wood) .prim(new Triplet(Blocks.air, 0, 1)) .max(woodEffectRange));

View File

@ -165,8 +165,8 @@ public class ConsumableRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_era, 1), new Object[] { "DPD", "PSP", "DPD", 'D', ModItems.ducttape, 'P', IRON.plate(), 'S', ModItems.ingot_semtex });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_kevlar, 1), new Object[] { "KIK", "IDI", "KIK", 'K', ModItems.plate_kevlar, 'I', ANY_RUBBER.ingot(), 'D', ModItems.ducttape });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_sapi, 1), new Object[] { "PKP", "DPD", "PKP", 'P', ANY_PLASTIC.ingot(), 'K', ModItems.insert_kevlar, 'D', ModItems.ducttape });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_esapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ANY_PLASTIC.ingot(), 'K', ModItems.insert_sapi, 'D', ModItems.ducttape, 'S', BIGMT.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_xsapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ASBESTOS.ingot(), 'K', ModItems.insert_esapi, 'D', ModItems.ducttape, 'S', ModItems.ingot_meteorite_forged });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_esapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ANY_PLASTIC.ingot(), 'K', ModItems.insert_sapi, 'D', ModItems.ducttape, 'S', WEAPONSTEEL.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_xsapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ASBESTOS.ingot(), 'K', ModItems.insert_esapi, 'D', ModItems.ducttape, 'S', BIGMT.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_yharonite, 1), new Object[] { "YIY", "IYI", "YIY", 'Y', ModItems.billet_yharonite, 'I', ModItems.insert_du });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.australium_iii, 1), new Object[] { "WSW", "PAP", "SPS", 'S', STEEL.plateWelded(), 'P', ANY_PLASTIC.ingot(), 'A', AUSTRALIUM.ingot(), 'W', GOLD.wireDense() });

View File

@ -10,7 +10,6 @@ import static com.hbm.inventory.OreDictManager.*;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.GunB92Cell;
@ -33,6 +32,15 @@ public class WeaponRecipes {
//SEDNA Parts
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_WOOD.id), new Object[] { "WWW", " W", 'W', KEY_PLANKS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_WOOD.id), new Object[] { "W ", " W", " W", 'W', KEY_PLANKS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_POLYMER.id), new Object[] { "WWW", " W", 'W', POLYMER.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_POLYMER.id), new Object[] { "W ", " W", " W", 'W', POLYMER.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_BAKELITE.id), new Object[] { "WWW", " W", 'W', BAKELITE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_BAKELITE.id), new Object[] { "W ", " W", " W", 'W', BAKELITE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_HARDPLASTIC.id), new Object[] { "WWW", " W", 'W', PC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_HARDPLASTIC.id), new Object[] { "W ", " W", " W", 'W', PC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_stock, 1, Mats.MAT_PVC.id), new Object[] { "WWW", " W", 'W', PVC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_PVC.id), new Object[] { "W ", " W", " W", 'W', PVC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.part_grip, 1, Mats.MAT_RUBBER.id), new Object[] { "W ", " W", " W", 'W', RUBBER.ingot() });
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.SHOTSHELL, 2), new Object[] { "P", "C", 'P', GUNMETAL.plate(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE) });
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.casing, EnumCasingType.BUCKSHOT, 2), new Object[] { "P", "C", 'P', ANY_PLASTIC.ingot(), 'C', DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE) });
@ -41,16 +49,37 @@ public class WeaponRecipes {
//SEDNA Guns
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_pepperbox, 1), new Object[] { "IIW", " C", 'I', IRON.ingot(), 'W', KEY_PLANKS, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_light_revolver, 1), new Object[] { "BRM", " G", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_light_revolver_atlas, 1), new Object[] { " M ", "MAM", " M ", 'M', WEAPONSTEEL.mechanism(), 'A', ModItems.gun_light_revolver });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_henry, 1), new Object[] { "BRP", "BMS", 'B', STEEL.lightBarrel(), 'R', GUNMETAL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'S', WOOD.stock(), 'P', GUNMETAL.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_greasegun, 1), new Object[] { "BRS", "SMG", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'S', STEEL.bolt(), 'M', GUNMETAL.mechanism(), 'G', STEEL.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_maresleg, 1), new Object[] { "BRM", "BGS", 'B', STEEL.lightBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', STEEL.bolt(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_maresleg_akimbo, 1), new Object[] { "SMS", 'S', ModItems.gun_maresleg, 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flaregun, 1), new Object[] { "BRM", " G", 'B', STEEL.heavyBarrel(), 'R', STEEL.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', STEEL.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_heavy_revolver, 1), new Object[] { "BRM", " G", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_carbine, 1), new Object[] { "BRM", "G S", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_am180, 1), new Object[] { "BBR", "GMS", 'B', DURA.lightBarrel(), 'R', DURA.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_liberator, 1), new Object[] { "BB ", "BBM", "G G", 'B', DURA.lightBarrel(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_congolake, 1), new Object[] { "BM ", "BRS", "G ", 'B', DURA.heavyBarrel(), 'M', GUNMETAL.mechanism(), 'R', DURA.lightReceiver(), 'S', WOOD.stock(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flamer, 1), new Object[] { " MG", "BBR", " GM", 'M', GUNMETAL.mechanism(), 'G', DURA.grip(), 'B', DURA.heavyBarrel(), 'R', DURA.heavyReceiver() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flamer_topaz, 1), new Object[] { " M ", "MFM", " M ", 'M', WEAPONSTEEL.mechanism(), 'F', ModItems.gun_flamer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_heavy_revolver, 1), new Object[] { "BRM", " G", 'B', DESH.lightBarrel(), 'R', DESH.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_carbine, 1), new Object[] { "BRM", "G S", 'B', DESH.lightBarrel(), 'R',DESH.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', WOOD.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi, 1), new Object[] { "BRS", " GM", 'B', DESH.lightBarrel(), 'R', DESH.lightReceiver(), 'S', ANY_PLASTIC.stock(), 'G', ANY_PLASTIC.grip(), 'M', GUNMETAL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_akimbo, 1), new Object[] { "UMU", 'U', ModItems.gun_uzi, 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "BRM", "BGS", 'B', DESH.lightBarrel(), 'R', DESH.lightReceiver(), 'M', GUNMETAL.mechanism(), 'G', ANY_PLASTIC.grip(), 'S', DESH.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_panzerschreck, 1), new Object[] { "BBB", "PGM", 'B', DESH.heavyBarrel(), 'P', STEEL.plateCast(), 'G', DESH.grip(), 'M', GUNMETAL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_g3, 1), new Object[] { "BRM", "WGS", 'B', WEAPONSTEEL.lightBarrel(), 'R', WEAPONSTEEL.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'W', WOOD.grip(), 'G', RUBBER.grip(), 'S', WOOD.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stinger, 1), new Object[] { "BBB", "PGM", 'B', WEAPONSTEEL.heavyBarrel(), 'P', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'G', WEAPONSTEEL.grip(), 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_chemthrower, 1), new Object[] { "MHW", "PSS", 'M', WEAPONSTEEL.mechanism(), 'H', RUBBER.pipe(), 'W', ModItems.wrench, 'P', WEAPONSTEEL.heavyBarrel(), 'S', WEAPONSTEEL.shell() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_m2, 1), new Object[] { " G", "BRM", " G", 'G', WOOD.grip(), 'B', FERRO.heavyBarrel(), 'R', FERRO.heavyReceiver(), 'M', WEAPONSTEEL.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_autoshotgun, 1), new Object[] { "BRM", "G G", 'B', FERRO.heavyBarrel(), 'R', FERRO.heavyReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_quadro, 1), new Object[] { "BCB", "BMB", "GG ", 'B', FERRO.heavyBarrel(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lag, 1), new Object[] { "BRM", " G", 'B', ANY_RESISTANTALLOY.lightBarrel(), 'R', ANY_RESISTANTALLOY.lightReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_minigun, 1), new Object[] { "BMG", "BRE", "BGM", 'B', ANY_RESISTANTALLOY.lightBarrel(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip(), 'R', ANY_RESISTANTALLOY.heavyReceiver(), 'E', ModItems.motor_desh });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_missile_launcher, 1), new Object[] { " CM", "BBB", "G ", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', WEAPONSTEEL.mechanism(), 'B', ANY_RESISTANTALLOY.heavyBarrel(), 'G', ANY_PLASTIC.grip() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_tesla_cannon, 1), new Object[] { "CCC", "BRB", "MGE", 'C', ModItems.coil_advanced_alloy, 'B', ANY_RESISTANTALLOY.heavyBarrel(), 'R', ANY_RESISTANTALLOY.heavyReceiver(), 'M', WEAPONSTEEL.mechanism(), 'G', ANY_PLASTIC.grip(), 'E', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_stg77, 1), new Object[] { " D ", "BRS", "GM ", 'D', DIAMOND.gem(), 'B', BIGMT.lightBarrel(), 'R', BIGMT.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fatman, 1), new Object[] { "PPP", "BSR", "G M", 'P', BIGMT.plate(), 'B', BIGMT.heavyBarrel(), 'S', BIGMT.shell(), 'R', BIGMT.heavyReceiver(), 'G', ANY_HARDPLASTIC.grip(), 'M', BIGMT.mechanism() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_tau, 1), new Object[] { " RD", "CTT", "GMS", 'D', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'C', CU.pipe(), 'T', ModItems.coil_advanced_torus, 'G', ANY_HARDPLASTIC.grip(), 'R', BIGMT.lightReceiver(), 'M', BIGMT.mechanism(), 'S', ANY_HARDPLASTIC.stock() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lasrifle, 1), new Object[] { "LC ", "BRS", "MG ", 'L', ModItems.crystal_redstone, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'B', ANY_BISMOIDBRONZE.lightBarrel(), 'R', ANY_BISMOIDBRONZE.lightReceiver(), 'S', ANY_HARDPLASTIC.stock(), 'M', BIGMT.mechanism(), 'G', ANY_HARDPLASTIC.grip() });
//SEDNA Ammo
CraftingManager.addRecipeAuto(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.STONE, 6), new Object[] { "C", "P", "G", 'C', KEY_COBBLESTONE, 'P', Items.paper, 'G', Items.gunpowder });
@ -101,193 +130,19 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.turret_sentry, 1), new Object[] { "PPL", " MD", " SC", 'P', STEEL.plate(), 'M', ModItems.motor, 'L', ModItems.mechanism_rifle_1, 'S', ModBlocks.steel_scaffold, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'D', ModItems.crt_display });
//Guns
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_rpg, 1), new Object[] { "SSW", " MW", 'S', STEEL.shell(), 'W', IRON.plate(), 'M', ModItems.mechanism_launcher_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_karl, 1), new Object[] { "SSW", " MW", 'S', STEEL.shell(), 'W', ALLOY.plate(), 'M', ModItems.mechanism_launcher_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_hk69, 1), new Object[] { "SSI", " MB", 'S', STEEL.shell(), 'I', IRON.ingot(), 'M', ModItems.mechanism_launcher_1, 'B', STEEL.bolt() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver, 1), new Object[] { "SSM", " RW", 'S', STEEL.plate(), 'W', KEY_PLANKS, 'R', AL.wireFine(), 'M', ModItems.mechanism_revolver_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_saturnite, 1), new Object[] { "SSM", " RW", 'S', BIGMT.plate(), 'W', KEY_PLANKS, 'R', W.wireFine(), 'M', ModItems.mechanism_revolver_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_gold, 1), new Object[] { "SSM", " RW", 'S', GOLD.plate(), 'W', W.ingot(), 'R', GOLD.wireFine(), 'M', ModItems.mechanism_revolver_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_schrabidium, 1), new Object[] { "SSM", " RW", 'S', SA326.block(), 'W', W.ingot(), 'R', SA326.wireFine(), 'M', ModItems.mechanism_special });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_pip, 1), new Object[] { " G ", "SSP", " TI", 'G', KEY_ANYPANE, 'S', STEEL.plate(), 'P', ModItems.mechanism_revolver_2, 'T', W.wireFine(), 'I', ANY_PLASTIC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nopip, 1), new Object[] { "SSP", " TI", 'S', STEEL.plate(), 'P', ModItems.mechanism_revolver_2, 'T', W.wireFine(), 'I', ANY_PLASTIC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_blackjack, 1), new Object[] { "SSP", " TI", 'S', STEEL.plate(), 'P', ModItems.mechanism_revolver_2, 'T', W.wireFine(), 'I', KEY_PLANKS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_silver, 1), new Object[] { "SSP", " TI", 'S', AL.plate(), 'P', ModItems.mechanism_revolver_2, 'T', W.wireFine(), 'I', KEY_PLANKS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_red, 1), new Object[] { "R ", " B", 'R', ModItems.key_red, 'B', ModItems.gun_revolver_blackjack });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_deagle, 1), new Object[] { "PPM", " BI", 'P', STEEL.plate(), 'B', STEEL.bolt(), 'I', ANY_PLASTIC.ingot(), 'M', ModItems.mechanism_rifle_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uac_pistol, 1), new Object[] { "IIM", " BI", 'B', DURA.bolt(), 'I', ANY_PLASTIC.ingot(), 'M', ModItems.mechanism_rifle_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_cursed, 1), new Object[] { "TTM", "SRI", 'S', STEEL.plate(), 'I', STEEL.ingot(), 'R', MINGRADE.wireFine(), 'T', TI.plate(), 'M', ModItems.mechanism_revolver_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare, 1), new Object[] { "SEM", " RW", 'S', STEEL.plate(), 'W', KEY_PLANKS, 'R', AL.wireFine(), 'E', ModItems.powder_power, 'M', ModItems.mechanism_revolver_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare2, 1), new Object[] { "SSM", "RRW", 'S', OreDictManager.getReflector(), 'W', W.ingot(), 'R', GOLD.wireFine(), 'M', ModItems.mechanism_special });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_bio_revolver, 1), new Object[] { "SSM", "BTW", 'S', STEEL.plate(), 'M', ModItems.mechanism_revolver_2, 'B', B.ingot(), 'T', W.bolt(), 'W', KEY_LOG });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_chemthrower, 1), new Object[] { "RWC", "HHT", "RLC", 'R', RUBBER.ingot(), 'W', ModItems.wrench, 'C', CU.plate(), 'H', STEEL.shell(), 'T', ModItems.tank_steel, 'L', ModItems.mechanism_launcher_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fatman, 1), new Object[] { "SSI", "IIM", "WPH", 'S', STEEL.plate(), 'I', STEEL.ingot(), 'W', AL.wireFine(), 'H', STEEL.shell(), 'P', Item.getItemFromBlock(Blocks.piston), 'M', ModItems.mechanism_launcher_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mirv, 1), new Object[] { "LLL", "WFW", "SSS", 'S', STEEL.plate(), 'L', PB.plate(), 'W', GOLD.wireFine(), 'F', ModItems.gun_fatman });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_proto, 1), new Object[] { "LLL", "WFW", "SSS", 'S', ANY_RUBBER.ingot(), 'L', ModItems.plate_desh, 'W', W.wireFine(), 'F', ModItems.gun_fatman });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke, 1, AmmoFatman.BALEFIRE.ordinal()), new Object[] { " S ", "EBE", " S ", 'S', STEEL.shell(), 'E', ModItems.powder_power, 'B', ModItems.egg_balefire_shard });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mp40, 1), new Object[] { "IIM", " SW", " S ", 'S', STEEL.plate(), 'I', STEEL.ingot(), 'W', KEY_PLANKS, 'M', ModItems.mechanism_rifle_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_thompson, 1), new Object[] { "IIM", " SW", " S ", 'S', IRON.plate(), 'I', STEEL.plate(), 'W', KEY_PLANKS, 'M', ModItems.mechanism_rifle_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_flechette, 1), new Object[] { "PPM", "TIS", "G ", 'P', STEEL.plate(), 'M', ModItems.mechanism_rifle_2, 'T', STEEL.shell(), 'I', STEEL.ingot(), 'S', ANY_PLASTIC.ingot(), 'G', ModItems.mechanism_launcher_1 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uboinik, 1), new Object[] { "IIM", "SPW", 'P', STEEL.plate(), 'I', STEEL.ingot(), 'W', KEY_PLANKS, 'S', KEY_STICK, 'M', ModItems.mechanism_revolver_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_supershotgun, 1), new Object[] { "BBM", "BBM", "AWL", 'B', STEEL.pipe(), 'M', ModItems.mechanism_rifle_2, 'A', ModItems.plate_dalekanium, 'W', GOLD.wireFine(), 'L', KEY_LOG });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_ks23, 1), new Object[] { "PPM", "SWL", 'P', STEEL.plate(), 'M', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'W', W.wireFine(), 'L', KEY_LOG });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.gun_sauer, 1), new Object[] { ModItems.ducttape, ModItems.gun_ks23, Blocks.lever, ModItems.gun_ks23 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456, 1), new Object[] { "PBB", "ACC", "PRY", 'P', STEEL.plate(), 'R', ModItems.redcoil_capacitor, 'A', ModItems.coil_advanced_alloy, 'B', ModItems.battery_generic, 'C', ModItems.coil_advanced_torus, 'Y', ModItems.mechanism_special });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", "SRS", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_natural_uranium });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", "SRS", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_uranium });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 20), new Object[] { " S ", " R ", " S ", 'S', STEEL.plate(), 'R', ModItems.waste_plate_u235 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { "SRS", 'S', STEEL.plate(), 'R', ModItems.waste_u235 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", " R ", " S ", 'S', STEEL.plate(), 'R', U238.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { "SRS", 'S', STEEL.plate(), 'R', U238.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_osipr, 1), new Object[] { "CCT", "WWI", "MCC", 'C', CMB.plate(), 'T', W.ingot(), 'W', MAGTUNG.wireFine(), 'I', ModItems.mechanism_rifle_2, 'M', ModItems.coil_magnetized_tungsten });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator, 1), new Object[] { "WCC", "PMT", "WAA", 'W', GOLD.wireFine(), 'C', CU.plate(), 'P', ALLOY.plate(), 'M', ModItems.mechanism_launcher_1, 'T', ModItems.tank_steel, 'A', STEEL.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator_ammo, 16), new Object[] { "SPS", "PCP", "SPS", 'S', STEEL.plate(), 'C', COAL.dust(), 'P', P_RED.dust() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator_ammo, 16), new Object[] { " F ", "SFS", " F ", 'S', STEEL.plate(), 'F', Fluids.DIESEL.getDict(1000) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_immolator_ammo, 24), new Object[] { " F ", "SFS", " F ", 'S', STEEL.plate(), 'F', ModItems.canister_napalm });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_cryolator, 1), new Object[] { "SSS", "IWL", "LMI", 'S', STEEL.plate(), 'I', IRON.plate(), 'L', Items.leather, 'M', ModItems.mechanism_launcher_1, 'W', AL.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_cryolator_ammo, 16), new Object[] { "SPS", "PCP", "SPS", 'S', STEEL.plate(), 'C', KNO.dust(), 'P', Items.snowball });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_cryolator_ammo, 16), new Object[] { " F ", "SFS", " F ", 'S', STEEL.plate(), 'F', ModItems.powder_ice });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mp, 1), new Object[] { "EEE", "SSM", "III", 'E', EUPH.ingot(), 'S', STEEL.plate(), 'I', STEEL.ingot(), 'M', ModItems.mechanism_rifle_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_emp, 1), new Object[] { "CPG", "CMF", "CPI", 'C', ModItems.coil_copper, 'P', PB.plate(), 'G', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', ModItems.magnetron, 'I', W.ingot(), 'F', ModItems.mechanism_special });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_emp_ammo, 8), new Object[] { "IGI", "IPI", "IPI", 'G', GOLD.plate(), 'I', IRON.plate(), 'P', ModItems.powder_power });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_jack, 1), new Object[] { "WW ", "TSD", " TT", 'W', "ingotWeidanium", 'T', ModItems.toothpicks, 'S', ModItems.gun_uboinik, 'D', ModItems.ducttape });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.gun_jack_ammo, 1), new Object[] { ModItems.ammo_12gauge, ModItems.ammo_12gauge, ModItems.ammo_12gauge, ModItems.ammo_12gauge });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_euthanasia, 1), new Object[] { "TDT", "AAS", " T ", 'A', AUSTRALIUM.ingot(), 'T', ModItems.toothpicks, 'S', ModItems.gun_mp40, 'D', ModItems.ducttape });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_euthanasia_ammo, 12), new Object[] { "P", "S", "N", 'P', ModItems.powder_poison, 'N', KNO.dust(), 'S', ModItems.syringe_metal_empty });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spark, 1), new Object[] { "TTD", "AAS", " T", 'A', "ingotDaffergon", 'T', ModItems.toothpicks, 'S', ModItems.gun_rpg, 'D', ModItems.ducttape });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spark_ammo, 4), new Object[] { "PCP", "DDD", "PCP", 'P', PB.plate(), 'C', ModItems.coil_gold, 'D', ModItems.powder_power });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_skystinger, 1), new Object[] { "TTT", "AAS", " D ", 'A', "ingotUnobtainium", 'T', ModItems.toothpicks, 'S', ModItems.gun_stinger, 'D', ModItems.ducttape });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_hp, 1), new Object[] { "TDT", "ASA", " T ", 'A', "ingotReiium", 'T', ModItems.toothpicks, 'S', ModItems.gun_xvl1456, 'D', ModItems.ducttape });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_hp_ammo, 8), new Object[] { " R ", "BSK", " Y ", 'S', STEEL.plate(), 'K', KEY_BLACK, 'R', KEY_RED, 'B', KEY_BLUE, 'Y', KEY_YELLOW });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_defabricator_ammo, 16), new Object[] { "PCP", "DDD", "PCP", 'P', STEEL.plate(), 'C', ModItems.coil_copper, 'D', LI.dust() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lever_action, 1), new Object[] { "PPI", "SWD", 'P', IRON.plate(), 'I', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'D', KEY_PLANKS, 'W', STEEL.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lever_action_dark, 1), new Object[] { "PPI", "SWD", 'P', STEEL.plate(), 'I', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'D', KEY_PLANKS, 'W', STEEL.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_bolt_action, 1), new Object[] { "PPI", "SWD", 'P', STEEL.plate(), 'I', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'D', KEY_PLANKS, 'W', CU.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_bolt_action_green, 1), new Object[] { "PPI", "SWD", 'P', IRON.plate(), 'I', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'D', KEY_PLANKS, 'W', CU.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_bolt_action_saturnite, 1), new Object[] { "PPI", "SWD", 'P', BIGMT.plate(), 'I', ModItems.mechanism_rifle_1, 'S', KEY_STICK, 'D', KEY_PLANKS, 'W', W.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b92), new Object[] { "DDD", "SSC", " R", 'D', ModItems.plate_dineutronium, 'S', STAR.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'R', ModItems.gun_revolver_schrabidium });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b93), new Object[] { "PCE", "SEB", "PCE", 'P', ModItems.plate_dineutronium, 'C', ModItems.weaponized_starblaster_cell, 'E', ModItems.component_emitter, 'B', ModItems.gun_b92, 'S', ModItems.singularity_spark });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b92), new Object[] { "DDD", "SSC", " R", 'D', ModItems.plate_dineutronium, 'S', STAR.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID), 'R', ModItems.gun_lasrifle });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_b92_ammo, 1), new Object[] { "PSP", "ESE", "PSP", 'P', STEEL.plate(), 'S', STAR.ingot(), 'E', ModItems.powder_spark_mix });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.weaponized_starblaster_cell, 1), new Object[] { new ItemStack(ModItems.fluid_tank_full, 1, Fluids.PEROXIDE.getID()), GunB92Cell.getFullCell(), CU.wireFine() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_silencer, 1), new Object[] { "P ", " P ", " U", 'P', ANY_PLASTIC.ingot(), 'U', ModItems.gun_uzi });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_saturnite, 1), new Object[] { "SMS", " PB", " P ", 'S', BIGMT.ingot(), 'M', ModItems.mechanism_rifle_2, 'P', BIGMT.plate(), 'B', W.bolt() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_uzi_saturnite_silencer, 1), new Object[] { "P ", " P ", " U", 'P', ANY_PLASTIC.ingot(), 'U', ModItems.gun_uzi_saturnite });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_bolter, 1), new Object[] { "SSM", "PIP", " I ", 'S', BIGMT.plate(), 'I', BIGMT.ingot(), 'M', ModItems.mechanism_special, 'P', ANY_PLASTIC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_calamity, 1), new Object[] { " PI", "BBM", " PI", 'P', IRON.plate(), 'B', STEEL.pipe(), 'M', ModItems.mechanism_rifle_1, 'I', STEEL.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_m2, 1), new Object[] { " PI", "BBM", " PI", 'P', STEEL.plate(), 'B', STEEL.pipe(), 'M', ModItems.mechanism_rifle_2, 'I', STEEL.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lacunae, 1), new Object[] { "TIT", "ILI", "PRP", 'T', ModItems.syringe_taint, 'I', STAR.ingot(), 'L', ModItems.gun_minigun, 'P', ModItems.pellet_rtg, 'R', ModBlocks.machine_rtg_grey });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mymy, 1), new Object[] { "PP ", " WP", 'P', ANY_RUBBER.ingot(), 'W', STEEL.wireFine() });
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_darter, 1), new Object[] { "SST", " P", 'S', STEEL.plate(), 'T', ModItems.gas_empty, 'P', ANY_PLASTIC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fireext, 1), new Object[] { "HB", " T", 'H', STEEL.pipe(), 'B', STEEL.bolt(), 'T', ModItems.tank_steel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "TPS", "HHR", " L", 'T', STEEL.bolt(), 'P', STEEL.plate(), 'S', STEEL.ingot(), 'H', STEEL.pipe(), 'R', ModItems.mechanism_rifle_1, 'L', ANY_PLASTIC.ingot()});
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_glass_cannon, 1), new Object[] { "GGC", "GTM", 'G', Item.getItemFromBlock(ModBlocks.glass_quartz), 'C', ModItems.battery_lithium_cell, 'T', ModItems.crt_display, 'M', ModItems.mechanism_special });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_remington, 1), new Object[] { "PPM", "S L", 'P', STEEL.plate(), 'M', ModItems.mechanism_rifle_1, 'S', KEY_SLAB, 'L', KEY_LOG });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_benelli), new Object[] { "HHP", "SSM", "AAP", 'H', ModItems.ingot_dura_steel, 'S', STEEL.pipe(), 'A', AL.pipe(), 'P', ANY_PLASTIC.ingot(), 'M', ModItems.mechanism_rifle_2 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lunatic_marksman), new Object[] { " GN", "SSM", " A", 'G', KEY_ANYPANE, 'N', ModItems.powder_nitan_mix, 'S', BIGMT.plate(), 'M', ModItems.mechanism_special, 'A', ANY_RESISTANTALLOY.plateCast() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_coilgun), new Object[] { "CCC", "SSM", " P", 'C', ModBlocks.capacitor_copper, 'S', BIGMT.plate(), 'M', ModItems.mechanism_special, 'P', ANY_PLASTIC.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_coilgun, 16, 0), new Object[] { " T ", "TST", " T ", 'T', W.ingot(), 'S', BIGMT.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_coilgun, 16, 1), new Object[] { " T ", "TST", " T ", 'T', FERRO.ingot(), 'S', BIGMT.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_coilgun, 16, 2), new Object[] { " T ", "TST", " T ", 'T', RUBBER.ingot(), 'S', ANY_PLASTIC.ingot() });
//TODO: somehow add more variance, 4 gauge is still missing
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_22lr, 16), new Object[] { ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_9mm, 16), new Object[] { ModItems.nitra_small, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_5mm, 16), new Object[] { ModItems.nitra_small, ModItems.nitra_small, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_357, 16, Ammo357Magnum.LEAD.ordinal()), new Object[] { ModItems.nitra, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_44, 16), new Object[] { ModItems.nitra, ModItems.nitra_small, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_45, 16), new Object[] { ModItems.nitra, ModItems.nitra_small, ModItems.nitra_small, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_50ae, 16), new Object[] { ModItems.nitra, ModItems.nitra });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_556, 16), new Object[] { ModItems.nitra, ModItems.nitra, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_20gauge, 16), new Object[] { ModItems.nitra, ModItems.nitra, ModItems.nitra_small, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_12gauge, 16), new Object[] { ModItems.nitra, ModItems.nitra, ModItems.nitra });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_762, 16), new Object[] { ModItems.nitra, ModItems.nitra, ModItems.nitra, ModItems.nitra_small });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_50bmg, 16), new Object[] { ModItems.nitra, ModItems.nitra, ModItems.nitra, ModItems.nitra });
//Ammo assemblies
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pellet_flechette, 1), new Object[] { " L ", " L ", "LLL", 'L', PB.nugget() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pellet_claws, 1), new Object[] { " X ", "X X", " XX", 'X', STEEL.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_iron, 1), new Object[] { " I", "GC", 'I', IRON.ingot(), 'G', ANY_GUNPOWDER.dust(), 'C', ModItems.casing_357 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_steel, 1), new Object[] { " I", "GC", 'I', PB.ingot(), 'G', ANY_GUNPOWDER.dust(), 'C', ModItems.casing_357 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_lead, 1), new Object[] { " I", "GC", 'I', U235.ingot(), 'G', ModItems.cordite, 'C', KEY_CLEARGLASS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_lead, 1), new Object[] { " I", "GC", 'I', PU239.ingot(), 'G', ModItems.cordite, 'C', KEY_CLEARGLASS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_lead, 1), new Object[] { " I", "GC", 'I', ModItems.trinitite, 'G', ModItems.cordite, 'C', KEY_CLEARGLASS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_lead, 1), new Object[] { " I", "GC", 'I', ModItems.nuclear_waste_tiny, 'G', ModItems.cordite, 'C', KEY_CLEARGLASS });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_gold, 1), new Object[] { " I", "GC", 'I', GOLD.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_357 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_schrabidium, 1), new Object[] { " I ", "GCN", 'I', SA326.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_357, 'N', ModItems.billet_yharonite });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nightmare, 1), new Object[] { " I", "GC", 'I', W.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_357 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_desh, 1), new Object[] { " I", "GC", 'I', DESH.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_357 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_smg, 1), new Object[] { " I", "GC", 'I', PB.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_556, 1), new Object[] { " I", "GC", 'I', STEEL.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_9 });
CraftingManager.addRecipeAuto(ModItems.ammo_556.stackFromEnum(30, Ammo556mm.K), new Object[] { "G", "C", 'G', ANY_GUNPOWDER.dust(), 'C', ModItems.casing_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_uzi, 1), new Object[] { " I", "GC", 'I', IRON.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_lacunae, 1), new Object[] { " I", "GC", 'I', CU.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nopip, 1), new Object[] { " I", "GC", 'I', PB.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_44 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_12gauge, 12), new Object[] { " I ", "GCL", 'I', ModItems.pellet_buckshot, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'L', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.PERCUSSION), new Object[] { "G", "C", 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge, 12), new Object[] { " I ", "GCL", 'I', ModItems.pellet_buckshot, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.SLUG), new Object[] { " I ", "GCL", 'I', STEEL.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.FLECHETTE), new Object[] { " I ", "GCL", 'I', ModItems.pellet_flechette, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", 'I', ModBlocks.tnt, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(6, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", 'I', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.MINING), new Object[] { " I ", "GCL", 'I', ModBlocks.det_miner, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'L', ANY_RUBBER.ingot() });
CraftingManager.addShapelessAuto(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.QUACK), new Object[] { ModItems.ammo_4gauge, ModItems.nugget_bismuth, ModItems.nugget_tantalium, ModItems.ball_dynamite });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK), new Object[] { " I ", "GCL", 'I', ModItems.pellet_buckshot, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.SLUG), new Object[] { " I ", "GCL", 'I', PB.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", 'I', ModItems.pellet_cluster, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.FLECHETTE), new Object[] { " I ", "GCL", 'I', ModItems.pellet_flechette, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_357.stackFromEnum(6, Ammo357Magnum.NIGHTMARE2), new Object[] { "I", "C", 'I', ModItems.powder_power, 'C', ModItems.casing_buckshot });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_calamity, 1), new Object[] { " I ", "GCG", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_actionexpress, 1), new Object[] { " I", "GC", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', STEEL.wireFine(), 'P', STEEL.plate(), 'S', STEEL.shell(), 'E', ANY_HIGHEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_dart.stackFromEnum(16, AmmoDart.GPS), new Object[] { "IPI", "ICI", "IPI", 'I', ANY_RUBBER.ingot(), 'P', IRON.plate(), 'C', new ItemStack(ModItems.fluid_tank_lead_full, 1, Fluids.WATZ.getID()) });
CraftingManager.addRecipeAuto(ModItems.ammo_dart.stackFromEnum(16, AmmoDart.NERF), new Object[] { "I", "I", 'I', ANY_RUBBER.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_45, 1), " I", "GC", 'I', CU.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_44);
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_762, 1), " I", "GC", 'I', CU.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50);
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_luna, 1), new Object[] { " B ", "GCG", "GPG", 'B', FERRO.ingot(), 'G', ModItems.powder_nitan_mix, 'C', ModItems.casing_50, 'P', ModItems.powder_power});
//Folly shells
CraftingManager.addRecipeAuto(new ItemStack(ModItems.folly_bullet, 1), new Object[] { " S ", "STS", "SMS", 'S', STAR.ingot(), 'T', ModItems.powder_magic, 'M', ModBlocks.block_meteor });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.folly_bullet_nuclear, 1), new Object[] { " N ", "UTU", "UTU", 'N', ModItems.ammo_nuke, 'U', IRON.ingot(), 'T', W.block() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.folly_bullet_du, 1), new Object[] { " U ", "UDU", "UTU", 'U', U238.block(), 'D', DESH.block(), 'T', W.block() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.folly_shell, 1), new Object[] { "IPI", "IPI", "IMI", 'I', IRON.ingot(), 'P', IRON.plate(), 'M', ANY_SMOKELESS.dust() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_folly, 1), new Object[] { " B ", "MEM", " S ", 'B', ModItems.folly_bullet, 'M', ModItems.powder_magic, 'E', ModItems.powder_power, 'S', ModItems.folly_shell });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_folly_nuclear, 1), new Object[] { " B ", "EEE", " S ", 'B', ModItems.folly_bullet_nuclear, 'E', ModBlocks.det_charge, 'S', ModItems.folly_shell });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_folly_du, 1), new Object[] { " B ", "EEE", " S ", 'B', ModItems.folly_bullet_du, 'E', ModBlocks.det_charge, 'S', ModItems.folly_shell });
//Rockets
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 1), new Object[] { "T", "C", "G", 'T', ModItems.ball_dynamite, 'G', ModItems.rocket_fuel, 'C', STEEL.shell() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { "T", "C", "G", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', STEEL.shell() });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.HE), new Object[] { "G", "R", 'G', ANY_PLASTICEXPLOSIVE.ingot(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.INCENDIARY), new Object[] { "G", "R", 'G', P_RED.dust(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.PHOSPHORUS), new Object[] { "G", "R", 'G', P_WHITE.ingot(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.EMP), new Object[] { "G", "R", 'G', "dustDiamond", 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.SHRAPNEL), new Object[] { "G", "R", 'G', ModItems.pellet_buckshot, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.GLARE), new Object[] { "GGG", "GRG", "GGG", 'G', REDSTONE.dust(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.CHLORINE), new Object[] { "G", "R", 'G', ModItems.pellet_gas, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.CANISTER), new Object[] { "G", "R", 'G', ModItems.pellet_canister, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.NUCLEAR), new Object[] { " P ", "NRN", " P ", 'P', PU239.nugget(), 'N', OreDictManager.getReflector(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', GOLD.wireFine(), 'P', STEEL.plate(), 'S', STEEL.shell(), 'E', ModItems.ball_tatb });
FluidType[] chainsawTypes = new FluidType[] {Fluids.DIESEL, Fluids.DIESEL_CRACK, Fluids.PETROIL, Fluids.PETROIL_LEADED, Fluids.GASOLINE, Fluids.GASOLINE_LEADED, Fluids.BIOFUEL};
for(FluidType type : chainsawTypes) CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', type.getDict(1000), 'H', STEEL.shell(), 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
//Stinger Rockets
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket, 2), "CE ", " S ", " F ", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'E', ANY_PLASTICEXPLOSIVE.ingot(), 'F', ModItems.rocket_fuel, 'S', STEEL.shell());
CraftingManager.addRecipeAuto(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.HE), new Object[] { "S", "R", 'S', ANY_PLASTICEXPLOSIVE.ingot(), 'R', ModItems.ammo_stinger_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.INCENDIARY), new Object[] { "S", "R", 'S', P_RED.dust(), 'R', ModItems.ammo_stinger_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.NUCLEAR), new Object[] { "RPR", "PSP", "RPR", 'R', ModItems.neutron_reflector, 'P', PU239.nugget(), 'S', ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.HE) });
CraftingManager.addRecipeAuto(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.BONES), new Object[] { " C ", "SKR", " P ", 'C', ModItems.fallout, 'S', SR90.dust(), 'K', ModItems.ammo_stinger_rocket, 'R', RA226.dust(), 'P', PU.dust() });
//40mm grenades
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.TRACER), new Object[] { " T ", "GCI", 'T', LAPIS.dust(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.HE), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ANY_PLASTICEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.INCENDIARY), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_RED.dust() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.PHOSPHORUS), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_WHITE.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.CHLORINE), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.powder_poison });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.CONCUSSION), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', Items.glowstone_dust });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.NUCLEAR), new Object[] { " P ", "GIG", " P ", 'G', ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.HE), 'I', ModItems.neutron_reflector, 'P', PU239.nugget() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.FINNED), new Object[] { "G", "R", 'G', Items.feather, 'R', ModItems.ammo_grenade });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.KAMPF), new Object[] { "G", "R", 'G', ModItems.ammo_rocket, 'R', ModItems.ammo_grenade });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.LEADBURSTER), new Object[] { "LCL", "CHC", "LML", 'L', ModItems.pellet_buckshot, 'C', ANY_SMOKELESS.dust(), 'H', AL.shell(), 'M', ModItems.motor });
//240mm Shells
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModBlocks.tnt, 'G', Items.gunpowder, 'H', STEEL.shell(), 'C', CU.ingot() });
@ -318,35 +173,6 @@ public class WeaponRecipes {
//DGK Belts
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dgk, 1), new Object[] { "LLL", "GGG", "CCC", 'L', PB.plate(), 'G', ModItems.ballistite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dgk, 1), new Object[] { "LLL", "GGG", "CCC", 'L', PB.plate(), 'G', ModItems.cordite, 'C', CU.ingot() });
//Mini Nuke
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke, 1), new Object[] { "P", "S", "P", 'P', PU239.nugget(), 'S', ModItems.assembly_nuke });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.LOW), new Object[] { "P", "S", 'P', PU239.nugget(), 'S', ModItems.assembly_nuke });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), new Object[] { "PPP", "PSP", "PPP", 'P', PU239.nugget(), 'S', ModItems.assembly_nuke });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.TOTS), new Object[] { "PPP", "PIP", "PPP", 'P', ModItems.pellet_cluster, 'I', PU239.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.SAFE), new Object[] { "G", "N", 'G', Items.glowstone_dust, 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.LOW) });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.PUMPKIN), new Object[] { " T ", "TST", " T ", 'T', ModBlocks.tnt, 'S', ModItems.assembly_nuke });
//MIRV recycling
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke, 6), new Object[] { ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV) });
CraftingManager.addShapelessAuto(ModItems.ammo_nuke.stackFromEnum(6, AmmoFatman.LOW), new Object[] { ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_LOW) });
CraftingManager.addShapelessAuto(ModItems.ammo_nuke.stackFromEnum(6, AmmoFatman.HIGH), new Object[] { ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_HIGH) });
CraftingManager.addShapelessAuto(ModItems.ammo_nuke.stackFromEnum(6, AmmoFatman.SAFE), new Object[] { ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_SAFE) });
//MIRV
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke, 'C', AL.plate(), 'D', ModBlocks.det_cord, 'S', STEEL.shell() });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_LOW), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.LOW), 'C', AL.plate(), 'D', ModBlocks.det_cord, 'S', STEEL.shell() });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_HIGH), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 'C', AL.plate(), 'D', ModBlocks.det_cord, 'S', STEEL.shell() });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_SAFE), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.SAFE), 'C', AL.plate(), 'D', ModBlocks.det_cord, 'S', STEEL.shell() });
//since the milk part of the recipe isn't really present in the MIRV's effect, it might as well be replaced with something more sensible, i.e. duct tape
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_SPECIAL), new Object[] { "CBC", "MCM", "CBC", 'C', ModItems.canned_conserve.stackFromEnum(EnumFoodType.JIZZ), 'B', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.BALEFIRE), 'M', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV) });
//Flamer fuel
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.DIESEL), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', STEEL.bolt(), 'D', Fluids.DIESEL.getDict(1000) });
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.NAPALM), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', STEEL.bolt(), 'D', ModItems.canister_napalm });
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.PHOSPHORUS), new Object[] { "CPC", "CDC", "CPC", 'C', COAL.dust(), 'P', P_WHITE.ingot(), 'D', ModItems.ammo_fuel });
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.CHLORINE), new Object[] { "PDP", "BDB", "PDP", 'P', STEEL.plate(), 'B', STEEL.bolt(), 'D', ModItems.pellet_gas });
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.VAPORIZER), new Object[] { "PSP", "SNS", "PSP", 'P', P_WHITE.ingot(), 'S', ModItems.crystal_sulfur, 'N', ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.NAPALM) });
//Fire Extingusisher Tanks
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fireext, 1), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', STEEL.bolt(), 'D', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.WATER.getID()) });
@ -411,10 +237,10 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_null, 1), new Object[] { "BAB", "AGA", "BAB", 'G', ModItems.grenade_if_generic, 'A', ModItems.undefined, 'B', BIGMT.ingot() });
//Mines
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_ap, 4), new Object[] { "C", "P", "T", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'P', IRON.plate(), 'T', ANY_PLASTICEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_ap, 4), new Object[] { "I", "C", "S", 'I', ModItems.plate_polymer, 'C', ANY_SMOKELESS.dust(), 'S', STEEL.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_shrap, 1), new Object[] { "L", "M", 'M', ModBlocks.mine_ap, 'L', ModItems.pellet_buckshot });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_he, 1), new Object[] { " C ", "PTP", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'P', STEEL.plate(), 'T', ANY_HIGHEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_shrap, 2), new Object[] { "LLL", " C ", "PTP", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'P', STEEL.plate(), 'T', ModBlocks.det_cord, 'L', ModItems.pellet_buckshot });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_fat, 1), new Object[] { "CDN", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ANALOG), 'D', ModItems.ducttape, 'N', ModItems.ammo_nuke });
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_fat, 1), new Object[] { "CDN", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ANALOG), 'D', ModItems.ducttape, 'N', DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO) });
//Nuke parts
CraftingManager.addRecipeAuto(new ItemStack(ModItems.n2_charge, 1), new Object[] { " D ", "ERE", " D ", 'D', ModItems.ducttape, 'E', ModBlocks.det_charge, 'R', REDSTONE.block() });

View File

@ -124,6 +124,7 @@ public class EntityMappings {
addEntity(EntityGrenadePC.class, "entity_grenade_pink_cloud", 250);
addEntity(EntityGrenadeCloud.class, "entity_grenade_cloud", 250);
addEntity(EntityBomber.class, "entity_bomber", 1000);
addEntity(EntityC130.class, "entity_c130", 1000);
addEntity(EntityBombletZeta.class, "entity_zeta", 1000);
addEntity(EntityOrangeFX.class, "entity_agent_orange", 1000);
addEntity(EntityDeathBlast.class, "entity_laser_blast", 1000);
@ -148,6 +149,7 @@ public class EntityMappings {
addEntity(EntityFallingNuke.class, "entity_falling_bomb", 1000);
addEntity(EntityBulletBaseNT.class, "entity_bullet_mk3", 250, false);
addEntity(EntityBulletBaseMK4.class, "entity_bullet_mk4", 250, false);
addEntity(EntityBulletBaseMK4CL.class, "entity_bullet_mk4_cl", 250, false);
addEntity(EntityBulletBeamBase.class, "entity_beam_mk4", 250, false);
addEntity(EntityMinerRocket.class, "entity_miner_lander", 1000);
addEntity(EntityFogFX.class, "entity_nuclear_fog", 1000);
@ -163,6 +165,7 @@ public class EntityMappings {
addEntity(EntityBuilding.class, "entity_falling_building", 1000);
addEntity(EntitySoyuz.class, "entity_soyuz", 1000);
addEntity(EntitySoyuzCapsule.class, "entity_soyuz_capsule", 1000);
addEntity(EntityParachuteCrate.class, "entity_parachute_crate", 1000);
addEntity(EntityMovingItem.class, "entity_c_item", 1000);
addEntity(EntityMovingPackage.class, "entity_c_package", 1000);
addEntity(EntityDeliveryDrone.class, "entity_delivery_drone", 250, false);
@ -251,6 +254,7 @@ public class EntityMappings {
addMob(EntityGlyphidDigger.class, "entity_glyphid_digger", 0x273038, 0x724A21);
addMob(EntityPlasticBag.class, "entity_plastic_bag", 0xd0d0d0, 0x808080);
addMob(EntityParasiteMaggot.class, "entity_parasite_maggot", 0xd0d0d0, 0x808080);
addMob(EntityDummy.class, "entity_ntm_test_dummy", 0xffffff, 0x000000);
addSpawn(EntityCreeperPhosgene.class, 5, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());
addSpawn(EntityCreeperVolatile.class, 10, 1, 1, EnumCreatureType.monster, BiomeGenBase.getBiomeGenArray());

View File

@ -19,6 +19,7 @@ public class EntityFireLingering extends Entity {
public static int TYPE_DIESEL = 0;
public static int TYPE_BALEFIRE = 1;
public static int TYPE_PHOSPHORUS = 2;
public int maxAge = 150;
public EntityFireLingering(World world) {
@ -72,6 +73,7 @@ public class EntityFireLingering extends Entity {
EntityLivingBase livng = (EntityLivingBase) e;
HbmLivingProps props = HbmLivingProps.getData(livng);
if(this.getType() == this.TYPE_DIESEL) if(props.fire < 60) props.fire = 60;
if(this.getType() == this.TYPE_PHOSPHORUS) if(props.fire < 300) props.fire = 300;
if(this.getType() == this.TYPE_BALEFIRE) if(props.balefire < 100) props.balefire = 100;
} else {
e.setFire(4);
@ -88,6 +90,7 @@ public class EntityFireLingering extends Entity {
MovingObjectPosition mop = worldObj.func_147447_a(up, down, false, true, true);
if(mop != null && mop.typeOfHit == mop.typeOfHit.BLOCK) down = mop.hitVec;
if(this.getType() == this.TYPE_DIESEL) FlameCreator.composeEffectClient(worldObj, x, down.yCoord, z, FlameCreator.META_FIRE);
if(this.getType() == this.TYPE_PHOSPHORUS) FlameCreator.composeEffectClient(worldObj, x, down.yCoord, z, FlameCreator.META_FIRE);
if(this.getType() == this.TYPE_BALEFIRE) FlameCreator.composeEffectClient(worldObj, x, down.yCoord, z, FlameCreator.META_BALEFIRE);
}
}

View File

@ -103,14 +103,12 @@ public abstract class EntityDroneBase extends Entity {
if(this.targetY != -1) {
Vec3 dist = Vec3.createVectorHelper(targetX - posX, targetY - posY, targetZ - posZ);
double speed = getSpeed();
double speed = Math.min(getSpeed(), dist.lengthVector());
if(dist.lengthVector() >= speed) {
dist = dist.normalize();
this.motionX = dist.xCoord * speed;
this.motionY = dist.yCoord * speed;
this.motionZ = dist.zCoord * speed;
}
dist = dist.normalize();
this.motionX = dist.xCoord * speed;
this.motionY = dist.yCoord * speed;
this.motionZ = dist.zCoord * speed;
}
if(isCollidedHorizontally){
motionY += 1;

View File

@ -0,0 +1,75 @@
package com.hbm.entity.item;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockSupplyCrate.TileEntitySupplyCrate;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
public class EntityParachuteCrate extends Entity {
public List<ItemStack> items = new ArrayList();
public EntityParachuteCrate(World world) {
super(world);
this.ignoreFrustumCheck = true;
this.isImmuneToFire = true;
}
@Override
public void onUpdate() {
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + this.motionX, posY + this.motionY, posZ + this.motionZ);
if(this.motionY > -0.2) this.motionY -= 0.02;
if(posY > 600) posY = 600;
if(this.worldObj.getBlock((int) Math.floor(this.posX), (int) Math.floor(this.posY), (int) Math.floor(this.posZ)) != Blocks.air) {
this.setDead();
if(!worldObj.isRemote) {
worldObj.setBlock((int) Math.floor(this.posX), (int) Math.floor(this.posY + 1), (int) Math.floor(this.posZ), ModBlocks.crate_supply);
TileEntitySupplyCrate crate = (TileEntitySupplyCrate) worldObj.getTileEntity((int) Math.floor(this.posX), (int) Math.floor(this.posY + 1), (int) Math.floor(this.posZ));
if(crate != null) crate.items.addAll(this.items);
}
}
}
@Override protected void entityInit() { }
@Override @SideOnly(Side.CLIENT) public boolean isInRangeToRenderDist(double distance) { return true; }
@Override
public void readEntityFromNBT(NBTTagCompound nbt) {
items.clear();
NBTTagList list = nbt.getTagList("items", 10);
for(int i = 0; i < list.tagCount(); i++) {
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
items.add(ItemStack.loadItemStackFromNBT(nbt1));
}
}
@Override
public void writeEntityToNBT(NBTTagCompound nbt) {
NBTTagList list = new NBTTagList();
for(int i = 0; i < items.size(); i++) {
NBTTagCompound nbt1 = new NBTTagCompound();
items.get(i).writeToNBT(nbt1);
list.appendTag(nbt1);
}
nbt.setTag("items", list);
}
}

View File

@ -199,7 +199,7 @@ public class EntityRequestDrone extends EntityDroneBase {
@Override
public double getSpeed() {
return 0.6D;
return 0.625D;
}
@Override

View File

@ -1,516 +1,275 @@
package com.hbm.entity.logic;
import java.util.ArrayList;
import java.util.List;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.projectile.EntityBombletZeta;
import com.hbm.entity.projectile.EntityBoxcar;
import com.hbm.entity.projectile.EntityRocketHoming;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.lib.ModDamageSource;
import com.hbm.interfaces.NotableComments;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.LoopedEntitySoundPacket;
import com.hbm.util.ParticleUtil;
import com.hbm.sound.AudioWrapper;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.ForgeChunkManager.Type;
public class EntityBomber extends Entity implements IChunkLoader {
@NotableComments
public class EntityBomber extends EntityPlaneBase {
int timer = 200;
/* This was probably the dumbest fucking way that I could have handled this. Not gonna change it now, be glad I made a superclass at all. */
int bombStart = 75;
int bombStop = 125;
int bombRate = 3;
int type = 0;
public int health = 50;
public EntityBomber(World p_i1582_1_) {
super(p_i1582_1_);
protected AudioWrapper audio;
public EntityBomber(World world) {
super(world);
this.ignoreFrustumCheck = true;
this.setSize(8.0F, 4.0F);
this.setSize(8.0F, 4.0F);
}
@Override
public void entityInit() {
super.entityInit();
this.dataWatcher.addObject(16, Byte.valueOf((byte) 0));
}
public boolean canBeCollidedWith()
{
return this.health > 0;
}
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
{
if(p_70097_1_ == ModDamageSource.nuclearBlast)
return false;
if (this.isEntityInvulnerable())
{
return false;
}
else
{
if (!this.isDead && !this.worldObj.isRemote && this.health > 0)
{
health -= p_70097_2_;
if (this.health <= 0)
{
this.killBomber();
}
}
return true;
}
}
private void killBomber() {
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, false, true);
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:entity.planeShotDown", 25.0F, 1.0F);
}
/** This sucks balls. Too bad! */
@Override
public void onUpdate() {
super.onUpdate();
//super.onUpdate();
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + motionX, posY + motionY, posZ + motionZ);
if(!worldObj.isRemote) {
this.dataWatcher.updateObject(17, health);
if(health > 0)
PacketDispatcher.wrapper.sendToAllAround(new LoopedEntitySoundPacket(this.getEntityId()), new TargetPoint(worldObj.provider.dimensionId, posX, posY, posZ, 250));
} else {
health = this.dataWatcher.getWatchableObjectInt(17);
}
this.rotation();
if(this.health <= 0) {
motionY -= 0.025;
for(int i = 0; i < 10; i++)
ParticleUtil.spawnGasFlame(this.worldObj, this.posX + rand.nextGaussian() * 0.5 - motionX * 2, this.posY + rand.nextGaussian() * 0.5 - motionY * 2, this.posZ + rand.nextGaussian() * 0.5 - motionZ * 2, 0.0, 0.1, 0.0);
if(worldObj.getBlock((int)posX, (int)posY, (int)posZ).isNormalCube() && !worldObj.isRemote) {
this.setDead();
/*worldObj.setBlock((int)posX, (int)posY, (int)posZ, ModBlocks.bomber);
TileEntityBomber te = (TileEntityBomber)worldObj.getTileEntity((int)posX, (int)posY, (int)posZ);
if(te != null) {
te.yaw = (int)(this.rotationYaw);
te.pitch = (int)(this.rotationPitch);
te.type = this.getDataWatcher().getWatchableObjectByte(16);
}*/
ExplosionLarge.explodeFire(worldObj, posX, posY, posZ, 25, true, false, true);
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:entity.planeCrash", 10.0F, 1.0F);
return;
if(worldObj.isRemote) {
if(this.getDataWatcher().getWatchableObjectFloat(17) > 0) {
if(audio == null || !audio.isPlaying()) {
int bomberType = this.dataWatcher.getWatchableObjectByte(16);
audio = MainRegistry.proxy.getLoopedSound(bomberType <= 4 ? "hbm:entity.bomberSmallLoop" : "hbm:entity.bomberLoop", (float) posX, (float) posY, (float) posZ, 2F, 250F, 1F, 20);
audio.startSound();
}
audio.keepAlive();
audio.updatePosition((float) posX, (float) posY, (float) posZ);
} else {
if(audio != null && audio.isPlaying()) {
audio.stopSound();
audio = null;
}
}
}
if(this.ticksExisted > timer)
this.setDead();
if(!worldObj.isRemote && this.health > 0 && this.ticksExisted > bombStart && this.ticksExisted < bombStop && this.ticksExisted % bombRate == 0) {
if(type == 3) {
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
ExplosionChaos.spawnChlorine(worldObj, this.posX, this.posY - 1F, this.posZ, 10, 0.5, 3);
} else if(type == 5) {
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:weapon.missileTakeOff", 10.0F, 0.9F + rand.nextFloat() * 0.2F);
EntityRocketHoming rocket = new EntityRocketHoming(worldObj);
rocket.setIsCritical(true);
//rocket.motionX = motionX;
//rocket.motionZ = motionZ;
rocket.motionY = -1;
rocket.shootingEntity = this;
rocket.homingRadius = 50;
rocket.homingMod = 5;
rocket.posX = posX + rand.nextDouble() - 0.5;
rocket.posY = posY - rand.nextDouble();
rocket.posZ = posZ + rand.nextDouble() - 0.5;
worldObj.spawnEntityInWorld(rocket);
} else if(type == 6) {
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:weapon.missileTakeOff", 10.0F, 0.9F + rand.nextFloat() * 0.2F);
EntityBoxcar rocket = new EntityBoxcar(worldObj);
rocket.posX = posX + rand.nextDouble() - 0.5;
rocket.posY = posY - rand.nextDouble();
rocket.posZ = posZ + rand.nextDouble() - 0.5;
worldObj.spawnEntityInWorld(rocket);
} else if(type == 7) {
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
ExplosionChaos.spawnChlorine(worldObj, this.posX, worldObj.getHeightValue((int)this.posX, (int)this.posZ) + 2, this.posZ, 10, 1, 2);
} else if(type == 5) {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "hbm:weapon.missileTakeOff", 10.0F, 0.9F + rand.nextFloat() * 0.2F);
EntityRocketHoming rocket = new EntityRocketHoming(worldObj);
rocket.setIsCritical(true);
rocket.motionY = -1;
rocket.shootingEntity = this;
rocket.homingRadius = 50;
rocket.homingMod = 5;
rocket.posX = posX + rand.nextDouble() - 0.5;
rocket.posY = posY - rand.nextDouble();
rocket.posZ = posZ + rand.nextDouble() - 0.5;
worldObj.spawnEntityInWorld(rocket);
} else if(type == 6) {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "hbm:weapon.missileTakeOff", 10.0F, 0.9F + rand.nextFloat() * 0.2F);
EntityBoxcar rocket = new EntityBoxcar(worldObj);
rocket.posX = posX + rand.nextDouble() - 0.5;
rocket.posY = posY - rand.nextDouble();
rocket.posZ = posZ + rand.nextDouble() - 0.5;
worldObj.spawnEntityInWorld(rocket);
} else if(type == 7) {
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "random.fizz", 5.0F, 2.6F + (rand.nextFloat() - rand.nextFloat()) * 0.8F);
ExplosionChaos.spawnChlorine(worldObj, this.posX, worldObj.getHeightValue((int) this.posX, (int) this.posZ) + 2, this.posZ, 10, 1, 2);
} else {
worldObj.playSoundEffect((double)(posX + 0.5F), (double)(posY + 0.5F), (double)(posZ + 0.5F), "hbm:entity.bombWhistle", 10.0F, 0.9F + rand.nextFloat() * 0.2F);
worldObj.playSoundEffect((double) (posX + 0.5F), (double) (posY + 0.5F), (double) (posZ + 0.5F), "hbm:entity.bombWhistle", 10.0F, 0.9F + rand.nextFloat() * 0.2F);
EntityBombletZeta zeta = new EntityBombletZeta(worldObj);
/*zeta.prevRotationYaw = zeta.rotationYaw = this.rotationYaw;
zeta.prevRotationPitch = zeta.rotationPitch = this.rotationPitch;*/
zeta.rotation();
zeta.type = type;
zeta.posX = posX + rand.nextDouble() - 0.5;
zeta.posY = posY - rand.nextDouble();
zeta.posZ = posZ + rand.nextDouble() - 0.5;
if(type == 0) {
zeta.motionX = motionX + rand.nextGaussian() * 0.15;
zeta.motionZ = motionZ + rand.nextGaussian() * 0.15;
zeta.motionX = motionX + rand.nextGaussian() * 0.15; zeta.motionZ = motionZ + rand.nextGaussian() * 0.15;
} else {
zeta.motionX = motionX;
zeta.motionZ = motionZ;
zeta.motionX = motionX; zeta.motionZ = motionZ;
}
worldObj.spawnEntityInWorld(zeta);
}
}
if(!worldObj.isRemote)
loadNeighboringChunks((int)(posX / 16), (int)(posZ / 16));
}
public void fac(World world, double x, double y, double z) {
Vec3 vector = Vec3.createVectorHelper(world.rand.nextDouble() - 0.5, 0, world.rand.nextDouble() - 0.5);
vector = vector.normalize();
vector.xCoord *= GeneralConfig.enableBomberShortMode ? 1 : 2;
vector.zCoord *= GeneralConfig.enableBomberShortMode ? 1 : 2;
this.setLocationAndAngles(x - vector.xCoord * 100, y + 50, z - vector.zCoord * 100, 0.0F, 0.0F);
this.loadNeighboringChunks((int)(x / 16), (int)(z / 16));
this.motionX = vector.xCoord;
this.motionZ = vector.zCoord;
this.motionY = 0.0D;
this.rotation();
int i = 1;
int rand = world.rand.nextInt(7);
switch(rand) {
case 0:
case 1: i = 1; break;
case 2:
case 3: i = 2; break;
case 4: i = 5; break;
case 5: i = 6; break;
case 6: i = 7; break;
}
if(world.rand.nextInt(100) == 0) {
rand = world.rand.nextInt(4);
switch(rand) {
case 0: i = 0; break;
case 1: i = 3; break;
case 2: i = 4; break;
case 3: i = 8; break;
}
}
this.getDataWatcher().updateObject(16, (byte)i);
this.setSize(8.0F, 4.0F);
}
public static EntityBomber statFacCarpet(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 100;
bomber.bombRate = 2;
public void fac(World world, double x, double y, double z) {
bomber.fac(world, x, y, z);
bomber.type = 0;
return bomber;
}
public static EntityBomber statFacNapalm(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 100;
bomber.bombRate = 5;
Vec3 vector = Vec3.createVectorHelper(world.rand.nextDouble() - 0.5, 0, world.rand.nextDouble() - 0.5);
vector = vector.normalize();
vector.xCoord *= GeneralConfig.enableBomberShortMode ? 1 : 2;
vector.zCoord *= GeneralConfig.enableBomberShortMode ? 1 : 2;
bomber.fac(world, x, y, z);
bomber.type = 1;
return bomber;
}
public static EntityBomber statFacChlorine(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 100;
bomber.bombRate = 4;
this.setLocationAndAngles(x - vector.xCoord * 100, y + 50, z - vector.zCoord * 100, 0.0F, 0.0F);
this.loadNeighboringChunks((int) (x / 16), (int) (z / 16));
bomber.fac(world, x, y, z);
bomber.type = 2;
return bomber;
}
public static EntityBomber statFacOrange(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 75;
bomber.bombStop = 125;
bomber.bombRate = 1;
this.motionX = vector.xCoord;
this.motionZ = vector.zCoord;
this.motionY = 0.0D;
bomber.fac(world, x, y, z);
bomber.type = 3;
return bomber;
}
public static EntityBomber statFacABomb(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 60;
bomber.bombStop = 70;
bomber.bombRate = 65;
this.rotation();
bomber.fac(world, x, y, z);
int i = 1;
int rand = world.rand.nextInt(3);
switch(rand) {
case 0: i = 5; break;
case 1: i = 6; break;
case 2: i = 7; break;
}
if(world.rand.nextInt(100) == 0) {
i = 8;
}
bomber.getDataWatcher().updateObject(16, (byte)i);
bomber.type = 4;
return bomber;
}
public static EntityBomber statFacStinger(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 150;
bomber.bombRate = 10;
int i = 1;
bomber.fac(world, x, y, z);
bomber.getDataWatcher().updateObject(16, (byte)4);
bomber.type = 5;
return bomber;
}
public static EntityBomber statFacBoxcar(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 150;
bomber.bombRate = 10;
int rand = world.rand.nextInt(7);
bomber.fac(world, x, y, z);
bomber.getDataWatcher().updateObject(16, (byte)6);
bomber.type = 6;
return bomber;
}
public static EntityBomber statFacPC(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 75;
bomber.bombStop = 125;
bomber.bombRate = 1;
switch(rand) {
case 0: case 1: i = 1; break;
case 2: case 3: i = 2; break;
case 4: i = 5; break;
case 5: i = 6; break;
case 6: i = 7; break;
}
bomber.fac(world, x, y, z);
bomber.getDataWatcher().updateObject(16, (byte)6);
bomber.type = 7;
return bomber;
}
if(world.rand.nextInt(100) == 0) {
rand = world.rand.nextInt(4);
switch(rand) {
case 0: i = 0; break;
case 1: i = 3; break;
case 2: i = 4; break;
case 3: i = 8; break;
}
}
@Override
public void entityInit() {
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
this.dataWatcher.addObject(16, Byte.valueOf((byte)0));
this.dataWatcher.addObject(17, Integer.valueOf((int)50));
}
this.getDataWatcher().updateObject(16, (byte) i);
this.setSize(8.0F, 4.0F);
}
public static EntityBomber statFacCarpet(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 100;
bomber.bombRate = 2;
bomber.fac(world, x, y, z);
bomber.type = 0;
return bomber;
}
public static EntityBomber statFacNapalm(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 100;
bomber.bombRate = 5;
bomber.fac(world, x, y, z);
bomber.type = 1;
return bomber;
}
public static EntityBomber statFacChlorine(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 100;
bomber.bombRate = 4;
bomber.fac(world, x, y, z);
bomber.type = 2;
return bomber;
}
public static EntityBomber statFacOrange(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 75;
bomber.bombStop = 125;
bomber.bombRate = 1;
bomber.fac(world, x, y, z);
bomber.type = 3;
return bomber;
}
public static EntityBomber statFacABomb(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 60;
bomber.bombStop = 70;
bomber.bombRate = 65;
bomber.fac(world, x, y, z);
int i = 1;
int rand = world.rand.nextInt(3);
switch(rand) {
case 0: i = 5; break;
case 1: i = 6; break;
case 2: i = 7; break;
}
if(world.rand.nextInt(100) == 0) i = 8;
bomber.getDataWatcher().updateObject(16, (byte) i);
bomber.type = 4;
return bomber;
}
public static EntityBomber statFacStinger(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 150;
bomber.bombRate = 10;
bomber.fac(world, x, y, z);
bomber.getDataWatcher().updateObject(16, (byte) 4);
bomber.type = 5;
return bomber;
}
public static EntityBomber statFacBoxcar(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 50;
bomber.bombStop = 150;
bomber.bombRate = 10;
bomber.fac(world, x, y, z);
bomber.getDataWatcher().updateObject(16, (byte) 6);
bomber.type = 6;
return bomber;
}
public static EntityBomber statFacPC(World world, double x, double y, double z) {
EntityBomber bomber = new EntityBomber(world);
bomber.timer = 200;
bomber.bombStart = 75;
bomber.bombStop = 125;
bomber.bombRate = 1;
bomber.fac(world, x, y, z);
bomber.getDataWatcher().updateObject(16, (byte) 6);
bomber.type = 7;
return bomber;
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
ticksExisted = nbt.getInteger("ticksExisted");
super.readEntityFromNBT(nbt);
bombStart = nbt.getInteger("bombStart");
bombStop = nbt.getInteger("bombStop");
bombRate = nbt.getInteger("bombRate");
type = nbt.getInteger("type");
this.getDataWatcher().updateObject(16, nbt.getByte("style"));
this.getDataWatcher().updateObject(17, nbt.getInteger("health"));
this.setSize(8.0F, 4.0F);
this.getDataWatcher().updateObject(16, nbt.getByte("style"));
this.setSize(8.0F, 4.0F);
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setInteger("ticksExisted", ticksExisted);
super.writeEntityToNBT(nbt);
nbt.setInteger("bombStart", bombStart);
nbt.setInteger("bombStop", bombStop);
nbt.setInteger("bombRate", bombRate);
nbt.setInteger("type", type);
nbt.setByte("style", this.getDataWatcher().getWatchableObjectByte(16));
nbt.setInteger("health", this.getDataWatcher().getWatchableObjectInt(17));
}
protected void rotation() {
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
{
;
}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
{
this.prevRotationPitch += 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
{
this.prevRotationYaw -= 360.0F;
}
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
{
this.prevRotationYaw += 360.0F;
}
}
@Override
@SideOnly(Side.CLIENT)
public boolean isInRangeToRenderDist(double distance)
{
return distance < 500000;
}
private Ticket loaderTicket;
public void init(Ticket ticket) {
if(!worldObj.isRemote) {
if(ticket != null) {
if(loaderTicket == null) {
loaderTicket = ticket;
loaderTicket.bindEntity(this);
loaderTicket.getModData();
}
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(chunkCoordX, chunkCoordZ));
}
}
}
List<ChunkCoordIntPair> loadedChunks = new ArrayList<ChunkCoordIntPair>();
public void loadNeighboringChunks(int newChunkX, int newChunkZ)
{
if(!worldObj.isRemote && loaderTicket != null)
{
for(ChunkCoordIntPair chunk : loadedChunks)
{
ForgeChunkManager.unforceChunk(loaderTicket, chunk);
}
loadedChunks.clear();
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ));
loadedChunks.add(new ChunkCoordIntPair(newChunkX + 1, newChunkZ + 1));
loadedChunks.add(new ChunkCoordIntPair(newChunkX - 1, newChunkZ - 1));
loadedChunks.add(new ChunkCoordIntPair(newChunkX + 1, newChunkZ - 1));
loadedChunks.add(new ChunkCoordIntPair(newChunkX - 1, newChunkZ + 1));
loadedChunks.add(new ChunkCoordIntPair(newChunkX + 1, newChunkZ));
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ + 1));
loadedChunks.add(new ChunkCoordIntPair(newChunkX - 1, newChunkZ));
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ - 1));
for(ChunkCoordIntPair chunk : loadedChunks)
{
ForgeChunkManager.forceChunk(loaderTicket, chunk);
}
}
}
}

View File

@ -0,0 +1,98 @@
package com.hbm.entity.logic;
import com.hbm.entity.item.EntityParachuteCrate;
import com.hbm.itempool.ItemPool;
import com.hbm.itempool.ItemPoolsC130;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.util.EnumUtil;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntityC130 extends EntityPlaneBase {
protected AudioWrapper audio;
public C130PayloadType payload = C130PayloadType.SUPPLIES;
public EntityC130(World world) {
super(world);
this.ignoreFrustumCheck = true;
this.setSize(8.0F, 4.0F);
}
@Override
public void onUpdate() {
super.onUpdate();
if(worldObj.isRemote) {
if(this.getDataWatcher().getWatchableObjectFloat(17) > 0) {
if(audio == null || !audio.isPlaying()) {
audio = MainRegistry.proxy.getLoopedSound("hbm:entity.bomberLoop", (float) posX, (float) posY, (float) posZ, 2F, 250F, 1F, 20);
audio.startSound();
}
audio.keepAlive();
audio.updatePosition((float) posX, (float) posY, (float) posZ);
} else {
if(audio != null && audio.isPlaying()) {
audio.stopSound();
audio = null;
}
}
}
if(!worldObj.isRemote && this.ticksExisted == this.getLifetime() / 2 && this.health > 0) {
EntityParachuteCrate crate = new EntityParachuteCrate(worldObj);
crate.setPosition(posX - motionX * 7, posY - 10, posZ - motionZ * 7);
if(this.payload == C130PayloadType.SUPPLIES) {
for(int i = 0; i < 5; i++) crate.items.add(ItemPool.getStack(ItemPoolsC130.POOL_SUPPLIES, this.rand));
}
if(this.payload == C130PayloadType.WEAPONS) {
int amount = 1 + rand.nextInt(2);
for(int i = 0; i < amount; i++) crate.items.add(ItemPool.getStack(ItemPoolsC130.POOL_WEAPONS, this.rand));
for(int i = 0; i < 6; i++) crate.items.add(ItemPool.getStack(ItemPoolsC130.POOL_AMMO, this.rand));
}
worldObj.spawnEntityInWorld(crate);
}
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
super.readEntityFromNBT(nbt);
this.payload = EnumUtil.grabEnumSafely(C130PayloadType.class, nbt.getInteger("payload"));
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
super.writeEntityToNBT(nbt);
nbt.setInteger("payload", this.payload.ordinal());
}
public void fac(World world, double x, double y, double z, C130PayloadType payload) {
Vec3 vector = Vec3.createVectorHelper(world.rand.nextDouble() - 0.5, 0, world.rand.nextDouble() - 0.5);
vector = vector.normalize();
vector.xCoord *= 2;
vector.zCoord *= 2;
this.payload = payload;
this.setLocationAndAngles(x - vector.xCoord * 100, y + 100, z - vector.zCoord * 100, 0.0F, 0.0F);
this.loadNeighboringChunks((int) (x / 16), (int) (z / 16));
this.motionX = vector.xCoord;
this.motionZ = vector.zCoord;
this.motionY = 0.0D;
this.rotation();
}
public static enum C130PayloadType {
SUPPLIES,
WEAPONS,
A_FUCKING_FUEL_TRUCK
}
}

View File

@ -0,0 +1,151 @@
package com.hbm.entity.logic;
import java.util.ArrayList;
import java.util.List;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.particle.helper.ExplosionSmallCreator;
import com.hbm.util.ParticleUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.ForgeChunkManager.Type;
public abstract class EntityPlaneBase extends Entity implements IChunkLoader {
private Ticket loaderTicket;
private List<ChunkCoordIntPair> loadedChunks = new ArrayList<ChunkCoordIntPair>();
public float health = getMaxHealth();
public int timer = getLifetime();
public EntityPlaneBase(World world) { super(world); }
public float getMaxHealth() { return 50F; }
public int getLifetime() { return 200; }
@Override public boolean canBeCollidedWith() { return this.health > 0; }
@Override
public boolean attackEntityFrom(DamageSource source, float amount) {
if(source == ModDamageSource.nuclearBlast) return false;
if(this.isEntityInvulnerable()) return false;
if(!this.isDead && !this.worldObj.isRemote && this.health > 0) {
health -= amount;
if(this.health <= 0) this.killPlane();
}
return true;
}
protected void killPlane() {
ExplosionSmallCreator.composeEffect(worldObj, posX, posY, posZ, 25, 3.5F, 2F);
worldObj.playSoundEffect(posX, posY, posZ, "hbm:entity.planeShotDown", 25.0F, 1.0F);
}
@Override
protected void entityInit() {
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
this.dataWatcher.addObject(17, new Float(50F));
}
@Override
public void init(Ticket ticket) {
if(!worldObj.isRemote && ticket != null) {
if(loaderTicket == null) {
loaderTicket = ticket;
loaderTicket.bindEntity(this);
loaderTicket.getModData();
}
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(chunkCoordX, chunkCoordZ));
}
}
@Override
public void onUpdate() {
this.lastTickPosX = this.prevPosX = posX;
this.lastTickPosY = this.prevPosY = posY;
this.lastTickPosZ = this.prevPosZ = posZ;
this.setPosition(posX + motionX, posY + motionY, posZ + motionZ);
if(!worldObj.isRemote) {
this.dataWatcher.updateObject(17, health);
} else {
health = this.dataWatcher.getWatchableObjectFloat(17);
}
this.rotation();
if(this.health <= 0) {
motionY -= 0.025;
for(int i = 0; i < 10; i++) ParticleUtil.spawnGasFlame(this.worldObj, this.posX + rand.nextGaussian() * 0.5 - motionX * 2, this.posY + rand.nextGaussian() * 0.5 - motionY * 2, this.posZ + rand.nextGaussian() * 0.5 - motionZ * 2, 0.0, 0.1, 0.0);
if((!worldObj.getBlock((int) posX, (int) posY, (int) posZ).isAir(worldObj, (int) posX, (int) posY, (int) posZ) || posY < 0) && !worldObj.isRemote) {
this.setDead();
new ExplosionVNT(worldObj, posX, posY, posZ, 15F).makeStandard().explode();
worldObj.playSoundEffect(posX, posY, posZ, "hbm:entity.planeCrash", 25.0F, 1.0F);
return;
}
} else {
this.motionY = 0F;
}
if(this.ticksExisted > timer) this.setDead();
if(!worldObj.isRemote) loadNeighboringChunks((int)Math.floor(posX / 16D), (int)Math.floor(posZ / 16D));
}
protected void rotation() {
float motionHorizontal = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
for(this.rotationPitch = (float) (Math.atan2(this.motionY, motionHorizontal) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) this.prevRotationPitch += 360.0F;
while(this.rotationYaw - this.prevRotationYaw < -180.0F) this.prevRotationYaw -= 360.0F;
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) this.prevRotationYaw += 360.0F;
}
@Override
public void setDead() {
super.setDead();
this.clearChunkLoader();
}
@Override
protected void readEntityFromNBT(NBTTagCompound nbt) {
ticksExisted = nbt.getInteger("ticksExisted");
this.getDataWatcher().updateObject(17, nbt.getFloat("health"));
}
@Override
protected void writeEntityToNBT(NBTTagCompound nbt) {
nbt.setInteger("ticksExisted", ticksExisted);
nbt.setFloat("health", this.getDataWatcher().getWatchableObjectFloat(17));
}
public void clearChunkLoader() {
if(!worldObj.isRemote && loaderTicket != null) {
for(ChunkCoordIntPair chunk : loadedChunks) ForgeChunkManager.unforceChunk(loaderTicket, chunk);
}
}
public void loadNeighboringChunks(int newChunkX, int newChunkZ) {
if(!worldObj.isRemote && loaderTicket != null) {
clearChunkLoader();
loadedChunks.clear();
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ));
for(ChunkCoordIntPair chunk : loadedChunks) ForgeChunkManager.forceChunk(loaderTicket, chunk);
}
}
@Override @SideOnly(Side.CLIENT) public boolean isInRangeToRenderDist(double distance) { return true; }
}

View File

@ -30,8 +30,8 @@ import net.minecraft.world.World;
public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLoader {
protected float fuel;
protected float consumption;
public float fuel;
public float consumption;
public EntityMissileCustom(World world) {
super(world);
@ -81,6 +81,12 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
@Override
public void onUpdate() {
ItemCustomMissilePart part = (ItemCustomMissilePart) Item.getItemById(this.dataWatcher.getWatchableObjectInt(9));
WarheadType type = (WarheadType) part.attributes[0];
if(type != null && type.updateCustom != null) {
type.updateCustom.accept(this);
}
if(!worldObj.isRemote) {
if(this.hasPropulsion()) this.fuel -= this.consumption;
@ -152,6 +158,11 @@ public class EntityMissileCustom extends EntityMissileBaseNT implements IChunkLo
WarheadType type = (WarheadType) part.attributes[0];
float strength = (Float) part.attributes[1];
if(type.impactCustom != null) {
type.impactCustom.accept(this);
return;
}
switch(type) {
case HE:

View File

@ -0,0 +1,34 @@
package com.hbm.entity.mob;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.passive.IAnimals;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.world.World;
public class EntityDummy extends EntityLiving implements IAnimals {
public EntityDummy(World world) {
super(world);
}
@Override
public boolean interact(EntityPlayer player) {
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemArmor) {
ItemArmor armor = (ItemArmor) player.getHeldItem().getItem();
this.setCurrentItemOrArmor(4 - armor.armorType, player.getHeldItem().copy());
}
return super.interact(player);
}
@Override @SideOnly(Side.CLIENT) public boolean getAlwaysRenderNameTagForRender() { return true; }
@Override public String getCommandSenderName() {
return (int) (this.getHealth() * 10) / 10F + " / " + (int) (this.getMaxHealth() * 10) / 10F; }
//return (int) this.rotationYaw + " " + (int) this.renderYawOffset + " " + (int) this.rotationYawHead + " " + (int) this.newRotationYaw; }
@Override protected void dropEquipment(boolean b, int i) { }
}

View File

@ -5,6 +5,8 @@ import com.hbm.util.BobMathUtil;
import com.hbm.util.TrackerUtil;
import com.hbm.util.Vec3NT;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EntityTrackerEntry;
@ -29,6 +31,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
super(world);
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
this.isImmuneToFire = true;
}
public EntityBulletBaseMK4(EntityLivingBase entity, BulletConfig config, float baseDamage, float gunSpread, double sideOffset, double heightOffset, double frontOffset) {
@ -61,6 +64,22 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread + gunSpread);
}
/** For turrets - angles are in radians, andp itch is negative! */
public EntityBulletBaseMK4(World world, BulletConfig config, float baseDamage, float gunSpread, float yaw, float pitch) {
this(world);
this.setBulletConfig(config);
this.damage = baseDamage * this.config.damageMult;
this.prevRotationYaw = this.rotationYaw = yaw * 180F / (float) Math.PI;
this.prevRotationPitch = this.rotationPitch = -pitch * 180F / (float) Math.PI;
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread + gunSpread);
}
@Override
protected void entityInit() {
@ -165,4 +184,6 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
@Override public boolean doesPenetrate() { return this.config.doesPenetrate; }
@Override public boolean isSpectral() { return this.config.isSpectral; }
@Override public int selfDamageDelay() { return this.config.selfDamageDelay; }
@Override @SideOnly(Side.CLIENT) public boolean canRenderOnFire() { return false; }
}

View File

@ -0,0 +1,81 @@
package com.hbm.entity.projectile;
import java.util.ArrayList;
import java.util.List;
import com.hbm.entity.logic.IChunkLoader;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.main.MainRegistry;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.ChunkCoordIntPair;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.ForgeChunkManager.Type;
public class EntityBulletBaseMK4CL extends EntityBulletBaseMK4 implements IChunkLoader {
private Ticket loaderTicket;
private List<ChunkCoordIntPair> loadedChunks = new ArrayList<ChunkCoordIntPair>();
public EntityBulletBaseMK4CL(World world) {
super(world);
}
public EntityBulletBaseMK4CL(EntityLivingBase entity, BulletConfig config, float damage, float spread, double sideOffset, double heightOffset, double forwardOffset) {
super(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
}
@Override
protected void entityInit() {
super.entityInit();
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
}
@Override
public void init(Ticket ticket) {
if(!worldObj.isRemote && ticket != null) {
if(loaderTicket == null) {
loaderTicket = ticket;
loaderTicket.bindEntity(this);
loaderTicket.getModData();
}
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(chunkCoordX, chunkCoordZ));
}
}
@Override
public void onUpdate() {
super.onUpdate();
if(!worldObj.isRemote) loadNeighboringChunks((int)Math.floor(posX / 16D), (int)Math.floor(posZ / 16D));
}
@Override
public void setDead() {
super.setDead();
clearChunkLoader();
}
public void clearChunkLoader() {
if(!worldObj.isRemote && loaderTicket != null) {
for(ChunkCoordIntPair chunk : loadedChunks) {
ForgeChunkManager.unforceChunk(loaderTicket, chunk);
}
}
}
public void loadNeighboringChunks(int newChunkX, int newChunkZ) {
if(!worldObj.isRemote && loaderTicket != null) {
clearChunkLoader();
loadedChunks.clear();
loadedChunks.add(new ChunkCoordIntPair(newChunkX, newChunkZ));
for(ChunkCoordIntPair chunk : loadedChunks) {
ForgeChunkManager.forceChunk(loaderTicket, chunk);
}
}
}
}

View File

@ -33,8 +33,11 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
this.ignoreFrustumCheck = true;
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
this.isImmuneToFire = true;
}
public EntityLivingBase getThrower() { return this.thrower; }
public EntityBulletBeamBase(EntityLivingBase entity, BulletConfig config, float baseDamage, float angularInaccuracy, double sideOffset, double heightOffset, double frontOffset) {
this(entity.worldObj);
@ -59,7 +62,7 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
this.headingZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
this.headingY = (double) (-MathHelper.sin((this.rotationPitch) / 180.0F * (float) Math.PI));
double range = 150D;
double range = 250D;
this.headingX *= range;
this.headingY *= range;
this.headingZ *= range;
@ -93,6 +96,8 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
return;
}
if(config.onUpdate != null) config.onUpdate.accept(this);
super.onUpdate();
if(!worldObj.isRemote && this.ticksExisted > config.expires) this.setDead();
@ -186,8 +191,14 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
@Override public void writeSpawnData(ByteBuf buf) {
buf.writeDouble(beamLength);
buf.writeFloat(rotationYaw);
buf.writeFloat(rotationPitch);
}
@Override public void readSpawnData(ByteBuf buf) {
this.beamLength = buf.readDouble();
this.rotationYaw = buf.readFloat();
this.rotationPitch = buf.readFloat();
}
@Override @SideOnly(Side.CLIENT) public boolean canRenderOnFire() { return false; }
}

View File

@ -193,7 +193,7 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
for(int j = 0; j < list.size(); ++j) {
Entity entity = (Entity) list.get(j);
if(entity.canBeCollidedWith() && (entity != thrower || this.ticksInAir >= this.selfDamageDelay())) {
if(entity.canBeCollidedWith() && (entity != thrower || this.ticksInAir >= this.selfDamageDelay()) && entity.isEntityAlive()) {
double hitbox = 0.3F;
AxisAlignedBB aabb = entity.boundingBox.expand(hitbox, hitbox, hitbox);
MovingObjectPosition hitMop = aabb.calculateIntercept(pos, nextPos);

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
import com.hbm.explosion.vanillant.interfaces.IEntityProcessor;
@ -96,9 +97,11 @@ public class EntityProcessorCross implements IEntityProcessor {
if(!damageMap.containsKey(entity) || damageMap.get(entity) < dmg) damageMap.put(entity, dmg);
double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback);
entity.motionX += deltaX * enchKnockback;
entity.motionY += deltaY * enchKnockback;
entity.motionZ += deltaZ * enchKnockback;
if(!(entity instanceof EntityBulletBaseMK4)) {
entity.motionX += deltaX * enchKnockback;
entity.motionY += deltaY * enchKnockback;
entity.motionZ += deltaZ * enchKnockback;
}
if(entity instanceof EntityPlayer) {
affectedPlayers.put((EntityPlayer) entity, Vec3.createVectorHelper(deltaX * knockback, deltaY * knockback, deltaZ * knockback));
@ -110,7 +113,7 @@ public class EntityProcessorCross implements IEntityProcessor {
for(Entry<Entity, Float> entry : damageMap.entrySet()) {
Entity entity = entry.getKey();
entity.attackEntityFrom(setExplosionSource(explosion.compat), entry.getValue());
attackEntity(entity, explosion, entry.getValue());
if(damage != null) {
double distanceScaled = entity.getDistance(x, y, z) / size;
@ -121,6 +124,10 @@ public class EntityProcessorCross implements IEntityProcessor {
return affectedPlayers;
}
public void attackEntity(Entity entity, ExplosionVNT source, float amount) {
entity.attackEntityFrom(setExplosionSource(source.compat), amount);
}
public float calculateDamage(double distanceScaled, double density, double knockback, float size) {
return (float) ((int) ((knockback * knockback + knockback) / 2.0D * 8.0D * size + 1.0D));
}

View File

@ -1,14 +1,51 @@
package com.hbm.explosion.vanillant.standard;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.util.EntityDamageUtil;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource;
public class EntityProcessorCrossSmooth extends EntityProcessorCross {
protected float fixedDamage;
protected float pierceDT = 0;
protected float pierceDR = 0;
protected DamageClass clazz = DamageClass.EXPLOSIVE;
public EntityProcessorCrossSmooth(double nodeDist, float fixedDamage) {
super(nodeDist);
this.fixedDamage = fixedDamage;
}
public EntityProcessorCrossSmooth setupPiercing(float pierceDT, float pierceDR) {
this.pierceDT = pierceDT;
this.pierceDR = pierceDR;
return this;
}
public EntityProcessorCrossSmooth setDamageClass(DamageClass clazz) {
this.clazz = clazz;
return this;
}
@Override
public void attackEntity(Entity entity, ExplosionVNT source, float amount) {
if(!entity.isEntityAlive()) return;
DamageSource dmg = BulletConfig.getDamage(null, source.exploder instanceof EntityLivingBase ? (EntityLivingBase) source.exploder : null, clazz);
if(!(entity instanceof EntityLivingBase)) {
entity.attackEntityFrom(dmg, amount);
} else {
EntityDamageUtil.attackEntityFromNT((EntityLivingBase) entity, dmg, amount, true, false, 0F, pierceDT, pierceDR);
if(!entity.isEntityAlive()) ConfettiUtil.decideConfetti((EntityLivingBase) entity, dmg);
}
}
@Override
public float calculateDamage(double distanceScaled, double density, double knockback, float size) {
return (float) (fixedDamage * (1 - distanceScaled));
}

View File

@ -48,6 +48,7 @@ public class HbmLivingProps implements IExtendedEntityProperties {
private int contagion;
private int oil;
public int fire;
public int phosphorus;
public int balefire;
private List<ContaminationEffect> contamination = new ArrayList();
@ -316,6 +317,7 @@ public class HbmLivingProps implements IExtendedEntityProperties {
props.setInteger("hfr_blacklung", blacklung);
props.setInteger("hfr_oil", oil);
props.setInteger("hfr_fire", fire);
props.setInteger("hfr_phosphorus", phosphorus);
props.setInteger("hfr_balefire", balefire);
props.setInteger("hfr_cont_count", this.contamination.size());
@ -342,6 +344,7 @@ public class HbmLivingProps implements IExtendedEntityProperties {
blacklung = props.getInteger("hfr_blacklung");
oil = props.getInteger("hfr_oil");
fire = props.getInteger("hfr_fire");
phosphorus = props.getInteger("hfr_phosphorus");
balefire = props.getInteger("hfr_balefire");
int cont = props.getInteger("hfr_cont_count");

View File

@ -7,12 +7,12 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.gui.GUIScreenBobmazon.Offer;
import com.hbm.inventory.gui.GUIScreenBobmazon.Requirement;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.machine.ItemBattery;
import com.hbm.items.special.ItemKitCustom;
import com.hbm.items.special.ItemKitNBT;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
@ -110,32 +110,6 @@ public class BobmazonOfferFactory {
weapons.add(new Offer(new ItemStack(ModItems.detonator), Requirement.ASSEMBLY, 15 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.detonator_laser), Requirement.CHEMICS, 60 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.defuser), Requirement.OIL, 5 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_revolver), Requirement.ASSEMBLY, 15 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_revolver_nopip), Requirement.ASSEMBLY, 20 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_minigun), Requirement.OIL, 100 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_panzerschreck), Requirement.ASSEMBLY, 95 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_hk69), Requirement.ASSEMBLY, 60 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_uzi), Requirement.OIL, 80 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_lever_action), Requirement.ASSEMBLY, 60 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_bolt_action), Requirement.ASSEMBLY, 35 * inflation));
weapons.add(new Offer(ModItems.ammo_357.stackFromEnum(6, Ammo357Magnum.LEAD), Requirement.OIL, 12 * inflation));
weapons.add(new Offer(ModItems.ammo_357.stackFromEnum(6, Ammo357Magnum.DESH), Requirement.OIL, 36 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_44, 6), Requirement.OIL, 12 * inflation));
weapons.add(new Offer(ModItems.ammo_44.stackFromEnum(6, Ammo44Magnum.AP), Requirement.OIL, 18 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_5mm, 50), Requirement.OIL, 50 * inflation));
weapons.add(new Offer(ModItems.ammo_5mm.stackFromEnum(50, Ammo5mm.DU), Requirement.OIL, 75 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_rocket), Requirement.OIL, 5 * inflation));
weapons.add(new Offer(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.INCENDIARY), Requirement.OIL, 8 * inflation));
weapons.add(new Offer(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.SLEEK), Requirement.OIL, 12 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_grenade), Requirement.OIL, 4 * inflation));
weapons.add(new Offer(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.INCENDIARY), Requirement.OIL, 6 * inflation));
weapons.add(new Offer(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.SLEEK), Requirement.OIL, 10 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_22lr, 32), Requirement.OIL, 24 * inflation));
weapons.add(new Offer(ModItems.ammo_22lr.stackFromEnum(32, Ammo22LR.AP), Requirement.OIL, 32 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_20gauge, 6), Requirement.OIL, 18 * inflation));
weapons.add(new Offer(ModItems.ammo_20gauge.stackFromEnum(6, Ammo20Gauge.SLUG), Requirement.OIL, 20 * inflation));
weapons.add(new Offer(ModItems.ammo_20gauge.stackFromEnum(6, Ammo20Gauge.FLECHETTE), Requirement.OIL, 22 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.gun_hp_ammo, 1), Requirement.ASSEMBLY, 1000 * inflation));
tools.add(new Offer(new ItemStack(ModBlocks.crate_can, 1), Requirement.STEEL, 20 * inflation));
tools.add(new Offer(new ItemStack(ModBlocks.machine_keyforge), Requirement.STEEL, 10 * inflation));
@ -238,23 +212,18 @@ public class BobmazonOfferFactory {
), Requirement.HIDDEN, 64));
special.add(new Offer(ItemKitCustom.create("Maid's Cleaning Utensils", "For the hard to reach spots", 0x00ff00, 0x008000,
new ItemStack(ModItems.gun_calamity),
ModItems.ammo_50bmg.stackFromEnum(64, Ammo50BMG.CHLOROPHYTE),
ModItems.ammo_50bmg.stackFromEnum(64, Ammo50BMG.CHLOROPHYTE),
ModItems.ammo_50bmg.stackFromEnum(64, Ammo50BMG.CHLOROPHYTE),
ModItems.ammo_50ae.stackFromEnum(64, Ammo50AE.STAR),
ModItems.ammo_50ae.stackFromEnum(64, Ammo50AE.STAR),
new ItemStack(ModItems.gun_supershotgun),
ModItems.ammo_12gauge.stackFromEnum(64, Ammo12Gauge.DU),
ModItems.ammo_12gauge.stackFromEnum(64, Ammo12Gauge.DU),
ModItems.ammo_12gauge.stackFromEnum(64, Ammo12Gauge.SHRAPNEL),
ModItems.ammo_12gauge.stackFromEnum(64, Ammo12Gauge.SHRAPNEL),
ModItems.ammo_12gauge.stackFromEnum(4, Ammo12Gauge.MARAUDER),
new ItemStack(ModItems.ammo_4gauge, 64),
ModItems.ammo_4gauge.stackFromEnum(64, Ammo4Gauge.CLAW),
ModItems.ammo_4gauge.stackFromEnum(64, Ammo4Gauge.KAMPF),
ModItems.ammo_4gauge.stackFromEnum(64, Ammo4Gauge.FLECHETTE),
ModItems.ammo_4gauge.stackFromEnum(64, Ammo4Gauge.VOID)
new ItemStack(ModItems.gun_m2),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.BMG50_DU.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.BMG50_DU.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.BMG50_DU.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.BMG50_DU.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.BMG50_DU.ordinal()),
new ItemStack(ModItems.gun_autoshotgun),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.G12_MAGNUM.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.G12_MAGNUM.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.G12_MAGNUM.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.G12_EXPLOSIVE.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.G12_EXPLOSIVE.ordinal())
), Requirement.HIDDEN, 64));
special.add(new Offer(ItemKitNBT.create(
@ -269,14 +238,10 @@ public class BobmazonOfferFactory {
new ItemStack(ModItems.rpa_plate),
new ItemStack(ModItems.rpa_legs),
new ItemStack(ModItems.rpa_boots),
new ItemStack(ModItems.gun_lacunae),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR),
ModItems.ammo_5mm.stackFromEnum(64, Ammo5mm.STAR)
new ItemStack(ModItems.gun_minigun_lacunae),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.CAPACITOR_OVERCHARGE.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.CAPACITOR_OVERCHARGE.ordinal()),
new ItemStack(ModItems.ammo_standard, 64, EnumAmmo.CAPACITOR_OVERCHARGE.ordinal())
).setStackDisplayName("Frenchman's Reward"), Requirement.HIDDEN, 32));
}

View File

@ -18,6 +18,7 @@ import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.interfaces.IArmorModDash;
import com.hbm.items.armor.ArmorFSB;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
@ -574,7 +575,12 @@ public class EntityEffectHandler {
HbmLivingProps props = HbmLivingProps.getData(living);
Random rand = living.getRNG();
if(living.isImmuneToFire()) props.fire = 0;
if(!entity.isEntityAlive()) return;
if(living.isImmuneToFire()) {
props.fire = 0;
props.phosphorus = 0;
}
double x = living.posX;
double y = living.posY;
@ -589,6 +595,13 @@ public class EntityEffectHandler {
FlameCreator.composeEffect(entity.worldObj, x - living.width / 2 + living.width * rand.nextDouble(), y + rand.nextDouble() * living.height, z - living.width / 2 + living.width * rand.nextDouble(), FlameCreator.META_FIRE);
}
if(props.phosphorus > 0) {
props.phosphorus--;
if((living.ticksExisted + living.getEntityId()) % 15 == 0) living.worldObj.playSoundEffect(living.posX, living.posY + living.height / 2, living.posZ, "random.fizz", 1F, 1.5F + rand.nextFloat() * 0.5F);
if((living.ticksExisted + living.getEntityId()) % 40 == 0) living.attackEntityFrom(DamageSource.onFire, 5F);
FlameCreator.composeEffect(entity.worldObj, x - living.width / 2 + living.width * rand.nextDouble(), y + rand.nextDouble() * living.height, z - living.width / 2 + living.width * rand.nextDouble(), FlameCreator.META_FIRE);
}
if(props.balefire > 0) {
props.balefire--;
if((living.ticksExisted + living.getEntityId()) % 15 == 0) living.worldObj.playSoundEffect(living.posX, living.posY + living.height / 2, living.posZ, "random.fizz", 1F, 1.5F + rand.nextFloat() * 0.5F);
@ -596,6 +609,8 @@ public class EntityEffectHandler {
if((living.ticksExisted + living.getEntityId()) % 20 == 0) living.attackEntityFrom(DamageSource.onFire, 5F);
FlameCreator.composeEffect(entity.worldObj, x - living.width / 2 + living.width * rand.nextDouble(), y + rand.nextDouble() * living.height, z - living.width / 2 + living.width * rand.nextDouble(), FlameCreator.META_BALEFIRE);
}
if(props.fire > 0 || props.phosphorus > 0 || props.balefire > 0) if(!entity.isEntityAlive()) ConfettiUtil.decideConfetti(living, DamageSource.onFire);
}
private static void handleDashing(Entity entity) {

View File

@ -9,13 +9,11 @@ import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.AmmoDart;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGunDart;
import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.main.MainRegistry;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
@ -100,28 +98,6 @@ public class GunDartFactory {
bullet.effects = new ArrayList();
bullet.effects.add(new PotionEffect(Potion.wither.id, 60 * 20, 2));
bullet.bntHurt = (bulletnt, hit) -> {
if(bulletnt.worldObj.isRemote)
return;
if(hit instanceof EntityPlayer) {
if(((EntityPlayer) hit).inventory.hasItem(ModItems.ingot_meteorite_forged))
return;
if(bulletnt.getThrower() instanceof EntityPlayer) {
EntityPlayer shooter = (EntityPlayer) bulletnt.getThrower();
if(shooter.getHeldItem() != null && shooter.getHeldItem().getItem() == ModItems.gun_darter) {
ItemGunDart.writePlayer(shooter.getHeldItem(), (EntityPlayer) hit);
shooter.playSound("random.orb", 1.0F, 1.0F);
}
}
}
};
return bullet;
}

View File

@ -0,0 +1,16 @@
package com.hbm.handler.nei;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.recipes.AmmoPressRecipes;
public class AmmoPressHandler extends NEIUniversalHandler {
public AmmoPressHandler() {
super(ModBlocks.machine_ammo_press.getLocalizedName(), ModBlocks.machine_ammo_press, AmmoPressRecipes.getRecipes());
}
@Override
public String getKey() {
return "ntmAmmoPress";
}
}

View File

@ -20,27 +20,28 @@ public class BoilingHandler extends NEIUniversalHandler {
public String getKey() {
return "ntmBoiling";
}
public static HashMap<Object, Object> cache;
public static boolean isReload=false;
public static HashMap<Object, Object> generateRecipes() {
if(cache != null) return cache;
if(cache != null && !isReload) return cache;
cache = new HashMap();
for(FluidType type : Fluids.getInNiceOrder()) {
if(type.hasTrait(FT_Heatable.class)) {
FT_Heatable trait = type.getTrait(FT_Heatable.class);
if(trait.getEfficiency(HeatingType.BOILER) > 0) {
HeatingStep step = trait.getFirstStep();
cache.put(ItemFluidIcon.make(type, step.amountReq), ItemFluidIcon.make(step.typeProduced, step.amountProduced));
}
}
}
isReload=false;
return cache;
}
}

View File

@ -546,15 +546,15 @@ public class OreDictManager {
for(NTMMaterial mat : Mats.orderedList) {
if(mat.smeltable == SmeltingBehavior.SMELTABLE) {
if(mat.autogen.contains(MaterialShapes.BOLT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.BOLT.name() + name, new ItemStack(ModItems.bolt, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.INGOT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.INGOT.name() + name, new ItemStack(ModItems.ingot_raw, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.CASTPLATE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.CASTPLATE.name() + name, new ItemStack(ModItems.plate_cast, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.WELDEDPLATE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.WELDEDPLATE.name() + name, new ItemStack(ModItems.plate_welded, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.HEAVY_COMPONENT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.HEAVY_COMPONENT.name() + name, new ItemStack(ModItems.heavy_component, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.DENSEWIRE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.DENSEWIRE.name() + name, new ItemStack(ModItems.wire_dense, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.SHELL)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.SHELL.name() + name, new ItemStack(ModItems.shell, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.PIPE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.PIPE.name() + name, new ItemStack(ModItems.pipe, 1, mat.id));
}
if(mat.autogen.contains(MaterialShapes.BOLT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.BOLT.name() + name, new ItemStack(ModItems.bolt, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.INGOT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.INGOT.name() + name, new ItemStack(ModItems.ingot_raw, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.SHELL)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.SHELL.name() + name, new ItemStack(ModItems.shell, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.PIPE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.PIPE.name() + name, new ItemStack(ModItems.pipe, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.FRAGMENT)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.FRAGMENT.name() + name, new ItemStack(ModItems.bedrock_ore_fragment, 1, mat.id));
if(mat.autogen.contains(MaterialShapes.WIRE)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.WIRE.name() + name, new ItemStack(ModItems.wire_fine, 1, mat.id));
@ -674,10 +674,11 @@ public class OreDictManager {
public static void registerGroups() {
ANY_RUBBER.addPrefix(INGOT, true);
ANY_PLASTIC.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(BLOCK, true);
ANY_HARDPLASTIC.addPrefix(INGOT, true);
ANY_RESISTANTALLOY.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(CASTPLATE, true).addPrefix(WELDEDPLATE, true).addPrefix(HEAVY_COMPONENT, true).addPrefix(BLOCK, true);
ANY_BISMOIDBRONZE.addPrefix(INGOT, true).addPrefix(CASTPLATE, true);
ANY_PLASTIC.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(BLOCK, true).addPrefix(GRIP, true).addPrefix(STOCK, true);
ANY_HARDPLASTIC.addPrefix(INGOT, true).addPrefix(STOCK, true).addPrefix(GRIP, true);
ANY_RESISTANTALLOY.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(CASTPLATE, true).addPrefix(WELDEDPLATE, true).addPrefix(HEAVY_COMPONENT, true).addPrefix(BLOCK, true)
.addPrefix(LIGHTBARREL, true).addPrefix(HEAVYBARREL, true).addPrefix(LIGHTRECEIVER, true).addPrefix(HEAVYRECEIVER, true);
ANY_BISMOIDBRONZE.addPrefix(INGOT, true).addPrefix(CASTPLATE, true).addPrefix(LIGHTBARREL, true).addPrefix(HEAVYBARREL, true).addPrefix(LIGHTRECEIVER, true).addPrefix(HEAVYRECEIVER, true);
ANY_TAR.addPrefix(ANY, false);
}
@ -685,9 +686,7 @@ public class OreDictManager {
@SubscribeEvent
public void onRegisterOre(OreRegisterEvent event) {
if(recursionBrake)
return;
if(recursionBrake) return;
recursionBrake = true;
@ -1016,6 +1015,13 @@ public class OreDictManager {
public String billet() { return BILLET.name() + groupName; }
public String block() { return BLOCK.name() + groupName; }
public String ore() { return ORE.name() + groupName; }
public String lightBarrel() { return LIGHTBARREL.name() + groupName; }
public String heavyBarrel() { return HEAVYBARREL.name() + groupName; }
public String lightReceiver() { return LIGHTRECEIVER.name() + groupName; }
public String heavyReceiver() { return HEAVYRECEIVER.name() + groupName; }
public String mechanism() { return MECHANISM.name() + groupName; }
public String stock() { return STOCK.name() + groupName; }
public String grip() { return GRIP.name() + groupName; }
}
private static void addReRegistration(String original, String additional) {

View File

@ -14,6 +14,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.handler.nei.BoilingHandler;
import com.hbm.handler.pollution.PollutionHandler;
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
import com.hbm.inventory.fluid.trait.*;
@ -179,12 +180,12 @@ public class Fluids {
public static FluidType STELLAR_FLUX;
public static FluidType VITRIOL;
public static FluidType SLOP;
/* Lagacy names for compatibility purposes */
@Deprecated public static FluidType ACID; //JAOPCA uses this, apparently
public static final HashBiMap<String, FluidType> renameMapping = HashBiMap.create();
public static List<FluidType> customFluids = new ArrayList();
private static final HashMap<Integer, FluidType> idMapping = new HashMap();
@ -226,20 +227,20 @@ public class Fluids {
public static final FT_Polluting P_LIQUID_GAS = new FT_Polluting().burn(PollutionType.SOOT, SOOT_GAS * 2F);
public static void init() {
// ##### ##### ##### ##### ## # ##### # # ##### ## # #####
// # # # # # ## # # # # # # ## # #
// ##### # # ### # # # ##### ##### # # # # # ###
// # # # # # # ## # # # # # # ## #
// # # # # ##### # ## ##### # # ##### # ## #####
/*
* The mapping ID is set in the CTOR, which is the static, never shifting ID that is used to save the fluid type.
* Therefore, ALWAYS append new fluid entries AT THE BOTTOM to avoid unnecessary ID shifting.
* In addition, you have to add your fluid to 'metaOrder' which is what is used to sort fluid identifiers and whatnot in the inventory.
* You may screw with metaOrder as much as you like, as long as you keep all fluids in the list exactly once.
*/
NONE = new FluidType("NONE", 0x888888, 0, 0, 0, EnumSymbol.NONE);
WATER = new FluidType("WATER", 0x3333FF, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, UNSIPHONABLE);
STEAM = new FluidType("STEAM", 0xe5e5e5, 3, 0, 0, EnumSymbol.NONE).setTemp(100).addTraits(GASEOUS, UNSIPHONABLE);
@ -307,8 +308,8 @@ public class Fluids {
NAPHTHA_CRACK = new FluidType("NAPHTHA_CRACK", 0x595744, 2, 1, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0x5F6D44)).addTraits(new FT_Flammable(125_000), new FT_Combustible(FuelGrade.MEDIUM, 200_000), LIQUID, VISCOUS, P_FUEL);
LIGHTOIL_CRACK = new FluidType("LIGHTOIL_CRACK", 0x8c7451, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xB46B52)).addTraits(new FT_Flammable(200_000), new FT_Combustible(FuelGrade.MEDIUM, 500_000), LIQUID, P_FUEL);
DIESEL_CRACK = new FluidType("DIESEL_CRACK", 0xf2eed5, 1, 2, 0, EnumSymbol.NONE).addContainers(new CD_Canister(0xFF2C2C)).addTraits(new FT_Flammable(200_000), new FT_Combustible(FuelGrade.HIGH, 450_000), LIQUID, P_FUEL);
AROMATICS = new FluidType("AROMATICS", 0x68A09A, 1, 4, 1, EnumSymbol.NONE).addTraits(new FT_Flammable(25_000), LIQUID, VISCOUS, P_GAS);
UNSATURATEDS = new FluidType("UNSATURATEDS", 0x628FAE, 1, 4, 1, EnumSymbol.NONE).addTraits(new FT_Flammable(1_000_000), GASEOUS, P_GAS); //acetylene burns as hot as satan's asshole
AROMATICS = new FluidType("AROMATICS", 0x68A09A, 1, 4, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0x68A09A, 0xEDCF27)).addTraits(new FT_Flammable(25_000), LIQUID, VISCOUS, P_GAS);
UNSATURATEDS = new FluidType("UNSATURATEDS", 0x628FAE, 1, 4, 1, EnumSymbol.NONE).addContainers(new CD_Gastank(0x628FAE, 0xEDCF27)).addTraits(new FT_Flammable(1_000_000), GASEOUS, P_GAS); //acetylene burns as hot as satan's asshole
SALIENT = new FluidType("SALIENT", 0x457F2D, 0, 0, 0, EnumSymbol.NONE).addTraits(DELICIOUS, LIQUID, VISCOUS);
XPJUICE = new FluidType("XPJUICE", 0xBBFF09, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
ENDERJUICE = new FluidType("ENDERJUICE", 0x127766, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
@ -384,18 +385,18 @@ public class Fluids {
SLOP = new FluidType("SLOP", 0x929D45, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
LEAD = new FluidType("LEAD", 0x666672, 4, 0, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS);
LEAD_HOT = new FluidType(143, "LEAD_HOT", 0x776563, 4, 0, 0, EnumSymbol.NONE).setTemp(1500).addTraits(LIQUID, VISCOUS);
// ^ ^ ^ ^ ^ ^ ^ ^
//ADD NEW FLUIDS HERE
File folder = MainRegistry.configHbmDir;
File customTypes = new File(folder.getAbsolutePath() + File.separatorChar + "hbmFluidTypes.json");
if(!customTypes.exists()) initDefaultFluids(customTypes);
readCustomFluids(customTypes);
//AND DON'T FORGET THE META DOWN HERE
// V V V V V V V V
//null
metaOrder.add(NONE);
//vanilla
@ -556,15 +557,15 @@ public class Fluids {
//bug meth
metaOrder.add(PHEROMONE);
metaOrder.add(PHEROMONE_M);
//ANY INTERNAL RENAMING MUST BE REFLECTED HERE - DON'T FORGET TO CHANGE: LANG FILES + TYPE'S STRING ID + NAME OF TANK/GUI TEXTURE FILES!
// V
renameMapping.put("ACID", PEROXIDE);
// LEGACY
ACID = PEROXIDE;
for(FluidType custom : customFluids) metaOrder.add(custom);
CHLORINE.addTraits(new FT_Toxin().addEntry(new ToxinDirectDamage(ModDamageSource.cloud, 2F, 20, HazardClass.GAS_LUNG, false)));
@ -576,7 +577,7 @@ public class Fluids {
double eff_steam_boil = 1.0D;
double eff_steam_heatex = 0.25D;
WATER.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, eff_steam_boil).setEff(HeatingType.HEATEXCHANGER, eff_steam_heatex)
.addStep(200, 1, STEAM, 100)
.addStep(220, 1, HOTSTEAM, 10)
@ -606,13 +607,13 @@ public class Fluids {
COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.0D).addStep(300, 1, COOLANT_HOT, 1));
COOLANT_HOT.addTraits(new FT_Coolable(COOLANT, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.25D).addStep(400, 1, MUG_HOT, 1), new FT_PWRModerator(1.15D));
MUG_HOT.addTraits(new FT_Coolable(MUG, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));
BLOOD.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.ICF, 1.25D).addStep(500, 1, BLOOD_HOT, 1));
BLOOD_HOT.addTraits(new FT_Coolable(BLOOD, 1, 1, 500).setEff(CoolingType.HEATEXCHANGER, 1.0D));
HEAVYWATER.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 1.0D).addStep(300, 1, HEAVYWATER_HOT, 1), new FT_PWRModerator(1.25D));
HEAVYWATER_HOT.addTraits(new FT_Coolable(HEAVYWATER, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
@ -623,17 +624,17 @@ public class Fluids {
/* Or maybe not, because I blocked your sorry ass. Guess why that is? */
LEAD_HOT.addTraits(new FT_Coolable(LEAD, 1, 1, 680).setEff(CoolingType.HEATEXCHANGER, 1.0D));
/* Maybe shittalking me in some corner where you thought I wouldn't listen was not that bright of an idea afterall? */
THORIUM_SALT.addTraits(new FT_Heatable().setEff(HeatingType.PWR, 1.0D).addStep(400, 1, THORIUM_SALT_HOT, 1), new FT_PWRModerator(2.5D));
THORIUM_SALT_HOT.addTraits(new FT_Coolable(THORIUM_SALT_DEPLETED, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));
if(idMapping.size() != metaOrder.size()) {
throw new IllegalStateException("A severe error has occoured during NTM's fluid registering process! The MetaOrder and Mappings are inconsistent! Mapping size: " + idMapping.size()+ " / MetaOrder size: " + metaOrder.size());
}
/// FINAL ///
long baseline = 100_000L; //we do not know
double demandVeryLow = 0.5D; //for waste gasses
double demandLow = 1.0D; //for fuel oils
@ -695,11 +696,11 @@ public class Fluids {
registerCalculatedFuel(DIESEL_CRACK_REFORM, DIESEL_CRACK.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 2.5D, FuelGrade.HIGH);
registerCalculatedFuel(KEROSENE_REFORM, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * complexityReform, 1.5D, FuelGrade.AERO);
registerCalculatedFuel(REFORMGAS, (baseline / 0.06 * flammabilityHigh * demandLow * complexityVacuum * complexityFraction), 1.5D, FuelGrade.GAS);
//all hail the spreadsheet
//the spreadsheet must not be questioned
//none may enter the orb- i mean the spreadsheet
int coalHeat = 400_000; // 200TU/t for 2000 ticks
registerCalculatedFuel(COALOIL, (coalHeat * (1000 /* bucket */ / 100 /* mB per coal */) * flammabilityLow * demandLow * complexityChemplant), 0, null);
long coaloil = COALOIL.getTrait(FT_Flammable.class).getHeatEnergy();
@ -721,24 +722,24 @@ public class Fluids {
registerCalculatedFuel(SYNGAS, (coalHeat * (1000 /* bucket */ / 100 /* mB per coal */) * flammabilityLow * demandLow * complexityChemplant) * 1.5, 1.25, FuelGrade.GAS); //same as coal oil, +50% bonus
registerCalculatedFuel(OXYHYDROGEN, 5_000, 3, FuelGrade.GAS); // whatever
File config = new File(folder.getAbsolutePath() + File.separatorChar + "hbmFluidTraits.json");
File template = new File(folder.getAbsolutePath() + File.separatorChar + "_hbmFluidTraits.json");
if(!config.exists()) {
writeDefaultTraits(template);
} else {
readTraits(config);
}
}
private static void initDefaultFluids(File file) {
try {
JsonWriter writer = new JsonWriter(new FileWriter(file));
writer.setIndent(" ");
writer.beginObject();
writer.name("CUSTOM_DEMO").beginObject();
writer.name("name").value("Custom Fluid Demo");
writer.name("id").value(1000);
@ -749,21 +750,21 @@ public class Fluids {
writer.name("texture").value("custom_water");
writer.name("temperature").value(20);
writer.endObject();
writer.endObject();
writer.close();
} catch(IOException e) {
e.printStackTrace();
}
}
private static void readCustomFluids(File file) {
try {
JsonObject json = gson.fromJson(new FileReader(file), JsonObject.class);
for(Entry<String, JsonElement> entry : json.entrySet()) {
JsonObject obj = (JsonObject) entry.getValue();
String name = entry.getKey();
@ -777,54 +778,54 @@ public class Fluids {
EnumSymbol symbol = EnumSymbol.valueOf(obj.get("symbol").getAsString());
String texture = obj.get("texture").getAsString();
int temperature = obj.get("temperature").getAsInt();
FluidType type = new FluidType(name, color, p, f, r, symbol, texture, tint, id, displayName).setTemp(temperature);
customFluids.add(type);
}
} catch(Exception ex) {
ex.printStackTrace();
}
}
private static void writeDefaultTraits(File file) {
try {
JsonWriter writer = new JsonWriter(new FileWriter(file));
writer.setIndent(" ");
writer.beginObject();
for(FluidType type : metaOrder) {
writer.name(type.getName()).beginObject();
for(Entry<Class<? extends FluidTrait>, FluidTrait> entry : type.traits.entrySet()) {
writer.name(FluidTrait.traitNameMap.inverse().get(entry.getKey())).beginObject();
entry.getValue().serializeJSON(writer);
writer.endObject();
}
writer.endObject();
}
writer.endObject();
writer.close();
} catch(IOException e) {
e.printStackTrace();
}
}
private static void readTraits(File config) {
try {
JsonObject json = gson.fromJson(new FileReader(config), JsonObject.class);
for(FluidType type : metaOrder) {
JsonElement element = json.get(type.getName());
if(element != null) {
type.traits.clear();
JsonObject obj = element.getAsJsonObject();
for(Entry<String, JsonElement> entry : obj.entrySet()) {
Class<? extends FluidTrait> traitClass = FluidTrait.traitNameMap.get(entry.getKey());
try {
@ -837,14 +838,36 @@ public class Fluids {
}
}
}
} catch(Exception ex) {
ex.printStackTrace();
}
}
public static void reloadFluids(){
File folder = MainRegistry.configHbmDir;
File customTypes = new File(folder.getAbsolutePath() + File.separatorChar + "hbmFluidTypes.json");
if(!customTypes.exists()) initDefaultFluids(customTypes);
for(FluidType type : customFluids){
idMapping.remove(type.getID());
registerOrder.remove(type);
nameMapping.remove(type.getName());
metaOrder.remove(type);
}
customFluids.clear();
readCustomFluids(customTypes);
for(FluidType custom : customFluids) metaOrder.add(custom);
File config = new File(MainRegistry.configHbmDir.getAbsolutePath() + File.separatorChar + "hbmFluidTraits.json");
File template = new File(MainRegistry.configHbmDir.getAbsolutePath() + File.separatorChar + "_hbmFluidTraits.json");
if(!config.exists()) {
writeDefaultTraits(template);
} else {
readTraits(config);
}
BoilingHandler.isReload=true;
}
private static void registerCalculatedFuel(FluidType type, double base, double combustMult, FuelGrade grade) {
long flammable = (long) base;
long combustible = (long) (base * combustMult);
@ -852,11 +875,11 @@ public class Fluids {
combustible = round(combustible);
type.addTraits(new FT_Flammable(flammable));
if(combustible > 0 && grade != null)
type.addTraits(new FT_Combustible(grade, combustible));
}
/** ugly but it does the thing well enough */
private static long round(long l) {
if(l > 10_000_000L) return l - (l % 100_000L);
@ -864,10 +887,10 @@ public class Fluids {
if(l > 100_000L) return l - (l % 1_000L);
if(l > 10_000L) return l - (l % 100L);
if(l > 1_000L) return l - (l % 10L);
return l;
}
protected static int registerSelf(FluidType fluid) {
int id = idMapping.size();
idMapping.put(id, fluid);
@ -875,90 +898,90 @@ public class Fluids {
nameMapping.put(fluid.getName(), fluid);
return id;
}
protected static void register(FluidType fluid, int id) {
idMapping.put(id, fluid);
registerOrder.add(fluid);
nameMapping.put(fluid.getName(), fluid);
}
public static FluidType fromID(int id) {
FluidType fluid = idMapping.get(id);
if(fluid == null)
fluid = Fluids.NONE;
return fluid;
}
public static FluidType fromName(String name) {
FluidType fluid = nameMapping.get(name);
if(fluid == null)
fluid = Fluids.NONE;
return fluid;
}
/** for old worlds with types saved as name, do not use otherwise */
public static FluidType fromNameCompat(String name) {
if(renameMapping.containsKey(name)) {
FluidType fluid = renameMapping.get(name);
if(fluid == null) //null safety never killed nobody
fluid = Fluids.NONE;
return fluid;
}
return fromName(name);
}
/** basically the inverse of the above method */
public static String toNameCompat(FluidType type) {
if(renameMapping.containsValue(type)) {
String name = renameMapping.inverse().get(type);
if(name == null) //ditto
name = Fluids.NONE.getName();
return name;
}
return type.getName();
}
public static FluidType[] getAll() {
return getInOrder(false);
}
public static FluidType[] getInNiceOrder() {
return getInOrder(true);
}
private static FluidType[] getInOrder(final boolean nice) {
FluidType[] all = new FluidType[idMapping.size()];
for(int i = 0; i < all.length; i++) {
FluidType type = nice ? metaOrder.get(i) : registerOrder.get(i);
if(type == null) {
throw new IllegalStateException("A severe error has occoured with NTM's fluid system! Fluid of the ID " + i + " has returned NULL in the registry!");
}
all[i] = type;
}
return all;
}
public static class CD_Canister {
public int color;
public CD_Canister(int color) { this.color = color; }
}
public static class CD_Gastank {
public int bottleColor, labelColor;
public CD_Gastank(int color1, int color2) { this.bottleColor = color1; this.labelColor = color2; }
}
}
}

View File

@ -11,15 +11,15 @@ import net.minecraft.util.EnumChatFormatting;
public class FT_PWRModerator extends FluidTrait {
private double multiplier;
public FT_PWRModerator(){}
public FT_PWRModerator(double mulitplier) {
this.multiplier = mulitplier;
}
public double getMultiplier() {
return multiplier;
}
@Override
public void addInfo(List<String> info) {
info.add(EnumChatFormatting.BLUE + "[PWR Flux Multiplier]");
@ -35,7 +35,7 @@ public class FT_PWRModerator extends FluidTrait {
public void serializeJSON(JsonWriter writer) throws IOException {
writer.name("multiplier").value(multiplier);
}
@Override
public void deserializeJSON(JsonObject obj) {
this.multiplier = obj.get("multiplier").getAsDouble();

View File

@ -11,6 +11,7 @@ import java.util.List;
public class FT_Pheromone extends FluidTrait{
public int type;
public FT_Pheromone() {}
public FT_Pheromone(int type) {
this.type = type;

View File

@ -20,12 +20,12 @@ public class FT_Polluting extends FluidTrait {
//original draft had both of them inside a hashmap for the release type but honestly handling hash maps in hash maps adds more complexity than it removes
public HashMap<PollutionType, Float> releaseMap = new HashMap();
public HashMap<PollutionType, Float> burnMap = new HashMap();
public FT_Polluting release(PollutionType type, float amount) {
releaseMap.put(type, amount);
return this;
}
public FT_Polluting burn(PollutionType type, float amount) {
burnMap.put(type, amount);
return this;
@ -38,12 +38,12 @@ public class FT_Polluting extends FluidTrait {
@Override
public void addInfoHidden(List<String> info) {
if(!this.releaseMap.isEmpty()) {
info.add(EnumChatFormatting.GREEN + "When spilled:");
for(Entry<PollutionType, Float> entry : releaseMap.entrySet()) info.add(EnumChatFormatting.GREEN + " - " + entry.getValue() + " " + entry.getKey() + " per mB");
}
if(!this.burnMap.isEmpty()) {
info.add(EnumChatFormatting.RED + "When burned:");
for(Entry<PollutionType, Float> entry : burnMap.entrySet()) info.add(EnumChatFormatting.RED + " - " + entry.getValue() + " " + entry.getKey() + " per mB");
@ -60,16 +60,16 @@ public class FT_Polluting extends FluidTrait {
public void serializeJSON(JsonWriter writer) throws IOException {
writer.name("release").beginObject();
for(Entry<PollutionType, Float> entry : releaseMap.entrySet()) {
writer.name(entry.toString()).value(entry.getValue());
writer.name(entry.getKey().name()).value(entry.getValue());
}
writer.endObject();
writer.name("burn").beginObject();
for(Entry<PollutionType, Float> entry : burnMap.entrySet()) {
writer.name(entry.toString()).value(entry.getValue());
writer.name(entry.getKey().name()).value(entry.getValue());
}
writer.endObject();
}
@Override
public void deserializeJSON(JsonObject obj) {
if(obj.has("release")) {
@ -89,14 +89,14 @@ public class FT_Polluting extends FluidTrait {
}
}
}
public static void pollute(World world, int x, int y, int z, FluidType type, FluidReleaseType release, float mB) {
FT_Polluting trait = type.getTrait(FT_Polluting.class);
if(trait == null) return;
if(release == FluidReleaseType.VOID) return;
HashMap<PollutionType, Float> map = release == FluidReleaseType.BURN ? trait.burnMap : trait.releaseMap;
for(Entry<PollutionType, Float> entry : map.entrySet()) {
PollutionHandler.incrementPollution(world, x, y, z, entry.getKey(), entry.getValue() * mB);
}

View File

@ -282,7 +282,9 @@ public class GUIMachineAmmoPress extends GuiInfoContainer {
GL11.glDisable(GL11.GL_BLEND);
}
}
RenderHelper.disableStandardItemLighting();
GL11.glColor4f(1F, 1F, 1F, 1F);
this.search.drawTextBox();
}

View File

@ -137,13 +137,13 @@ public class Mats {
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xFFBA7D, 0xAF1700, 0xE44C0F).setAutogen(WIRE, DUST, BLOCK).m();
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF8330, 0x700000, 0xFF7318).setAutogen(WIRE, DUST, DENSEWIRE, PLATE, CASTPLATE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0x183039, 0x030B0B, 0x376373).setAutogen(BOLT, DUST, PIPE, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, GRIP).m();
public static final NTMMaterial MAT_DESH = makeSmeltable(_AS + 12, DESH, 0xFF6D6D, 0x720000, 0xF22929).setAutogen(DUST, CASTPLATE, BLOCK, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_DESH = makeSmeltable(_AS + 12, DESH, 0xFF6D6D, 0x720000, 0xF22929).setAutogen(DUST, CASTPLATE, BLOCK, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, STOCK, GRIP).m();
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0xCCCCEA, 0x11111A, 0xA5A5D3).setAutogen(DUST, DENSEWIRE, BLOCK).m();
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).m();
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setAutogen(DUST, CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setAutogen(CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT).m();
public static final NTMMaterial MAT_BBRONZE = makeSmeltable(_AS + 16, BBRONZE, 0xE19A69, 0x485353, 0x987D65).setAutogen(CASTPLATE).m();
public static final NTMMaterial MAT_ABRONZE = makeSmeltable(_AS + 17, ABRONZE, 0xDB9462, 0x203331, 0x77644D).setAutogen(CASTPLATE).m();
public static final NTMMaterial MAT_FERRO = makeSmeltable(_AS + 7, FERRO, 0xB7B7C9, 0x101022, 0x6B6B8B).setAutogen(HEAVYBARREL, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_TCALLOY = makeSmeltable(_AS + 6, TCALLOY, 0xD4D6D6, 0x323D3D, 0x9CA6A6).setAutogen(DUST, CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_CDALLOY = makeSmeltable(_AS + 13, CDALLOY, 0xF7DF8F, 0x604308, 0xFBD368).setAutogen(CASTPLATE, WELDEDPLATE, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER).m();
public static final NTMMaterial MAT_BBRONZE = makeSmeltable(_AS + 16, BBRONZE, 0xE19A69, 0x485353, 0x987D65).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER).m();
public static final NTMMaterial MAT_ABRONZE = makeSmeltable(_AS + 17, ABRONZE, 0xDB9462, 0x203331, 0x77644D).setAutogen(CASTPLATE, LIGHTBARREL, LIGHTRECEIVER).m();
public static final NTMMaterial MAT_BSCCO = makeSmeltable(_AS + 18, BSCCO, 0x767BF1, 0x000000, 0x5E62C0).setAutogen(DENSEWIRE).m();
public static final NTMMaterial MAT_MAGTUNG = makeSmeltable(_AS + 8, MAGTUNG, 0x22A2A2, 0x0F0F0F, 0x22A2A2).setAutogen(WIRE, DUST, DENSEWIRE, BLOCK).m();
public static final NTMMaterial MAT_CMB = makeSmeltable(_AS + 9, CMB, 0x6F6FB4, 0x000011, 0x6F6FB4).setAutogen(DUST, PLATE, CASTPLATE, WELDEDPLATE, BLOCK).m();
@ -152,11 +152,16 @@ public class Mats {
public static final NTMMaterial MAT_SLAG = makeSmeltable(_AS + 11, SLAG, 0x554940, 0x34281F, 0x6C6562).setAutogen(BLOCK).n();
public static final NTMMaterial MAT_MUD = makeSmeltable(_AS + 14, MUD, 0xBCB5A9, 0x481213, 0x96783B).n();
public static final NTMMaterial MAT_GUNMETAL = makeSmeltable(_AS + 19, GUNMETAL, 0xFFEF3F, 0xAD3600, 0xF9C62C).setAutogen(LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
public static final NTMMaterial MAT_WEAPONSTEEL = makeSmeltable(_AS + 20, WEAPONSTEEL, 0xA0A0A0, 0x000000, 0x808080).setAutogen(LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0x3AC4DA, 0x09282C, 0x30A4B7).setAutogen(PLATE, CASTPLATE, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).m();
public static final NTMMaterial MAT_WEAPONSTEEL = makeSmeltable(_AS + 20, WEAPONSTEEL, 0xA0A0A0, 0x000000, 0x808080).setAutogen(SHELL, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0x3AC4DA, 0x09282C, 0x30A4B7).setAutogen(PLATE, CASTPLATE, SHELL, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).m();
//Extension
public static final NTMMaterial MAT_RAREEARTH = makeNonSmeltable(_ES + 00, RAREEARTH, 0xC1BDBD, 0x384646, 0x7B7F7F).setAutogen(FRAGMENT).n();
public static final NTMMaterial MAT_POLYMER = makeNonSmeltable(_ES + 01, POLYMER, 0x363636, 0x040404, 0x272727).setAutogen(STOCK, GRIP).n();
public static final NTMMaterial MAT_BAKELITE = makeNonSmeltable(_ES + 02, BAKELITE, 0xF28086, 0x2B0608, 0xC93940).setAutogen(STOCK, GRIP).n();
public static final NTMMaterial MAT_RUBBER = makeNonSmeltable(_ES + 03, RUBBER, 0x817F75, 0x0F0D03, 0x4B4A3F).setAutogen(PIPE, GRIP).n();
public static final NTMMaterial MAT_HARDPLASTIC = makeNonSmeltable(_ES + 04, PC, 0xEDE7C4, 0x908A67, 0xE1DBB8).setAutogen(STOCK, GRIP).n();
public static final NTMMaterial MAT_PVC = makeNonSmeltable(_ES + 05, PVC, 0xFCFCFC, 0x9F9F9F, 0xF0F0F0).setAutogen(STOCK, GRIP).n();
public static NTMMaterial makeSmeltable(int id, DictFrame dict, int color) { return makeSmeltable(id, dict, color, color, color); }

View File

@ -2,6 +2,7 @@ package com.hbm.inventory.recipes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import static com.hbm.inventory.OreDictManager.*;
@ -14,11 +15,13 @@ import com.hbm.inventory.OreDictManager.DictFrame;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class AmmoPressRecipes extends SerializableRecipe {
@ -36,9 +39,11 @@ public class AmmoPressRecipes extends SerializableRecipe {
OreDictStack copper = new OreDictStack(CU.ingot());
OreDictStack plastic = new OreDictStack(ANY_PLASTIC.ingot());
OreDictStack uranium = new OreDictStack(U238.ingot());
ComparableStack smokeful = new ComparableStack(Items.gunpowder);
OreDictStack smokeless = new OreDictStack(ANY_SMOKELESS.dust());
OreDictStack he = new OreDictStack(ANY_HIGHEXPLOSIVE.ingot());
OreDictStack wp = new OreDictStack(P_WHITE.ingot());
OreDictStack rp = new OreDictStack(P_RED.dust());
ComparableStack cSmall = new ComparableStack(ModItems.casing, 1, EnumCasingType.SMALL);
ComparableStack cBig = new ComparableStack(ModItems.casing, 1, EnumCasingType.LARGE);
ComparableStack sSmall = new ComparableStack(ModItems.casing, 1, EnumCasingType.SMALL_STEEL);
@ -46,7 +51,11 @@ public class AmmoPressRecipes extends SerializableRecipe {
ComparableStack bpShell = new ComparableStack(ModItems.casing, 1, EnumCasingType.SHOTSHELL);
ComparableStack pShell = new ComparableStack(ModItems.casing, 1, EnumCasingType.BUCKSHOT);
ComparableStack sShell = new ComparableStack(ModItems.casing, 1, EnumCasingType.BUCKSHOT_ADVANCED);
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_BP, 16),
null, lead.copy(2), null,
null, smokeful, null,
null, cSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M357_SP, 8),
null, lead, null,
null, smokeless, null,
@ -67,7 +76,11 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, steel, null,
null, smokeless.copy(3), null,
null, cSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M44_BP, 12),
null, lead.copy(2), null,
null, smokeful, null,
null, cSmall, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.M44_SP, 6),
null, lead, null,
null, smokeless, null,
@ -219,6 +232,144 @@ public class AmmoPressRecipes extends SerializableRecipe {
null, wp, null,
null, smokeless, null,
null, sShell, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G26_FLARE, 4),
null, rp, null,
null, smokeless, null,
null, cBig, null));
ComparableStack dyn = new ComparableStack(ModItems.ball_dynamite);
OreDictStack coplate = new OreDictStack(CU.plate());
OreDictStack diesel = new OreDictStack(Fluids.DIESEL.getDict(1_000));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_HE, 4),
null, dyn, null,
null, smokeless, null,
null, cBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_HEAT, 4),
coplate, he, null,
null, smokeless, null,
null, cBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_DEMO, 4),
null, he.copy(2), null,
null, smokeless, null,
null, cBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_INC, 4),
diesel, dyn, null,
null, smokeless, null,
null, cBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.G40_PHOSPHORUS, 4),
wp, he, null,
null, smokeless, null,
null, cBig, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HE, 2),
null, dyn, null,
null, cBig, null,
null, smokeless.copy(2), null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HEAT, 2),
coplate, he, null,
null, cBig, null,
null, smokeless.copy(2), null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_DEMO, 2),
null, he.copy(2), null,
null, cBig, null,
null, smokeless.copy(2), null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_INC, 2),
diesel, dyn, null,
null, cBig, null,
null, smokeless.copy(2), null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_PHOSPHORUS, 2),
wp, he, null,
null, cBig, null,
null, smokeless.copy(2), null));
OreDictStack sPlate = new OreDictStack(STEEL.plate());
ComparableStack napalm = new ComparableStack(ModItems.canister_napalm);
OreDictStack gas = new OreDictStack(Fluids.GAS.getDict(1000));
OreDictStack bf = new OreDictStack(Fluids.BALEFIRE.getDict(1000));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.FLAME_DIESEL, 1),
null, sPlate, null,
null, diesel, null,
null, sPlate, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.FLAME_NAPALM, 1),
null, sPlate, null,
null, napalm, null,
null, sPlate, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.FLAME_GAS, 1),
null, sPlate, null,
null, gas, null,
null, sPlate, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.FLAME_BALEFIRE, 1),
null, sPlate, null,
null, bf, null,
null, sPlate, null));
OreDictStack silicon = new OreDictStack(SI.billet());
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.CAPACITOR, 4),
null, plastic, null,
null, silicon.copy(4), null,
null, plastic, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.CAPACITOR_OVERCHARGE, 4),
null, plastic, null,
null, silicon.copy(6), null,
null, plastic, null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.CAPACITOR_IR, 4),
null, plastic, null,
null, silicon.copy(4), null,
null, plastic, null));
OreDictStack lPlate = new OreDictStack(PB.plate());
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.TAU_URANIUM, 16),
null, lPlate, null,
null, uranium, null,
null, lPlate , null));
OreDictStack tungsten = new OreDictStack(W.ingot());
OreDictStack ferro = new OreDictStack(FERRO.ingot());
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.COIL_TUNGSTEN, 4),
null, null, null,
null, tungsten, null,
null, null , null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.COIL_FERROURANIUM, 4),
null, null, null,
null, ferro, null,
null, null , null));
ComparableStack shell = new ComparableStack(ModItems.assembly_nuke);
ComparableStack tatb = new ComparableStack(ModItems.ball_tatb);
OreDictStack plutonium = new OreDictStack(PU239.nugget());
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_STANDARD, 1),
null, plutonium, null,
null, shell, null,
null, null , null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO, 1),
null, plutonium.copy(2), null,
null, shell, null,
null, null , null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_HIGH, 1),
null, plutonium.copy(4), null,
null, shell, null,
null, null , null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_TOTS, 1),
null, plutonium.copy(2), null,
null, tatb.copy(2), null,
null, sPlate.copy(4) , null));
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_HIVE, 1),
null, he.copy(8), null,
null, sBig.copy(2), null,
null, sPlate.copy(4), null));
}
public static HashMap getRecipes() {
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
for(AmmoPressRecipe recipe : AmmoPressRecipes.recipes) {
List<AStack> inputs = new ArrayList();
for(AStack stack : recipe.input) if(stack != null) inputs.add(stack);
recipes.put(inputs.toArray(new AStack[0]), recipe.output.copy());
}
return recipes;
}
@Override

View File

@ -224,13 +224,6 @@ public class ChemplantRecipes extends SerializableRecipe {
recipes.add(new ChemRecipe(60, "XENON_OXY", 20)
.inputFluids(new FluidStack(Fluids.OXYGEN, 250))
.outputFluids(new FluidStack(Fluids.XENON, 50)));
recipes.add(new ChemRecipe(61, "SATURN", 60)
.inputItems(
new OreDictStack(DURA.dust(), 2),
new OreDictStack(CU.dust(), 1),
new OreDictStack(COAL.dust(), 1))
.inputFluids(new FluidStack(Fluids.SULFURIC_ACID, 100))
.outputItems(new ItemStack(ModItems.ingot_saturnite, 4)));
recipes.add(new ChemRecipe(62, "BALEFIRE", 100)
.inputItems(new ComparableStack(ModItems.egg_balefire_shard))
.inputFluids(new FluidStack(Fluids.KEROSENE, 6000))

View File

@ -9,9 +9,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryCrafting;
@ -46,28 +44,6 @@ public class MagicRecipes {
recipes.add(new MagicRecipe(new ItemStack(ModItems.balefire_and_steel), new OreDictStack(STEEL.ingot()), new ComparableStack(ModItems.egg_balefire_shard)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.mysteryshovel), new ComparableStack(Items.iron_shovel), new ComparableStack(Items.bone), new ComparableStack(ModItems.ingot_starmetal), new ComparableStack(ModItems.ducttape)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.ingot_electronium), new ComparableStack(ModItems.pellet_charged), new ComparableStack(ModItems.pellet_charged), new ComparableStack(ModItems.ingot_dineutronium), new ComparableStack(ModItems.ingot_dineutronium)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_44, 1, ItemAmmoEnums.Ammo44Magnum.PIP.ordinal()),
new ComparableStack(ModItems.ammo_44),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.powder_magic)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_44, 1, ItemAmmoEnums.Ammo44Magnum.BJ.ordinal()),
new ComparableStack(ModItems.ammo_44),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.powder_desh)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_44, 1, ItemAmmoEnums.Ammo44Magnum.SILVER.ordinal()),
new ComparableStack(ModItems.ammo_44),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.ingot_starmetal)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.gun_bf),
new ComparableStack(ModItems.gun_fatman),
new ComparableStack(ModItems.egg_balefire_shard),
new ComparableStack(ModItems.powder_magic),
new ComparableStack(ModItems.powder_magic)));
recipes.add(new MagicRecipe(new ItemStack(ModItems.diamond_gavel),
new ComparableStack(ModBlocks.gravel_diamond),
@ -92,17 +68,6 @@ public class MagicRecipes {
new OreDictStack(DNT.wireDense()),
new OreDictStack(W.wireDense()),
new OreDictStack(GOLD.wireDense())));
recipes.add(new MagicRecipe(new ItemStack(ModItems.gun_darter),
new OreDictStack(STEEL.plate()),
new OreDictStack(STEEL.plate()),
new OreDictStack(ANY_PLASTIC.ingot()),
new OreDictStack(GOLD.plate())));
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_dart, 4, ItemAmmoEnums.AmmoDart.NUCLEAR.ordinal()),
new OreDictStack(ANY_RUBBER.ingot()),
new ComparableStack(ModItems.nugget_pu239),
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.CHIP)));
}
public static List<MagicRecipe> getRecipes() {

View File

@ -20,9 +20,6 @@ import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums.EnumBriquetteType;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.ItemEnums.EnumPages;
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
import com.hbm.items.ItemAmmoEnums.Ammo556mm;
import com.hbm.items.ItemAmmoEnums.AmmoLunaticSniper;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemStamp;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
@ -102,29 +99,6 @@ public class PressRecipes extends SerializableRecipe {
makeRecipe(StampType.CIRCUIT, new OreDictStack(SI.billet()), DictFrame.fromOne(ModItems.circuit, EnumCircuitType.SILICON));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_iron), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.IRON));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_steel), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.LEAD));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_lead), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.NUCLEAR));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_gold), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.GOLD));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_schrabidium), ModItems.ammo_357.stackFromEnum(6, Ammo357Magnum.SCHRABIDIUM));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_nightmare), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.NIGHTMARE1));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_desh), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.DESH));
makeRecipe(StampType.C357, new OreDictStack(STEEL.ingot()), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.STEEL));
makeRecipe(StampType.C44, new ComparableStack(ModItems.assembly_nopip), new ItemStack(ModItems.ammo_44, 24));
makeRecipe(StampType.C44, new ComparableStack(ModItems.assembly_45), new ItemStack(ModItems.ammo_45, 32));
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_smg), new ItemStack(ModItems.ammo_9mm, 32));
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_uzi), new ItemStack(ModItems.ammo_22lr, 32));
makeRecipe(StampType.C9, new OreDictStack(GOLD.ingot()), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.GOLD));
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_lacunae), new ItemStack(ModItems.ammo_5mm, 64));
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_556), new ItemStack(ModItems.ammo_556, 32));
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_calamity), new ItemStack(ModItems.ammo_50bmg, 12));
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_actionexpress), new ItemStack(ModItems.ammo_50ae, 12));
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_luna), ModItems.ammo_luna_sniper.stackFromEnum(4, AmmoLunaticSniper.SABOT));
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_762), new ItemStack(ModItems.ammo_762, 32));
makeRecipe(StampType.PRINTING1, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE1));
makeRecipe(StampType.PRINTING2, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE2));
makeRecipe(StampType.PRINTING3, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE3));

View File

@ -43,10 +43,10 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(4)), 200, 100, new OreDictStack(IRON.fragment(), 9), new OreDictStack(ANY_COKE.gem()), new ComparableStack(ModItems.powder_flux)));
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_DESH, INGOT.q(1)), 100, 200, new FluidStack(Fluids.LIGHTOIL, 100), new ComparableStack(ModItems.powder_desh_ready)));
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_SATURN, INGOT.q(2)), 200, 400, new FluidStack(Fluids.HEATINGOIL, 250), new OreDictStack(DURA.dust(), 2), new OreDictStack(CU.dust())));
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_GUNMETAL, INGOT.q(4)), 200, 100, new OreDictStack(CU.ingot(), 3), new OreDictStack(AL.ingot(), 1)));
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_WEAPONSTEEL, INGOT.q(1)), 200, 400, new FluidStack(Fluids.GAS_COKER, 100), new OreDictStack(STEEL.ingot(), 1), new ComparableStack(ModItems.powder_flux, 2)));
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_SATURN, INGOT.q(2)), 200, 400, new FluidStack(Fluids.REFORMGAS, 250), new OreDictStack(DURA.dust(), 4), new OreDictStack(CU.dust())));
}
public static HashMap getRecipes() {

View File

@ -18,7 +18,6 @@ import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.NTMMaterial;
import com.hbm.inventory.recipes.AssemblerRecipes;
import com.hbm.inventory.recipes.AssemblerRecipes.AssemblerRecipe;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ItemEnums.EnumChunkType;
import com.hbm.items.ModItems;
import com.hbm.items.food.ItemFlask.EnumInfusion;
@ -27,7 +26,6 @@ import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
@ -83,10 +81,11 @@ public class AnvilRecipes {
smithingRecipes.add(new AnvilSmithingHotRecipe(3, new ItemStack(ModItems.cobalt_decorated_shovel, 1), new ComparableStack(ModItems.cobalt_shovel), new ComparableStack(ModItems.ingot_meteorite)));
smithingRecipes.add(new AnvilSmithingHotRecipe(3, new ItemStack(ModItems.cobalt_decorated_hoe, 1), new ComparableStack(ModItems.cobalt_hoe), new ComparableStack(ModItems.ingot_meteorite)));
smithingRecipes.add(new AnvilSmithingRecipe(1, new ItemStack(ModItems.gun_ar15, 1), new ComparableStack(ModItems.gun_thompson), new ComparableStack(ModItems.pipe_lead)));
smithingRecipes.add(new AnvilSmithingRecipe(1916169, new ItemStack(ModItems.wings_murk, 1), new ComparableStack(ModItems.wings_limp), new ComparableStack(ModItems.particle_tachyon)));
smithingRecipes.add(new AnvilSmithingRecipe(4, new ItemStack(ModItems.flask_infusion, 1, EnumInfusion.SHIELD.ordinal()), new ComparableStack(ModItems.gem_alexandrite), new ComparableStack(ModItems.bottle_nuka)));
smithingRecipes.add(new AnvilSmithingRecipe(1, new ItemStack(ModItems.ingot_gunmetal, 1), new OreDictStack(CU.ingot()), new OreDictStack(AL.ingot())));
smithingRecipes.add(new AnvilSmithingMold(0, new OreDictStack(GOLD.nugget()), new OreDictStack("nugget")));
smithingRecipes.add(new AnvilSmithingMold(1, new OreDictStack(U.billet()), new OreDictStack("billet")));
smithingRecipes.add(new AnvilSmithingMold(2, new OreDictStack(IRON.ingot()), new OreDictStack("ingot")));
@ -144,10 +143,12 @@ public class AnvilRecipes {
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(PB.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_lead))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CU.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_copper))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(ALLOY.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_advanced_alloy))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(SA326.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_schrabidium))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CMB.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_combine_steel))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(GUNMETAL.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_gunmetal))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(WEAPONSTEEL.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_weaponsteel))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(BIGMT.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_saturnite))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(DURA.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_dura_steel))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(SA326.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_schrabidium))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CMB.ingot()), new AnvilOutput(new ItemStack(ModItems.plate_combine_steel))).setTier(3));
for(NTMMaterial mat : Mats.orderedList) {
if(mat.autogen.contains(MaterialShapes.WIRE) && OreDictionary.doesOreNameExist(MaterialShapes.INGOT.make(mat))) {
@ -184,9 +185,13 @@ public class AnvilRecipes {
for(NTMMaterial mat : Mats.orderedList) if(mat.autogen.contains(MaterialShapes.SHELL)) constructionRecipes.add(new AnvilConstructionRecipe(
new OreDictStack(MaterialShapes.PLATE.name() + mat.names[0], 4),
new AnvilOutput(new ItemStack(ModItems.shell, 1, mat.id))).setTier(1));
for(NTMMaterial mat : Mats.orderedList) if(mat.autogen.contains(MaterialShapes.PIPE)) constructionRecipes.add(new AnvilConstructionRecipe(
new OreDictStack(MaterialShapes.PLATE.name() + mat.names[0], 3),
new AnvilOutput(new ItemStack(ModItems.pipe, 1, mat.id))).setTier(1));
for(NTMMaterial mat : Mats.orderedList) if(mat.autogen.contains(MaterialShapes.PIPE)) {
String key = (OreDictionary.doesOreNameExist(MaterialShapes.PLATE.name() + mat.names[0]) ?
MaterialShapes.PLATE.name() + mat.names[0] : MaterialShapes.INGOT.name() + mat.names[0]);
constructionRecipes.add(new AnvilConstructionRecipe(
new OreDictStack(key, 3),
new AnvilOutput(new ItemStack(ModItems.pipe, 1, mat.id))).setTier(1));
}
constructionRecipes.add(new AnvilConstructionRecipe(
new ComparableStack(ModItems.coil_copper, 2),
@ -522,13 +527,13 @@ public class AnvilRecipes {
new AStack[] {new OreDictStack(TI.plate(), 2), new OreDictStack(STEEL.ingot(), 1), new OreDictStack(STEEL.bolt(), 4)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_titanium))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack(IRON.plate(), 4), new OreDictStack(BIGMT.plate(), 2), new ComparableStack(ModItems.plate_armor_titanium, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_ajr))).setTier(3));
new AStack[] {new OreDictStack(IRON.plate(), 6), new OreDictStack(NB.ingot(), 1), new ComparableStack(ModItems.plate_armor_titanium, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_ajr, 2))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack(ALLOY.plate(), 4), new ComparableStack(ModItems.plate_armor_titanium, 1), new OreDictStack(W.wireFine(), 6)},
new AStack[] {new OreDictStack(ALLOY.plate(), 4), new ComparableStack(ModItems.plate_armor_titanium, 1), new OreDictStack(W.wireFine(), 8)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_hev))).setTier(4));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(STAR.ingot(), 1), new OreDictStack(MAGTUNG.wireFine(), 6)},
new AStack[] {new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(STAR.ingot(), 1), new OreDictStack(MAGTUNG.wireFine(), 8)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_lunar))).setTier(4));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new ComparableStack(ModItems.ingot_meteorite_forged, 4), new OreDictStack(DESH.ingot(), 1), new ComparableStack(ModItems.billet_yharonite, 1)},
@ -570,6 +575,11 @@ public class AnvilRecipes {
public static void registerConstructionAmmo() {
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.stamp_iron_flat), new OreDictStack(GUNMETAL.ingot(), 2)}, new AnvilOutput(new ItemStack(ModItems.stamp_9))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.stamp_iron_flat), new OreDictStack(GUNMETAL.ingot(), 2)}, new AnvilOutput(new ItemStack(ModItems.stamp_50))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.stamp_desh_flat), new OreDictStack(WEAPONSTEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.stamp_desh_9))).setTier(4));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.stamp_desh_flat), new OreDictStack(WEAPONSTEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.stamp_desh_50))).setTier(4));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 22))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 23))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 24))).setTier(2));
@ -578,112 +588,8 @@ public class AnvilRecipes {
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 27))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 28))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CU.plate()), new AnvilOutput(new ItemStack(ModItems.casing_357))).setTier(1));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CU.plate()), new AnvilOutput(new ItemStack(ModItems.casing_44))).setTier(1));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CU.plate()), new AnvilOutput(new ItemStack(ModItems.casing_9))).setTier(1));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CU.plate()), new AnvilOutput(new ItemStack(ModItems.casing_50))).setTier(1));
constructionRecipes.add(new AnvilConstructionRecipe(new OreDictStack(CU.plate()), new AnvilOutput(new ItemStack(ModItems.casing_buckshot))).setTier(1));
pullFromAssembler(new ComparableStack(ModItems.pellet_buckshot), 1);
pullFromAssembler(new ComparableStack(ModItems.pellet_canister), 1);
constructionRecipes.add(new AnvilConstructionRecipe( new AStack[]{
new ComparableStack(ModItems.powder_chlorophyte, 1),
new OreDictStack(PB.nugget(), 12),},
new AnvilOutput(new ItemStack(ModItems.pellet_chlorophyte, 2))).setTier(1));
Object[][] recs = new Object[][] {
{ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.STOCK), P_RED.dust(), ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.INCENDIARY), 2},
{ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.STOCK), Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.SHRAPNEL), 2},
{ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.STOCK), U238.ingot(), ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.DU), 3},
{ModItems.ammo_12gauge.stackFromEnum(120, Ammo12Gauge.STOCK), ModItems.coin_maskman, ModItems.ammo_12gauge.stackFromEnum(120, Ammo12Gauge.SLEEK), 4},
{ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK), P_RED.dust(), ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.INCENDIARY), 2},
{ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK), Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.SHRAPNEL), 2},
{ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK), ModItems.powder_poison, ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.CAUSTIC), 2},
{ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK), DIAMOND.dust(), ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.SHOCK), 2},
{ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK), Item.getItemFromBlock(Blocks.soul_sand), ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.WITHER), 3},
{ModItems.ammo_20gauge.stackFromEnum(120, Ammo20Gauge.STOCK), ModItems.coin_maskman, ModItems.ammo_20gauge.stackFromEnum(120, Ammo20Gauge.SLEEK), 4},
{ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.FLECHETTE), P_WHITE.ingot(), ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.FLECHETTE_PHOSPHORUS), 2},
{ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.EXPLOSIVE), ModItems.egg_balefire_shard, ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.BALEFIRE), 4},
{ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.EXPLOSIVE), ModItems.ammo_rocket, ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.KAMPF), 2},
{ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.KAMPF), ModItems.pellet_canister, ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.CANISTER), 3},
{ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.STOCK), ModItems.pellet_claws, ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.CLAW), 5},
{ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.STOCK), ModItems.toothpicks, ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.VAMPIRE), 5},
{ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.STOCK), ModItems.pellet_charged, ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.VOID), 5},
{ModItems.ammo_4gauge.stackFromEnum(120, Ammo4Gauge.STOCK), ModItems.coin_maskman, ModItems.ammo_4gauge.stackFromEnum(120, Ammo4Gauge.SLEEK), 4},
{ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.STOCK), DURA.ingot(), ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.AP), 2},
{ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.STOCK), U238.ingot(), ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.DU), 2},
{ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.STOCK), P_WHITE.ingot(), ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.PHOSPHORUS), 2},
{ModItems.ammo_44.stackFromEnum(12, Ammo44Magnum.DU), STAR.ingot(), ModItems.ammo_44.stackFromEnum(12, Ammo44Magnum.STAR), 3},
{ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_44.stackFromEnum(24, Ammo44Magnum.CHLOROPHYTE), 3},
{ModItems.ammo_45.stackFromEnum(32, Ammo45ACP.STOCK), DURA.ingot(), ModItems.ammo_45.stackFromEnum(32, Ammo45ACP.AP), 3},
{ModItems.ammo_45.stackFromEnum(32, Ammo45ACP.STOCK), U238.ingot(), ModItems.ammo_45.stackFromEnum(32, Ammo45ACP.DU), 3},
{ModItems.ammo_5mm.stackFromEnum(128, Ammo5mm.STOCK), ModItems.ingot_semtex, ModItems.ammo_5mm.stackFromEnum(128, Ammo5mm.EXPLOSIVE), 2},
{ModItems.ammo_5mm.stackFromEnum(128, Ammo5mm.STOCK), U238.ingot(), ModItems.ammo_5mm.stackFromEnum(128, Ammo5mm.DU), 2},
{ModItems.ammo_5mm.stackFromEnum(32, Ammo5mm.DU), STAR.ingot(), ModItems.ammo_5mm.stackFromEnum(32, Ammo5mm.STAR), 3},
{ModItems.ammo_5mm.stackFromEnum(128, Ammo5mm.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_5mm.stackFromEnum(128, Ammo5mm.CHLOROPHYTE), 3},
{ModItems.ammo_9mm.stackFromEnum(32, Ammo9mm.STOCK), DURA.ingot(), ModItems.ammo_9mm.stackFromEnum(32, Ammo9mm.AP), 2},
{ModItems.ammo_9mm.stackFromEnum(32, Ammo9mm.STOCK), U238.ingot(), ModItems.ammo_9mm.stackFromEnum(32, Ammo9mm.DU), 2},
{ModItems.ammo_9mm.stackFromEnum(32, Ammo9mm.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_9mm.stackFromEnum(32, Ammo9mm.CHLOROPHYTE), 3},
{ModItems.ammo_22lr.stackFromEnum(32, Ammo22LR.STOCK), DURA.ingot(), ModItems.ammo_22lr.stackFromEnum(32, Ammo22LR.AP), 2},
{ModItems.ammo_22lr.stackFromEnum(32, Ammo22LR.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_22lr.stackFromEnum(32, Ammo22LR.CHLOROPHYTE), 3},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), P_RED.dust(), ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.INCENDIARY), 2},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), P_WHITE.ingot(), ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.PHOSPHORUS), 2},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), ModItems.ingot_semtex, ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.EXPLOSIVE), 2},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), DURA.ingot(), ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.AP), 2},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), U238.ingot(), ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.DU), 2},
{ModItems.ammo_50bmg.stackFromEnum(8, Ammo50BMG.DU), STAR.ingot(), ModItems.ammo_50bmg.stackFromEnum(8, Ammo50BMG.STAR), 3},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.CHLOROPHYTE), 3},
{ModItems.ammo_50bmg.stackFromEnum(128, Ammo50BMG.STOCK), ModItems.coin_maskman, ModItems.ammo_50bmg.stackFromEnum(128, Ammo50BMG.SLEEK), 4},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.STOCK), ModItems.pellet_flechette, ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.FLECHETTE), 2},
{ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.FLECHETTE), ModItems.nugget_am_mix, ModItems.ammo_50bmg.stackFromEnum(16, Ammo50BMG.FLECHETTE_AM), 3},
{ModItems.ammo_50bmg.stackFromEnum(32, Ammo50BMG.FLECHETTE), ModItems.powder_polonium, ModItems.ammo_50bmg.stackFromEnum(32, Ammo50BMG.FLECHETTE_PO), 3},
{ModItems.ammo_50ae.stackFromEnum(32, Ammo50AE.STOCK), DURA.ingot(), ModItems.ammo_50ae.stackFromEnum(32, Ammo50AE.AP), 2},
{ModItems.ammo_50ae.stackFromEnum(32, Ammo50AE.STOCK), U238.ingot(), ModItems.ammo_50ae.stackFromEnum(32, Ammo50AE.DU), 2},
{ModItems.ammo_50ae.stackFromEnum(16, Ammo50AE.DU), STAR.ingot(), ModItems.ammo_50ae.stackFromEnum(16, Ammo50AE.STAR), 3},
{ModItems.ammo_50ae.stackFromEnum(32, Ammo50AE.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_50ae.stackFromEnum(32, Ammo50AE.CHLOROPHYTE), 3},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.STOCK), P_WHITE.ingot(), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.PHOSPHORUS), 2},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.STOCK), DURA.ingot(), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.AP), 2},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.STOCK), U238.ingot(), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.DU), 2},
{ModItems.ammo_556.stackFromEnum(16, Ammo556mm.DU), STAR.ingot(), ModItems.ammo_556.stackFromEnum(16, Ammo556mm.STAR), 3},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_556.stackFromEnum(32, Ammo556mm.CHLOROPHYTE), 3},
{ModItems.ammo_556.stackFromEnum(128, Ammo556mm.STOCK), ModItems.coin_maskman, ModItems.ammo_556.stackFromEnum(128, Ammo556mm.SLEEK), 4},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.STOCK), Items.redstone, ModItems.ammo_556.stackFromEnum(32, Ammo556mm.TRACER), 2},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.STOCK), ModItems.pellet_flechette, ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE), 2},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE), P_RED.dust(), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE_INCENDIARY), 2},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE), P_WHITE.ingot(), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE_PHOSPHORUS), 2},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE), U238.ingot(), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE_DU), 2},
{ModItems.ammo_556.stackFromEnum(100, Ammo556mm.FLECHETTE), ModItems.coin_maskman, ModItems.ammo_556.stackFromEnum(128, Ammo556mm.FLECHETTE_SLEEK), 4},
{ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE), ModItems.pellet_chlorophyte, ModItems.ammo_556.stackFromEnum(32, Ammo556mm.FLECHETTE_CHLOROPHYTE), 3},
{ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.STOCK), Items.redstone, ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.TRACER), 2},
{ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.STOCK), DURA.ingot(), ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.AP), 2},
{ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.STOCK), P_WHITE.ingot(), ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.PHOSPHORUS), 2},
{ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.STOCK), U238.ingot(), ModItems.ammo_762.stackFromEnum(32, Ammo762NATO.DU), 2}
};
for(Object[] objs : recs) {
ComparableStack ammoIn = new ComparableStack((ItemStack) objs[0]);
ItemStack out = (ItemStack) objs[2];
if(objs[1] instanceof Item) {
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] { ammoIn, new ComparableStack((Item)objs[1], 1) }, new AnvilOutput(out)).setTier((int)objs[3]));
} else if(objs[1] instanceof String) {
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] { ammoIn, new OreDictStack((String)objs[1], 1) }, new AnvilOutput(out)).setTier((int)objs[3]));
}
}
}
public static void registerConstructionUpgrades() {

View File

@ -25,6 +25,7 @@ public class ItemPool {
ItemPoolsRedRoom.init();
ItemPoolsSatellite.init();
ItemPoolsPile.init();
ItemPoolsC130.init();
}
public static HashMap<String, ItemPool> pools = new HashMap();

View File

@ -0,0 +1,60 @@
package com.hbm.itempool;
import static com.hbm.lib.HbmChestContents.weighted;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import net.minecraft.util.WeightedRandomChestContent;
public class ItemPoolsC130 {
public static final String POOL_SUPPLIES = "POOL_SUPPLIES";
public static final String POOL_WEAPONS = "POOL_WEAPONS";
public static final String POOL_AMMO = "POOL_AMMO";
public static void init() {
new ItemPool(POOL_SUPPLIES) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.definitelyfood, 0, 3, 10, 25),
weighted(ModItems.syringe_metal_stimpak, 0, 1, 3, 10),
weighted(ModItems.pill_iodine, 0, 1, 2, 2),
weighted(ModItems.canister_full, Fluids.DIESEL.getID(), 1, 4, 5),
weighted(ModBlocks.machine_diesel, 0, 1, 1, 1),
weighted(ModItems.geiger_counter, 0, 1, 1, 2),
weighted(ModItems.med_bag, 0, 1, 1, 3),
weighted(ModItems.radaway, 0, 1, 5, 10),
};
}};
new ItemPool(POOL_WEAPONS) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.gun_light_revolver, 0, 1, 1, 10),
weighted(ModItems.gun_henry, 0, 1, 1, 10),
weighted(ModItems.gun_maresleg, 0, 1, 1, 10),
weighted(ModItems.gun_greasegun, 0, 1, 1, 10),
weighted(ModItems.gun_carbine, 0, 1, 1, 5),
weighted(ModItems.gun_heavy_revolver, 0, 1, 1, 5),
weighted(ModItems.gun_panzerschreck, 0, 1, 1, 2),
};
}};
new ItemPool(POOL_AMMO) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.ammo_standard, EnumAmmo.M357_SP.ordinal(), 12, 12, 10),
weighted(ModItems.ammo_standard, EnumAmmo.M357_FMJ.ordinal(), 6, 6, 10),
weighted(ModItems.ammo_standard, EnumAmmo.M44_SP.ordinal(), 12, 12, 5),
weighted(ModItems.ammo_standard, EnumAmmo.M44_FMJ.ordinal(), 6, 6, 5),
weighted(ModItems.ammo_standard, EnumAmmo.P9_SP.ordinal(), 12, 12, 10),
weighted(ModItems.ammo_standard, EnumAmmo.P9_FMJ.ordinal(), 6, 6, 10),
weighted(ModItems.ammo_standard, EnumAmmo.R762_SP.ordinal(), 6, 6, 5),
weighted(ModItems.ammo_standard, EnumAmmo.G12_BP.ordinal(), 6, 6, 10),
weighted(ModItems.ammo_standard, EnumAmmo.ROCKET_HE.ordinal(), 1, 1, 3),
};
}};
}
}

View File

@ -77,7 +77,6 @@ public class ItemPoolsComponent {
weighted(ModItems.gas_mask_m65, 0, 1, 1, 5),
weighted(ModItems.battery_advanced, 0, 1, 1, 5),
weighted(ModItems.designator, 0, 1, 1, 5),
weighted(ModItems.crate_caller, 0, 1, 1, 1),
weighted(ModItems.thruster_small, 0, 1, 1, 5),
weighted(ModItems.thruster_medium, 0, 1, 1, 4),
weighted(ModItems.fuel_tank_small, 0, 1, 1, 5),

View File

@ -3,11 +3,10 @@ package com.hbm.itempool;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.material.Mats;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.items.machine.ItemBreedingRod.BreedingRodType;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import static com.hbm.lib.HbmChestContents.*;
@ -43,11 +42,12 @@ public class ItemPoolsLegacy {
weighted(ModItems.ingot_beryllium, 0, 1, 2, 4),
weighted(ModItems.ingot_titanium, 0, 1, 1, 3),
weighted(ModItems.circuit, EnumCircuitType.VACUUM_TUBE.ordinal(), 1, 1, 5),
weighted(ModItems.gun_revolver, 0, 1, 1, 3),
weighted(ModItems.ammo_357, Ammo357Magnum.LEAD.ordinal(), 2, 6, 4),
weighted(ModItems.gun_light_revolver, 0, 1, 1, 3),
weighted(ModItems.ammo_standard, EnumAmmo.M357_SP.ordinal(), 2, 6, 4),
weighted(ModItems.ammo_standard, EnumAmmo.G12_BP.ordinal(), 3, 6, 3),
weighted(ModItems.ammo_standard, EnumAmmo.G26_FLARE_SUPPLY.ordinal(), 1, 1, 1),
weighted(ModItems.gun_kit_1, 0, 1, 3, 4),
weighted(ModItems.gun_lever_action, 0, 1, 1, 1),
weighted(ModItems.ammo_20gauge, 0, 2, 6, 3),
weighted(ModItems.casing_9, 0, 4, 10, 3),
weighted(ModItems.casing_50, 0, 4, 10, 3),
weighted(ModItems.cordite, 0, 4, 6, 5),
@ -106,12 +106,10 @@ public class ItemPoolsLegacy {
weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 1, 1, 2),
weighted(ModItems.gun_kit_1, 0, 1, 3, 6),
weighted(ModItems.gun_kit_2, 0, 1, 2, 3),
weighted(ModItems.gun_rpg, 0, 1, 1, 4),
weighted(ModItems.ammo_rocket, 0, 1, 4, 5),
weighted(ModItems.gun_fatman, 0, 1, 1, 1),
weighted(ModItems.ammo_nuke, AmmoFatman.SAFE.ordinal(), 1, 2, 1),
weighted(ModItems.ammo_nuke, AmmoFatman.LOW.ordinal(), 1, 2, 1),
weighted(ModItems.ammo_nuke, AmmoFatman.PUMPKIN.ordinal(), 1, 2, 1),
weighted(ModItems.gun_panzerschreck, 0, 1, 1, 4),
weighted(ModItems.ammo_standard, EnumAmmo.ROCKET_HE.ordinal(), 1, 4, 5),
weighted(ModItems.ammo_standard, EnumAmmo.G26_FLARE_SUPPLY.ordinal(), 1, 1, 5),
weighted(ModItems.ammo_standard, EnumAmmo.G26_FLARE_WEAPON.ordinal(), 1, 1, 3),
weighted(ModItems.grenade_nuclear, 0, 1, 1, 2),
weighted(ModItems.grenade_smart, 0, 1, 3, 3),
weighted(ModItems.grenade_mirv, 0, 1, 1, 2),
@ -120,7 +118,6 @@ public class ItemPoolsLegacy {
weighted(ModItems.battery_advanced_cell, 0, 1, 1, 2),
weighted(ModItems.battery_schrabidium, 0, 1, 1, 1),
weighted(ModItems.syringe_awesome, 0, 1, 1, 1),
weighted(ModItems.crate_caller, 0, 1, 1, 3),
weighted(ModItems.fusion_core, 0, 1, 1, 4),
weighted(ModItems.bottle_nuka, 0, 1, 3, 6),
weighted(ModItems.bottle_quantum, 0, 1, 1, 3),
@ -194,20 +191,17 @@ public class ItemPoolsLegacy {
weighted(ModItems.t45_boots, 0, 1, 1, 15),
weighted(ModItems.t45_kit, 0, 1, 1, 3),
weighted(ModItems.fusion_core, 0, 1, 1, 10),
weighted(ModItems.gun_revolver, 0, 1, 1, 4),
weighted(ModItems.ammo_357, Ammo357Magnum.LEAD.ordinal(), 1, 24, 4),
weighted(ModItems.gun_light_revolver, 0, 1, 1, 4),
weighted(ModItems.gun_kit_1, 0, 2, 3, 4),
weighted(ModItems.gun_rpg, 0, 1, 1, 3),
weighted(ModItems.ammo_rocket, 0, 1, 6, 3),
weighted(ModItems.ammo_standard, EnumAmmo.M357_FMJ.ordinal(), 1, 24, 4),
weighted(ModItems.ammo_standard, EnumAmmo.G40_HE.ordinal(), 1, 6, 3),
weighted(ModItems.ammo_standard, EnumAmmo.G26_FLARE_WEAPON.ordinal(), 1, 1, 5),
weighted(ModItems.rod, BreedingRodType.U235.ordinal(), 1, 1, 2),
weighted(ModItems.billet_uranium_fuel, 0, 1, 1, 2),
weighted(ModItems.ingot_uranium_fuel, 0, 1, 1, 2),
weighted(ModItems.ammo_nuke, AmmoFatman.SAFE.ordinal(), 1, 2, 1),
weighted(ModItems.gun_fatman, 0, 1, 1, 1),
weighted(ModItems.bottle_nuka, 0, 1, 3, 6),
weighted(ModItems.bottle_quantum, 0, 1, 1, 3),
weighted(ModItems.stealth_boy, 0, 1, 1, 7),
weighted(ModItems.crate_caller, 0, 1, 1, 3),
weighted(ModItems.gas_mask_m65, 0, 1, 1, 5),
weighted(ModItems.gas_mask_filter, 0, 1, 1, 5),
weighted(ModItems.grenade_nuclear, 0, 1, 2, 2),

View File

@ -3,9 +3,8 @@ package com.hbm.itempool;
import static com.hbm.lib.HbmChestContents.weighted;
import com.hbm.inventory.material.Mats;
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import net.minecraft.init.Items;
import net.minecraft.util.WeightedRandomChestContent;
@ -41,14 +40,12 @@ public class ItemPoolsPile {
weighted(ModItems.steel_pickaxe, 0, 1, 1, 5),
weighted(ModItems.steel_shovel, 0, 1, 1, 5),
//Weapons
weighted(ModItems.gun_lever_action, 0, 1, 1, 5),
weighted(ModItems.gun_bio_revolver, 0, 1, 1, 1),
weighted(ModItems.gun_maresleg, 0, 1, 1, 5),
weighted(ModItems.gun_light_revolver, 0, 1, 1, 1),
weighted(ModItems.grenade_if_generic, 0, 1, 2, 5),
weighted(ModItems.ammo_20gauge, 0, 8, 8, 10),
weighted(ModItems.ammo_12gauge, 0, 4, 4, 10),
weighted(ModItems.ammo_357, Ammo357Magnum.LEAD.ordinal(), 6, 12, 10),
weighted(ModItems.ammo_standard, EnumAmmo.G12.ordinal(), 4, 4, 10),
weighted(ModItems.ammo_standard, EnumAmmo.M357_SP.ordinal(), 6, 12, 10),
weighted(ModItems.ammo_grenade, 0, 1, 1, 2),
weighted(ModItems.ammo_nuke, AmmoFatman.PUMPKIN.ordinal(), 1, 1, 1),
//Consumables
weighted(ModItems.bottle_nuka, 0, 1, 2, 20),
weighted(ModItems.bottle_quantum, 0, 1, 2, 1),
@ -96,16 +93,17 @@ public class ItemPoolsPile {
}};
//makeshift gun
new ItemPool(POOL_PILE_MAKESHIFT_GUN) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.gun_lever_action, 0, 1, 1, 10) }; }};
new ItemPool(POOL_PILE_MAKESHIFT_GUN) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.gun_maresleg, 0, 1, 1, 10) }; }};
new ItemPool(POOL_PILE_MAKESHIFT_WRENCH) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.wrench, 0, 1, 1, 10) }; }};
new ItemPool(POOL_PILE_MAKESHIFT_PLATES) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.plate_steel, 0, 1, 1, 10) }; }};
new ItemPool(POOL_PILE_MAKESHIFT_WIRE) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.wire_fine, Mats.MAT_ALUMINIUM.id, 1, 1, 10) }; }};
new ItemPool(POOL_PILE_NUKE_STORAGE) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.ammo_nuke, AmmoFatman.STOCK.ordinal(), 1, 1, 10),
weighted(ModItems.ammo_nuke, AmmoFatman.LOW.ordinal(), 1, 1, 50),
weighted(ModItems.ammo_nuke, AmmoFatman.SAFE.ordinal(), 1, 1, 50),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_STANDARD.ordinal(), 1, 1, 50),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_HIGH.ordinal(), 1, 1, 10),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_TOTS.ordinal(), 1, 1, 10),
};
}};
}

View File

@ -8,8 +8,9 @@ import com.hbm.items.ModItems;
import net.minecraft.util.WeightedRandomChestContent;
public class ItemPoolsRedRoom {
public static final String POOL_RED_PEDESTAL = "POOL_RED_PEDESTAL";
public static final String POOL_RED_WEAPON = "POOL_RED_WEAPON";
public static void init() {
@ -39,5 +40,19 @@ public class ItemPoolsRedRoom {
weighted(ModItems.gun_revolver_pip, 0, 1, 1, 5)
};
}};
//pedestal weapons
new ItemPool(POOL_RED_WEAPON) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.gun_light_revolver_dani, 0, 1, 1, 10),
weighted(ModItems.gun_maresleg_broken, 0, 1, 1, 10),
weighted(ModItems.gun_heavy_revolver_lilmac, 0, 1, 1, 10),
weighted(ModItems.gun_flamer_daybreaker, 0, 1, 1, 5),
weighted(ModItems.gun_autoshotgun_sexy, 0, 1, 1, 5),
weighted(ModItems.gun_minigun_lacunae, 0, 1, 1, 5),
weighted(ModItems.gun_hangman, 0, 1, 1, 5),
weighted(ModItems.gun_folly, 0, 1, 1, 1),
};
}};
}
}

View File

@ -4,8 +4,8 @@ import static com.hbm.lib.HbmChestContents.weighted;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import net.minecraft.init.Items;
import net.minecraft.util.WeightedRandomChestContent;
@ -47,8 +47,8 @@ public class ItemPoolsSingle {
weighted(ModItems.gun_calamity, 0, 1, 1, 1),
weighted(ModItems.bottle_quantum, 0, 1, 3, 1),
weighted(ModItems.ingot_advanced_alloy, 0, 4, 12, 1),
weighted(ModItems.ammo_50bmg, 0, 24, 48, 1),
weighted(ModItems.ammo_45, 0, 48, 64, 2),
weighted(ModItems.ammo_standard, EnumAmmo.BMG50_FMJ.ordinal(), 24, 48, 1),
weighted(ModItems.ammo_standard, EnumAmmo.P9_JHP.ordinal(), 48, 64, 2),
weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 3, 6, 1),
weighted(ModItems.gas_mask_m65, 0, 1, 1, 1),
weighted(ModItems.grenade_if_he, 0, 1, 1, 1),
@ -63,14 +63,13 @@ public class ItemPoolsSingle {
weighted(ModItems.battery_advanced_cell_4, 0, 1, 1, 1),
weighted(ModItems.powder_desh_mix, 0, 1, 5, 1),
weighted(Items.diamond, 0, 3, 6, 1),
weighted(ModItems.ammo_nuke, 0, 1, 1, 1),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_STANDARD.ordinal(), 1, 1, 1),
weighted(ModItems.ammo_container, 0, 1, 1, 1),
weighted(ModItems.grenade_nuclear, 0, 1, 1, 1),
weighted(ModItems.grenade_smart, 0, 1, 6, 1),
weighted(ModItems.powder_yellowcake, 0, 16, 24, 1),
weighted(ModItems.gun_uzi, 0, 1, 1, 1),
weighted(ModItems.gun_uzi_silencer, 0, 1, 1, 1),
weighted(ModItems.clip_uzi, 0, 1, 3, 1),
weighted(ModItems.circuit, EnumCircuitType.VACUUM_TUBE.ordinal(), 12, 16, 1),
weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 2, 6, 1)
};
@ -84,15 +83,13 @@ public class ItemPoolsSingle {
weighted(ModItems.sat_chip, 0, 1, 1, 1),
weighted(Items.diamond, 0, 5, 9, 1),
weighted(ModItems.warhead_nuclear, 0, 1, 1, 1),
weighted(ModItems.ammo_nuke, 0, 1, 3, 1),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_STANDARD.ordinal(), 1, 3, 1),
weighted(ModItems.ammo_container, 0, 1, 4, 1),
weighted(ModItems.grenade_nuclear, 0, 1, 2, 1),
weighted(ModItems.grenade_mirv, 0, 1, 1, 1),
weighted(ModItems.powder_yellowcake, 0, 26, 42, 1),
weighted(ModItems.ingot_u235, 0, 3, 6, 1),
weighted(ModItems.gun_fatman, 0, 1, 1, 1),
weighted(ModItems.gun_revolver_pip, 0, 1, 1, 1),
weighted(ModItems.clip_revolver_pip, 0, 2, 4, 1),
weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 18, 32, 1),
weighted(ModItems.circuit, EnumCircuitType.BASIC.ordinal(), 6, 12, 1)
};
@ -101,10 +98,8 @@ public class ItemPoolsSingle {
new ItemPool(POOL_VAULT_UNBREAKABLE) {{
this.pool = new WeightedRandomChestContent[] {
weighted(ModItems.ammo_container, 0, 3, 6, 1),
weighted(ModItems.clip_fatman, 0, 2, 3, 1),
weighted(ModItems.ammo_nuke, AmmoFatman.MIRV.ordinal(), 2, 3, 1),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO.ordinal(), 2, 3, 1),
weighted(ModItems.gun_mirv, 0, 1, 1, 1),
weighted(ModItems.gun_fatman, 0, 1, 1, 1),
weighted(ModItems.gun_proto, 0, 1, 1, 1),
weighted(ModItems.gun_b92, 0, 1, 1, 1),
weighted(ModItems.ingot_combine_steel, 0, 16, 28, 1),

File diff suppressed because it is too large Load Diff

View File

@ -184,13 +184,9 @@ public class ArmorDNT extends ArmorFSBPowered {
}
}
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.explosionImmune"));
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.cap", 5));
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.modifier", 0.001F));
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.vats"));
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.thermal"));
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.hardLanding"));
list.add(EnumChatFormatting.DARK_RED + " " + I18nUtil.resolveKey("armor.ignoreLimit"));
list.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.rocketBoots"));
list.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.fastFall"));
list.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.sprintBoost"));

View File

@ -3,10 +3,8 @@ package com.hbm.items.armor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
import org.lwjgl.opengl.GL11;
@ -28,7 +26,6 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
@ -51,21 +48,12 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
private String texture = "";
private ResourceLocation overlay = null;
public List<PotionEffect> effects = new ArrayList<PotionEffect>();
public HashMap<String, Float> resistance = new HashMap<String, Float>();
public float blastProtection = -1;
public float projectileProtection = -1;
public float damageCap = -1;
public float damageMod = -1;
public float damageThreshold = 0;
public float protectionYield = 100F;
public boolean fireproof = false;
public boolean noHelmet = false;
public boolean vats = false;
public boolean thermal = false;
public boolean geigerSound = false;
public boolean customGeiger = false;
public boolean hardLanding = false;
public double gravity = 0;
public int dashCount = 0;
public int stepSize = 0;
public String step;
@ -82,46 +70,6 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
return this;
}
public ArmorFSB addResistance(String damage, float mod) {
resistance.put(damage, mod);
return this;
}
public ArmorFSB setCap(float cap) {
this.damageCap = cap;
return this;
}
public ArmorFSB setMod(float mod) {
this.damageMod = mod;
return this;
}
public ArmorFSB setThreshold(float threshold) {
this.damageThreshold = threshold;
return this;
}
public ArmorFSB setProtectionLevel(float damageYield) {
this.protectionYield = damageYield;
return this;
}
public ArmorFSB setBlastProtection(float blastProtection) {
this.blastProtection = blastProtection;
return this;
}
public ArmorFSB setProjectileProtection(float projectileProtection) {
this.projectileProtection = projectileProtection;
return this;
}
public ArmorFSB setFireproof(boolean fire) {
this.fireproof = fire;
return this;
}
public ArmorFSB setNoHelmet(boolean noHelmet) {
this.noHelmet = noHelmet;
return this;
@ -151,11 +99,6 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
this.hardLanding = hardLanding;
return this;
}
public ArmorFSB setGravity(double gravity) {
this.gravity = gravity;
return this;
}
public ArmorFSB setDashCount(int dashCount) {
this.dashCount = dashCount;
@ -191,21 +134,12 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
//lists aren't being modified after instantiation, so there's no need to dereference
this.effects = original.effects;
this.resistance = original.resistance;
this.damageCap = original.damageCap;
this.damageMod = original.damageMod;
this.damageThreshold = original.damageThreshold;
this.protectionYield = original.protectionYield;
this.blastProtection = original.blastProtection;
this.projectileProtection = original.projectileProtection;
this.fireproof = original.fireproof;
this.noHelmet = original.noHelmet;
this.vats = original.vats;
this.thermal = original.thermal;
this.geigerSound = original.geigerSound;
this.customGeiger = original.customGeiger;
this.hardLanding = original.hardLanding;
this.gravity = original.gravity;
this.dashCount = original.dashCount;
this.stepSize = original.stepSize;
this.step = original.step;
@ -222,85 +156,29 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add(EnumChatFormatting.GOLD + I18nUtil.resolveKey("armor.fullSetBonus"));
List toAdd = new ArrayList();
if(!effects.isEmpty()) {
List potionList = new ArrayList();
for(PotionEffect effect : effects) {
list.add(EnumChatFormatting.AQUA + " " + I18n.format(Potion.potionTypes[effect.getPotionID()].getName()));
potionList.add(I18n.format(Potion.potionTypes[effect.getPotionID()].getName()));
}
toAdd.add(EnumChatFormatting.AQUA + String.join(", ", potionList));
}
if(!resistance.isEmpty()) {
if(geigerSound) toAdd.add(EnumChatFormatting.GOLD + " " + I18nUtil.resolveKey("armor.geigerSound"));
if(customGeiger) toAdd.add(EnumChatFormatting.GOLD + " " + I18nUtil.resolveKey("armor.geigerHUD"));
if(vats) toAdd.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.vats"));
if(thermal) toAdd.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.thermal"));
if(hardLanding) toAdd.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.hardLanding"));
if(stepSize != 0) toAdd.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.stepSize", stepSize));
if(dashCount > 0) toAdd.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.dash", dashCount));
for(Entry<String, Float> struct : resistance.entrySet()) {
if(struct.getValue() != 0)
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.damageModifier", struct.getValue(), I18n.format(struct.getKey())));
else
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.nullDamage", I18n.format(struct.getKey())));
}
}
if(blastProtection != -1) {
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.blastProtection", blastProtection));
}
if(projectileProtection != -1) {
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.projectileProtection", projectileProtection));
}
if(damageCap != -1) {
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.cap", damageCap));
}
if(damageMod != -1) {
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.modifier", damageMod));
}
if(damageThreshold > 0) {
list.add(EnumChatFormatting.YELLOW + " " + I18nUtil.resolveKey("armor.threshold", damageThreshold));
}
if(fireproof) {
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.fireproof"));
}
if(geigerSound) {
list.add(EnumChatFormatting.GOLD + " " + I18nUtil.resolveKey("armor.geigerSound"));
}
if(customGeiger) {
list.add(EnumChatFormatting.GOLD + " " + I18nUtil.resolveKey("armor.geigerHUD"));
}
if(vats) {
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.vats"));
}
if(thermal) {
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.thermal"));
}
if(hardLanding) {
list.add(EnumChatFormatting.RED + " " + I18nUtil.resolveKey("armor.hardLanding"));
}
if(gravity != 0) {
list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.gravity", gravity));
}
if(stepSize != 0) {
list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.stepSize", stepSize));
}
if(dashCount > 0) {
list.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.dash", dashCount));
}
if(protectionYield != 100F) {
list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.yield", protectionYield));
if(!toAdd.isEmpty()) {
list.add(EnumChatFormatting.GOLD + I18nUtil.resolveKey("armor.fullSetBonus"));
list.addAll(toAdd);
}
}
@ -359,80 +237,6 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
return false;
}
public void handleAttack(LivingAttackEvent event) {
EntityLivingBase e = event.entityLiving;
if(e instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) e;
if(ArmorFSB.hasFSBArmor(player)) {
ItemStack plate = player.inventory.armorInventory[2];
ArmorFSB chestplate = (ArmorFSB) plate.getItem();
if(chestplate.damageThreshold >= event.ammount && !event.source.isUnblockable()) {
event.setCanceled(true);
}
if(chestplate.fireproof && event.source.isFireDamage()) {
player.extinguish();
event.setCanceled(true);
}
if(chestplate.resistance.get(event.source.getDamageType()) != null && chestplate.resistance.get(event.source.getDamageType()) <= 0) {
event.setCanceled(true);
}
}
}
}
public void handleHurt(LivingHurtEvent event) {
EntityLivingBase e = event.entityLiving;
if(e instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) e;
if(ArmorFSB.hasFSBArmor(player)) {
ArmorFSB chestplate = (ArmorFSB) player.inventory.armorInventory[2].getItem();
//store any damage above the yield
float overFlow = Math.max(0, event.ammount - chestplate.protectionYield);
//reduce the damage to the yield cap if it exceeds the yield
event.ammount = Math.min(event.ammount, chestplate.protectionYield);
if(!event.source.isUnblockable())
event.ammount -= chestplate.damageThreshold;
if(chestplate.damageMod != -1) {
event.ammount *= chestplate.damageMod;
}
if(chestplate.resistance.get(event.source.getDamageType()) != null) {
event.ammount *= chestplate.resistance.get(event.source.getDamageType());
}
if(chestplate.blastProtection != -1 && event.source.isExplosion()) {
event.ammount *= chestplate.blastProtection;
}
if(chestplate.projectileProtection != -1 && event.source.isProjectile()) {
event.ammount *= chestplate.projectileProtection;
}
if(chestplate.damageCap != -1) {
event.ammount = Math.min(event.ammount, chestplate.damageCap);
}
//add back anything that was above the protection yield before
event.ammount += overFlow;
}
}
}
public void handleTick(TickEvent.PlayerTickEvent event) {
EntityPlayer player = event.player;
@ -450,9 +254,6 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
}
}
if(!player.capabilities.isFlying && !player.isInWater())
player.motionY -= chestplate.gravity;
if(chestplate.step != null && player.worldObj.isRemote && player.onGround) {
try {
@ -531,14 +332,9 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
@Override
public void onArmorTick(World world, EntityPlayer entity, ItemStack stack) {
if(this.armorType != 1)
return;
if(!hasFSBArmor(entity) || !this.geigerSound)
return;
if(entity.inventory.hasItem(ModItems.geiger_counter) || entity.inventory.hasItem(ModItems.dosimeter))
return;
if(this.armorType != 1) return;
if(!hasFSBArmor(entity) || !this.geigerSound) return;
if(entity.inventory.hasItem(ModItems.geiger_counter) || entity.inventory.hasItem(ModItems.dosimeter)) return;
if(world.getTotalWorldTime() % 5 == 0) {
@ -560,26 +356,20 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
int r = list.get(world.rand.nextInt(list.size()));
if(r > 0)
world.playSoundAtEntity(entity, "hbm:item.geiger" + r, 1.0F, 1.0F);
if(r > 0) world.playSoundAtEntity(entity, "hbm:item.geiger" + r, 1.0F, 1.0F);
}
}
}
public static int check(World world, int x, int y, int z) {
int rads = (int) Math.ceil(ChunkRadiationManager.proxy.getRadiation(world, x, y, z));
return rads;
}
// For crazier stuff not possible without hooking the event
@SideOnly(Side.CLIENT)
public void handleOverlay(RenderGameOverlayEvent.Pre event, EntityPlayer player) {
}
@SideOnly(Side.CLIENT) public void handleOverlay(RenderGameOverlayEvent.Pre event, EntityPlayer player) { }
public boolean isArmorEnabled(ItemStack stack) {
return true;
}
public boolean isArmorEnabled(ItemStack stack) { return true; }
@SideOnly(Side.CLIENT)
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
@ -624,4 +414,7 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
public boolean disablesPart(EntityPlayer player, ItemStack stack, EnumPlayerPart part) {
return hidden.contains(part) && (!needsFullSet || hasFSBArmorIgnoreCharge(player));
}
public void handleAttack(LivingAttackEvent event) { }
public void handleHurt(LivingHurtEvent event) { }
}

View File

@ -9,6 +9,7 @@ import com.hbm.entity.projectile.EntityBoxcar;
import com.hbm.explosion.ExplosionChaos;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
@ -111,8 +112,8 @@ public class ItemGlitch extends Item implements IBatteryItem {
player.addChatMessage(new ChatComponentText("89% of magic tricks are not magic. Technically, they are sorcery."));
break;
case 18:
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_lever_action));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge, 12));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_maresleg));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_standard, 12, EnumAmmo.G12.ordinal()));
player.addChatMessage(new ChatComponentText("Here ya go."));
break;
case 19:

View File

@ -37,10 +37,7 @@ public class ItemBombCaller extends Item {
case 5: list.add("Type: VT stinger rockets"); break;
case 6: list.add("Type: PIP OH GOD"); break;
case 7: list.add("Type: Cloud the cloud oh god the cloud"); break;
default: list.add("Type: INVALID, Report it to mod creator");
}
}
@Override

View File

@ -1,70 +0,0 @@
package com.hbm.items.tool;
import java.util.List;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemCrateCaller extends Item {
Random rand = new Random();
public ItemCrateCaller() {
this.canRepair = false;
this.setMaxDamage(4);
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
list.add("Right click to request supply drop!");
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
stack.damageItem(1, player);
int x = rand.nextInt(31) - 15;
int z = rand.nextInt(31) - 15;
Block crate = ModBlocks.crate;
int i = rand.nextInt(1000);
if(i < 350)
crate = ModBlocks.crate_weapon;
if(i < 100)
crate = ModBlocks.crate_metal;
if(i < 50)
crate = ModBlocks.crate_lead;
if(i == 0)
crate = ModBlocks.crate_red;
if(!world.isRemote)
{
if(world.getBlock((int)player.posX + x, 255, (int)player.posZ + z) == Blocks.air)
world.setBlock((int)player.posX + x, 255, (int)player.posZ + z, crate);
}
if(world.isRemote)
{
player.addChatMessage(new ChatComponentText("Called in supply drop!"));
}
world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
player.swingItem();
return stack;
}
}

View File

@ -0,0 +1,54 @@
package com.hbm.items.tool;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemRepairKit extends Item {
public ItemRepairKit(int dura) {
this.setMaxStackSize(1);
this.setMaxDamage(dura - 1);
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(world.isRemote) return stack;
boolean didSomething = false;
for(int i = 0; i < 9; i++) {
ItemStack item = player.inventory.mainInventory[i];
if(item != null && item.getItem() instanceof ItemGunBaseNT) {
ItemGunBaseNT gun = (ItemGunBaseNT) item.getItem();
int configs = gun.getConfigCount();
for(int j = 0; j < configs; j++) {
GunConfig cfg = gun.getConfig(item, j);
float maxDura = cfg.getDurability(item);
float wear = Math.min(gun.getWear(item, j), maxDura);
if(wear > 0) {
gun.setWear(item, j, Math.max(0F, gun.getWear(item, j) - maxDura * 0.25F));
didSomething = true;
}
}
}
}
if(didSomething) {
if(this == ModItems.gun_kit_1) world.playSoundAtEntity(player, "hbm:item.spray", 1.0F, 1.0F);
if(this == ModItems.gun_kit_2) world.playSoundAtEntity(player, "hbm:item.repair", 1.0F, 1.0F);
stack.damageItem(1, player);
}
return stack;
}
}

View File

@ -1,270 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
import com.hbm.entity.logic.EntityNukeExplosionMK3;
import com.hbm.entity.projectile.EntityModBeam;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunB93 extends Item {
Random rand = new Random();
public int dmgMin = 16;
public int dmgMax = 28;
public GunB93() {
this.maxStackSize = 1;
}
@Override
public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {
if (!p_77615_3_.isSneaking()) {
int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_;
ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j);
MinecraftForge.EVENT_BUS.post(event);
j = event.charge;
boolean flag = true;
if (flag) {
float f = j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if (j < 10.0D) {
return;
}
if (j > 10.0F) {
f = 10.0F;
}
if (!p_77615_2_.isRemote) {
EntityModBeam entityarrow1;
entityarrow1 = new EntityModBeam(p_77615_2_, p_77615_3_, 3.0F);
entityarrow1.mode = getPower(p_77615_1_) - 1;
p_77615_1_.damageItem(1, p_77615_3_);
p_77615_2_.spawnEntityInWorld(entityarrow1);
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.sparkShoot", 5.0F, 1.0F);
}
setAnim(p_77615_1_, 1);
setPower(p_77615_1_, 0);
}
} else {
}
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) {
int j = getAnim(stack);
if (j > 0) {
if (j < 30)
setAnim(stack, j + 1);
else
setAnim(stack, 0);
if (j == 15) {
world.playSoundAtEntity(entity, "hbm:weapon.b92Reload", 2F, 0.9F);
setPower(stack, getPower(stack) + 1);
if(getPower(stack) > 10) {
setPower(stack, 0);
if(!world.isRemote) {
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(world, entity.posX, entity.posY, entity.posZ, 50);
if(!ex.isDead) {
world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "random.explode", 100.0f, world.rand.nextFloat() * 0.1F + 0.9F);
world.spawnEntityInWorld(ex);
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, 50);
cloud.posX = entity.posX;
cloud.posY = entity.posY;
cloud.posZ = entity.posZ;
world.spawnEntityInWorld(cloud);
}
}
}
}
}
}
@Override
public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
return p_77654_1_;
}
/**
* How long it takes to use or consume an item
*/
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
/**
* returns the action that specifies what animation to play when the items
* is being used
*/
@Override
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
return EnumAction.bow;
}
/**
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
if (!p_77659_3_.isSneaking() && getPower(p_77659_1_) > 0) {
ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
MinecraftForge.EVENT_BUS.post(event);
if (this.getAnim(p_77659_1_) == 0)
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
} else {
if (getAnim(p_77659_1_) == 0) {
setAnim(p_77659_1_, 1);
}
}
return p_77659_1_;
}
/**
* Return the enchantability factor of the item, most of the time is based
* on material.
*/
@Override
public int getItemEnchantability() {
return 1;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 3.5, 0));
return multimap;
}
private static int getAnim(ItemStack stack) {
if (stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
return 0;
}
return stack.stackTagCompound.getInteger("animation");
}
private static void setAnim(ItemStack stack, int i) {
if (stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
}
stack.stackTagCompound.setInteger("animation", i);
}
private static int getPower(ItemStack stack) {
if (stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
return 0;
}
return stack.stackTagCompound.getInteger("energy");
}
private static void setPower(ItemStack stack, int i) {
if (stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
}
stack.stackTagCompound.setInteger("energy", i);
}
public static float getRotationFromAnim(ItemStack stack) {
float rad = 0.0174533F;
rad *= 7.5F;
int i = getAnim(stack);
if (i < 10)
return 0;
i -= 10;
if (i < 6)
return rad * i;
if (i > 14)
return rad * (5 - (i - 15));
return rad * 5;
}
public static float getOffsetFromAnim(ItemStack stack) {
float i = getAnim(stack);
if (i < 10)
return 0;
i -= 10;
if (i < 10)
return i / 10;
else
return 2 - (i / 10);
}
public static float getTransFromAnim(ItemStack stack) {
float i = getAnim(stack);
if (i < 10)
return 0;
i -= 10;
if (i > 4 && i < 10)
return (i - 5) * 0.05F;
if (i > 9 && i < 15)
return (10 * 0.05F) - ((i - 5) * 0.05F);
return 0;
}
@Override
public EnumRarity getRarity(ItemStack p_77613_1_) {
return EnumRarity.uncommon;
}
}

View File

@ -1,95 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.entity.projectile.EntityLN2;
import com.hbm.items.ModItems;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunCryolator extends Item {
Random rand = new Random();
public GunCryolator() {
this.maxStackSize = 1;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.bow;
}
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
new ArrowNockEvent(p_77659_3_, p_77659_1_);
{
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
}
return p_77659_1_;
}
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
World world = player.worldObj;
boolean flag = player.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_cryolator_ammo))) {
EntityLN2 entityarrow = new EntityLN2(world, player, 3.0F);
if (flag) {
entityarrow.canBePickedUp = 2;
} else {
if (count % 10 == 0)
player.inventory.consumeInventoryItem(ModItems.gun_cryolator_ammo);
}
if (count % 5 == 0)
world.playSoundAtEntity(player, "hbm:weapon.cryolatorShoot", 1.0F, 1F);
if (!world.isRemote) {
world.spawnEntityInWorld(entityarrow);
}
}
}
@Override
public int getItemEnchantability() {
return 0;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("Ice to meet you!");
list.add("");
list.add("Ammo: Cryolator Ammo");
list.add("Damage: 5");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 4, 0));
return multimap;
}
}

View File

@ -1,103 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunDefabricator extends Item {
Random rand = new Random();
public GunDefabricator()
{
this.maxStackSize = 1;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.bow;
}
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
new ArrowNockEvent(p_77659_3_, p_77659_1_);
{
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
}
return p_77659_1_;
}
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count)
{
World world = player.worldObj;
boolean flag = player.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_defabricator_ammo))
&& count % 2 == 0) {
EntityBullet entitybullet = new EntityBullet(world, player, 3.0F, 40, 120, false, "tauDay");
entitybullet.setDamage(40 + rand.nextInt(120 - 40));
//world.playSoundAtEntity(player, "random.explode", 1.0F, 1.5F + (rand.nextFloat() / 4));
world.playSoundAtEntity(player, "hbm:weapon.defabShoot", 1.0F, 0.9F + (rand.nextFloat() * 0.2F));
if(count == this.getMaxItemUseDuration(stack))
world.playSoundAtEntity(player, "hbm:weapon.defabSpinup", 1.0F, 1.0F);
if(count % 20 == 0 && !flag)
player.inventory.consumeInventoryItem(ModItems.gun_defabricator_ammo);
if (!world.isRemote) {
world.spawnEntityInWorld(entitybullet);
}
}
}
@Override
public int getItemEnchantability() {
return 0;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if(MainRegistry.polaroidID == 11)
list.add("Did you set your alarm for volcano day?");
else
list.add("BAD WOLF");
list.add("");
list.add("Ammo: Defabricator Energy Cell");
list.add("Damage: 40 - 120");
list.add("");
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 6.5, 0));
return multimap;
}
}

View File

@ -1,105 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.items.ModItems;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunEuthanasia extends Item {
Random rand = new Random();
public GunEuthanasia()
{
this.maxStackSize = 1;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.bow;
}
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
new ArrowNockEvent(p_77659_3_, p_77659_1_);
{
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
}
return p_77659_1_;
}
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count)
{
World world = player.worldObj;
boolean flag = player.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
if ((player.capabilities.isCreativeMode || player.inventory.hasItem(ModItems.gun_euthanasia_ammo))
&& count % 8 == 0) {
int deadly = rand.nextInt(5);
EntityBullet entityarrow = new EntityBullet(world, player, 3.0F, 2, 8, deadly == 0, false);
entityarrow.setDamage(1 + rand.nextInt(3));
entityarrow.antidote = true;
//world.playSoundAtEntity(player, "random.explode", 1.0F, 1.5F + (rand.nextFloat() / 4));
world.playSoundAtEntity(player, "hbm:weapon.rifleShoot", 1.0F, 0.8F + (rand.nextFloat() * 0.4F));
if (flag) {
entityarrow.canBePickedUp = 2;
} else {
player.inventory.consumeInventoryItem(ModItems.gun_euthanasia_ammo);
}
if (!world.isRemote) {
world.spawnEntityInWorld(entityarrow);
}
}
}
@Override
public int getItemEnchantability() {
return 0;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("Say hello to my little syringe gun!");
list.add("");
list.add("Ammo: Syringe");
list.add("Damage: 1 - 4");
list.add("Syringes have a 20% chance to instakill the enemy.");
list.add("");
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 3, 0));
return multimap;
}
}

View File

@ -1,135 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.entity.projectile.EntityBulletBaseNT;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.interfaces.IHoldableWeapon;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.Crosshair;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
public class GunFolly extends Item implements IHoldableWeapon {
@Override
public Crosshair getCrosshair() {
return Crosshair.L_SPLIT;
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
int state = getState(stack);
if(state == 0) {
world.playSoundAtEntity(player, "hbm:weapon.follyOpen", 1.0F, 1.0F);
setState(stack, 1);
} else if(state == 1) {
if(player.inventory.hasItem(ModItems.ammo_folly)) {
world.playSoundAtEntity(player, "hbm:weapon.follyReload", 1.0F, 1.0F);
player.inventory.consumeInventoryItem(ModItems.ammo_folly);
setState(stack, 2);
} else {
world.playSoundAtEntity(player, "hbm:weapon.follyClose", 1.0F, 1.0F);
setState(stack, 0);
}
} else if(state == 2) {
world.playSoundAtEntity(player, "hbm:weapon.follyClose", 1.0F, 1.0F);
setState(stack, 3);
setTimer(stack, 100);
} else if(state == 3) {
if(getTimer(stack) == 0) {
setState(stack, 0);
world.playSoundAtEntity(player, "hbm:weapon.follyFire", 1.0F, 1.0F);
double mult = 1.75D;
player.motionX -= player.getLookVec().xCoord * mult;
player.motionY -= player.getLookVec().yCoord * mult;
player.motionZ -= player.getLookVec().zCoord * mult;
if (!world.isRemote) {
EntityBulletBaseNT bullet = new EntityBulletBaseNT(world, BulletConfigSyncingUtil.TEST_CONFIG, player);
world.spawnEntityInWorld(bullet);
}
}
}
return stack;
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isCurrentItem) {
if(getState(stack) == 3) {
if(isCurrentItem) {
int timer = getTimer(stack);
if(timer > 0) {
timer--;
if(timer % 20 == 0 && timer != 0)
world.playSoundAtEntity(entity, "hbm:weapon.follyBuzzer", 1.0F, 1.0F);
if(timer == 0)
world.playSoundAtEntity(entity, "hbm:weapon.follyAquired", 1.0F, 1.0F);
setTimer(stack, timer);
}
} else {
setTimer(stack, 100);
}
}
}
//0: closed, empty,
//1: open, empty
//2: open, full
//3: closed, full
public static void setState(ItemStack stack, int i) {
writeNBT(stack, "state", i);
}
public static int getState(ItemStack stack) {
return readNBT(stack, "state");
}
public static void setTimer(ItemStack stack, int i) {
writeNBT(stack, "timer", i);
}
public static int getTimer(ItemStack stack) {
return readNBT(stack, "timer");
}
private static void writeNBT(ItemStack stack, String key, int value) {
if(!stack.hasTagCompound())
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setInteger(key, value);
}
private static int readNBT(ItemStack stack, String key) {
if(!stack.hasTagCompound())
return 0;
return stack.stackTagCompound.getInteger(key);
}
}

View File

@ -1,71 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
@Deprecated
public class GunHP extends Item {
Random rand = new Random();
public GunHP() {
this.maxStackSize = 1;
}
@Override
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
return EnumAction.bow;
}
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
new ArrowNockEvent(p_77659_3_, p_77659_1_);
{
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
}
return p_77659_1_;
}
@Override
public void onUsingTick(ItemStack stack, EntityPlayer player, int count) { }
@Override
public int getItemEnchantability() {
return 0;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("Rrrrt - rrrrt - rrrrt, weeee!");
list.add("");
list.add("Ammo: Ink Cartridge");
list.add("Damage: 25 - 45");
list.add("");
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 4, 0));
return multimap;
}
}

View File

@ -1,150 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.items.ModItems;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunJack extends Item {
Random rand = new Random();
public int dmgMin = 12;
public int dmgMax = 24;
public GunJack() {
this.maxStackSize = 1;
}
/**
* called when the player releases the use item button. Args: itemstack,
* world, entityplayer, itemInUseCount
*/
@Override
public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {
int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_;
ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j);
MinecraftForge.EVENT_BUS.post(event);
j = event.charge;
boolean flag = p_77615_3_.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0;
if (flag || p_77615_3_.inventory.hasItem(ModItems.gun_jack_ammo)) {
float f = j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if (j < 10.0D) {
return;
}
if (j > 10.0F) {
f = 10.0F;
}
p_77615_1_.damageItem(1, p_77615_3_);
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.shotgunShoot", 1.0F, 1.0F);
if (flag) { } else {
p_77615_3_.inventory.consumeInventoryItem(ModItems.gun_jack_ammo);
}
int k = rand.nextInt(25) + 24;
for(int i = 0; i < k; i++) {
EntityBullet entityarrow1 = new EntityBullet(p_77615_2_, p_77615_3_, 3.0F);
entityarrow1.setDamage(dmgMin + rand.nextInt(dmgMax - dmgMin));
if(!p_77615_2_.isRemote)
p_77615_2_.spawnEntityInWorld(entityarrow1);
}
}
}
@Override
public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
return p_77654_1_;
}
/**
* How long it takes to use or consume an item
*/
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
/**
* returns the action that specifies what animation to play when the items
* is being used
*/
@Override
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
return EnumAction.bow;
}
/**
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
MinecraftForge.EVENT_BUS.post(event);
if (p_77659_3_.capabilities.isCreativeMode || p_77659_3_.inventory.hasItem(ModItems.gun_jack_ammo)) {
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
}
return p_77659_1_;
}
/**
* Return the enchantability factor of the item, most of the time is based
* on material.
*/
@Override
public int getItemEnchantability() {
return 1;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("One barrel? Boring.");
list.add("Two barrels? Nah.");
list.add("Four barrels? Heck yes!");
list.add("");
list.add("Ammo: Quadruple Shotgun Shells");
list.add("Damage: 12 - 24");
list.add("Projectiles: 24 - 48");
list.add("");
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 4.5, 0));
return multimap;
}
}

View File

@ -1,232 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunLeverActionS extends Item {
Random rand = new Random();
public int dmgMin = 8;
public int dmgMax = 16;
public GunLeverActionS() {
this.maxStackSize = 1;
this.setMaxDamage(500);
}
/**
* called when the player releases the use item button. Args: itemstack,
* world, entityplayer, itemInUseCount
*/
@Override
public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {
int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_;
ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j);
MinecraftForge.EVENT_BUS.post(event);
j = event.charge;
boolean flag = p_77615_3_.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0;
if (flag || p_77615_3_.inventory.hasItem(ModItems.ammo_20gauge)) {
float f = j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if (j < 10.0D) {
return;
}
if (j > 10.0F) {
f = 10.0F;
}
Vec3 vec = p_77615_3_.getLookVec();
vec.xCoord *= -1;
vec.yCoord *= -1;
vec.zCoord *= -1;
vec.normalize();
p_77615_3_.motionX += vec.xCoord * 0.75;
p_77615_3_.motionY += vec.yCoord * 0.75;
p_77615_3_.motionZ += vec.zCoord * 0.75;
p_77615_3_.inventory.consumeInventoryItem(ModItems.ammo_20gauge);
p_77615_1_.damageItem(1, p_77615_3_);
p_77615_3_.attackEntityFrom(ModDamageSource.suicide, 10000);
if(!p_77615_3_.capabilities.isCreativeMode)
p_77615_3_.setHealth(0.0F);
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.revolverShootAlt", 5.0F, 0.75F);
setAnim(p_77615_1_, 1);
}
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int i, boolean b) {
int j = getAnim(stack);
if(j > 0) {
if(j < 30)
setAnim(stack, j + 1);
else
setAnim(stack, 0);
if(j == 15)
world.playSoundAtEntity(entity, "hbm:weapon.leverActionReload", 2F, 0.85F);
}
}
@Override
public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
return p_77654_1_;
}
/**
* How long it takes to use or consume an item
*/
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
/**
* returns the action that specifies what animation to play when the items
* is being used
*/
@Override
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
return EnumAction.bow;
}
/**
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
MinecraftForge.EVENT_BUS.post(event);
if(this.getAnim(p_77659_1_) == 0)
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
return p_77659_1_;
}
/**
* Return the enchantability factor of the item, most of the time is based
* on material.
*/
@Override
public int getItemEnchantability() {
return 1;
}
public String getItemStackDisplayName(ItemStack stack)
{
if(MainRegistry.polaroidID == 11)
return ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + "_2.name")).trim();
else
return ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim();
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if(MainRegistry.polaroidID == 11)
list.add("Vee guilt-tripped me into this.");
else
list.add("I hate your guts, Vee.");
list.add("");
list.add("Ammo: 12x74 Buckshot");
list.add("Damage: Infinite");
list.add("");
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 3.5, 0));
return multimap;
}
private static int getAnim(ItemStack stack) {
if(stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
return 0;
}
return stack.stackTagCompound.getInteger("animation");
}
private static void setAnim(ItemStack stack, int i) {
if(stack.stackTagCompound == null) {
stack.stackTagCompound = new NBTTagCompound();
}
stack.stackTagCompound.setInteger("animation", i);
}
public static float getRotationFromAnim(ItemStack stack) {
float rad = 0.0174533F;
rad *= 7.5F;
int i = getAnim(stack);
if(i < 10)
return 0;
i -= 10;
if(i < 10)
return rad * i;
else
return (rad * 10) - (rad * (i - 10));
}
public static float getOffsetFromAnim(ItemStack stack) {
float i = getAnim(stack);
if(i < 10)
return 0;
i -= 10;
if(i < 10)
return i / 10;
else
return 2 - (i / 10);
}
}

View File

@ -1,141 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.entity.projectile.EntitySparkBeam;
import com.hbm.items.ModItems;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunSpark extends Item {
Random rand = new Random();
public int dmgMin = 12;
public int dmgMax = 24;
public GunSpark() {
this.maxStackSize = 1;
}
/**
* called when the player releases the use item button. Args: itemstack,
* world, entityplayer, itemInUseCount
*/
@Override
public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_) {
int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_;
ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j);
MinecraftForge.EVENT_BUS.post(event);
j = event.charge;
boolean flag = p_77615_3_.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0;
if (flag || p_77615_3_.inventory.hasItem(ModItems.gun_spark_ammo)) {
float f = j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if (j < 10.0D) {
return;
}
if (j > 10.0F) {
f = 10.0F;
}
p_77615_1_.damageItem(1, p_77615_3_);
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.sparkShoot", 1.0F, 1.0F);
if (flag) { } else {
p_77615_3_.inventory.consumeInventoryItem(ModItems.gun_spark_ammo);
}
EntitySparkBeam beam = new EntitySparkBeam(p_77615_2_, p_77615_3_, 3F);
beam.setDamage(dmgMin + rand.nextInt(dmgMax - dmgMin));
if(!p_77615_2_.isRemote)
p_77615_2_.spawnEntityInWorld(beam);
}
}
@Override
public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) {
return p_77654_1_;
}
/**
* How long it takes to use or consume an item
*/
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_) {
return 72000;
}
/**
* returns the action that specifies what animation to play when the items
* is being used
*/
@Override
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
return EnumAction.bow;
}
/**
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
MinecraftForge.EVENT_BUS.post(event);
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
return p_77659_1_;
}
/**
* Return the enchantability factor of the item, most of the time is based
* on material.
*/
@Override
public int getItemEnchantability() {
return 1;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("'magic does not compute'");
list.add("'aeiou'");
list.add("");
list.add("Ammo: Electromagnetic Cartridge");
list.add("Projectiles explode on impact.");
list.add("");
list.add("[LEGENDARY WEAPON]");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 4.5, 0));
return multimap;
}
}

View File

@ -1,158 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import java.util.Random;
import com.google.common.collect.Multimap;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
public class GunSuicide extends Item {
public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"};
@SideOnly(Side.CLIENT)
private IIcon[] iconArray;
private Item ammo;
Random rand = new Random();
public GunSuicide()
{
this.maxStackSize = 1;
//if(this == ModItems.gun_revolver)
{
this.setMaxDamage(500);
}
this.ammo = ModItems.ammo_357;
}
/**
* called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
*/
@Override
public void onPlayerStoppedUsing(ItemStack p_77615_1_, World p_77615_2_, EntityPlayer p_77615_3_, int p_77615_4_)
{
int j = this.getMaxItemUseDuration(p_77615_1_) - p_77615_4_;
ArrowLooseEvent event = new ArrowLooseEvent(p_77615_3_, p_77615_1_, j);
MinecraftForge.EVENT_BUS.post(event);
j = event.charge;
boolean flag = p_77615_3_.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0;
if (flag || p_77615_3_.inventory.hasItem(ammo))
{
float f = j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;
if (j < 10.0D)
{
return;
}
if (j > 10.0F)
{
f = 10.0F;
}
p_77615_1_.damageItem(1, p_77615_3_);
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.revolverShoot", 1.0F, 1.0F);
if (flag)
{ }
else
{
p_77615_3_.inventory.consumeInventoryItem(ammo);
}
if (!p_77615_2_.isRemote)
{
p_77615_3_.attackEntityFrom(ModDamageSource.suicide, 10000);
if(!p_77615_3_.capabilities.isCreativeMode)
p_77615_3_.setHealth(0.0F);
}
}
}
@Override
public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_)
{
return p_77654_1_;
}
/**
* How long it takes to use or consume an item
*/
@Override
public int getMaxItemUseDuration(ItemStack p_77626_1_)
{
return 72000;
}
/**
* returns the action that specifies what animation to play when the items is being used
*/
@Override
public EnumAction getItemUseAction(ItemStack p_77661_1_)
{
return EnumAction.bow;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
{
ArrowNockEvent event = new ArrowNockEvent(p_77659_3_, p_77659_1_);
MinecraftForge.EVENT_BUS.post(event);
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
return p_77659_1_;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
@Override
public int getItemEnchantability()
{
return 1;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
list.add("I've seen things...");
list.add("...I shouldn't have seen.");
list.add("");
list.add("Ammo: Lead Bullets");
list.add("Damage: Infinite");
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap multimap = super.getItemAttributeModifiers();
multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
new AttributeModifier(field_111210_e, "Weapon modifier", 2.5, 0));
return multimap;
}
}

View File

@ -11,7 +11,6 @@ import com.hbm.items.ItemAmmoEnums.IAmmoItemEnum;
import com.hbm.items.ItemEnumMulti;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.util.EnumUtil;
import com.hbm.util.I18nUtil;
@ -122,7 +121,7 @@ public class ItemAmmo extends ItemEnumMulti {
public ItemAmmo(Class<? extends Enum<?>> clazz, String altName) {
super(clazz, true, true);
setCreativeTab(MainRegistry.weaponTab);
this.setCreativeTab(null);
this.altName = altName;
}

View File

@ -1,40 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemStack;
public class ItemCoilgun extends ItemGunBase {
public ItemCoilgun(GunConfiguration config) {
super(config);
}
@Override
@SideOnly(Side.CLIENT)
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
if(type == AnimType.CYCLE) {
return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence()
.addPos(1, 0, 0, 100)
.addPos(0, 0, 0, 200));
}
if(type == AnimType.RELOAD) {
return new BusAnimation()
.addBus("RELOAD", new BusAnimationSequence()
.addPos(1, 0, 0, 250)
.addPos(1, 0, 0, 500)
.addPos(0, 0, 0, 250));
}
GunConfiguration config = ((ItemGunBase) stack.getItem()).mainConfig;
return config.animations.get(type);
}
}

View File

@ -2,7 +2,9 @@ package com.hbm.items.weapon;
import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;
import com.hbm.entity.missile.EntityMissileCustom;
import com.hbm.items.special.ItemLootCrate;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -86,7 +88,17 @@ public class ItemCustomMissilePart extends Item {
SCHRAB,
TAINT,
CLOUD,
TURBINE
TURBINE,
//shit solution but it works. this allows traits to be attached to these empty dummy types, allowing for custom warheads
CUSTOM0, CUSTOM1, CUSTOM2, CUSTOM3, CUSTOM4, CUSTOM5, CUSTOM6, CUSTOM7, CUSTOM8, CUSTOM9;
/** Overrides that type's impact effect. Only runs serverside */
public Consumer<EntityMissileCustom> impactCustom = null;
/** Runs at the beginning of the missile's update cycle, both client and serverside. */
public Consumer<EntityMissileCustom> updateCustom = null;
/** Override for the warhead's name in the missile description */
public String labelCustom = null;
}
public enum FuelType {
@ -246,6 +258,8 @@ public class ItemCustomMissilePart extends Item {
public String getWarhead(WarheadType type) {
if(type.labelCustom != null) return type.labelCustom;
switch(type) {
case HE:
return EnumChatFormatting.YELLOW + "HE";

View File

@ -1,125 +0,0 @@
package com.hbm.items.weapon;
import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.GunConfiguration;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ItemGunBio extends ItemGunBase {
public ItemGunBio(GunConfiguration config) {
super(config);
}
public static long lastShot;
public static List<double[]> smokeNodes = new ArrayList();
@Override
public void startActionClient(ItemStack stack, World world, EntityPlayer player, boolean main) { }
@Override
@SideOnly(Side.CLIENT)
protected void updateClient(ItemStack stack, World world, EntityPlayer entity, int slot, boolean isCurrentItem) {
super.updateClient(stack, world, entity, slot, isCurrentItem);
boolean smoking = lastShot + 2000 > System.currentTimeMillis();
if(!smoking && !smokeNodes.isEmpty()) {
smokeNodes.clear();
}
if(smoking) {
Vec3 prev = Vec3.createVectorHelper(-entity.motionX, -entity.motionY, -entity.motionZ);
prev.rotateAroundY((float) (entity.rotationYaw * Math.PI / 180D));
double accel = 15D;
double side = (entity.rotationYaw - entity.prevRotationYawHead) * 0.1D;
double waggle = 0.025D;
for(double[] node : smokeNodes) {
node[0] += prev.xCoord * accel + world.rand.nextGaussian() * waggle + side;
node[1] += prev.yCoord + 1.5D;
node[2] += prev.zCoord * accel + world.rand.nextGaussian() * waggle;
}
double alpha = (System.currentTimeMillis() - ItemGunBio.lastShot) / 2000D;
alpha = (1 - alpha) * 0.5D;
if(this.getIsReloading(stack)) alpha = 0;
smokeNodes.add(new double[] {0, 0, 0, alpha});
}
}
@Override
@SideOnly(Side.CLIENT)
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
if(type == AnimType.CYCLE) {
lastShot = System.currentTimeMillis();
return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence()
.addPos(0, 0, 0, 50)
.addPos(0, 0, -3, 50)
.addPos(0, 0, 0, 250)
)
.addBus("HAMMER", new BusAnimationSequence()
.addPos(0, 0, 1, 50)
.addPos(0, 0, 1, 300)
.addPos(0, 0, 0, 200)
)
.addBus("DRUM", new BusAnimationSequence()
.addPos(0, 0, 1, 50)
);
}
if(type == AnimType.RELOAD) {
return new BusAnimation()
.addBus("LATCH", new BusAnimationSequence()
.addPos(0, 0, 90, 300)
.addPos(0, 0, 90, 2000)
.addPos(0, 0, 0, 150)
)
.addBus("FRONT", new BusAnimationSequence()
.addPos(0, 0, 0, 200)
.addPos(0, 0, 45, 150)
.addPos(0, 0, 45, 2000)
.addPos(0, 0, 0, 75)
)
.addBus("RELOAD_ROT", new BusAnimationSequence()
.addPos(0, 0, 0, 300)
.addPos(60, 0, 0, 500)
.addPos(60, 0, 0, 500)
.addPos(0, -90, -90, 0)
.addPos(0, -90, -90, 600)
.addPos(0, 0, 0, 300)
.addPos(0, 0, 0, 100)
.addPos(-45, 0, 0, 50)
.addPos(-45, 0, 0, 100)
.addPos(0, 0, 0, 300)
)
.addBus("RELOAD_MOVE", new BusAnimationSequence()
.addPos(0, 0, 0, 300)
.addPos(0, -15, 0, 1000)
.addPos(0, 0, 0, 450)
)
.addBus("DRUM_PUSH", new BusAnimationSequence()
.addPos(0, 0, 0, 1600)
.addPos(0, 0, -5, 0)
.addPos(0, 0, 0, 300)
);
}
return null;
}
}

View File

@ -1,226 +0,0 @@
package com.hbm.items.weapon;
import java.util.List;
import com.hbm.config.GeneralConfig;
import com.hbm.entity.projectile.EntityChemical;
import com.hbm.handler.GunConfiguration;
import com.hbm.handler.guncfg.GunEnergyFactory;
import com.hbm.interfaces.IHoldableWeapon;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.GunAnimationPacket;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay;
import api.hbm.fluid.IFillableItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class ItemGunChemthrower extends ItemGunBase implements IFillableItem {
public ItemGunChemthrower() {
super(GunEnergyFactory.getChemConfig());
}
@Override
protected void fire(ItemStack stack, World world, EntityPlayer player) {
if(!hasAmmo(stack, player, true))
return;
int bullets = 1;
for(int i = 0; i < bullets; i++) {
spawnProjectile(world, player, stack, 0);
}
if(player instanceof EntityPlayerMP)
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
useUpAmmo(player, stack, true);
player.inventoryContainer.detectAndSendChanges();
int wear = (int) Math.ceil(10 / (1F + EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, stack)));
setItemWear(stack, getItemWear(stack) + wear);
}
@Override
public boolean hasAmmo(ItemStack stack, EntityPlayer player, boolean main) {
return getMag(stack) >= 0 + this.getConsumption(stack);
}
@Override
public void useUpAmmo(EntityPlayer player, ItemStack stack, boolean main) {
if(!main && altConfig == null)
return;
GunConfiguration config = mainConfig;
if(!main)
config = altConfig;
if(hasInfinity(stack, config))
return;
setMag(stack, getMag(stack) - this.getConsumption(stack));
}
@Override
public boolean canReload(ItemStack stack, World world, EntityPlayer player) {
return false;
}
@Override
protected void spawnProjectile(World world, EntityPlayer player, ItemStack stack, int config) {
//spawn fluid projectile
EntityChemical chem = new EntityChemical(world, player, 0, 0, 0);
chem.setFluid(this.getFluidType(stack));
world.spawnEntityInWorld(chem);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add("Ammo: " + getMag(stack) + " / " + mainConfig.ammoCap + "mB");
list.add("Ammo Type: " + this.getFluidType(stack).getLocalizedName());
int dura = mainConfig.durability - getItemWear(stack);
if(dura < 0)
dura = 0;
list.add("Durability: " + dura + " / " + mainConfig.durability);
list.add("");
list.add("Name: " + mainConfig.name);
list.add("Manufacturer: " + mainConfig.manufacturer);
if(!mainConfig.comment.isEmpty()) {
list.add("");
for(String s : mainConfig.comment)
list.add(EnumChatFormatting.ITALIC + s);
}
if(GeneralConfig.enableExtendedLogging) {
list.add("");
list.add("Type: " + getMagType(stack));
list.add("Is Reloading: " + getIsReloading(stack));
list.add("Reload Cycle: " + getReloadCycle(stack));
list.add("RoF Cooldown: " + getDelay(stack));
}
}
@Override
@SideOnly(Side.CLIENT)
public void renderHUD(Pre event, ElementType type, EntityPlayer player, ItemStack stack) {
ItemGunBase gun = ((ItemGunBase)stack.getItem());
GunConfiguration gcfg = gun.mainConfig;
if(type == ElementType.HOTBAR) {
FluidType fluid = this.getFluidType(stack);
ItemStack ammo = ItemFluidIcon.make(fluid, 1);
int count = ItemGunBase.getMag(stack);
int max = gcfg.ammoCap;
boolean showammo = gcfg.showAmmo;
int dura = ItemGunBase.getItemWear(stack) * 50 / gcfg.durability;
RenderScreenOverlay.renderAmmo(event.resolution, Minecraft.getMinecraft().ingameGUI, ammo, count, max, dura, showammo);
}
if(type == ElementType.CROSSHAIRS && GeneralConfig.enableCrosshairs) {
event.setCanceled(true);
if(!(gcfg.hasSights && player.isSneaking()))
RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, ((IHoldableWeapon)player.getHeldItem().getItem()).getCrosshair());
else
RenderScreenOverlay.renderCustomCrosshairs(event.resolution, Minecraft.getMinecraft().ingameGUI, Crosshair.NONE);
}
}
@Override
protected void reload2(ItemStack stack, World world, EntityPlayer player) {
this.setIsReloading(stack, false);
}
public FluidType getFluidType(ItemStack stack) {
return Fluids.fromID(this.getMagType(stack));
}
public int getConsumption(ItemStack stack) {
return 3;
}
@Override
public boolean acceptsFluid(FluidType type, ItemStack stack) {
return getFluidType(stack) == type || this.getMag(stack) == 0;
}
public static final int transferSpeed = 50;
@Override
public int tryFill(FluidType type, int amount, ItemStack stack) {
if(!acceptsFluid(type, stack))
return amount;
if(this.getMag(stack) == 0)
this.setMagType(stack, type.getID());
int fill = this.getMag(stack);
int req = this.mainConfig.ammoCap - fill;
int toFill = Math.min(amount, req);
toFill = Math.min(toFill, transferSpeed);
this.setMag(stack, fill + toFill);
return amount - toFill;
}
@Override
public boolean providesFluid(FluidType type, ItemStack stack) {
return getFluidType(stack) == type;
}
@Override
public int tryEmpty(FluidType type, int amount, ItemStack stack) {
int fill = this.getMag(stack);
int toUnload = Math.min(fill, amount);
toUnload = Math.min(toUnload, transferSpeed);
this.setMag(stack, fill - toUnload);
return toUnload;
}
@Override
public FluidType getFirstFluidType(ItemStack stack) {
return this.getFluidType(stack);
}
@Override
public int getFill(ItemStack stack) {
return this.getMag(stack);
}
}

View File

@ -1,78 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import api.hbm.item.IDesignatorItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ItemGunDart extends ItemGunBase implements IDesignatorItem {
public ItemGunDart(GunConfiguration config) {
super(config);
}
public static void writePlayer(ItemStack stack, EntityPlayer player) {
if(!stack.hasTagCompound())
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("player", player.getDisplayName());
stack.stackTagCompound.setLong("lease", player.worldObj.getTotalWorldTime() + 60 * 60 * 20);
}
public static EntityPlayer readPlayer(World world, ItemStack stack) {
if(!stack.hasTagCompound())
return null;
if(stack.stackTagCompound.getLong("lease") < world.getTotalWorldTime())
return null;
return MinecraftServer.getServer().getConfigurationManager().func_152612_a(stack.stackTagCompound.getString("player"));
}
public void startAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
if(main) {
super.startAction(stack, world, player, main);
} else {
EntityPlayer target = readPlayer(world, stack);
if(target != null) {
int dim = target.worldObj.provider.dimensionId;
int x = (int)target.posX;
int y = (int)target.posY;
int z = (int)target.posZ;
int dist = (int) target.getDistanceToEntity(player);
player.addChatComponentMessage(new ChatComponentText(target.getDisplayName()).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
player.addChatComponentMessage(new ChatComponentText("Dim: " + dim + " X:" + x + " Y:" + y + " Z:" + z + " (" + dist + " blocks away)").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
} else {
player.addChatComponentMessage(new ChatComponentText("No Target").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
}
}
}
@Override
public boolean isReady(World world, ItemStack stack, int x, int y, int z) {
EntityPlayer target = readPlayer(world, stack);
return target != null && target.dimension == world.provider.dimensionId;
}
@Override
public Vec3 getCoords(World world, ItemStack stack, int x, int y, int z) {
EntityPlayer target = readPlayer(world, stack);
return Vec3.createVectorHelper(target.posX, target.posY, target.posZ);
}
}

View File

@ -1,17 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import net.minecraft.item.ItemStack;
public class ItemGunDetonator extends ItemGunBase {
public ItemGunDetonator(GunConfiguration config) {
super(config);
}
@Override
public boolean hasInfinity(ItemStack stack, GunConfiguration config) {
return true;
}
}

View File

@ -1,158 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.entity.projectile.EntityBulletBaseNT;
import com.hbm.handler.GunConfiguration;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.GunAnimationPacket;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.sound.AudioWrapper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemGunGauss extends ItemGunBase {
private AudioWrapper chargeLoop;
public ItemGunGauss(GunConfiguration config, GunConfiguration alt) {
super(config, alt);
}
public void endAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
if(getHasShot(stack)) {
world.playSoundAtEntity(player, "hbm:weapon.sparkShoot", 2.0F, 1.0F);
setHasShot(stack, false);
}
if(!main && getStored(stack) > 0) {
EntityBulletBaseNT bullet = new EntityBulletBaseNT(world, altConfig.config.get(0), player);
bullet.overrideDamage = Math.max(getStored(stack), 1) * 10F;
world.spawnEntityInWorld(bullet);
world.playSoundAtEntity(player, "hbm:weapon.tauShoot", 0.5F, 0.75F);
setItemWear(stack, getItemWear(stack) + (getCharge(stack)) * 2);
setCharge(stack, 0);
if(player instanceof EntityPlayerMP)
PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player);
}
}
public void endActionClient(ItemStack stack, World world, EntityPlayer player, boolean main) {
if(chargeLoop != null) {
chargeLoop.stopSound();
chargeLoop = null;
}
}
protected void altFire(ItemStack stack, World world, EntityPlayer player) {
setCharge(stack, 1);
}
@Override
public void startActionClient(ItemStack stack, World world, EntityPlayer player, boolean main) {
if(!main && getItemWear(stack) < mainConfig.durability && player.inventory.hasItem(ModItems.gun_xvl1456_ammo)) {
chargeLoop = MainRegistry.proxy.getLoopedSound("hbm:weapon.tauChargeLoop2", (float)player.posX, (float)player.posY, (float)player.posZ, 1.0F, 5F, 0.75F);
world.playSoundAtEntity(player, "hbm:weapon.tauChargeLoop2", 1.0F, 0.75F);
if(chargeLoop != null) {
chargeLoop.startSound();
}
}
}
protected void updateServer(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) {
super.updateServer(stack, world, player, slot, isCurrentItem);
if(getIsAltDown(stack) && getItemWear(stack) < mainConfig.durability) {
int c = getCharge(stack);
if(c > 200) {
setCharge(stack, 0);
setItemWear(stack, mainConfig.durability);
player.attackEntityFrom(ModDamageSource.tauBlast, 1000);
world.newExplosion(player, player.posX, player.posY + player.eyeHeight, player.posZ, 5.0F, true, true);
return;
}
if(c > 0) {
setCharge(stack, c + 1);
if(c % 10 == 1 && c < 140 && c > 2) {
if(player.inventory.hasItem(ModItems.gun_xvl1456_ammo)) {
player.inventory.consumeInventoryItem(ModItems.gun_xvl1456_ammo);
setStored(stack, getStored(stack) + 1);
} else {
setCharge(stack, 0);
setStored(stack, 0);
}
}
} else {
setStored(stack, 0);
}
} else {
setCharge(stack, 0);
setStored(stack, 0);
}
}
protected void updateClient(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) {
super.updateClient(stack, world, player, slot, isCurrentItem);
if(chargeLoop != null) {
if(!chargeLoop.isPlaying()) {
chargeLoop = rebootAudio(chargeLoop, player);
}
chargeLoop.updatePosition((float)player.posX, (float)player.posY, (float)player.posZ);
chargeLoop.updatePitch(1 + (getCharge(stack)) * 0.01F);
}
}
public AudioWrapper rebootAudio(AudioWrapper wrapper, EntityPlayer player) {
wrapper.stopSound();
AudioWrapper audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.tauChargeLoop2", (float)player.posX, (float)player.posY, (float)player.posZ, wrapper.getVolume(), wrapper.getRange(), wrapper.getPitch());
audio.startSound();
return audio;
}
protected void spawnProjectile(World world, EntityPlayer player, ItemStack stack, int config) {
super.spawnProjectile(world, player, stack, config);
setHasShot(stack, true);
}
public static void setHasShot(ItemStack stack, boolean b) {
writeNBT(stack, "hasShot", b ? 1 : 0);
}
public static boolean getHasShot(ItemStack stack) {
return readNBT(stack, "hasShot") == 1;
}
/// gauss charge state ///
public static void setCharge(ItemStack stack, int i) {
writeNBT(stack, "gauss_charge", i);
}
public static int getCharge(ItemStack stack) {
return readNBT(stack, "gauss_charge");
}
public static void setStored(ItemStack stack, int i) {
writeNBT(stack, "gauss_stored", i);
}
public static int getStored(ItemStack stack) {
return readNBT(stack, "gauss_stored");
}
}

View File

@ -1,42 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemGunLacunae extends ItemGunBase {
public ItemGunLacunae(GunConfiguration config) {
super(config);
}
@Override
public void startAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
if(main) {
setDelay(stack, 20);
world.playSoundAtEntity(player, "hbm:weapon.lacunaeSpinup", 1.0F, 1.0F);
}
}
@Override
public void endAction(ItemStack stack, World world, EntityPlayer player, boolean main) {
if(main)
world.playSoundAtEntity(player, "hbm:weapon.lacunaeSpindown", 1.0F, 1.0F);
}
protected void updateServer(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) {
super.updateServer(stack, world, player, slot, isCurrentItem);
if(getIsMouseDown(stack)) {
int rot = readNBT(stack, "rot") % 360;
rot += 25;
writeNBT(stack, "rot", rot);
}
}
}

View File

@ -1,62 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.entity.projectile.EntityCombineBallNT;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.GunConfiguration;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemGunOSIPR extends ItemGunBase {
public ItemGunOSIPR(GunConfiguration config, GunConfiguration alt) {
super(config, alt);
}
@Override
protected void altFire(ItemStack stack, World world, EntityPlayer player) {
setCharge(stack, 1);
world.playSoundAtEntity(player, "hbm:weapon.osiprCharging", 1.0F, 1F);
}
@Override
protected void updateServer(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) {
super.updateServer(stack, world, player, slot, isCurrentItem);
if(!isCurrentItem) {
setCharge(stack, 0);
return;
}
int i = getCharge(stack);
if(i >= 20) {
EntityCombineBallNT energyBall = new EntityCombineBallNT(world, BulletConfigSyncingUtil.SPECIAL_OSIPR_CHARGED, player);
world.spawnEntityInWorld(energyBall);
world.playSoundAtEntity(player, altConfig.firingSound, 1.0F, 1F);
setCharge(stack, 0);
setDelay(stack, altConfig.rateOfFire);
player.inventory.consumeInventoryItem(ModItems.gun_osipr_ammo2);
} else if(i > 0)
setCharge(stack, i + 1);
}
@Override
protected boolean tryShoot(ItemStack stack, World world, EntityPlayer player, boolean main) {
return super.tryShoot(stack, world, player, main) && getCharge(stack) == 0;
}
/// CMB charge state ///
public static void setCharge(ItemStack stack, int i) {
writeNBT(stack, "cmb_charge", i);
}
public static int getCharge(ItemStack stack) {
return readNBT(stack, "cmb_charge");
}
}

View File

@ -1,137 +0,0 @@
package com.hbm.items.weapon;
import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.GunConfiguration;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ItemGunPip extends ItemGunBase {
public static long lastShot;
public static List<double[]> smokeNodes = new ArrayList();
public ItemGunPip(GunConfiguration config) {
super(config);
}
@Override
@SideOnly(Side.CLIENT)
protected void updateClient(ItemStack stack, World world, EntityPlayer entity, int slot, boolean isCurrentItem) {
super.updateClient(stack, world, entity, slot, isCurrentItem);
boolean smoking = lastShot + 2000 > System.currentTimeMillis();
if(!smoking && !smokeNodes.isEmpty()) {
smokeNodes.clear();
}
if(smoking) {
Vec3 prev = Vec3.createVectorHelper(-entity.motionX, -entity.motionY, -entity.motionZ);
prev.rotateAroundY((float) (entity.rotationYaw * Math.PI / 180D));
double accel = 15D;
double side = (entity.rotationYaw - entity.prevRotationYawHead) * 0.1D;
double waggle = 0.025D;
for(double[] node : smokeNodes) {
node[0] += -prev.zCoord * accel + world.rand.nextGaussian() * waggle;
node[1] += prev.yCoord + 1.5D;
node[2] += prev.xCoord * accel + world.rand.nextGaussian() * waggle + side;
}
double alpha = (System.currentTimeMillis() - lastShot) / 2000D;
alpha = (1 - alpha) * 0.5D;
if(this.getIsReloading(stack)) alpha = 0;
smokeNodes.add(new double[] {0, 0, 0, alpha});
}
}
@Override
@SideOnly(Side.CLIENT)
public BusAnimation getAnimation(ItemStack stack, AnimType type) {
if(type == AnimType.EQUIP) {
return new BusAnimation()
.addBus("ROTATE", new BusAnimationSequence()
.addPos(-360, 0, 0, 350)
);
}
if(type == AnimType.CYCLE) {
lastShot = System.currentTimeMillis();
int s = 1;
return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence()
.addPos(0, 0, 0, 50 * s)
.addPos(0, 0, -3, 50 * s)
.addPos(0, 0, 0, 250 * s)
)
.addBus("HAMMER", new BusAnimationSequence()
.addPos(0, 0, 1, 50 * s)
.addPos(0, 0, 1, 300 * s)
.addPos(0, 0, 0, 200 * s)
)
.addBus("DRUM", new BusAnimationSequence()
.addPos(0, 0, 1, 50 * s)
);
}
if(type == AnimType.RELOAD) {
int s = 1;
return new BusAnimation()
.addBus("RELAOD_TILT", new BusAnimationSequence()
.addPos(-15, 0, 0, 100 * s)
.addPos(65, 0, 0, 100 * s) //200
.addPos(45, 0, 0, 50 * s) //250
.addPos(0, 0, 0, 200 * s) //450
.addPos(0, 0, 0, 1450 * s) //1900
.addPos(-80, 0, 0, 100 * s) //2000
.addPos(-80, 0, 0, 100 * s) //2100
.addPos(0, 0, 0, 200 * s) //2300
)
.addBus("RELOAD_CYLINDER", new BusAnimationSequence()
.addPos(0, 0, 0, 200 * s)
.addPos(90, 0, 0, 100 * s) //300
.addPos(90, 0, 0, 1700 * s) //2000
.addPos(0, 0, 0, 70 * s) //2100
)
.addBus("RELOAD_LIFT", new BusAnimationSequence()
.addPos(0, 0, 0, 350 * s)
.addPos(-45, 0, 0, 250 * s) //600
.addPos(-45, 0, 0, 350 * s) //950
.addPos(-15, 0, 0, 200 * s) //1150
.addPos(-15, 0, 0, 1050 * s) //2200
.addPos(0, 0, 0, 100 * s) //2300
)
.addBus("RELOAD_JOLT", new BusAnimationSequence()
.addPos(0, 0, 0, 600 * s)
.addPos(2, 0, 0, 50 * s) //650
.addPos(0, 0, 0, 100 * s) //750
)
.addBus("RELOAD_BULLETS", new BusAnimationSequence()
.addPos(0, 0, 0, 650 * s)
.addPos(10, 0, 0, 300 * s) //950
.addPos(10, 0, 0, 200 * s) //1150
.addPos(0, 0, 0, 700 * s) //1850
)
.addBus("RELOAD_BULLETS_CON", new BusAnimationSequence()
.addPos(1, 0, 0, 0 * s)
.addPos(1, 0, 0, 950 * s)
.addPos(0, 0, 0, 1 * s)
);
}
return null;
}
}

View File

@ -1,24 +0,0 @@
package com.hbm.items.weapon;
import com.hbm.handler.GunConfiguration;
import com.hbm.util.ShadyUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemGunShotty extends ItemGunBase {
public ItemGunShotty(GunConfiguration config) {
super(config);
}
protected void updateServer(ItemStack stack, World world, EntityPlayer player, int slot, boolean isCurrentItem) {
super.updateServer(stack, world, player, slot, isCurrentItem);
if((player.getUniqueID().toString().equals(ShadyUtil.Dr_Nostalgia) || player.getDisplayName().equals("Tankish") || player.getDisplayName().equals("Tankish020")) &&
this.getDelay(stack) < this.mainConfig.rateOfFire * 0.9)
this.setDelay(stack, 0);
}
}

View File

@ -10,16 +10,21 @@ import com.hbm.entity.projectile.EntityBulletBeamBase;
import com.hbm.interfaces.NotableComments;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.lib.ModDamageSource;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
import com.hbm.particle.SpentCasing;
import com.hbm.util.BobMathUtil;
import com.hbm.util.EntityDamageUtil;
import com.hbm.util.TrackerUtil;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.util.MovingObjectPosition;
@ -42,16 +47,15 @@ public class BulletConfig implements Cloneable {
public float wear = 1F;
public int projectilesMin = 1;
public int projectilesMax = 1;
public ProjectileType pType = ProjectileType.BULLET;
public float damageMult = 1.0F;
public float armorThresholdNegation = 0.0F;
public float armorPiercingPercent = 0.0F;
public float knockbackMult = 0.1F;
public float headshotMult = 1.0F;
public String damageType = ModDamageSource.s_bullet;
public boolean dmgProj = true;
public boolean dmgFire = false;
public boolean dmgExplosion = false;
public boolean dmgBypass = false;
public DamageClass dmgClass = DamageClass.PHYSICAL;
public float ricochetAngle = 5F;
public int maxRicochetCount = 2;
@ -90,8 +94,12 @@ public class BulletConfig implements Cloneable {
return this;
}
public BulletConfig setBeam() { this.pType = ProjectileType.BEAM; return this; }
public BulletConfig setChunkloading() { this.pType = ProjectileType.BULLET_CHUNKLOADING; return this; }
public BulletConfig setItem(Item ammo) { this.ammo = new ComparableStack(ammo); return this; }
public BulletConfig setItem(ItemStack ammo) { this.ammo = new ComparableStack(ammo); return this; }
public BulletConfig setItem(EnumAmmo ammo) { this.ammo = new ComparableStack(ModItems.ammo_standard, 1, ammo.ordinal()); return this; }
public BulletConfig setItem(EnumAmmoSecret ammo) { this.ammo = new ComparableStack(ModItems.ammo_secret, 1, ammo.ordinal()); return this; }
public BulletConfig setReloadCount(int ammoReloadCount) { this.ammoReloadCount = ammoReloadCount; return this; }
public BulletConfig setVel(float velocity) { this.velocity = velocity; return this; }
public BulletConfig setSpread(float spread) { this.spread = spread; return this; }
@ -99,10 +107,11 @@ public class BulletConfig implements Cloneable {
public BulletConfig setProjectiles(int amount) { this.projectilesMin = this.projectilesMax = amount; return this; }
public BulletConfig setProjectiles(int min, int max) { this.projectilesMin = min; this.projectilesMax = max; return this; }
public BulletConfig setDamage(float damageMult) { this.damageMult = damageMult; return this; }
public BulletConfig setThresholdNegation(float armorThresholdNegation) { this.armorThresholdNegation = armorThresholdNegation; return this; }
public BulletConfig setArmorPiercing(float armorPiercingPercent) { this.armorPiercingPercent = armorPiercingPercent; return this; }
public BulletConfig setKnockback(float knockbackMult) { this.knockbackMult = knockbackMult; return this; }
public BulletConfig setHeadshot(float headshotMult) { this.headshotMult = headshotMult; return this; }
public BulletConfig setDamageType(String type) { this.damageType = type; return this; }
public BulletConfig setupDamageClass(boolean proj, boolean fire, boolean explosion, boolean bypass) { this.dmgProj = proj; this.dmgFire = fire; this.dmgExplosion = explosion; this.dmgBypass = bypass; return this; }
public BulletConfig setupDamageClass(DamageClass clazz) { this.dmgClass = clazz; return this; }
public BulletConfig setRicochetAngle(float angle) { this.ricochetAngle = angle; return this; }
public BulletConfig setRicochetCount(int count) { this.maxRicochetCount = count; return this; }
public BulletConfig setDamageFalloutByPen(boolean falloff) { this.damageFalloffByPen = falloff; return this; }
@ -125,17 +134,28 @@ public class BulletConfig implements Cloneable {
public BulletConfig setOnBeamImpact(BiConsumer<EntityBulletBeamBase, MovingObjectPosition> lambda) { this.onImpactBeam = lambda; return this; }
public BulletConfig setOnEntityHit(BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> lambda) { this.onEntityHit = lambda; return this; }
public DamageSource getDamage(Entity projectile, EntityLivingBase shooter, boolean bypass) {
public static enum ProjectileType {
BULLET,
BULLET_CHUNKLOADING,
BEAM
}
@SuppressWarnings("incomplete-switch") //shut up
public static DamageSource getDamage(Entity projectile, EntityLivingBase shooter, DamageClass dmgClass) {
DamageSource dmg;
if(shooter != null) dmg = new EntityDamageSourceIndirect(damageType, projectile, shooter);
else dmg = new DamageSource(damageType);
if(shooter != null) dmg = new EntityDamageSourceIndirect(dmgClass.name(), projectile, shooter);
else dmg = new DamageSource(dmgClass.name());
if(this.dmgProj) dmg.setProjectile();
if(this.dmgFire) dmg.setFireDamage();
if(this.dmgExplosion) dmg.setExplosion();
if(this.dmgBypass || bypass) dmg.setDamageBypassesArmor();
switch(dmgClass) {
case PHYSICAL: dmg.setProjectile(); break;
case FIRE: dmg.setFireDamage(); break;
case EXPLOSIVE: dmg.setExplosion(); break;
case ELECTRIC: break;
case LASER: break;
case SUBATOMIC: break;
}
return dmg;
}
@ -143,6 +163,13 @@ public class BulletConfig implements Cloneable {
public static BiConsumer<EntityBulletBaseMK4, MovingObjectPosition> LAMBDA_STANDARD_RICOCHET = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.BLOCK) {
Block b = bullet.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ);
if(b.getMaterial() == Material.glass) {
bullet.worldObj.func_147480_a(mop.blockX, mop.blockY, mop.blockZ, false);
bullet.setPosition(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
return;
}
ForgeDirection dir = ForgeDirection.getOrientation(mop.sideHit);
Vec3 face = Vec3.createVectorHelper(dir.offsetX, dir.offsetY, dir.offsetZ);
@ -184,22 +211,17 @@ public class BulletConfig implements Cloneable {
if(entity == bullet.getThrower() && bullet.ticksExisted < bullet.selfDamageDelay()) return;
if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0) return;
DamageSource damageCalc = bullet.config.getDamage(bullet, bullet.getThrower(), false);
DamageSource source = bullet.config.getDamage(bullet, bullet.getThrower(), bullet.config.dmgClass);
if(!(entity instanceof EntityLivingBase)) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, bullet.damage);
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, source, bullet.damage);
return;
}
EntityLivingBase living = (EntityLivingBase) entity;
float prevHealth = living.getHealth();
if(bullet.config.armorPiercingPercent == 0) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, bullet.damage);
} else {
DamageSource damagePiercing = bullet.config.getDamage(bullet, bullet.getThrower(), true);
EntityDamageUtil.attackArmorPiercing(living, damageCalc, damagePiercing, bullet.damage, bullet.config.armorPiercingPercent);
}
EntityDamageUtil.attackEntityFromNT(living, source, bullet.damage, true, true, bullet.config.knockbackMult, bullet.config.armorThresholdNegation, bullet.config.armorPiercingPercent);
float newHealth = living.getHealth();
@ -208,6 +230,28 @@ public class BulletConfig implements Cloneable {
bullet.setPosition(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
bullet.setDead();
}
if(!living.isEntityAlive()) ConfettiUtil.decideConfetti(living, source);
}
};
public static BiConsumer<EntityBulletBeamBase, MovingObjectPosition> LAMBDA_STANDARD_BEAM_HIT = (bullet, mop) -> {
if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
Entity entity = mop.entityHit;
if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0) return;
DamageSource source = bullet.config.getDamage(bullet, bullet.getThrower(), bullet.config.dmgClass);
if(!(entity instanceof EntityLivingBase)) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, source, bullet.damage);
return;
}
EntityLivingBase living = (EntityLivingBase) entity;
EntityDamageUtil.attackEntityFromNT(living, source, bullet.damage, true, true, bullet.config.knockbackMult, bullet.config.armorThresholdNegation, bullet.config.armorPiercingPercent);
if(!living.isEntityAlive()) ConfettiUtil.decideConfetti(living, source);
}
};
@ -218,21 +262,15 @@ public class BulletConfig implements Cloneable {
if(entity instanceof EntityLivingBase && ((EntityLivingBase) entity).getHealth() <= 0) return;
DamageSource damageCalc = beam.config.getDamage(beam, beam.thrower, false);
DamageSource source = beam.config.getDamage(beam, beam.thrower, beam.config.dmgClass);
if(!(entity instanceof EntityLivingBase)) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, beam.damage);
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, source, beam.damage);
return;
}
EntityLivingBase living = (EntityLivingBase) entity;
if(beam.config.armorPiercingPercent == 0) {
EntityDamageUtil.attackEntityFromIgnoreIFrame(entity, damageCalc, beam.damage);
} else {
DamageSource damagePiercing = beam.config.getDamage(beam, beam.thrower, true);
EntityDamageUtil.attackArmorPiercing(living, damageCalc, damagePiercing, beam.damage, beam.config.armorPiercingPercent);
}
EntityDamageUtil.attackEntityFromNT(living, source, beam.damage, true, false, beam.config.knockbackMult, beam.config.armorThresholdNegation, beam.config.armorPiercingPercent);
}
};

View File

@ -14,6 +14,7 @@ import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.HbmAnimations.AnimType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
/**
* Despite how complicated the GunConfig looks, it actually only exists to hold together a bunch of fields. Everything else is infrastructure for getting and setting.
@ -29,9 +30,11 @@ public class GunConfig {
public static final String F_DURABILITY = "F_DURABILITY";
public static final String I_DRAWDURATION = "I_DRAWDURATION";
public static final String I_INSPECTDURATION = "I_INSPECTDURATION";
public static final String I_INSPECTCANCEL = "I_INSPECTCANCEL";
public static final String O_CROSSHAIR = "O_CROSSHAIR";
public static final String B_HIDECROSSHAIR = "B_HIDECROSSHAIR";
public static final String B_RELOADANIMATIONSEQUENTIAL = "B_RELOADANIMATIONSEQUENTIAL";
public static final String O_SCOPETEXTURE = "O_SCOPETEXTURE";
public static final String CON_SMOKE = "CON_SMOKE";
public static final String CON_ORCHESTRA = "CON_ORCHESTRA";
public static final String CON_ONPRESSPRIMARY = "CON_ONPRESSPRIMARY";
@ -53,9 +56,11 @@ public class GunConfig {
protected float durability_DNA;
protected int drawDuration_DNA = 0;
protected int inspectDuration_DNA = 0;
protected boolean inspectCancel_DNA = true;
protected Crosshair crosshair_DNA;
protected boolean hideCrosshair_DNA = true;
protected boolean reloadAnimationsSequential_DNA;
protected ResourceLocation scopeTexture_DNA;
/** Handles smoke clientside */
protected BiConsumer<ItemStack, LambdaContext> smokeHandler_DNA;
/** This piece only triggers during reloads, playing sounds depending on the reload's progress making reload sounds easier and synced to animations */
@ -82,9 +87,11 @@ public class GunConfig {
public float getDurability(ItemStack stack) { return WeaponUpgradeManager.eval(durability_DNA, stack, F_DURABILITY, this); }
public int getDrawDuration(ItemStack stack) { return WeaponUpgradeManager.eval(drawDuration_DNA, stack, I_DRAWDURATION, this); }
public int getInspectDuration(ItemStack stack) { return WeaponUpgradeManager.eval(inspectDuration_DNA, stack, I_INSPECTDURATION, this); }
public boolean getInspectCancel(ItemStack stack) { return WeaponUpgradeManager.eval(inspectCancel_DNA, stack, I_INSPECTCANCEL, this); }
public Crosshair getCrosshair(ItemStack stack) { return WeaponUpgradeManager.eval(crosshair_DNA, stack, O_CROSSHAIR, this); }
public boolean getHideCrosshair(ItemStack stack) { return WeaponUpgradeManager.eval(hideCrosshair_DNA, stack, B_HIDECROSSHAIR, this); }
public boolean getReloadAnimSequential(ItemStack stack) { return WeaponUpgradeManager.eval(reloadAnimationsSequential_DNA, stack, B_RELOADANIMATIONSEQUENTIAL, this); }
public ResourceLocation getScopeTexture(ItemStack stack) { return WeaponUpgradeManager.eval(scopeTexture_DNA, stack, O_SCOPETEXTURE, this); }
public BiConsumer<ItemStack, LambdaContext> getSmokeHandler(ItemStack stack) { return WeaponUpgradeManager.eval(smokeHandler_DNA, stack, CON_SMOKE, this); }
public BiConsumer<ItemStack, LambdaContext> getOrchestra(ItemStack stack) { return WeaponUpgradeManager.eval(this.orchestra_DNA, stack, CON_ORCHESTRA, this); }
@ -105,13 +112,15 @@ public class GunConfig {
/* SETTERS */
public GunConfig rec(Receiver... receivers) { this.receivers_DNA = receivers; return this; }
public GunConfig dura(float dura) { this.durability_DNA = dura; return this; }
public GunConfig draw(int draw) { this.drawDuration_DNA = draw; return this; }
public GunConfig inspect(int inspect) { this.inspectDuration_DNA = inspect; return this; }
public GunConfig crosshair(Crosshair crosshair) { this.crosshair_DNA = crosshair; return this; }
public GunConfig hideCrosshair(boolean flag) { this.hideCrosshair_DNA = flag; return this; }
public GunConfig reloadSequential(boolean flag) { this.reloadAnimationsSequential_DNA = flag; return this; }
public GunConfig rec(Receiver... receivers) { this.receivers_DNA = receivers; return this; }
public GunConfig dura(float dura) { this.durability_DNA = dura; return this; }
public GunConfig draw(int draw) { this.drawDuration_DNA = draw; return this; }
public GunConfig inspect(int inspect) { this.inspectDuration_DNA = inspect; return this; }
public GunConfig inspectCancel(boolean flag) { this.inspectCancel_DNA = flag; return this; }
public GunConfig crosshair(Crosshair crosshair) { this.crosshair_DNA = crosshair; return this; }
public GunConfig hideCrosshair(boolean flag) { this.hideCrosshair_DNA = flag; return this; }
public GunConfig reloadSequential(boolean flag) { this.reloadAnimationsSequential_DNA = flag; return this; }
public GunConfig scopeTexture(ResourceLocation tex) { this.scopeTexture_DNA = tex; return this; }
public GunConfig smoke(BiConsumer<ItemStack, LambdaContext> smoke) { this.smokeHandler_DNA = smoke; return this; }
public GunConfig orchestra(BiConsumer<ItemStack, LambdaContext> orchestra) { this.orchestra_DNA = orchestra; return this; }

View File

@ -1,5 +1,6 @@
package com.hbm.items.weapon.sedna;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.BiConsumer;
@ -23,6 +24,7 @@ import com.hbm.util.EnumUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -43,11 +45,26 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
public long[] lastShot;
/** [0;1] randomized every shot for various rendering applications */
public double shotRand = 0D;
public static List<Item> secrets = new ArrayList();
public static float recoilVertical = 0;
public static float recoilHorizontal = 0;
public static float recoilDecay = 0.75F;
public static float recoilRebound = 0.25F;
public static float offsetVertical = 0;
public static float offsetHorizontal = 0;
public static void setupRecoil(float vertical, float horizontal, float decay, float rebound) {
recoilVertical += vertical;
recoilHorizontal += horizontal;
recoilDecay = decay;
recoilRebound = rebound;
}
public static void setupRecoil(float vertical, float horizontal) {
setupRecoil(vertical, horizontal, 0.75F, 0.25F);
}
public static final String O_GUNCONFIG = "O_GUNCONFIG_";
@ -65,6 +82,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
public static final String KEY_ANIMTIMER = "animtimer_";
public static final String KEY_LOCKONTARGET = "lockontarget";
public static final String KEY_LOCKEDON = "lockedon";
public static final String KEY_CANCELRELOAD = "cancel";
public static ConcurrentHashMap<EntityLivingBase, AudioWrapper> loopedSounds = new ConcurrentHashMap();
@ -81,12 +99,17 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
return WeaponUpgradeManager.eval(cfg, stack, O_GUNCONFIG + index, this);
}
public int getConfigCount() {
return configs_DNA.length;
}
public ItemGunBaseNT(WeaponQuality quality, GunConfig... cfg) {
this.setMaxStackSize(1);
this.configs_DNA = cfg;
this.quality = quality;
this.lastShot = new long[cfg.length];
this.setCreativeTab(MainRegistry.weaponTab);
if(quality == WeaponQuality.A_SIDE || quality == WeaponQuality.SPECIAL) this.setCreativeTab(MainRegistry.weaponTab);
if(quality == WeaponQuality.LEGENDARY || quality == WeaponQuality.SECRET) this.secrets.add(this);
this.setTextureName(RefStrings.MODID + ":gun_darter");
}
@ -100,12 +123,11 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
}
public static enum GunState {
DRAWING, //initial delay after selecting
IDLE, //gun can be fired or reloaded
WINDUP, //fire button is down, added delay before fire
COOLDOWN, //gun has been fired, cooldown
RELOADING, //gun is currently reloading
JAMMED, //gun is jammed, either after reloading or while firing
DRAWING, //forced delay where nothing can be done
IDLE, //the gun is ready to fire or reload
COOLDOWN, //forced delay, but with option for refire
RELOADING, //forced delay after which a reload action happens, may be canceled (TBI)
JAMMED, //forced delay due to jamming
}
@SideOnly(Side.CLIENT)
@ -117,7 +139,12 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
for(Receiver rec : config.getReceivers(stack)) {
IMagazine mag = rec.getMagazine(stack);
list.add("Ammo: " + mag.getIconForHUD(stack, player).getDisplayName() + " " + mag.reportAmmoStateForHUD(stack, player));
list.add("Base Damage: " + rec.getBaseDamage(stack));
float dmg = rec.getBaseDamage(stack);
list.add("Base Damage: " + dmg);
if(mag.getType(stack, player.inventory) instanceof BulletConfig) {
BulletConfig bullet = (BulletConfig) mag.getType(stack, player.inventory);
list.add("Damage with current ammo: " + dmg * bullet.damageMult + (bullet.projectilesMin > 1 ? (" x" + (bullet.projectilesMin != bullet.projectilesMax ? (bullet.projectilesMin + "-" + bullet.projectilesMax) : bullet.projectilesMin)) : ""));
}
}
}
@ -126,7 +153,7 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
case B_SIDE: list.add(EnumChatFormatting.GOLD + "B-Side"); break;
case LEGENDARY: list.add(EnumChatFormatting.RED + "Legendary Weapon"); break;
case SPECIAL: list.add(EnumChatFormatting.AQUA + "Special Weapon"); break;
case SECRET: list.add(EnumChatFormatting.DARK_RED + "SECRET"); break;
case SECRET: list.add((BobMathUtil.getBlink() ? EnumChatFormatting.DARK_RED : EnumChatFormatting.RED) + "SECRET"); break;
case DEBUG: list.add((BobMathUtil.getBlink() ? EnumChatFormatting.YELLOW : EnumChatFormatting.GOLD) + "DEBUG"); break;
}
}
@ -161,7 +188,13 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
@Override
public void onEquip(EntityPlayer player, ItemStack stack) {
for(int i = 0; i < this.configs_DNA.length; i++) playAnimation(player, stack, AnimType.EQUIP, i);
for(int i = 0; i < this.configs_DNA.length; i++) {
playAnimation(player, stack, AnimType.EQUIP, i);
this.setPrimary(stack, i, false);
this.setSecondary(stack, i, false);
this.setTertiary(stack, i, false);
this.setReloadKey(stack, i, false);
}
}
public static void playAnimation(EntityPlayer player, ItemStack stack, AnimType type, int index) {
@ -280,6 +313,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
public static void setTertiary(ItemStack stack, int index, boolean value) { setValueBool(stack, KEY_TERTIARY + index, value); }
public static boolean getReloadKey(ItemStack stack, int index) { return getValueBool(stack, KEY_RELOAD + index); }
public static void setReloadKey(ItemStack stack, int index, boolean value) { setValueBool(stack, KEY_RELOAD + index, value); }
// RELOAD CANCEL //
public static boolean getReloadCancel(ItemStack stack) { return getValueBool(stack, KEY_CANCELRELOAD); }
public static void setReloadCancel(ItemStack stack, boolean value) { setValueBool(stack, KEY_CANCELRELOAD, value); }
/// UTIL ///
@ -339,6 +375,8 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IEquipRecei
bottomOffset += component.getComponentHeight(player, stack);
}
}
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
}
public static class SmokeNode {

View File

@ -39,6 +39,7 @@ public class Receiver {
public static final String F_FIREPITCH = "F_FIREPITCH";
public static final String O_MAGAZINE = "O_MAGAZINE";
public static final String O_PROJECTILEOFFSET = "O_PROJECTILEOFFSET";
public static final String O_PROJECTILEOFFSETSCOPED = "O_PROJECTILEOFFSETSCOPED";
public static final String FUN_CANFIRE = "FUN_CANFIRE";
public static final String CON_ONFIRE = "CON_ONFIRE";
public static final String CON_ONRECOIL = "CON_ONRECOIL";
@ -69,6 +70,7 @@ public class Receiver {
protected float firePitch_DNA = 1.0F;
protected IMagazine magazine_DNA;
protected Vec3 projectileOffset_DNA = Vec3.createVectorHelper(0, 0, 0);
protected Vec3 projectileOffsetScoped_DNA = Vec3.createVectorHelper(0, 0, 0);
protected BiFunction<ItemStack, LambdaContext, Boolean> canFire_DNA;
protected BiConsumer<ItemStack, LambdaContext> onFire_DNA;
protected BiConsumer<ItemStack, LambdaContext> onRecoil_DNA;
@ -95,25 +97,27 @@ public class Receiver {
public float getFirePitch(ItemStack stack) { return WeaponUpgradeManager.eval(this.firePitch_DNA, stack, F_FIREPITCH, this); }
public IMagazine getMagazine(ItemStack stack) { return WeaponUpgradeManager.eval(this.magazine_DNA, stack, O_MAGAZINE, this); }
public Vec3 getProjectileOffset(ItemStack stack) { return WeaponUpgradeManager.eval(this.projectileOffset_DNA, stack, O_PROJECTILEOFFSET, this); }
public Vec3 getProjectileOffsetScoped(ItemStack stack) { return WeaponUpgradeManager.eval(this.projectileOffsetScoped_DNA, stack, O_PROJECTILEOFFSETSCOPED, this); }
public BiFunction<ItemStack, LambdaContext, Boolean> getCanFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.canFire_DNA, stack, FUN_CANFIRE, this); }
public BiConsumer<ItemStack, LambdaContext> getOnFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.onFire_DNA, stack, CON_ONFIRE, this); }
public BiConsumer<ItemStack, LambdaContext> getRecoil(ItemStack stack) { return WeaponUpgradeManager.eval(this.onRecoil_DNA, stack, CON_ONRECOIL, this); }
/* SETTERS */
public Receiver dmg(float dmg) { this.baseDamage_DNA = dmg; return this; }
public Receiver delay(int delay) { this.delayAfterFire_DNA = this.delayAfterDryFire_DNA = delay; return this; }
public Receiver dry(int delay) { this.delayAfterDryFire_DNA = delay; return this; }
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; return this; }
public Receiver spread(float spread) { this.spreadModExtra_DNA = spread; return this; }
public Receiver auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
public Receiver autoAfterDry(boolean auto) { this.refireAfterDry_DNA = auto; return this; }
public Receiver dryfire(boolean dryfire) { this.doesDryFire_DNA = dryfire; return this; }
public Receiver dryfireAfterAuto(boolean dryfire) { this.doesDryFireAfterAuto_DNA = dryfire; return this; }
public Receiver ejectOnFire(boolean eject) { this.ejectOnFire_DNA = eject; return this; }
public Receiver mag(IMagazine magazine) { this.magazine_DNA = magazine; return this; }
public Receiver offset(double f, double u, double s) { this.projectileOffset_DNA = Vec3.createVectorHelper(f, u, s); return this; }
public Receiver jam(int jam) { this.jamDuration_DNA = jam; return this; }
public Receiver dmg(float dmg) { this.baseDamage_DNA = dmg; return this; }
public Receiver delay(int delay) { this.delayAfterFire_DNA = this.delayAfterDryFire_DNA = delay; return this; }
public Receiver dry(int delay) { this.delayAfterDryFire_DNA = delay; return this; }
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; return this; }
public Receiver spread(float spread) { this.spreadModExtra_DNA = spread; return this; }
public Receiver auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
public Receiver autoAfterDry(boolean auto) { this.refireAfterDry_DNA = auto; return this; }
public Receiver dryfire(boolean dryfire) { this.doesDryFire_DNA = dryfire; return this; }
public Receiver dryfireAfterAuto(boolean dryfire) { this.doesDryFireAfterAuto_DNA = dryfire; return this; }
public Receiver ejectOnFire(boolean eject) { this.ejectOnFire_DNA = eject; return this; }
public Receiver mag(IMagazine magazine) { this.magazine_DNA = magazine; return this; }
public Receiver offset(double f, double u, double s) { this.projectileOffset_DNA = Vec3.createVectorHelper(f, u, s); this.projectileOffsetScoped_DNA = Vec3.createVectorHelper(f, u, 0); return this; }
public Receiver offsetScoped(double f, double u, double s) { this.projectileOffsetScoped_DNA = Vec3.createVectorHelper(f, u, s); return this; }
public Receiver jam(int jam) { this.jamDuration_DNA = jam; return this; }
public Receiver reload(int delay) { return reload(0, delay, delay, 0, 0); }
public Receiver reload(int begin, int cycle, int end, int cock) { return reload(0, begin, cycle, end, cock); }
@ -138,6 +142,5 @@ public class Receiver {
}
public Receiver setupStandardFire() { return this.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE) .fire(Lego.LAMBDA_STANDARD_FIRE); }
public Receiver setupBeamFire() { return this.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE) .fire(Lego.LAMBDA_BEAM_FIRE); }
public Receiver setupLockonFire() { return this.canFire(Lego.LAMBDA_LOCKON_CAN_FIRE) .fire(Lego.LAMBDA_STANDARD_FIRE); }
}

View File

@ -0,0 +1,46 @@
package com.hbm.items.weapon.sedna.factory;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.toclient.AuxParticlePacketNT;
import com.hbm.particle.helper.AshesCreator;
import com.hbm.particle.helper.SkeletonCreator;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
public class ConfettiUtil {
public static void decideConfetti(EntityLivingBase entity, DamageSource source) {
if(entity.isEntityAlive()) return;
if(source.damageType.equals(DamageClass.LASER.name())) pulverize(entity);
if(source.damageType.equals(DamageClass.ELECTRIC.name())) pulverize(entity);
if(source.isExplosion()) gib(entity);
if(source.isFireDamage()) cremate(entity);
}
public static void pulverize(EntityLivingBase entity) {
int amount = MathHelper.clamp_int((int) (entity.width * entity.height * entity.width * 25), 5, 50);
AshesCreator.composeEffect(entity.worldObj, entity, amount, 0.125F);
SkeletonCreator.composeEffect(entity.worldObj, entity, 1F);
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:weapon.fire.disintegration", 2.0F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
public static void cremate(EntityLivingBase entity) {
int amount = MathHelper.clamp_int((int) (entity.width * entity.height * entity.width * 25), 5, 50);
AshesCreator.composeEffect(entity.worldObj, entity, amount, 0.125F);
SkeletonCreator.composeEffect(entity.worldObj, entity, 0.25F);
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:weapon.fire.disintegration", 2.0F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
public static void gib(EntityLivingBase entity) {
NBTTagCompound vdat = new NBTTagCompound();
vdat.setString("type", "giblets");
vdat.setInteger("ent", entity.getEntityId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, entity.posX, entity.posY + entity.height * 0.5, entity.posZ), new TargetPoint(entity.dimension, entity.posX, entity.posY + entity.height * 0.5, entity.posZ, 150));
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + entity.getRNG().nextFloat() * 0.2F);
}
}

View File

@ -28,6 +28,7 @@ public class GunFactory {
/// AMMO ITEMS ///
ModItems.ammo_debug = new Item().setUnlocalizedName("ammo_debug").setTextureName(RefStrings.MODID + ":ammo_45");
ModItems.ammo_standard = new ItemEnumMulti(EnumAmmo.class, true, true).setUnlocalizedName("ammo_standard").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_standard");
ModItems.ammo_secret = new ItemEnumMulti(EnumAmmoSecret.class, true, true).setUnlocalizedName("ammo_secret").setCreativeTab(null).setTextureName(RefStrings.MODID + ":ammo_secret");
/// BULLLET CFGS ///
ammo_debug = new BulletConfig().setItem(ModItems.ammo_debug).setSpread(0.01F).setRicochetAngle(45).setCasing(CASING44.clone().register("DEBUG0"));
@ -41,7 +42,7 @@ public class GunFactory {
.mag(new MagazineFullReload(0, 12).addConfigs(ammo_debug, ammo_debug_buckshot))
.offset(0.75, -0.0625, -0.3125D)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_STANDARD_FIRE))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY) .pr(Lego.LAMBDA_STANDARD_RELOAD) .pt(Lego.LAMBDA_TOGGLE_AIM)
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD).pt(Lego.LAMBDA_TOGGLE_AIM)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(Lego.LAMBDA_DEBUG_ANIMS)
).setUnlocalizedName("gun_debug");
@ -60,6 +61,10 @@ public class GunFactory {
XFactory50.init();
XFactoryEnergy.init();
XFactoryAccelerator.init();
XFactoryCatapult.init();
XFactory75Bolt.init();
XFactoryFolly.init();
XFactoryTurret.init();
/// PROXY BULLSHIT ///
MainRegistry.proxy.registerGunCfg();
@ -67,20 +72,27 @@ public class GunFactory {
public static enum EnumAmmo {
STONE, STONE_AP, STONE_IRON, STONE_SHOT,
M357_SP, M357_FMJ, M357_JHP, M357_AP, M357_EXPRESS,
M44_SP, M44_FMJ, M44_JHP, M44_AP, M44_EXPRESS,
M357_BP, M357_SP, M357_FMJ, M357_JHP, M357_AP, M357_EXPRESS,
M44_BP, M44_SP, M44_FMJ, M44_JHP, M44_AP, M44_EXPRESS,
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,
BMG50_SP, BMG50_FMJ, BMG50_JHP, BMG50_AP, BMG50_DU,
G12_BP, G12_BP_MAGNUM, G12_BP_SLUG, G12, G12_SLUG, G12_FLECHETTE, G12_MAGNUM, G12_EXPLOSIVE, G12_PHOSPHORUS, G12_ANTHRAX,
B75, B75_INC, B75_EXP,
G12_BP, G12_BP_MAGNUM, G12_BP_SLUG, G12, G12_SLUG, G12_FLECHETTE, G12_MAGNUM, G12_EXPLOSIVE, G12_PHOSPHORUS, //G12_ANTHRAX,
G26_FLARE, G26_FLARE_SUPPLY, G26_FLARE_WEAPON,
G40_HE, G40_HEAT, G40_DEMO, G40_INC, G40_PHOSPHORUS,
ROCKET_HE, ROCKET_HEAT, ROCKET_DEMO, ROCKET_INC, ROCKET_PHOSPHORUS,
FLAME_DIESEL, FLAME_GAS, FLAME_NAPALM, FLAME_BALEFIRE,
CAPACITOR, CAPACITOR_OVERCHARGE, CAPACITOR_BLACKLIGHTNING,
CAPACITOR, CAPACITOR_OVERCHARGE, CAPACITOR_IR,
TAU_URANIUM,
COIL_TUNGSTEN, COIL_FERROURANIUM,
NUKE_STANDARD, NUKE_DEMO, NUKE_HIGH, NUKE_TOTS, NUKE_HIVE
}
public static enum EnumAmmoSecret {
FOLLY_SM, FOLLY_NUKE,
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN
}
}

View File

@ -8,11 +8,15 @@ import static com.hbm.items.weapon.sedna.factory.XFactory40mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactory44.*;
import static com.hbm.items.weapon.sedna.factory.XFactory50.*;
import static com.hbm.items.weapon.sedna.factory.XFactory556mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactory75Bolt.*;
import static com.hbm.items.weapon.sedna.factory.XFactory762mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactory9mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryAccelerator.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryBlackPowder.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryCatapult.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryEnergy.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryFolly.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryTurret.*;
import static com.hbm.items.weapon.sedna.factory.XFactoryRocket.*;
import java.util.function.BiConsumer;
@ -33,7 +37,8 @@ public class GunFactoryClient {
//GUNS
MinecraftForgeClient.registerItemRenderer(ModItems.gun_debug, new ItemRenderDebug());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_pepperbox, new ItemRenderPepperbox());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_light_revolver, new ItemRenderAtlas());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_light_revolver, new ItemRenderAtlas(ResourceManager.bio_revolver_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_light_revolver_atlas, new ItemRenderAtlas(ResourceManager.bio_revolver_atlas_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_light_revolver_dani, new ItemRenderDANI());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_henry, new ItemRenderHenry());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_greasegun, new ItemRenderGreasegun());
@ -47,9 +52,12 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_am180, new ItemRenderAm180());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_liberator, new ItemRenderLiberator());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_congolake, new ItemRenderCongoLake());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderFlamer());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer, new ItemRenderFlamer(ResourceManager.flamethrower_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer_topaz, new ItemRenderFlamer(ResourceManager.flamethrower_topaz_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_flamer_daybreaker, new ItemRenderFlamer(ResourceManager.flamethrower_daybreaker_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_lag, new ItemRenderLAG());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi, new ItemRenderUzi());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_uzi_akimbo, new ItemRenderUziAkimbo());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_spas12, new ItemRenderSPAS12());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_panzerschreck, new ItemRenderPanzerschreck());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_g3, new ItemRenderG3());
@ -59,11 +67,18 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_autoshotgun, new ItemRenderShredder(ResourceManager.shredder_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_autoshotgun_sexy, new ItemRenderShredder(ResourceManager.sexy_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_quadro, new ItemRenderQuadro());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_minigun, new ItemRenderMinigun());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_minigun, new ItemRenderMinigun(ResourceManager.minigun_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_minigun_lacunae, new ItemRenderMinigun(ResourceManager.minigun_lacunae_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_missile_launcher, new ItemRenderMissileLauncher());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_tesla_cannon, new ItemRenderTeslaCannon());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_stg77, new ItemRenderSTG77());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_tau, new ItemRenderTau());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_fatman, new ItemRenderFatMan());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_lasrifle, new ItemRenderLasrifle());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_coilgun, new ItemRenderCoilgun());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_hangman, new ItemRenderHangman());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter, new ItemRenderBolter());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_folly, new ItemRenderFolly());
//PROJECTILES
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
ammo_debug_buckshot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -72,13 +87,15 @@ public class GunFactoryClient {
flint.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
iron.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
shot.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m357_bp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m357_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m357_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m357_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m357_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
m357_express.setRenderer(LegoClient.RENDER_EXPRESS_BULLET);
m44_bp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m44_sp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m44_fmj.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
m44_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -112,6 +129,10 @@ public class GunFactoryClient {
bmg50_jhp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
bmg50_ap.setRenderer(LegoClient.RENDER_AP_BULLET);
bmg50_du.setRenderer(LegoClient.RENDER_DU_BULLET);
b75.setRenderer(LegoClient.RENDER_AP_BULLET);
b75_inc.setRenderer(LegoClient.RENDER_AP_BULLET);
b75_exp.setRenderer(LegoClient.RENDER_EXPRESS_BULLET);
g12_bp.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
g12_bp_magnum.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -122,26 +143,41 @@ public class GunFactoryClient {
g12_magnum.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
g12_explosive.setRenderer(LegoClient.RENDER_EXPRESS_BULLET);
g12_phosphorus.setRenderer(LegoClient.RENDER_AP_BULLET);
g12_anthrax.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
//g12_anthrax.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
g12_equestrian.setRenderer(LegoClient.RENDER_LEGENDARY_BULLET);
g26_flare.setRenderer(LegoClient.RENDER_FLARE);
g26_flare_supply.setRenderer(LegoClient.RENDER_FLARE_SUPPLY);
g26_flare_weapon.setRenderer(LegoClient.RENDER_FLARE_WEAPON);
setRendererBulk(LegoClient.RENDER_GRENADE, g40_he, g40_heat, g40_demo, g40_inc);
setRendererBulk(LegoClient.RENDER_GRENADE, g40_he, g40_heat, g40_demo, g40_inc, g40_phosphorus);
setRendererBulk(LegoClient.RENDER_RPZB, rocket_rpzb);
setRendererBulk(LegoClient.RENDER_QD, rocket_qd);
setRendererBulk(LegoClient.RENDER_ML, rocket_ml);
setRendererBulk(LegoClient.RENDER_NUKE, nuke_standard, nuke_demo, nuke_high);
nuke_tots.setRenderer(LegoClient.RENDER_GRENADE);
nuke_hive.setRenderer(LegoClient.RENDER_HIVE);
setRendererBulkBeam(LegoClient.RENDER_LIGHTNING, energy_tesla, energy_tesla_overcharge);
setRendererBulkBeam(LegoClient.RENDER_TAU, tau_uranium);
setRendererBulkBeam(LegoClient.RENDER_TAU_CHARGE, tau_uranium_charge);
setRendererBulkBeam(LegoClient.RENDER_LASER_RED, energy_las, energy_las_overcharge, energy_las_ir);
setRendererBulkBeam(LegoClient.RENDER_LASER_PURPLE, energy_lacunae, energy_lacunae_overcharge, energy_lacunae_ir);
setRendererBulk(LegoClient.RENDER_AP_BULLET, coil_tungsten, coil_ferrouranium);
folly_sm.setRendererBeam(LegoClient.RENDER_FOLLY);
folly_nuke.setRenderer(LegoClient.RENDER_BIG_NUKE);
setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
//HUDS
((ItemGunBaseNT) ModItems.gun_debug) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_pepperbox) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_light_revolver) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_light_revolver_atlas) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_henry) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_greasegun) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_maresleg) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
@ -154,6 +190,8 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_liberator) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_congolake) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_flamer) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO_NOCOUNTER);
((ItemGunBaseNT) ModItems.gun_flamer_topaz) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO_NOCOUNTER);
((ItemGunBaseNT) ModItems.gun_flamer_daybreaker) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO_NOCOUNTER);
((ItemGunBaseNT) ModItems.gun_uzi) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_spas12) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_panzerschreck) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
@ -166,15 +204,24 @@ public class GunFactoryClient {
((ItemGunBaseNT) ModItems.gun_quadro) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_lag) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_minigun) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_minigun_lacunae) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_missile_launcher) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_tesla_cannon) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_stg77) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_tau) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_fatman) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_lasrifle) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_coilgun) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_hangman) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_bolter) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_folly) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_light_revolver_dani) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_light_revolver_dani) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
}
public static void setRendererBulk(BiConsumer<EntityBulletBaseMK4, Float> renderer, BulletConfig... configs) { for(BulletConfig config : configs) config.setRenderer(renderer); }

View File

@ -63,9 +63,10 @@ public class GunStateDecider {
IMagazine mag = rec.getMagazine(stack);
mag.reloadAction(stack, ctx.inventory);
boolean cancel = ItemGunBaseNT.getReloadCancel(stack);
//if after reloading the gun can still reload, assume a tube mag and resume reloading
if(mag.canReload(stack, ctx.inventory)) {
if(!cancel && mag.canReload(stack, ctx.inventory)) {
ItemGunBaseNT.setState(stack, gunIndex, GunState.RELOADING);
ItemGunBaseNT.setTimer(stack, gunIndex, rec.getReloadCycleDuration(stack));
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_CYCLE, gunIndex);
@ -82,6 +83,8 @@ public class GunStateDecider {
ItemGunBaseNT.setTimer(stack, gunIndex, duration);
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD_END, gunIndex);
}
ItemGunBaseNT.setReloadCancel(stack, false);
}
mag.setAmountAfterReload(stack, mag.getAmount(stack, ctx.inventory));

View File

@ -6,6 +6,7 @@ import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
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;
@ -13,6 +14,7 @@ import com.hbm.explosion.vanillant.standard.ExplosionEffectWeapon;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.interfaces.NotableComments;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.BulletConfig.ProjectileType;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
@ -20,7 +22,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.SmokeNode;
import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.particle.helper.BlackPowderHelper;
import com.hbm.particle.helper.BlackPowderCreator;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
@ -64,6 +66,10 @@ public class Lego {
ItemGunBaseNT.playAnimation(player, stack, AnimType.RELOAD, ctx.configIndex);
} else {
ItemGunBaseNT.playAnimation(player, stack, AnimType.INSPECT, ctx.configIndex);
if(!ctx.config.getInspectCancel(stack)) {
ItemGunBaseNT.setState(stack, ctx.configIndex, GunState.DRAWING);
ItemGunBaseNT.setTimer(stack, ctx.configIndex, ctx.config.getInspectDuration(stack));
}
}
}
};
@ -101,6 +107,10 @@ public class Lego {
}
}
}
if(state == GunState.RELOADING) {
ItemGunBaseNT.setReloadCancel(stack, true);
}
}
/** If IDLE, switch mode between 0 and 1. */
@ -120,12 +130,6 @@ public class Lego {
}
};
/** Toggles isAiming. Used by keybinds. */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_RECOIL = (stack, ctx) -> {
//ItemGunBaseNT.recoilVertical += 10;
//ItemGunBaseNT.recoilHorizontal += ctx.player.getRNG().nextGaussian() * 1.5;
};
/** Default smoke. */
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_STANDARD_SMOKE = (stack, ctx) -> {
handleStandardSmoke(ctx.entity, stack, 2000, 0.025D, 1.15D, ctx.configIndex);
@ -190,9 +194,6 @@ public class Lego {
doStandardFire(stack, ctx, AnimType.CYCLE, true);
ItemGunBaseNT.setIsLockedOn(stack, false);
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_BEAM_FIRE = (stack, ctx) -> {
doBeamFire(stack, ctx, AnimType.CYCLE, true);
};
public static void doStandardFire(ItemStack stack, LambdaContext ctx, AnimType anim, boolean calcWear) {
EntityLivingBase entity = ctx.entity;
@ -204,11 +205,11 @@ public class Lego {
Receiver primary = ctx.config.getReceivers(stack)[0];
IMagazine mag = primary.getMagazine(stack);
BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory);
Vec3 offset = primary.getProjectileOffset(stack);
Vec3 offset = ItemGunBaseNT.getIsAiming(stack) ? primary.getProjectileOffsetScoped(stack) : primary.getProjectileOffset(stack);
double forwardOffset = offset.xCoord;
double heightOffset = offset.yCoord;
double sideOffset = ItemGunBaseNT.getIsAiming(stack) ? 0 : offset.zCoord; //TODO: make this configurable
double sideOffset = offset.zCoord;
/*forwardOffset = 0.75;
heightOffset = -0.125;
@ -220,45 +221,21 @@ public class Lego {
for(int i = 0; i < projectiles; i++) {
float damage = calcDamage(ctx, stack, primary, calcWear, index);
float spread = calcSpread(ctx, stack, primary, calcWear, index, aim);
EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
if(ItemGunBaseNT.getIsLockedOn(stack)) mk4.lockonTarget = entity.worldObj.getEntityByID(ItemGunBaseNT.getLockonTarget(stack));
if(i == 0 && config.blackPowder) BlackPowderHelper.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
entity.worldObj.spawnEntityInWorld(mk4);
}
mag.useUpAmmo(stack, ctx.inventory, 1);
if(calcWear) ItemGunBaseNT.setWear(stack, index, Math.min(ItemGunBaseNT.getWear(stack, index) + config.wear, ctx.config.getDurability(stack)));
}
//shittily copy pasted because god damn this sucks ass why do projectiles need this much fucking setup jesus christ have mercy
public static void doBeamFire(ItemStack stack, LambdaContext ctx, AnimType anim, boolean calcWear) {
EntityLivingBase entity = ctx.entity;
EntityPlayer player = ctx.getPlayer();
int index = ctx.configIndex;
if(anim != null) ItemGunBaseNT.playAnimation(player, stack, anim, ctx.configIndex);
float aim = ItemGunBaseNT.getIsAiming(stack) ? 0.25F : 1F;
Receiver primary = ctx.config.getReceivers(stack)[0];
IMagazine mag = primary.getMagazine(stack);
BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory);
Vec3 offset = primary.getProjectileOffset(stack);
double forwardOffset = offset.xCoord;
double heightOffset = offset.yCoord;
double sideOffset = ItemGunBaseNT.getIsAiming(stack) ? 0 : offset.zCoord;
/*forwardOffset = 0.75;
heightOffset = 0;
sideOffset = -0.375D;*/
int projectiles = config.projectilesMin;
if(config.projectilesMax > config.projectilesMin) projectiles += entity.getRNG().nextInt(config.projectilesMax - config.projectilesMin + 1);
for(int i = 0; i < projectiles; i++) {
float damage = calcDamage(ctx, stack, primary, calcWear, index);
float spread = calcSpread(ctx, stack, primary, calcWear, index, aim);
EntityBulletBeamBase mk4 = new EntityBulletBeamBase(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
entity.worldObj.spawnEntityInWorld(mk4);
if(config.pType == ProjectileType.BULLET) {
EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
if(ItemGunBaseNT.getIsLockedOn(stack)) mk4.lockonTarget = entity.worldObj.getEntityByID(ItemGunBaseNT.getLockonTarget(stack));
if(i == 0 && config.blackPowder) BlackPowderCreator.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
entity.worldObj.spawnEntityInWorld(mk4);
} else if(config.pType == ProjectileType.BULLET_CHUNKLOADING) {
EntityBulletBaseMK4CL mk4 = new EntityBulletBaseMK4CL(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
if(ItemGunBaseNT.getIsLockedOn(stack)) mk4.lockonTarget = entity.worldObj.getEntityByID(ItemGunBaseNT.getLockonTarget(stack));
if(i == 0 && config.blackPowder) BlackPowderCreator.composeEffect(entity.worldObj, mk4.posX, mk4.posY, mk4.posZ, mk4.motionX, mk4.motionY, mk4.motionZ, 10, 0.25F, 0.5F, 10, 0.25F);
entity.worldObj.spawnEntityInWorld(mk4);
} else if(config.pType == ProjectileType.BEAM) {
EntityBulletBeamBase mk4 = new EntityBulletBeamBase(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
entity.worldObj.spawnEntityInWorld(mk4);
}
}
mag.useUpAmmo(stack, ctx.inventory, 1);
@ -296,7 +273,7 @@ public class Lego {
public static void standardExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range) { standardExplode(bullet, mop, range, 1F); }
public static void standardExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range, float damageMod) {
ExplosionVNT vnt = new ExplosionVNT(bullet.worldObj, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, range);
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, bullet.damage * damageMod));
vnt.setEntityProcessor(new EntityProcessorCrossSmooth(1, bullet.damage * damageMod).setupPiercing(bullet.config.armorThresholdNegation, bullet.config.armorPiercingPercent));
vnt.setPlayerProcessor(new PlayerProcessorStandard());
vnt.setSFX(new ExplosionEffectWeapon(10, 2.5F, 1F));
vnt.explode();

View File

@ -10,6 +10,7 @@ import com.hbm.items.weapon.sedna.hud.HUDComponentAmmoCounter;
import com.hbm.items.weapon.sedna.hud.HUDComponentDurabilityBar;
import com.hbm.lib.RefStrings;
import com.hbm.main.ResourceManager;
import com.hbm.render.tileentity.RenderArcFurnace;
import com.hbm.render.util.BeamPronter;
import com.hbm.render.util.BeamPronter.EnumBeamType;
import com.hbm.render.util.BeamPronter.EnumWaveType;
@ -18,6 +19,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
@ -120,10 +122,18 @@ public class LegoClient {
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_FLARE_WEAPON = (bullet, interp) -> { renderFlare(bullet, interp, 0.5F, 1F, 0.5F); };
private static final ResourceLocation flare = new ResourceLocation(RefStrings.MODID + ":textures/particle/flare.png");
public static void renderFlare(EntityBulletBaseMK4 bullet, float interp, float r, float g, float b) {
public static void renderFlare(Entity bullet, float interp, float r, float g, float b) {
if(bullet.ticksExisted < 2) return;
RenderArcFurnace.fullbright(true);
double scale = Math.min(5, (bullet.ticksExisted + interp - 2) * 0.5) * (0.8 + bullet.worldObj.rand.nextDouble() * 0.4);
renderFlareSprite(bullet, interp, r, g, b, scale, 0.5F, 0.75F);
RenderArcFurnace.fullbright(false);
}
public static void renderFlareSprite(Entity bullet, float interp, float r, float g, float b, double scale, float outerAlpha, float innerAlpha) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
@ -146,9 +156,8 @@ public class LegoClient {
double posX = 0;
double posY = 0;
double posZ = 0;
double scale = Math.min(5, (bullet.ticksExisted + interp - 2) * 0.5) * (0.8 + bullet.worldObj.rand.nextDouble() * 0.4);
tess.setColorRGBA_F(r, g, b, 0.5F);
tess.setColorRGBA_F(r, g, b, outerAlpha);
tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1);
tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0);
tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0);
@ -156,7 +165,7 @@ public class LegoClient {
scale *= 0.5D;
tess.setColorRGBA_F(1F, 1F, 1F, 0.75F);
tess.setColorRGBA_F(1F, 1F, 1F, innerAlpha);
tess.addVertexWithUV((double) (posX - f1 * scale - f3 * scale), (double) (posY - f5 * scale), (double) (posZ - f2 * scale - f4 * scale), 1, 1);
tess.addVertexWithUV((double) (posX - f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ - f2 * scale + f4 * scale), 1, 0);
tess.addVertexWithUV((double) (posX + f1 * scale + f3 * scale), (double) (posY + f5 * scale), (double) (posZ + f2 * scale + f4 * scale), 0, 0);
@ -181,6 +190,15 @@ public class LegoClient {
GL11.glShadeModel(GL11.GL_FLAT);
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_BIG_NUKE = (bullet, interp) -> {
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glRotated(90, 0, 0, 1);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rocket_mirv_tex);
ResourceManager.projectiles.renderPart("MissileMIRV");
GL11.glShadeModel(GL11.GL_FLAT);
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_RPZB = (bullet, interp) -> {
GL11.glPushMatrix();
@ -231,7 +249,8 @@ public class LegoClient {
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LIGHTNING = (bullet, interp) -> {
RenderArcFurnace.fullbright(true);
GL11.glPushMatrix();
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
@ -245,10 +264,12 @@ public class LegoClient {
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorOuter, colorOuter, bullet.ticksExisted, (int)(bullet.beamLength / 2 + 1), (float)scale * 7F, 2, 0.0625F);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorOuter, colorOuter, bullet.ticksExisted / 2, (int)(bullet.beamLength / 2 + 1), (float)scale * 7F, 2, 0.0625F);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(false);
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_TAU = (bullet, interp) -> {
RenderArcFurnace.fullbright(true);
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
GL11.glPushMatrix();
@ -269,10 +290,12 @@ public class LegoClient {
renderBulletStandard(Tessellator.instance, 0xFFBF00, 0xFFFFFF, bullet.beamLength, true);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(false);
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_TAU_CHARGE = (bullet, interp) -> {
RenderArcFurnace.fullbright(true);
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
GL11.glPushMatrix();
@ -293,5 +316,80 @@ public class LegoClient {
renderBulletStandard(Tessellator.instance, 0xFFF0A0, 0xFFFFFF, bullet.beamLength, true);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(false);
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_RED = (bullet, interp) -> {
renderStandardLaser(bullet, interp, 0x80, 0x15, 0x15);
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_PURPLE = (bullet, interp) -> {
renderStandardLaser(bullet, interp, 0x60, 0x15, 0x80);
};
public static void renderStandardLaser(EntityBulletBeamBase bullet, float interp, int r, int g, int b) {
RenderArcFurnace.fullbright(true);
GL11.glPushMatrix();
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
Vec3 delta = Vec3.createVectorHelper(0, bullet.beamLength, 0);
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
GL11.glScaled(age / 2 + 0.5, 1, age / 2 + 0.5);
int colorInner = ((int)(r * age) << 16) | ((int)(g * age) << 8) | (int) (b * age);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorInner, colorInner, bullet.ticksExisted / 3, (int)(bullet.beamLength / 2 + 1), 0F, 8, 0.0625F);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(false);
}
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_FOLLY = (bullet, interp) -> {
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
RenderArcFurnace.fullbright(true);
GL11.glPushMatrix();
renderFlareSprite(bullet, interp, 1F, 1F, 1F, (1 - age) * 7.5 + 1.5, 0.5F * (float) age, 0.75F * (float) age);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
Vec3 delta = Vec3.createVectorHelper(0, bullet.beamLength, 0);
GL11.glScaled((1 - age) * 25 + 2.5, 1, (1 - age) * 25 + 2.5);
int colorInner = ((int)(0x20 * age) << 16) | ((int)(0x20 * age) << 8) | (int) (0x20 * age);
BeamPronter.prontBeam(delta, EnumWaveType.RANDOM, EnumBeamType.SOLID, colorInner, colorInner, bullet.ticksExisted / 3, (int)(bullet.beamLength / 2 + 1), 0F, 8, 0.0625F);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(false);
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_NUKE = (bullet, interp) -> {
GL11.glPushMatrix();
GL11.glScalef(0.125F, 0.125F, 0.125F);
GL11.glRotated(-90, 0, 1, 0);
GL11.glTranslatef(0, -1, 1F);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.fatman_mininuke_tex);
ResourceManager.fatman.renderPart("MiniNuke");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
};
public static BiConsumer<EntityBulletBaseMK4, Float> RENDER_HIVE = (bullet, interp) -> {
GL11.glPushMatrix();
GL11.glScalef(0.125F, 0.125F, 0.125F);
GL11.glRotated(90, 0, -1, 0);
GL11.glTranslatef(0, 0, 3.5F);
GL11.glShadeModel(GL11.GL_SMOOTH);
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.panzerschreck_tex);
ResourceManager.panzerschreck.renderPart("Rocket");
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
};
}

View File

@ -16,11 +16,15 @@ import com.hbm.particle.SpentCasing;
import com.hbm.particle.helper.CasingCreator;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.sound.AudioWrapper;
import com.hbm.util.EntityDamageUtil;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
/** Orchestras are server-side components that run along client-side animations.
* The orchestra only knows what animation is or was playing and how long it started, but not if it is still active.
@ -569,12 +573,49 @@ public class Orchestras {
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FLAMER_DAYBREAKER = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.RELOAD) {
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.openLatch", 1F, 1F);
if(timer == 35) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.impact", 0.5F, 1F);
if(timer == 60) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.75F);
if(timer == 70) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.insertCanister", 1F, 1F);
if(timer == 85) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pressureValve", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_LAG = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.CYCLE) {
if(timer == 1) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.0625, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 1F);
}
if(type == AnimType.RELOAD) {
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 26) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.impact", 0.5F, 1.6F);
if(timer == 36) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_UZI = (stack, ctx) -> {
@ -609,6 +650,38 @@ public class Orchestras {
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_UZI_AKIMBO = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.EQUIP) {
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.openLatch", 1F, 1.25F);
}
if(type == AnimType.CYCLE) {
if(timer == 1) {
int mult = ctx.configIndex == 0 ? -1 : 1;
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, -0.125, -0.375D * mult, 0, 0.18, -0.12 * mult, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
if(type == AnimType.RELOAD) {
if(timer == 4) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 26) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 36) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 17) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1F);
if(timer == 31) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_SPAS = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
@ -623,6 +696,10 @@ public class Orchestras {
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunCock", 1F, 1F);
}
if(type == AnimType.RELOAD) {
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
if(mag.getAmount(stack, ctx.inventory) == 0) {
@ -634,6 +711,15 @@ public class Orchestras {
if(type == AnimType.RELOAD_CYCLE) {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunReload", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunCockOpen", 1F, 1F);
if(timer == 18) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunCockClose", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 18) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.foley.gunWhack", 1F, 1F);
if(timer == 25) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.foley.gunWhack", 1F, 1F);
if(timer == 29) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunCockClose", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_PANERSCHRECK = (stack, ctx) -> {
@ -662,8 +748,7 @@ public class Orchestras {
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.8F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 9) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 0.9F);
}
if(type == AnimType.RELOAD) {
@ -831,6 +916,9 @@ public class Orchestras {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.75F);
if(timer == 1) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
if(type == AnimType.INSPECT) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
}
@ -880,27 +968,61 @@ public class Orchestras {
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.CYCLE) {
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.8F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 0.9F);
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 10) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 24) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 34) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 10) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 114) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
if(timer == 124) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(ClientConfig.GUN_ANIMS_LEGACY.get()) {
if(type == AnimType.CYCLE) {
if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.125, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.8F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 0.9F);
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 10) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 24) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 34) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 10) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 114) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
if(timer == 124) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
} else {
if(type == AnimType.CYCLE) {
if(timer == 0) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.25, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
}
if(type == AnimType.CYCLE_DRY) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.8F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 0.9F);
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 16) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 32) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.impact", 0.25F, 1.25F);
if(timer == 38) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 43) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
if(timer == 11) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 72) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
if(timer == 84) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
}
};
@ -979,4 +1101,141 @@ public class Orchestras {
}
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FATMAN = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.fatmanFull", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_LASRIFLE = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
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 == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 18) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.impact", 0.25F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 38) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.INSPECT) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 12) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
if(type == AnimType.JAMMED) {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 1F);
if(timer == 22) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
if(timer == 30) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_COILGUN = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.coilgunReload", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_HANGMAN = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
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, 1F);
}
if(type == AnimType.RELOAD) {
if(timer == 0) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.8F);
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 0.8F);
if(timer == 25) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 35) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.75F);
if(timer == 10) {
Receiver rec = ctx.config.getReceivers(stack)[0];
IMagazine mag = rec.getMagazine(stack);
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.25, -0.25, -0.125, -0.05, 0, 0, 0.01, casing.getName());
}
}
if(type == AnimType.INSPECT) {
if(timer == 16 && ctx.getPlayer() != null) {
MovingObjectPosition mop = EntityDamageUtil.getMouseOver(ctx.getPlayer(), 3.0D);
if(mop != null) {
if(mop.typeOfHit == mop.typeOfHit.ENTITY) {
float damage = 10F;
mop.entityHit.attackEntityFrom(DamageSource.causePlayerDamage(ctx.getPlayer()), damage);
mop.entityHit.motionX *= 2;
mop.entityHit.motionZ *= 2;
entity.worldObj.playSoundAtEntity(mop.entityHit, "hbm:weapon.fire.smack", 1F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
if(mop.typeOfHit == mop.typeOfHit.BLOCK) {
Block b = entity.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ);
entity.worldObj.playSoundEffect(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord, b.stepSound.getStepResourcePath(), 2F, 0.9F + entity.getRNG().nextFloat() * 0.2F);
}
}
}
}
if(type == AnimType.JAMMED) {
if(timer == 10) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.8F);
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 0.8F);
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 1F);
if(timer == 25) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverCock", 1F, 0.75F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_BOLTER = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
if(type == AnimType.CYCLE) {
if(timer == 1) {
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
}
}
if(type == AnimType.RELOAD) {
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magRemove", 1F, 1F);
if(timer == 26) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magInsert", 1F, 1F);
}
};
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_FOLLY = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
if(type == AnimType.RELOAD) {
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.screw", 1F, 1F);
if(timer == 80) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.insertRocket", 1F, 1F);
if(timer == 120) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.screw", 1F, 1F);
}
};
}

View File

@ -4,6 +4,7 @@ import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair;
@ -14,6 +15,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.GunState;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
import com.hbm.items.weapon.sedna.mags.MagazineFullReload;
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
import com.hbm.main.MainRegistry;
@ -50,46 +52,47 @@ public class XFactory12ga {
public static void init() {
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setBlackPowder(true).setProjectiles(8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setBlackPowder(true).setProjectiles(4).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setBlackPowder(true).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG"));
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setBlackPowder(true).setProjectiles(8).setDamage(0.5F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setBlackPowder(true).setProjectiles(4).setDamage(0.5F/4F).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setBlackPowder(true).setDamage(0.5F).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG"));
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8).setDamage(1F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
g12_slug = new BulletConfig().setItem(EnumAmmo.G12_SLUG).setSpread(0.0F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x393939, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_SLUG"));
g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setProjectiles(8).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE"));
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setProjectiles(4).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE"));
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setProjectiles(8).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"));
g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX"));
g12_equestrian = new BulletConfig().setItem(EnumAmmo.G12_EQUESTRIAN).setDamage(0F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_EQUESTRIAN, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12gaEquestrian"));
g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setProjectiles(8).setDamage(1F/8F).setThresholdNegation(5F).setArmorPiercing(0.2F).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE"));
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setProjectiles(4).setDamage(2F/4F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setDamage(2.5F).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE"));
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"))
.setOnImpact((bullet, mop) -> { if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase) { HbmLivingProps data = HbmLivingProps.getData((EntityLivingBase) mop.entityHit); if(data.phosphorus < 300) data.phosphorus = 300; } });
//g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX"));
g12_equestrian = new BulletConfig().setItem(EnumAmmoSecret.G12_EQUESTRIAN).setDamage(0F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_EQUESTRIAN, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12gaEquestrian"));
BulletConfig[] all = new BulletConfig[] {g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus, g12_anthrax};
BulletConfig[] all = new BulletConfig[] {g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus};
ModItems.gun_maresleg = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(10).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(16F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
.setupStandardConfiguration()
.anim(LAMBDA_MARESLEG_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG)
).setUnlocalizedName("gun_maresleg");
ModItems.gun_maresleg_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(16F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, 0.1875D)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
.pp(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO),
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(1, 6).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
.ps(Lego.LAMBDA_STANDARD_CLICK_PRIMARY).pr(Lego.LAMBDA_STANDARD_RELOAD)
.decider(GunStateDecider.LAMBDA_STANDARD_DECIDER)
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO)
@ -97,10 +100,10 @@ public class XFactory12ga {
ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(32F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(Lego.LAMBDA_STANDARD_RECOIL))
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(LAMBDA_RECOIL_MARESLEG))
.setupStandardConfiguration()
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_SHORT)
).setUnlocalizedName("gun_maresleg_broken");
@ -108,10 +111,10 @@ public class XFactory12ga {
ModItems.gun_liberator = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(200).draw(20).inspect(21).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).rounds(4).reload(25, 15, 7, 0).jam(45).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(8F).delay(20).rounds(4).reload(25, 15, 7, 0).jam(45).sound("hbm:weapon.fire.shotgunAlt", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 4).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_LIBERATOR))
.setupStandardConfiguration()
.anim(LAMBDA_LIBERATOR_ANIMS).orchestra(Orchestras.ORCHESTRA_LIBERATOR)
).setUnlocalizedName("gun_liberator");
@ -119,10 +122,10 @@ public class XFactory12ga {
ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(12F).delay(20).reload(5, 10, 10, 10, 0).jam(24).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
.dmg(32F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 8).addConfigs(all))
.offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
.setupStandardConfiguration().ps(LAMBDA_SPAS_SECONDARY).pt(null)
.anim(LAMBDA_SPAS_ANIMS).orchestra(Orchestras.ORCHESTRA_SPAS)
).setUnlocalizedName("gun_spas12");
@ -130,25 +133,41 @@ public class XFactory12ga {
ModItems.gun_autoshotgun = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(2_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(10).auto(true).autoAfterDry(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.dmg(48F).delay(10).auto(true).autoAfterDry(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.shotgunAuto", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 20).addConfigs(all))
.offset(0.75, -0.125, -0.25)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_AUTOSHOTGUN))
.setupStandardConfiguration()
.anim(LAMBDA_SHREDDER_ANIMS).orchestra(Orchestras.ORCHESTRA_SHREDDER)
).setUnlocalizedName("gun_autoshotgun");
ModItems.gun_autoshotgun_sexy = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(5_000).draw(10).inspect(33).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0)
.dmg(15F).delay(1).auto(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.blackPowder", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 100).addConfigs(g12_equestrian, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus, g12_anthrax))
.dmg(64F).delay(1).auto(true).dryfireAfterAuto(true).reload(44).jam(19).sound("hbm:weapon.fire.shotgunAuto", 1.0F, 1.0F)
.mag(new MagazineFullReload(0, 100).addConfigs(g12_equestrian, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus))
.offset(0.75, -0.125, -0.25)
.setupStandardFire().recoil(Lego.LAMBDA_STANDARD_RECOIL))
.setupStandardFire().recoil(LAMBDA_RECOIL_SEXY))
.setupStandardConfiguration()
.anim(LAMBDA_SEXY_ANIMS).orchestra(Orchestras.ORCHESTRA_SHREDDER_SEXY)
).setUnlocalizedName("gun_autoshotgun_sexy");
}
//TODO: make generic code for this crap
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_MARESLEG = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil(10, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_LIBERATOR = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil(5, (float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_AUTOSHOTGUN = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 1.5) + 1.5F, (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_SEXY = (stack, ctx) -> {
ItemGunBaseNT.setupRecoil((float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5), (float) (ctx.getPlayer().getRNG().nextGaussian() * 0.5));
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_SPAS_SECONDARY = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity;
EntityPlayer player = ctx.getPlayer();
@ -177,6 +196,9 @@ public class XFactory12ga {
}
}
}
if(state == GunState.RELOADING) {
ItemGunBaseNT.setReloadCancel(stack, true);
}
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_MARESLEG_ANIMS = (stack, type) -> {
@ -348,14 +370,15 @@ public class XFactory12ga {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-60, 0, 0, 0).addPos(0, 0, -3, 500, IType.SIN_DOWN));
case CYCLE: return ResourceManager.spas_12_anim.get("Fire");
case CYCLE_DRY: return new BusAnimation();
case CYCLE_DRY: return ResourceManager.spas_12_anim.get("FireDry");
case ALT_CYCLE: return ResourceManager.spas_12_anim.get("FireAlt");
case RELOAD:
boolean empty = ((ItemGunBaseNT) stack.getItem()).getConfig(stack, 0).getReceivers(stack)[0].getMagazine(stack).getAmount(stack, MainRegistry.proxy.me().inventory) <= 0;
return ResourceManager.spas_12_anim.get(empty ? "ReloadEmptyStart" : "ReloadStart");
case RELOAD_CYCLE: return ResourceManager.spas_12_anim.get("Reload");
case RELOAD_END: return ResourceManager.spas_12_anim.get("ReloadEnd");
case JAMMED: return new BusAnimation();
case INSPECT: return new BusAnimation();
case JAMMED: return ResourceManager.spas_12_anim.get("Jammed");
case INSPECT: return ResourceManager.spas_12_anim.get("Inspect");
}
return null;

Some files were not shown because too many files have changed in this diff Show More