Merge branch 'master' into GradleFix

This commit is contained in:
HbmMods 2023-02-06 07:53:06 +01:00 committed by GitHub
commit 0e3b6b343e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
221 changed files with 6377 additions and 18860 deletions

View File

@ -1,6 +1,8 @@
package api.hbm.energy;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public interface IBatteryItem {
@ -11,4 +13,31 @@ public interface IBatteryItem {
public long getMaxCharge();
public long getChargeRate();
public long getDischargeRate();
/** Returns a string for the NBT tag name of the long storing power */
public default String getChargeTagName() {
return "charge";
}
/** Returns a string for the NBT tag name of the long storing power */
public static String getChargeTagName(ItemStack stack) {
return ((IBatteryItem) stack.getItem()).getChargeTagName();
}
/** Returns an empty battery stack from the passed ItemStack, the original won't be modified */
public static ItemStack emptyBattery(ItemStack stack) {
if(stack != null && stack.getItem() instanceof IBatteryItem) {
String keyName = getChargeTagName(stack);
ItemStack stackOut = stack.copy();
stackOut.stackTagCompound = new NBTTagCompound();
stackOut.stackTagCompound.setLong(keyName, 0);
return stackOut.copy();
}
return null;
}
/** Returns an empty battery stack from the passed Item */
public static ItemStack emptyBattery(Item item) {
return item instanceof IBatteryItem ? emptyBattery(new ItemStack(item)) : null;
}
}

View File

@ -3,6 +3,7 @@ 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.lib.RefStrings;
@ -17,19 +18,16 @@ import net.minecraft.world.World;
public class BlockAmmoCrate extends Block {
@SideOnly(Side.CLIENT)
private IIcon iconTop;
@SideOnly(Side.CLIENT)
private IIcon iconBottom;
@SideOnly(Side.CLIENT) private IIcon iconTop;
@SideOnly(Side.CLIENT) private IIcon iconBottom;
public BlockAmmoCrate(Material p_i45394_1_) {
super(p_i45394_1_);
public BlockAmmoCrate(Material mat) {
super(mat);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":crate_ammo_top");
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":crate_ammo_bottom");
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":crate_ammo_side");
@ -42,35 +40,37 @@ public class BlockAmmoCrate extends Block {
}
Random rand = new Random();
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ret.add(new ItemStack(ModItems.cap_nuka, 12 + rand.nextInt(21)));
ret.add(new ItemStack(ModItems.syringe_metal_stimpak, 1 + rand.nextInt(3)));
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
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.gun_revolver_ammo, 10 + rand.nextInt(11)));
if(rand.nextBoolean()) ret.add(new ItemStack(ModItems.gun_revolver_iron_ammo, 12 + rand.nextInt(15)));
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)));
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.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_12gauge_incendiary, 3));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_incendiary, 3));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_caustic, 3));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_20gauge_flechette, 3));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_9mm_ap, 7));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket_incendiary, 1));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_rocket_sleek, 1));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_he, 1));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_incendiary, 1));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.ammo_grenade_sleek, 1));
if(rand.nextInt(10) == 0) ret.add(new ItemStack(ModItems.syringe_metal_super, 2));
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)));
return ret;
}
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,6 +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.ModItems;
import net.minecraft.block.BlockFalling;
@ -18,219 +19,219 @@ import net.minecraft.world.World;
public class BlockCrate extends BlockFalling {
List<Item> crateList;
List<Item> weaponList;
List<Item> leadList;
List<Item> metalList;
List<Item> redList;
List<ItemStack> crateList;
List<ItemStack> weaponList;
List<ItemStack> leadList;
List<ItemStack> metalList;
List<ItemStack> redList;
public BlockCrate(Material p_i45394_1_) {
super(p_i45394_1_);
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
{
return null;
}
@Override
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return null;
}
@Override
@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))
{
dropItems(world, x, y, z);
world.setBlockToAir(x, y, z);
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
return true;
} else {
if(world.isRemote)
{
if(player.getHeldItem() != null && player.getHeldItem().getItem().equals(ModItems.crowbar)) {
dropItems(world, x, y, z);
world.setBlockToAir(x, y, z);
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
return true;
} else {
if(world.isRemote) {
player.addChatMessage(new ChatComponentText("I'll need a crate opening device to get the loot, smashing the whole thing won't work..."));
}
}
}
return true;
}
return true;
}
public void setDrops() {
public void setDrops() {
crateList = new ArrayList<Item>();
weaponList = new ArrayList<Item>();
leadList = new ArrayList<Item>();
metalList = new ArrayList<Item>();
redList = new ArrayList<Item>();
crateList = new ArrayList();
weaponList = new ArrayList();
leadList = new ArrayList();
metalList = new ArrayList();
redList = new ArrayList();
//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);
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_flare, 4);
BlockCrate.addToListWithWeight(crateList, ModItems.ammo_container, 2);
// 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);
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_flare, 4);
BlockCrate.addToListWithWeight(crateList, ModItems.ammo_container, 2);
//Weapon Crate
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_iron, 10);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver, 9);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_gold, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_lead, 8);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_cursed, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_calamity, 3);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_rpg, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_karl, 4);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_panzerschreck, 6);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_hk69, 8);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_stinger, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_mp40, 9);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_uzi, 6);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_uzi_silencer, 5);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_uboinik, 8);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_lever_action, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_bolt_action, 7);
// Weapon Crate
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_iron, 10);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver, 9);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_gold, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_lead, 8);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_revolver_cursed, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_calamity, 3);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_rpg, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_karl, 4);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_panzerschreck, 6);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_hk69, 8);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_stinger, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_mp40, 9);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_uzi, 6);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_uzi_silencer, 5);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_uboinik, 8);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_lever_action, 7);
BlockCrate.addToListWithWeight(weaponList, ModItems.gun_bolt_action, 7);
//Lead Crate
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_uranium, 10);
//BlockCrate.addToListWithWeight(leadList, ModItems.ingot_u235, 5);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_u238, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_plutonium, 7);
//BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu238, 5);
//BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu239, 4);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu240, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_neptunium, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_uranium_fuel, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_plutonium_fuel, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_mox_fuel, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_uranium, 10);
//BlockCrate.addToListWithWeight(leadList, ModItems.nugget_u235, 5);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_u238, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_plutonium, 7);
//BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu238, 5);
//BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu239, 4);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu240, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_neptunium, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_uranium_fuel, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_plutonium_fuel, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_mox_fuel, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_deuterium, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_tritium, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_uf6, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_puf6, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.pellet_rtg, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.pellet_rtg_weak, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.tritium_deuterium_cake, 5);
BlockCrate.addToListWithWeight(leadList, ModItems.powder_yellowcake, 10);
// Lead Crate
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_uranium, 10);
// BlockCrate.addToListWithWeight(leadList, ModItems.ingot_u235, 5);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_u238, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_plutonium, 7);
// BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu238, 5);
// BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu239, 4);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_pu240, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_neptunium, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_uranium_fuel, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_plutonium_fuel, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.ingot_mox_fuel, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_uranium, 10);
// BlockCrate.addToListWithWeight(leadList, ModItems.nugget_u235, 5);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_u238, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_plutonium, 7);
// BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu238, 5);
// BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu239, 4);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_pu240, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_neptunium, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_uranium_fuel, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_plutonium_fuel, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.nugget_mox_fuel, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_deuterium, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_tritium, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_uf6, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.cell_puf6, 8);
BlockCrate.addToListWithWeight(leadList, ModItems.pellet_rtg, 6);
BlockCrate.addToListWithWeight(leadList, ModItems.pellet_rtg_weak, 7);
BlockCrate.addToListWithWeight(leadList, ModItems.tritium_deuterium_cake, 5);
BlockCrate.addToListWithWeight(leadList, ModItems.powder_yellowcake, 10);
//Metal Crate
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_press), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 9);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), 6);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_coal_off), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_diesel), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_selenium), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_rtg_grey), 4);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.red_pylon), 9);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_battery), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_lithium_battery), 5);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_assembler), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_fluidtank), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_drill), 4);
BlockCrate.addToListWithWeight(metalList, ModItems.centrifuge_element, 6);
BlockCrate.addToListWithWeight(metalList, ModItems.motor, 8);
BlockCrate.addToListWithWeight(metalList, ModItems.coil_tungsten, 7);
BlockCrate.addToListWithWeight(metalList, ModItems.photo_panel, 3);
BlockCrate.addToListWithWeight(metalList, ModItems.coil_copper, 10);
BlockCrate.addToListWithWeight(metalList, ModItems.tank_steel, 9);
BlockCrate.addToListWithWeight(metalList, ModItems.blade_titanium, 3);
BlockCrate.addToListWithWeight(metalList, ModItems.bolt_compound, 2);
BlockCrate.addToListWithWeight(metalList, ModItems.piston_selenium, 6);
// Metal Crate
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_press), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 9);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), 6);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_coal_off), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_diesel), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_selenium), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_rtg_grey), 4);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.red_pylon), 9);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_battery), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_lithium_battery), 5);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 8);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_assembler), 10);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_fluidtank), 7);
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_drill), 4);
BlockCrate.addToListWithWeight(metalList, ModItems.centrifuge_element, 6);
BlockCrate.addToListWithWeight(metalList, ModItems.motor, 8);
BlockCrate.addToListWithWeight(metalList, ModItems.coil_tungsten, 7);
BlockCrate.addToListWithWeight(metalList, ModItems.photo_panel, 3);
BlockCrate.addToListWithWeight(metalList, ModItems.coil_copper, 10);
BlockCrate.addToListWithWeight(metalList, ModItems.tank_steel, 9);
BlockCrate.addToListWithWeight(metalList, ModItems.blade_titanium, 3);
BlockCrate.addToListWithWeight(metalList, ModItems.bolt_compound, 2);
BlockCrate.addToListWithWeight(metalList, ModItems.piston_selenium, 6);
//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_pip, 1);
BlockCrate.addToListWithWeight(redList, ModItems.ammo_44_bj, 1);
BlockCrate.addToListWithWeight(redList, ModItems.ammo_44_silver, 1);
BlockCrate.addToListWithWeight(redList, ModItems.battery_spark, 1);
BlockCrate.addToListWithWeight(redList, ModItems.bottle_sparkle, 1);
BlockCrate.addToListWithWeight(redList, ModItems.bottle_rad, 1);
BlockCrate.addToListWithWeight(redList, ModItems.ring_starmetal, 1);
BlockCrate.addToListWithWeight(redList, ModItems.flame_pony, 1);
BlockCrate.addToListWithWeight(redList, Item.getItemFromBlock(ModBlocks.ntm_dirt), 1);
BlockCrate.addToListWithWeight(redList, Item.getItemFromBlock(ModBlocks.broadcaster_pc), 1);
}
// 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.battery_spark, 1);
BlockCrate.addToListWithWeight(redList, ModItems.bottle_sparkle, 1);
BlockCrate.addToListWithWeight(redList, ModItems.bottle_rad, 1);
BlockCrate.addToListWithWeight(redList, ModItems.ring_starmetal, 1);
BlockCrate.addToListWithWeight(redList, ModItems.flame_pony, 1);
BlockCrate.addToListWithWeight(redList, Item.getItemFromBlock(ModBlocks.ntm_dirt), 1);
BlockCrate.addToListWithWeight(redList, Item.getItemFromBlock(ModBlocks.broadcaster_pc), 1);
}
public void dropItems(World world, int x, int y, int z) {
Random rand = new Random();
public void dropItems(World world, int x, int y, int z) {
Random rand = new Random();
setDrops();
setDrops();
List<Item> list = new ArrayList<Item>();
List<ItemStack> list = new ArrayList();
int i = rand.nextInt(3) + 3;
int i = rand.nextInt(3) + 3;
if(this == ModBlocks.crate_weapon) {
i = 1 + rand.nextInt(2);
if(this == ModBlocks.crate_weapon) {
i = 1 + rand.nextInt(2);
if(rand.nextInt(100) == 34)
i = 25;
}
if(rand.nextInt(100) == 34)
i = 25;
}
for(int j = 0; j < i; j++) {
for(int j = 0; j < i; j++) {
if(this == ModBlocks.crate)
list.add(crateList.get(rand.nextInt(crateList.size())));
if(this == ModBlocks.crate_weapon)
list.add(weaponList.get(rand.nextInt(weaponList.size())));
if(this == ModBlocks.crate_lead)
list.add(leadList.get(rand.nextInt(leadList.size())));
if(this == ModBlocks.crate_metal)
list.add(metalList.get(rand.nextInt(metalList.size())));
if(this == ModBlocks.crate_red)
list.add(redList.get(rand.nextInt(redList.size())));
}
if(this == ModBlocks.crate)
list.add(crateList.get(rand.nextInt(crateList.size())));
if(this == ModBlocks.crate_weapon)
list.add(weaponList.get(rand.nextInt(weaponList.size())));
if(this == ModBlocks.crate_lead)
list.add(leadList.get(rand.nextInt(leadList.size())));
if(this == ModBlocks.crate_metal)
list.add(metalList.get(rand.nextInt(metalList.size())));
if(this == ModBlocks.crate_red)
list.add(redList.get(rand.nextInt(redList.size())));
}
if(this == ModBlocks.crate_red) {
list.clear();
if(this == ModBlocks.crate_red) {
list.clear();
for(int k = 0; k < redList.size(); k++) {
list.add(redList.get(k));
}
}
for(int k = 0; k < redList.size(); k++) {
list.add(redList.get(k));
}
}
for(Item stack : list) {
float f = rand.nextFloat() * 0.8F + 0.1F;
float f1 = rand.nextFloat() * 0.8F + 0.1F;
float f2 = rand.nextFloat() * 0.8F + 0.1F;
for(ItemStack stack : list) {
float f = rand.nextFloat() * 0.8F + 0.1F;
float f1 = rand.nextFloat() * 0.8F + 0.1F;
float f2 = rand.nextFloat() * 0.8F + 0.1F;
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(stack));
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, stack.copy());
float f3 = 0.05F;
entityitem.motionX = (float)rand.nextGaussian() * f3;
entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float)rand.nextGaussian() * f3;
if(!world.isRemote)
world.spawnEntityInWorld(entityitem);
}
}
float f3 = 0.05F;
entityitem.motionX = (float) rand.nextGaussian() * f3;
entityitem.motionY = (float) rand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) rand.nextGaussian() * f3;
if(!world.isRemote)
world.spawnEntityInWorld(entityitem);
}
}
public static void addToListWithWeight(List<Item> list, Item item, int weight) {
for(int i = 0; i < weight; i++)
list.add(item);
}
public static void addToListWithWeight(List<ItemStack> list, Item item, int weight) {
for(int i = 0; i < weight; i++) list.add(new ItemStack(item));
}
public static void addToListWithWeight(List<ItemStack> list, ItemStack item, int weight) {
for(int i = 0; i < weight; i++) list.add(item);
}
}

View File

@ -140,10 +140,8 @@ public class BlockOre extends Block {
return ModItems.rtg_unit;
case 30:
return ModItems.gun_spark_ammo;
case 31:
return ModItems.ammo_nuke_low;
case 32:
return ModItems.ammo_mirv;
case 31: case 32:
return ModItems.ammo_nuke;
case 33:
return ModItems.gun_defabricator_ammo;
case 34:

View File

@ -3,6 +3,7 @@ package com.hbm.crafting;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.items.ItemEnums;
import com.hbm.items.ModItems;
import com.hbm.main.CraftingManager;
@ -28,7 +29,7 @@ public class ConsumableRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 1), new Object[] { "TTT", "TRT", "TTT", 'T', ModItems.grenade_gascan, 'R', ModItems.detonator_laser });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 2), new Object[] { "TTT", "TRT", "TTT", 'T', ModItems.pellet_gas, 'R', ModItems.detonator_laser });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 3), new Object[] { "TRT", 'T', ModItems.grenade_cloud, 'R', ModItems.detonator_laser });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 4), new Object[] { "TR", 'T', ModItems.ammo_nuke_high, 'R', ModItems.detonator_laser });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 4), new Object[] { "TR", 'T', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 'R', ModItems.detonator_laser });
//Food
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_waffle, 1), new Object[] { "WEW", "MPM", "WEW", 'W', Items.wheat, 'E', Items.egg, 'M', Items.milk_bucket, 'P', ModItems.man_core });
@ -58,6 +59,7 @@ public class ConsumableRecipes {
CraftingManager.addShapelessAuto(new ItemStack(ModItems.coffee_radium), new Object[] { ModItems.coffee, RA226.nugget() });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ingot_smore), new Object[] { Items.wheat, new ItemStack(ModItems.marshmallow, 1, 1), new ItemStack(Items.dye, 1, 3) });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.marshmallow), new Object[] { Items.stick, Items.sugar, Items.wheat_seeds });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.quesadilla, 3), new Object[] { ModItems.cheese, ModItems.cheese, Items.bread });
//Peas
CraftingManager.addRecipeAuto(new ItemStack(ModItems.peas), new Object[] { " S ", "SNS", " S ", 'S', Items.wheat_seeds, 'N', GOLD.nugget() });

View File

@ -5,6 +5,8 @@ import com.hbm.inventory.OreDictManager;
import com.hbm.inventory.fluid.Fluids;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.GunB92Cell;
import com.hbm.main.CraftingManager;
@ -24,7 +26,7 @@ public class WeaponRecipes {
//Missiles
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_taint, 1), new Object[] { ModItems.missile_assembly, ModItems.bucket_mud, ModItems.powder_spark_mix, ModItems.powder_magic });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_micro, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.ammo_nuke_high });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_micro, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH) });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_bhole, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.grenade_black_hole });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_schrabidium, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.grenade_aschrab });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_schrabidium, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.cell_sas3, ModItems.circuit_targeting_tier4 });
@ -174,8 +176,9 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_smg, 32), new Object[] { " I", "GC", " P", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_smg, 32), new Object[] { " I", "GC", " P", 'I', PB.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_556, 32), new Object[] { " I", "GC", " P", 'I', STEEL.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_556_k, 32), new Object[] { "G", "C", "P", 'G', Items.gunpowder, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_556_k, 32), new Object[] { "G", "C", "P", 'G', ModItems.ballistite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(ModItems.ammo_556.stackFromEnum(30, Ammo556mm.K), new Object[] { "G", "C", "P", 'G', ANY_GUNPOWDER.dust(), 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_uzi, 32), new Object[] { " I", "GC", " P", 'I', IRON.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_uzi, 32), new Object[] { " I", "GC", " P", 'I', IRON.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_uzi, 32), new Object[] { " I", "GC", " P", 'I', IRON.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_uzi, 32), new Object[] { " I", "GC", " P", 'I', IRON.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_lacunae, 32), new Object[] { " I", "GC", " P", 'I', CU.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_9, 'P', ModItems.primer_9 });
@ -183,33 +186,28 @@ public class WeaponRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nopip, 24), new Object[] { " I", "GC", " P", 'I', PB.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_44, 'P', ModItems.primer_44 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_12gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.cordite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_12gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(ModItems.ammo_12gauge.stackFromEnum(12, Ammo12Gauge.PERCUSSION), new Object[] { "G", "C", "P", 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_slug, 12), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_slug, 12), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_flechette, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_flechette, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 4), new Object[] { " I ", "GCL", " P ", 'I', Blocks.tnt, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 4), new Object[] { " I ", "GCL", " P ", 'I', Blocks.tnt, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 6), new Object[] { " I ", "GCL", " P ", 'I', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 6), new Object[] { " I ", "GCL", " P ", 'I', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_semtex, 4), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_semtex, 4), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_4gauge_titan, 1), new Object[] { ModItems.ammo_4gauge, ModItems.nugget_bismuth, ModItems.nugget_tantalium, ModItems.ball_dynamite });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.cordite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_buckshot, 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge_slug, 12), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge_slug, 12), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge_explosive, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_cluster, 'G', ModItems.cordite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge_explosive, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_cluster, 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge_flechette, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ModItems.cordite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_20gauge_flechette, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ModItems.ballistite, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 6), new Object[] { "I", "C", "P", 'I', ModItems.powder_power, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.SLUG), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(12, Ammo4Gauge.FLECHETTE), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.tnt, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(6, Ammo4Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", " P ", 'I', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(ModItems.ammo_4gauge.stackFromEnum(4, Ammo4Gauge.MINING), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
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", " P ", 'I', ModItems.pellet_buckshot, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.SLUG), new Object[] { " I ", "GCL", " P ", 'I', PB.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(12, Ammo20Gauge.EXPLOSIVE), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_cluster, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.FLECHETTE), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot, 'L', CU.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_357.stackFromEnum(6, Ammo357Magnum.NIGHTMARE2), new Object[] { "I", "C", "P", 'I', ModItems.powder_power, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_calamity, 12), new Object[] { " I ", "GCG", " P ", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_actionexpress, 12), new Object[] { " I", "GC", " P", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', ModItems.wire_aluminium, 'P', STEEL.plate(), 'S', ModItems.hull_small_steel, 'E', ANY_HIGHEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dart, 16), new Object[] { "IPI", "ICI", "IPI", 'I', ModItems.plate_polymer, 'P', IRON.plate(), 'C', new ItemStack(ModItems.fluid_tank_lead_full, 1, Fluids.WATZ.ordinal()) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dart_nerf, 16), new Object[] { "I", "I", 'I', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(ModItems.ammo_dart.stackFromEnum(16, AmmoDart.GPS), new Object[] { "IPI", "ICI", "IPI", 'I', ModItems.plate_polymer, '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', ModItems.plate_polymer });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_45, 32), " I", "GC", " P", 'I', CU.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_44, 'P', ModItems.primer_44);
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_762, 32), " I", "GC", " P", 'I', CU.ingot(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_9);
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_luna, 4), 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 });
@ -221,60 +219,58 @@ public class WeaponRecipes {
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 ", "GCG", " P ", 'T', Blocks.tnt, 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { " T ", "GCG", " P ", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 3), new Object[] { " T ", "GCG", " P ", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_he, 1), new Object[] { "G", "R", 'G', ANY_HIGHEXPLOSIVE.ingot(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_incendiary, 1), new Object[] { "G", "R", 'G', P_RED.dust(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_phosphorus, 1), new Object[] { "G", "R", 'G', P_WHITE.ingot(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_emp, 1), new Object[] { "G", "R", 'G', DIAMOND.dust(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_shrapnel, 1), new Object[] { "G", "R", 'G', ModItems.pellet_buckshot, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_glare, 1), new Object[] { "GGG", "GRG", "GGG", 'G', REDSTONE.dust(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_toxic, 1), new Object[] { "G", "R", 'G', ModItems.pellet_gas, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_canister, 1), new Object[] { "G", "R", 'G', ModItems.pellet_canister, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_nuclear, 1), new Object[] { " P ", "NRN", " P ", 'P', PU239.nugget(), 'N', OreDictManager.getReflector(), 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.DIESEL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.DIESEL_CRACK.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.PETROIL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.PETROIL_LEADED.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.GASOLINE.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.GASOLINE_LEADED.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.BIOFUEL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 1), new Object[] { " T ", "GCG", " P ", 'T', ModItems.ball_dynamite, 'G', ModItems.rocket_fuel, 'C', ModItems.hull_small_aluminium, 'P', ModItems.primer_50 });// I got tired of changing *all* of them, the stock one is always the first one anyway
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { " T ", "GCG", " P ", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.hull_small_aluminium, 'P', ModItems.primer_50 });
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(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.DIESEL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.DIESEL_CRACK.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.PETROIL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.PETROIL_LEADED.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.GASOLINE.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.GASOLINE_LEADED.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
CraftingManager.addRecipeAuto(ModItems.ammo_rocket.stackFromEnum(2, AmmoRocket.RPC), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.BIOFUEL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
//Stinger Rockets
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_he, 1), new Object[] { "S", "R", 'S', ANY_HIGHEXPLOSIVE.ingot(), 'R', ModItems.ammo_stinger_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_incendiary, 1), new Object[] { "S", "R", 'S', P_RED.dust(), 'R', ModItems.ammo_stinger_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_nuclear, 1), new Object[] { "RPR", "PSP", "RPR", 'R', ModItems.neutron_reflector, 'P', PU239.nugget(), 'S', ModItems.ammo_stinger_rocket });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_bones, 1), new Object[] { " C ", "SKR", " P ", 'C', ModItems.fallout, 'S', SR90.dust(), 'K', ModItems.ammo_stinger_rocket, 'R', RA226.dust(), 'P', PU.dust() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket, 2), "CE ", "FSF", " P ", 'C', ModItems.circuit_aluminium, 'E', ANY_PLASTICEXPLOSIVE.ingot(), 'F', ModItems.rocket_fuel, 'S', ModItems.hull_small_aluminium, 'P', ModItems.primer_50);
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", " P ", 'T', Items.gunpowder, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', Items.gunpowder, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_tracer, 2), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_tracer, 2), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_he, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ANY_HIGHEXPLOSIVE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_incendiary, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_RED.dust() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_phosphorus, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_WHITE.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_toxic, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.powder_poison });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_concussion, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', Items.glowstone_dust });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_nuclear, 2), new Object[] { " P ", "GIG", " P ", 'G', ModItems.ammo_grenade, 'I', ModItems.neutron_reflector, 'P', PU239.nugget() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_finned, 1), new Object[] { "G", "R", 'G', Items.feather, 'R', ModItems.ammo_grenade });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_kampf, 2), new Object[] { "G", "R", 'G', ModItems.ammo_rocket, 'R', ModItems.ammo_grenade });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', ANY_HIGHEXPLOSIVE.dust(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
CraftingManager.addRecipeAuto(ModItems.ammo_grenade.stackFromEnum(2, AmmoGrenade.TRACER), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ANY_SMOKELESS.dust(), 'C', ModItems.casing_50, 'P', ModItems.primer_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 });
//240mm Shells
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 6), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 6), new Object[] { " T ", "GHG", "CCC", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', Items.gunpowder, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.ballistite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 6), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.cordite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_du, 4), new Object[] { " I ", "GIG", "CCC", 'I', U238.ingot(), 'G', Items.gunpowder, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_du, 4), new Object[] { " I ", "GIG", "CCC", 'I', U238.ingot(), 'G', ModItems.ballistite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_du, 6), new Object[] { " I ", "GIG", "CCC", 'I', U238.ingot(), 'G', ModItems.cordite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_w9, 1), new Object[] { " P ", "NSN", " P ", 'P', PU239.nugget(), 'N', OreDictManager.getReflector(), 'S', ModItems.ammo_shell_explosive });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModBlocks.tnt, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModBlocks.tnt, 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 6), new Object[] { " T ", "GHG", "CCC", 'T', ModBlocks.tnt, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(4, Ammo240Shell.EXPLOSIVE), new Object[] { " T ", "GHG", "CCC", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(4, Ammo240Shell.EXPLOSIVE), new Object[] { " T ", "GHG", "CCC", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(6, Ammo240Shell.EXPLOSIVE), new Object[] { " T ", "GHG", "CCC", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(4, Ammo240Shell.APFSDS_T), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', Items.gunpowder, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(4, Ammo240Shell.APFSDS_T), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.ballistite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(6, Ammo240Shell.APFSDS_T), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.cordite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(4, Ammo240Shell.APFSDS_DU), new Object[] { " I ", "GIG", "CCC", 'I', U238.ingot(), 'G', Items.gunpowder, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(4, Ammo240Shell.APFSDS_DU), new Object[] { " I ", "GIG", "CCC", 'I', U238.ingot(), 'G', ModItems.ballistite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(6, Ammo240Shell.APFSDS_DU), new Object[] { " I ", "GIG", "CCC", 'I', U238.ingot(), 'G', ModItems.cordite, 'C', CU.ingot() });
CraftingManager.addRecipeAuto(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.W9), new Object[] { " P ", "NSN", " P ", 'P', PU239.nugget(), 'N', OreDictManager.getReflector(), 'S', ModItems.ammo_shell.stackFromEnum(Ammo240Shell.EXPLOSIVE) });
//Artillery Shells
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_arty, 1, 0), new Object[] { "CIC", "CSC", "CCC", 'C', ModItems.cordite, 'I', IRON.block(), 'S', ModItems.hull_small_steel });
@ -293,38 +289,37 @@ public class WeaponRecipes {
//Mini Nuke
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke, 1), new Object[] { "P", "S", "P", 'P', PU239.nugget(), 'S', ModItems.assembly_nuke });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_low, 1), new Object[] { "P", "S", 'P', PU239.nugget(), 'S', ModItems.assembly_nuke });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_high, 1), new Object[] { "PPP", "PSP", "PPP", 'P', PU239.nugget(), 'S', ModItems.assembly_nuke });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_tots, 1), new Object[] { "PPP", "PIP", "PPP", 'P', ModItems.pellet_cluster, 'I', PU239.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_safe, 1), new Object[] { "G", "N", 'G', Items.glowstone_dust, 'N', ModItems.ammo_nuke_low });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_pumpkin, 1), new Object[] { " T ", "TST", " T ", 'T', Blocks.tnt, 'S', ModItems.assembly_nuke });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke_barrel, 1), new Object[] { ModItems.nuclear_waste_pearl, ModItems.tank_steel });
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_mirv });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke_low, 6), new Object[] { ModItems.ammo_mirv_low });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke_high, 6), new Object[] { ModItems.ammo_mirv_high });
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke_safe, 6), new Object[] { ModItems.ammo_mirv_safe });
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(new ItemStack(ModItems.ammo_mirv, 1), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke, 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_mirv_low, 1), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke_low, 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_mirv_high, 1), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke_high, 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_mirv_safe, 1), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke_safe, 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
//since the milk part of the recipe isn't realy present in the MIRV's effect, it might as well be replaced with something more sensible, i.e. duct tape
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_mirv_special, 1), new Object[] { "CBC", "MCM", "CBC", 'C', ModItems.canned_jizz, 'B', ModItems.gun_bf_ammo, 'M', ModItems.ammo_mirv });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke, 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_LOW), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.LOW), 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_HIGH), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
CraftingManager.addRecipeAuto(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_SAFE), new Object[] { "NNN", "CDS", "NNN", 'N', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.SAFE), 'C', ModItems.cap_aluminium, 'D', ModBlocks.det_cord, 'S', ModItems.hull_small_steel });
//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_jizz, 'B', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.BALEFIRE), 'M', ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV) });
//Flamer fuel
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fuel, 1), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten, 'D', Fluids.DIESEL.getDict(1000) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fuel_napalm, 1), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten, 'D', ModItems.canister_napalm });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fuel_phosphorus, 1), new Object[] { "CPC", "CDC", "CPC", 'C', COAL.dust(), 'P', P_WHITE.ingot(), 'D', ModItems.ammo_fuel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fuel_gas, 1), new Object[] { "PDP", "BDB", "PDP", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten, 'D', ModItems.pellet_gas });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fuel_vaporizer, 1), new Object[] { "PSP", "SNS", "PSP", 'P', P_WHITE.ingot(), 'S', ModItems.crystal_sulfur, 'N', ModItems.ammo_fuel_napalm });
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.DIESEL), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten, 'D', Fluids.DIESEL.getDict(1000) });
CraftingManager.addRecipeAuto(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.NAPALM), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten, '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', ModItems.bolt_tungsten, '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', ModItems.bolt_tungsten, 'D', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.WATER.ordinal()) });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fireext_foam, 1), new Object[] { " N ", "NFN", " N ", 'N', KNO.dust(), 'F', ModItems.ammo_fireext });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fireext_sand, 1), new Object[] { "NNN", "NFN", "NNN", 'N', ModBlocks.sand_boron, 'F', ModItems.ammo_fireext });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_fireext, 1), new Object[] { " P ", "BDB", " P ", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten, 'D', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.WATER.getID()) });
CraftingManager.addRecipeAuto(ModItems.ammo_fireext.stackFromEnum(AmmoFireExt.FOAM), new Object[] { " N ", "NFN", " N ", 'N', KNO.dust(), 'F', ModItems.ammo_fireext });
CraftingManager.addRecipeAuto(ModItems.ammo_fireext.stackFromEnum(AmmoFireExt.SAND), new Object[] { "NNN", "NFN", "NNN", 'N', ModBlocks.sand_boron, 'F', ModItems.ammo_fireext });
//Grenades
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_generic, 4), new Object[] { "RS ", "ITI", " I ", 'I', IRON.plate(), 'R', ModItems.wire_red_copper, 'S', STEEL.plate(), 'T', Item.getItemFromBlock(Blocks.tnt) });

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.items.ModItems;
import net.minecraft.item.ItemStack;
@ -42,7 +43,7 @@ public class EntityMissileMicro extends EntityMissileBaseAdvanced {
@Override
public ItemStack getDebrisRareDrop() {
return new ItemStack(ModItems.ammo_nuke_high, 1);
return ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH);
}
@Override

View File

@ -7,6 +7,7 @@ import com.hbm.entity.mob.ai.EntityAINuclearCreeperSwell;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
@ -241,7 +242,7 @@ public class EntityNuclearCreeper extends EntityMob {
this.dropItem(ModItems.fusion_core, 1);
}
if(i == 10)
this.dropItem(ModItems.ammo_nuke_high, 1);
this.entityDropItem(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH), 1);
}
}

View File

@ -14,6 +14,8 @@ import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.items.weapon.ItemGunBase;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -32,6 +34,7 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IProjectile;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
@ -81,13 +84,28 @@ public class EntityBulletBase extends Entity implements IProjectile {
this.dataWatcher.updateObject(18, config);
shooter = entity;
ItemStack gun = entity.getHeldItem();
boolean offsetShot = true;
if(gun != null && gun.getItem() instanceof ItemGunBase) {
GunConfiguration cfg = ((ItemGunBase) gun.getItem()).mainConfig;
if(cfg != null && cfg.hasSights && entity.isSneaking()) {
offsetShot = false;
}
}
this.setLocationAndAngles(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ, entity.rotationYaw, entity.rotationPitch);
double sideOffset = 0.16D;
if(offsetShot) {
double sideOffset = 0.16D;
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset;
this.posY -= 0.1D;
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset;
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset;
this.posY -= 0.1D;
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * sideOffset;
} else {
this.posY -= 0.1D;
}
this.setPosition(this.posX, this.posY, this.posZ);
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
@ -97,7 +115,7 @@ public class EntityBulletBase extends Entity implements IProjectile {
this.renderDistanceWeight = 10.0D;
this.setSize(0.5F, 0.5F);
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread);
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread * (offsetShot ? 1F : 0.25F));
this.dataWatcher.updateObject(16, (byte)this.config.style);
this.dataWatcher.updateObject(17, (byte)this.config.trail);
@ -233,6 +251,10 @@ public class EntityBulletBase extends Entity implements IProjectile {
}
if(config.maxAge == 0) {
if(this.config.bUpdate != null)
this.config.bUpdate.behaveUpdate(this);
this.setDead();
return;
}
@ -292,10 +314,10 @@ public class EntityBulletBase extends Entity implements IProjectile {
boolean didBounce = false;
if (movement != null) {
if(movement != null) {
//handle entity collision
if(movement.entityHit != null) {
//handle entity collision
if(movement.entityHit != null) {
DamageSource damagesource = this.config.getDamage(this, shooter);
@ -325,7 +347,7 @@ public class EntityBulletBase extends Entity implements IProjectile {
}
}
if(!victim.attackEntityFrom(damagesource, damage)) {
if(victim != null && !victim.attackEntityFrom(damagesource, damage)) {
try {
Field lastDamage = ReflectionHelper.findField(EntityLivingBase.class, "lastDamage", "field_110153_bc");
@ -337,12 +359,12 @@ public class EntityBulletBase extends Entity implements IProjectile {
}
} catch (Exception x) { }
}
}
if(!worldObj.isRemote && headshot) {
if(victim instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) victim;
double head = living.height - living.getEyeHeight();
if(!worldObj.isRemote && headshot) {
if(victim instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) victim;
double head = living.height - living.getEyeHeight();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaburst");
data.setInteger("count", 15);

View File

@ -0,0 +1,18 @@
package com.hbm.entity.projectile;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World;
public class EntityCombineBallNT extends EntityBulletBase {
public EntityCombineBallNT(World world, int config, EntityLivingBase shooter) {
super(world, config, shooter);
overrideDamage = 1000;
}
@Override
public void setDead() {
super.setDead();
worldObj.createExplosion(shooter, posX, posY, posZ, 2, false);
}
}

View File

@ -97,18 +97,22 @@ public class ExplosionNukeRayBatched {
float y0 = (float) (posY + (vec.yCoord * i));
float z0 = (float) (posZ + (vec.zCoord * i));
int iX = (int) Math.floor(x0);
int iY = (int) Math.floor(y0);
int iZ = (int) Math.floor(z0);
double fac = 100 - ((double) i) / ((double) length) * 100;
fac *= 0.07D;
if(!world.getBlock((int)x0, (int)y0, (int)z0).getMaterial().isLiquid())
res -= Math.pow(world.getBlock((int)x0, (int)y0, (int)z0).getExplosionResistance(null), 7.5D - fac);
if(!world.getBlock(iX, iY, iZ).getMaterial().isLiquid())
res -= Math.pow(world.getBlock(iX, iY, iZ).getExplosionResistance(null), 7.5D - fac);
//else
// res -= Math.pow(Blocks.air.getExplosionResistance(null), 7.5D - fac); // air is 0, might want to raise that is necessary
if(res > 0 && world.getBlock((int)x0, (int)y0, (int)z0) != Blocks.air) {
if(res > 0 && world.getBlock(iX, iY, iZ) != Blocks.air) {
lastPos = new FloatTriplet(x0, y0, z0);
//all-air chunks don't need to be buffered at all
ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(((int) x0) >> 4, ((int) z0) >> 4);
ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(iX >> 4, iZ >> 4);
chunkCoords.add(chunkPos);
}
@ -185,9 +189,9 @@ public class ExplosionNukeRayBatched {
boolean inChunk = false;
for(int i = enter; i < vec.lengthVector(); i++) {
int x0 = (int)(posX + pX * i);
int y0 = (int)(posY + pY * i);
int z0 = (int)(posZ + pZ * i);
int x0 = (int) Math.floor(posX + pX * i);
int y0 = (int) Math.floor(posY + pY * i);
int z0 = (int) Math.floor(posZ + pZ * i);
if(x0 >> 4 != chunkX || z0 >> 4 != chunkZ) {
if(inChunk) {

View File

@ -0,0 +1,125 @@
package com.hbm.explosion.vanillant.standard;
import java.util.HashMap;
import java.util.List;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
import com.hbm.explosion.vanillant.interfaces.IEntityProcessor;
import com.hbm.explosion.vanillant.interfaces.IEntityRangeMutator;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.ForgeEventFactory;
/** The amount of good decisions in NTM is few and far between, but the VNT explosion surely is one of them. */
public class EntityProcessorCross implements IEntityProcessor {
protected double nodeDist = 2D;
protected IEntityRangeMutator range;
protected ICustomDamageHandler damage;
public EntityProcessorCross(double nodeDist) {
this.nodeDist = nodeDist;
}
@Override
public HashMap<EntityPlayer, Vec3> process(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
HashMap<EntityPlayer, Vec3> affectedPlayers = new HashMap();
size *= 2.0F;
if(range != null) {
size = range.mutateRange(explosion, size);
}
double minX = x - (double) size - 1.0D;
double maxX = x + (double) size + 1.0D;
double minY = y - (double) size - 1.0D;
double maxY = y + (double) size + 1.0D;
double minZ = z - (double) size - 1.0D;
double maxZ = z + (double) size + 1.0D;
List list = world.getEntitiesWithinAABBExcludingEntity(explosion.exploder, AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ));
ForgeEventFactory.onExplosionDetonate(world, explosion.compat, list, size);
Vec3[] nodes = new Vec3[7];
for(int i = 0; i < 7; i++) {
ForgeDirection dir = ForgeDirection.getOrientation(i);
nodes[i] = Vec3.createVectorHelper(x + dir.offsetX * nodeDist, y + dir.offsetY * nodeDist, z + dir.offsetZ * nodeDist);
}
for(int index = 0; index < list.size(); ++index) {
Entity entity = (Entity) list.get(index);
double distanceScaled = entity.getDistance(x, y, z) / size;
if(distanceScaled <= 1.0D) {
double deltaX = entity.posX - x;
double deltaY = entity.posY + entity.getEyeHeight() - y;
double deltaZ = entity.posZ - z;
double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
if(distance != 0.0D) {
deltaX /= distance;
deltaY /= distance;
deltaZ /= distance;
double density = 0;
for(Vec3 vec : nodes) {
double d = world.getBlockDensity(vec, entity.boundingBox);
if(d > density) {
density = d;
}
}
double knockback = (1.0D - distanceScaled) * density;
entity.attackEntityFrom(DamageSource.setExplosionSource(explosion.compat), (float) ((int) ((knockback * knockback + knockback) / 2.0D * 8.0D * size + 1.0D)));
double enchKnockback = EnchantmentProtection.func_92092_a(entity, knockback);
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));
}
if(damage != null) {
damage.handleAttack(explosion, entity, distanceScaled);
}
}
}
}
return affectedPlayers;
}
public EntityProcessorCross withRangeMod(float mod) {
range = new IEntityRangeMutator() {
@Override
public float mutateRange(ExplosionVNT explosion, float range) {
return range * mod;
}
};
return this;
}
public EntityProcessorCross withDamageMod(ICustomDamageHandler damage) {
this.damage = damage;
return this;
}
}

View File

@ -7,6 +7,7 @@ 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.machine.ItemBattery;
import com.hbm.items.special.ItemKitCustom;
@ -122,25 +123,24 @@ public class BobmazonOfferFactory {
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(new ItemStack(ModItems.gun_revolver_ammo, 6), Requirement.OIL, 12 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_357_desh, 6), Requirement.OIL, 36 * 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(new ItemStack(ModItems.ammo_44_ap, 6), Requirement.OIL, 18 * 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(new ItemStack(ModItems.ammo_5mm_du, 50), Requirement.OIL, 75 * 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(new ItemStack(ModItems.ammo_rocket_incendiary), Requirement.OIL, 8 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_rocket_sleek), Requirement.OIL, 12 * 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(new ItemStack(ModItems.ammo_grenade_incendiary), Requirement.OIL, 6 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_grenade_sleek), Requirement.OIL, 10 * 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(new ItemStack(ModItems.ammo_22lr_ap, 32), Requirement.OIL, 32 * 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(new ItemStack(ModItems.ammo_20gauge_slug, 6), Requirement.OIL, 20 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.ammo_20gauge_flechette, 6), Requirement.OIL, 22 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.grenade_if_generic, 3), Requirement.CHEMICS, 15 * inflation));
weapons.add(new Offer(new ItemStack(ModItems.grenade_if_he, 3), Requirement.CHEMICS, 25 * 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));
@ -244,23 +244,23 @@ public class BobmazonOfferFactory {
special.add(new Offer(ItemKitCustom.create("Maid's Cleaning Utensils", "For the hard to reach spots", 0x00ff00, 0x008000,
new ItemStack(ModItems.gun_calamity),
new ItemStack(ModItems.ammo_50bmg_chlorophyte, 64),
new ItemStack(ModItems.ammo_50bmg_chlorophyte, 64),
new ItemStack(ModItems.ammo_50bmg_chlorophyte, 64),
new ItemStack(ModItems.ammo_50bmg_star, 64),
new ItemStack(ModItems.ammo_50bmg_star, 64),
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),
new ItemStack(ModItems.ammo_12gauge_du, 64),
new ItemStack(ModItems.ammo_12gauge_du, 64),
new ItemStack(ModItems.ammo_12gauge_shrapnel, 64),
new ItemStack(ModItems.ammo_12gauge_shrapnel, 64),
new ItemStack(ModItems.ammo_12gauge_marauder, 4),
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.gun_sauer),
new ItemStack(ModItems.ammo_4gauge, 64),
new ItemStack(ModItems.ammo_4gauge_claw, 64),
new ItemStack(ModItems.ammo_4gauge_kampf, 64),
new ItemStack(ModItems.ammo_4gauge_flechette, 64),
new ItemStack(ModItems.ammo_4gauge_void, 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)
), Requirement.HIDDEN, 64));
special.add(new Offer(ItemKitNBT.create(
@ -276,13 +276,13 @@ public class BobmazonOfferFactory {
new ItemStack(ModItems.rpa_legs),
new ItemStack(ModItems.rpa_boots),
new ItemStack(ModItems.gun_lacunae),
new ItemStack(ModItems.ammo_5mm_star, 64),
new ItemStack(ModItems.ammo_5mm_star, 64),
new ItemStack(ModItems.ammo_5mm_star, 64),
new ItemStack(ModItems.ammo_5mm_star, 64),
new ItemStack(ModItems.ammo_5mm_star, 64),
new ItemStack(ModItems.ammo_5mm_star, 64),
new ItemStack(ModItems.ammo_5mm_star, 64)
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)
).setStackDisplayName("Frenchman's Reward"), Requirement.HIDDEN, 32));
special.add(new Offer(new ItemStack(ModItems.gun_detonator, 1), Requirement.HIDDEN, 32));

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map.Entry;
import com.hbm.handler.guncfg.*;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
public class BulletConfigSyncingUtil {
@ -73,6 +74,7 @@ public class BulletConfigSyncingUtil {
public static int G12_DU = i++;
public static int G12_AM = i++;
public static int G12_SLEEK = i++;
public static int G12_PERCUSSION = i++;
public static int LR22_NORMAL = i++;
public static int LR22_AP = i++;
@ -94,6 +96,10 @@ public class BulletConfigSyncingUtil {
public static int P9_DU = i++;
public static int P9_ROCKET = i++;
public static int ACP_45 = i++;
public static int ACP_45_AP = i++;
public static int ACP_45_DU = i++;
public static int BMG50_NORMAL = i++;
public static int BMG50_INCENDIARY = i++;
public static int BMG50_EXPLOSIVE = i++;
@ -106,6 +112,10 @@ public class BulletConfigSyncingUtil {
public static int BMG50_FLECHETTE_AM = i++;
public static int BMG50_FLECHETTE_PO = i++;
public static int ROUND_LUNA_SNIPER_SABOT = i++;
public static int ROUND_LUNA_SNIPER_INCENDIARY = i++;
public static int ROUND_LUNA_SNIPER_EXPLOSIVE = i++;
public static int R5_NORMAL = i++;
public static int R5_EXPLOSIVE = i++;
public static int R5_DU = i++;
@ -166,6 +176,8 @@ public class BulletConfigSyncingUtil {
public static int R556_FLECHETTE_SLEEK = i++;
public static int R556_K = i++;
public static int W308 = i++;
public static int B75_NORMAL = i++;
public static int B75_INCENDIARY = i++;
public static int B75_HE = i++;
@ -230,6 +242,10 @@ public class BulletConfigSyncingUtil {
public static int NUKE_AMAT = i++;
public static int TWR_RAY = i++;
public static int HLR_NORMAL = i++;
public static int HLR_ALT = i++;
public static int ZOMG_BOLT = i++;
public static int DET_BOLT = i++;
@ -271,18 +287,18 @@ public class BulletConfigSyncingUtil {
configSet.put(TEST_CONFIG, BulletConfigFactory.getTestConfig());
configSet.put(IRON_REVOLVER, Gun357MagnumFactory.getRevIronConfig());
configSet.put(STEEL_REVOLVER, Gun357MagnumFactory.getRevSteelConfig());
configSet.put(LEAD_REVOLVER, Gun357MagnumFactory.getRevLeadConfig());
configSet.put(STEEL_REVOLVER, Gun357MagnumFactory.getRevLeadConfig());
configSet.put(LEAD_REVOLVER, Gun357MagnumFactory.getRevNuclearConfig());
configSet.put(GOLD_REVOLVER, Gun357MagnumFactory.getRevGoldConfig());
configSet.put(CURSED_REVOLVER, Gun357MagnumFactory.getRevCursedConfig());
configSet.put(SCHRABIDIUM_REVOLVER, Gun357MagnumFactory.getRevSchrabidiumConfig());
configSet.put(NIGHT_REVOLVER, Gun357MagnumFactory.getRevNightmareConfig());
configSet.put(NIGHT_REVOLVER, Gun357MagnumFactory.getRevNightmare1Config());
configSet.put(NIGHT2_REVOLVER, Gun357MagnumFactory.getRevNightmare2Config());
configSet.put(SATURNITE_REVOLVER, Gun357MagnumFactory.getRevSteelConfig().setToFire(3));
configSet.put(SATURNITE_REVOLVER, Gun357MagnumFactory.getRevLeadConfig().setToFire(3));
configSet.put(DESH_REVOLVER, Gun357MagnumFactory.getRevDeshConfig());
configSet.put(IRON_HS, Gun357MagnumFactory.getRevIronConfig().setHeadshot(3F));
configSet.put(STEEL_HS, Gun357MagnumFactory.getRevSteelConfig().setHeadshot(3F));
configSet.put(STEEL_HS, Gun357MagnumFactory.getRevCursedConfig().setHeadshot(3F));
configSet.put(GOLD_HS, Gun357MagnumFactory.getRevGoldConfig().setHeadshot(3F));
configSet.put(DESH_HS, Gun357MagnumFactory.getRevDeshConfig().setHeadshot(3F));
@ -335,6 +351,7 @@ public class BulletConfigSyncingUtil {
configSet.put(G12_DU, Gun12GaugeFactory.get12GaugeDUConfig());
configSet.put(G12_AM, Gun12GaugeFactory.get12GaugeAMConfig());
configSet.put(G12_SLEEK, Gun12GaugeFactory.get12GaugeSleekConfig());
configSet.put(G12_PERCUSSION, Gun12GaugeFactory.get12GaugePercussionConfig());
configSet.put(LR22_NORMAL, Gun22LRFactory.get22LRConfig());
configSet.put(LR22_AP, Gun22LRFactory.get22LRAPConfig());
@ -356,6 +373,10 @@ public class BulletConfigSyncingUtil {
configSet.put(P9_DU, Gun9mmFactory.get9mmDUConfig());
configSet.put(P9_ROCKET, Gun9mmFactory.get9mmRocketConfig());
configSet.put(ACP_45, Gun45ACPFactory.get45AutoConfig());
configSet.put(ACP_45_AP, Gun45ACPFactory.get45AutoAPConfig());
configSet.put(ACP_45_DU, Gun45ACPFactory.get45AutoDUConfig());
configSet.put(BMG50_NORMAL, Gun50BMGFactory.get50BMGConfig());
configSet.put(BMG50_INCENDIARY, Gun50BMGFactory.get50BMGFireConfig());
configSet.put(BMG50_PHOSPHORUS, Gun50BMGFactory.get50BMGPhosphorusConfig());
@ -368,6 +389,10 @@ public class BulletConfigSyncingUtil {
configSet.put(BMG50_FLECHETTE_AM, Gun50BMGFactory.get50BMGFlechetteAMConfig());
configSet.put(BMG50_FLECHETTE_PO, Gun50BMGFactory.get50BMGFlechettePOConfig());
configSet.put(ROUND_LUNA_SNIPER_SABOT, Gun50BMGFactory.getLunaticSabotRound());
configSet.put(ROUND_LUNA_SNIPER_INCENDIARY, Gun50BMGFactory.getLunaticIncendiaryRound());
configSet.put(ROUND_LUNA_SNIPER_EXPLOSIVE, Gun50BMGFactory.getLunaticExplosiveRound());
configSet.put(R5_NORMAL, Gun5mmFactory.get5mmConfig());
configSet.put(R5_EXPLOSIVE, Gun5mmFactory.get5mmExplosiveConfig());
configSet.put(R5_DU, Gun5mmFactory.get5mmDUConfig());
@ -428,6 +453,8 @@ public class BulletConfigSyncingUtil {
configSet.put(R556_FLECHETTE_SLEEK, Gun556mmFactory.get556FlechetteSleekConfig());
configSet.put(R556_K, Gun556mmFactory.get556KConfig());
configSet.put(W308, Gun762mmFactory.get762NATOConfig());
configSet.put(B75_NORMAL, Gun75BoltFactory.get75BoltConfig());
configSet.put(B75_INCENDIARY, Gun75BoltFactory.get75BoltIncConfig());
configSet.put(B75_HE, Gun75BoltFactory.get75BoltHEConfig());
@ -486,6 +513,10 @@ public class BulletConfigSyncingUtil {
configSet.put(NUKE_AMAT, GunFatmanFactory.getBalefireConfig());
//configSet.put(TWR_RAY, GunEnergyFactory.getSingConfig());
//configSet.put(HLR_NORMAL, GunEnergyFactory.getHLRPrecisionConfig());
//configSet.put(HLR_ALT, GunEnergyFactory.getHLRScatterConfig());
configSet.put(ZOMG_BOLT, GunEnergyFactory.getZOMGBoltConfig());
configSet.put(DET_BOLT, GunDetonatorFactory.getLaserConfig());
@ -500,16 +531,16 @@ public class BulletConfigSyncingUtil {
configSet.put(GLASS_EMGAMMA, GunPoweredFactory.getEMGammaConfig());
configSet.put(CHL_LR22, Gun22LRFactory.get22LRConfig().setToHoming(ModItems.ammo_22lr_chlorophyte));
configSet.put(CHL_LR22_FIRE, Gun22LRFactory.get22LRConfig().setToFire(3).setToHoming(ModItems.ammo_22lr_chlorophyte));
configSet.put(CHL_M44, Gun44MagnumFactory.getNoPipConfig().setToHoming(ModItems.ammo_44_chlorophyte));
configSet.put(CHL_P9, Gun9mmFactory.get9mmConfig().setToHoming(ModItems.ammo_9mm_chlorophyte));
configSet.put(CHL_BMG50, Gun50BMGFactory.get50BMGConfig().setToHoming(ModItems.ammo_50bmg_chlorophyte));
configSet.put(CHL_R5, Gun5mmFactory.get5mmConfig().setToHoming(ModItems.ammo_5mm_chlorophyte));
configSet.put(CHL_R5_BOLT, Gun5mmFactory.get5mmConfig().setToBolt(BulletConfiguration.BOLT_LACUNAE).setToHoming(ModItems.ammo_5mm_chlorophyte));
configSet.put(CHL_AE50, Gun50AEFactory.get50AEConfig().setToHoming(ModItems.ammo_50ae_chlorophyte));
configSet.put(CHL_R556, Gun556mmFactory.get556Config().setToHoming(ModItems.ammo_556_chlorophyte));
configSet.put(CHL_R556_FLECHETTE, Gun556mmFactory.get556FlechetteConfig().setToHoming(ModItems.ammo_556_flechette_chlorophyte));
configSet.put(CHL_LR22, Gun22LRFactory.get22LRConfig().setToHoming(ModItems.ammo_22lr.stackFromEnum(Ammo22LR.CHLOROPHYTE)));
configSet.put(CHL_LR22_FIRE, Gun22LRFactory.get22LRConfig().setToFire(3).setToHoming(ModItems.ammo_22lr.stackFromEnum(Ammo22LR.CHLOROPHYTE)));
configSet.put(CHL_M44, Gun44MagnumFactory.getNoPipConfig().setToHoming(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.CHLOROPHYTE)));
configSet.put(CHL_P9, Gun9mmFactory.get9mmConfig().setToHoming(ModItems.ammo_9mm.stackFromEnum(Ammo9mm.CHLOROPHYTE)));
configSet.put(CHL_BMG50, Gun50BMGFactory.get50BMGConfig().setToHoming(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.CHLOROPHYTE)));
configSet.put(CHL_R5, Gun5mmFactory.get5mmConfig().setToHoming(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.CHLOROPHYTE)));
configSet.put(CHL_R5_BOLT, Gun5mmFactory.get5mmConfig().setToBolt(BulletConfiguration.BOLT_LACUNAE).setToHoming(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.CHLOROPHYTE)));
configSet.put(CHL_AE50, Gun50AEFactory.get50AEConfig().setToHoming(ModItems.ammo_50ae.stackFromEnum(Ammo50AE.CHLOROPHYTE)));
configSet.put(CHL_R556, Gun556mmFactory.get556Config().setToHoming(ModItems.ammo_556.stackFromEnum(Ammo556mm.CHLOROPHYTE)));
configSet.put(CHL_R556_FLECHETTE, Gun556mmFactory.get556FlechetteConfig().setToHoming(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE_CHLOROPHYTE)));
configSet.put(MASKMAN_BULLET, GunNPCFactory.getMaskmanBullet());
configSet.put(MASKMAN_ORB, GunNPCFactory.getMaskmanOrb());

View File

@ -10,19 +10,22 @@ import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletRicochetBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.interfaces.Untested;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.particle.SpentCasing;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EntityDamageSourceIndirect;
import net.minecraft.util.EnumChatFormatting;
public class BulletConfiguration {
public class BulletConfiguration implements Cloneable {
//what item this specific configuration consumes
public Item ammo;
public ComparableStack ammo;
//how many ammo units one item restores
public int ammoCount = 1;
//how fast the bullet is (in sanics per second, or sps)
@ -98,6 +101,7 @@ public class BulletConfiguration {
public int plink;
//vanilla particle FX
public String vPFX = "";
public SpentCasing spentCasing;
//energy projectiles
//power consumed per shot
@ -173,9 +177,7 @@ public class BulletConfiguration {
return this;
}
public BulletConfiguration setToHoming(Item ammo) {
this.ammo = ammo;
public BulletConfiguration getChlorophyte() {
this.bUpdate = BulletConfigFactory.getHomingBehavior(200, 45);
this.dmgMin *= 1.5F;
this.dmgMax *= 1.5F;
@ -183,9 +185,27 @@ public class BulletConfiguration {
this.doesRicochet = false;
this.doesPenetrate = false;
this.vPFX = "greendust";
if(this.spentCasing != null) {
int[] colors = this.spentCasing.getColors();
this.spentCasing = this.spentCasing.clone();
if(colors != null && colors.length > 0) {
int[] colorClone = new int[colors.length];
for(int i = 0; i < colors.length; i++) colorClone[i] = colors[i];
colorClone[colorClone.length - 1] = 0x659750; // <- standard chlorophyte coloring in last place
this.spentCasing.setColor(colorClone).register(this.spentCasing.getName() + "Cl");
}
}
return this;
}
public BulletConfiguration setToHoming(ItemStack ammo) {
this.ammo = new ComparableStack(ammo);
return getChlorophyte();
}
public BulletConfiguration accuracyMod(float mod) {
this.spread *= mod;
@ -214,4 +234,14 @@ public class BulletConfiguration {
return dmg;
}
@Override
public BulletConfiguration clone() {
try {
return (BulletConfiguration) super.clone();
} catch(CloneNotSupportedException e) {
MainRegistry.logger.catching(e);
return new BulletConfiguration();
}
}
}

View File

@ -0,0 +1,163 @@
package com.hbm.handler;
import java.util.HashMap;
import java.util.Random;
import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;
import org.lwjgl.util.vector.Vector4f;
import com.hbm.particle.ParticleSpentCasing;
import com.hbm.particle.SpentCasing;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
/**
* Config for the guns themselves on where to spawn casings and at what angle
* @author uffr, hbm
*/
public class CasingEjector implements Cloneable {
public static HashMap<Integer, CasingEjector> mappings = new HashMap();
public static final Random rand = new Random();
private int id;
private static int nextId = 0;
private Vec3 posOffset = Vec3.createVectorHelper(0, 0, 0);
private Vec3 initialMotion = Vec3.createVectorHelper(0, 0, 0);
private int casingAmount = 1;
private boolean afterReload = false;
private int delay = 0;
private float randomYaw = 0F;
private float randomPitch = 0F;
public CasingEjector() {
this.id = nextId;
nextId++;
mappings.put(id, this);
}
public CasingEjector setOffset(double x, double y, double z) {
return setOffset(Vec3.createVectorHelper(x, y, z));
}
public CasingEjector setOffset(Vec3 vec) {
this.posOffset = vec;
return this;
}
public CasingEjector setMotion(double x, double y, double z) {
return setMotion(Vec3.createVectorHelper(x, y, z));
}
public CasingEjector setMotion(Vec3 vec) {
this.initialMotion = vec;
return this;
}
public CasingEjector setAmount(int am) {
this.casingAmount = am;
return this;
}
public CasingEjector setAfterReload() {
this.afterReload = true;
return this;
}
public CasingEjector setDelay(int delay) {
this.delay = delay;
return this;
}
public CasingEjector setAngleRange(float yaw, float pitch) {
this.randomYaw = yaw;
this.randomPitch = pitch;
return this;
}
public int getId() { return this.id; }
public Vec3 getOffset() { return this.posOffset; }
public Vec3 getMotion() { return this.initialMotion; }
public int getAmount() { return this.casingAmount; }
public boolean getAfterReload() { return this.afterReload; }
public int getDelay() { return this.delay; }
public float getYawFactor() { return this.randomYaw; }
public float getPitchFactor() { return this.randomPitch; }
@SideOnly(Side.CLIENT)
public void spawnCasing(TextureManager textureManager, SpentCasing config, World world, double x, double y, double z, float pitch, float yaw, boolean crouched) {
Vec3 rotatedMotionVec = rotateVector(getMotion(), pitch + (float) rand.nextGaussian() * getPitchFactor(), yaw + (float) rand.nextGaussian() * getPitchFactor(), getPitchFactor(), getPitchFactor());
ParticleSpentCasing casing = new ParticleSpentCasing(textureManager, world, x, y, z, rotatedMotionVec.xCoord, rotatedMotionVec.yCoord, rotatedMotionVec.zCoord, (float) (getPitchFactor() * rand.nextGaussian()), (float) (getYawFactor() * rand.nextGaussian()), config);
offsetCasing(casing, getOffset(), pitch, yaw, crouched);
casing.rotationPitch = (float) Math.toDegrees(pitch);
casing.rotationYaw = (float) Math.toDegrees(yaw);
Minecraft.getMinecraft().effectRenderer.addEffect(casing);
}
// Rotate a position
@SideOnly(Side.CLIENT)
private static void offsetCasing(ParticleSpentCasing casing, Vec3 offset, float pitch, float yaw, boolean crouched) {
// x-axis offset, 0 if crouched to center
final float oX = (float) (crouched ? 0 : offset.xCoord);
// Create rotation matrices for pitch and yaw
final Matrix4f pitchMatrix = new Matrix4f(), yawMatrix = new Matrix4f();
pitchMatrix.rotate(pitch, new Vector3f(1, 0, 0)); // modify axis of rotation
yawMatrix.rotate(-yaw, new Vector3f(0, 1, 0));
// Multiply matrices to get combined rotation matrix
final Matrix4f rotMatrix = Matrix4f.mul(yawMatrix, pitchMatrix, null);
// Create vector representing the offset and apply rotation
final Vector4f offsetVector = new Vector4f(oX, (float) offset.yCoord, (float) offset.zCoord, 1); // set fourth coordinate to 1
Matrix4f.transform(rotMatrix, offsetVector, offsetVector);
final Vector3f result = new Vector3f(); // create result vector
result.set(offsetVector.x, offsetVector.y, offsetVector.z); // set result vector using transformed coordinates
// Apply rotation
casing.setPosition(casing.posX + result.x, casing.posY + result.y, casing.posZ + result.z);
}
private static Vec3 rotateVector(Vec3 vector, float pitch, float yaw, float pitchFactor, float yawFactor) {
// Apply randomness to vector
vector.xCoord += rand.nextGaussian() * yawFactor;
vector.yCoord += rand.nextGaussian() * pitchFactor;
vector.zCoord += rand.nextGaussian() * yawFactor;
final Matrix4f pitchMatrix = new Matrix4f(), yawMatrix = new Matrix4f();
pitchMatrix.setIdentity();
pitchMatrix.rotate(-pitch, new Vector3f(1, 0, 0));
yawMatrix.setIdentity();
yawMatrix.rotate(-yaw, new Vector3f(0, 1, 0));
final Vector4f vector4f = new Vector4f((float) vector.xCoord, (float) vector.yCoord, (float) vector.zCoord, 1);
Matrix4f.transform(pitchMatrix, vector4f, vector4f);
Matrix4f.transform(yawMatrix, vector4f, vector4f);
return Vec3.createVectorHelper(vector4f.x, vector4f.y, vector4f.z);
}
public static CasingEjector fromId(int id) {
return mappings.get(id);
}
@Override
public CasingEjector clone() {
try {
return (CasingEjector) super.clone();
} catch(CloneNotSupportedException e) {
return new CasingEjector();
}
}
}

View File

@ -4,11 +4,14 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class GunConfiguration {
import net.minecraft.util.ResourceLocation;
public class GunConfiguration implements Cloneable {
/**
* alt function restrictions:
@ -31,8 +34,14 @@ public class GunConfiguration {
//animations!
public HashMap<AnimType, BusAnimation> animations = new HashMap();
//whether ot not to disable crosshais when sneaking
//whether or not to disable crosshair when sneaking
public boolean hasSights;
//texture overlay when sneaking
public ResourceLocation scopeTexture;
//whether the FOV multiplier should be absolute or multiplicative to other modifiers, multiplicative mode is experimental!
public boolean absoluteFOV = true;
//the target FOV/multiplied FOV modifier when sneaking
public float zoomFOV = 0.0F;
//how long the reload animation will play
//MUST BE GREATER THAN ZERO ! ! !
@ -46,6 +55,7 @@ public class GunConfiguration {
public float firingPitch = 1.0F;
//whether the reload sound should be played at the beginning or at the end of the reload
public boolean reloadSoundEnd = true;
public String equipSound = "";
//how much ammo the clip can hold, 0 if drawn from inventory
public int ammoCap;
@ -58,14 +68,14 @@ public class GunConfiguration {
//for electrically powered weapons:
//the Maximum capacity of the gun
public int maxCharge;
public long maxCharge;
//the rate at which the gun is charged
public int chargeRate;
public long chargeRate;
//how much energy is discharged per shot
public int dischargePerShot;
public long dischargePerShot;
public String name = "";
public String manufacturer = "";
public EnumGunManufacturer manufacturer = EnumGunManufacturer.NONE;
public List<String> comment = new ArrayList();
//bullet configs for main and alt fire
@ -74,6 +84,9 @@ public class GunConfiguration {
//crosshair
public Crosshair crosshair;
//casing eject behavior
public CasingEjector ejector = null;
public static final int MODE_NORMAL = 0;
public static final int MODE_RELEASE = 1;
public static final int MODE_BOTH = 1;

View File

@ -2,6 +2,7 @@ package com.hbm.handler;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockBobble.BobbleType;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
import com.hbm.items.tool.IItemAbility;
import com.hbm.packet.AuxParticlePacketNT;
@ -206,38 +207,27 @@ public abstract class WeaponAbility {
if(living.getHealth() <= 0.0F) {
WeightedRandomObject[] ammo = new WeightedRandomObject[] {
new WeightedRandomObject(ModItems.ammo_12gauge, 10),
new WeightedRandomObject(ModItems.ammo_12gauge_shrapnel, 5),
new WeightedRandomObject(ModItems.ammo_12gauge_du, 3),
new WeightedRandomObject(ModItems.ammo_20gauge, 10),
new WeightedRandomObject(ModItems.ammo_20gauge_flechette, 5),
new WeightedRandomObject(ModItems.ammo_20gauge_slug, 5),
new WeightedRandomObject(ModItems.ammo_9mm, 10),
new WeightedRandomObject(ModItems.ammo_9mm_ap, 5),
new WeightedRandomObject(ModItems.ammo_5mm, 10),
new WeightedRandomObject(ModItems.ammo_5mm_du, 3),
new WeightedRandomObject(ModItems.ammo_556, 10),
new WeightedRandomObject(ModItems.ammo_556_phosphorus, 5),
new WeightedRandomObject(ModItems.ammo_556_flechette, 10),
new WeightedRandomObject(ModItems.ammo_556_flechette_phosphorus, 5),
new WeightedRandomObject(ModItems.ammo_50bmg, 10),
new WeightedRandomObject(ModItems.ammo_50bmg_incendiary, 5),
new WeightedRandomObject(ModItems.ammo_50bmg_ap, 5),
new WeightedRandomObject(ModItems.ammo_grenade, 5),
new WeightedRandomObject(ModItems.ammo_grenade_concussion, 3),
new WeightedRandomObject(ModItems.ammo_grenade_phosphorus, 3),
new WeightedRandomObject(ModItems.ammo_rocket, 5),
new WeightedRandomObject(ModItems.ammo_rocket_glare, 5),
new WeightedRandomObject(ModItems.ammo_rocket_phosphorus, 5),
new WeightedRandomObject(ModItems.ammo_rocket_rpc, 1),
new WeightedRandomObject(ModItems.syringe_metal_stimpak, 25),
new WeightedRandomObject(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.STOCK), 10),
new WeightedRandomObject(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.SHRAPNEL), 5),
new WeightedRandomObject(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.STOCK), 10),
new WeightedRandomObject(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.FLECHETTE), 5),
new WeightedRandomObject(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.SLUG), 5),
new WeightedRandomObject(ModItems.ammo_9mm.stackFromEnum(Ammo9mm.STOCK), 10),
new WeightedRandomObject(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.STOCK), 10),
new WeightedRandomObject(ModItems.ammo_556.stackFromEnum(Ammo556mm.STOCK), 10),
new WeightedRandomObject(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE), 10),
new WeightedRandomObject(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.STOCK), 3),
new WeightedRandomObject(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.STOCK), 3),
new WeightedRandomObject(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.STOCK), 1),
new WeightedRandomObject(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.GLARE), 1),
new WeightedRandomObject(new ItemStack(ModItems.syringe_metal_stimpak), 20),
};
int count = Math.min((int)Math.ceil(living.getMaxHealth() / divider), 250); //safeguard to prevent funnies from bosses with obscene health
for(int i = 0; i < count; i++) {
living.dropItem(((WeightedRandomObject)WeightedRandom.getRandomItem(living.getRNG(), ammo)).asItem(), 1);
living.entityDropItem(((WeightedRandomObject)WeightedRandom.getRandomItem(living.getRNG(), ammo)).asStack(), 1);
world.spawnEntityInWorld(new EntityXPOrb(world, living.posX, living.posY, living.posZ, 1));
}

View File

@ -10,6 +10,8 @@ import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.packet.AuxParticlePacketNT;
@ -38,7 +40,7 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.gun_revolver_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.LEAD));
bullet.velocity = 5.0F;
bullet.spread = 0.05F;
bullet.wear = 10;
@ -62,6 +64,8 @@ public class BulletConfigFactory {
}
public static final float defaultSpread = 0.005F;
/// STANDARD CONFIGS ///
//do not include damage or ammo
public static BulletConfiguration standardBulletConfig() {
@ -69,7 +73,7 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 5.0F;
bullet.spread = 0.005F;
bullet.spread = defaultSpread;
bullet.wear = 10;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;
@ -101,9 +105,9 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 5.0F;
bullet.spread = 0.05F;
bullet.spread = defaultSpread * 10F;
bullet.wear = 10;
bullet.bulletsMin = 5;
bullet.bulletsMin = 6;
bullet.bulletsMax = 8;
bullet.gravity = 0D;
bullet.maxAge = 100;
@ -181,7 +185,7 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 2.0F;
bullet.spread = 0.005F;
bullet.spread = defaultSpread;
bullet.wear = 10;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;
@ -207,7 +211,7 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 2.0F;
bullet.spread = 0.005F;
bullet.spread = defaultSpread;
bullet.wear = 10;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;
@ -233,7 +237,7 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 3.0F;
bullet.spread = 0.005F;
bullet.spread = defaultSpread;
bullet.wear = 10;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;
@ -258,7 +262,7 @@ public class BulletConfigFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 3.0F;
bullet.spread = 0.005F;
bullet.spread = defaultSpread;
bullet.wear = 10;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;

View File

@ -1,13 +1,22 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import java.util.List;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHurtBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.Ammo12Gauge;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
@ -15,12 +24,31 @@ import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.Vec3;
public class Gun12GaugeFactory {
private static final CasingEjector EJECTOR_SPAS, EJECTOR_SPAS_ALT, EJECTOR_BENELLI, EJECTOR_UBOINIK, EJECTOR_SSG;
private static final SpentCasing CASING12GAUGE;
static {
EJECTOR_SPAS = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, 0, 0.5).setAngleRange(0.01F, 0.03F).setDelay(12);
EJECTOR_SPAS_ALT = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, 0, 0.5).setAngleRange(0.01F, 0.03F).setDelay(12).setAmount(2);
EJECTOR_BENELLI = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.3, 1, 0).setAngleRange(0.01F, 0.03F);
EJECTOR_UBOINIK = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, -0.3, 0.5).setAngleRange(0.01F, 0.03F);
EJECTOR_SSG = new CasingEjector().setMotion(0.2, 0, -0.2).setOffset(0.8, 0, 0).setAngleRange(0.05F, 0.02F).setDelay(20).setAmount(2);
CASING12GAUGE = new SpentCasing(CasingType.SHOTGUN).setScale(1.5F).setBounceMotion(0.05F, 0.02F).setupSmoke(0.5F, 0.5D, 60, 20);
}
public static GunConfiguration getSpas12Config() {
GunConfiguration config = new GunConfiguration();
@ -39,18 +67,12 @@ public class Gun12GaugeFactory {
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
config.firingSound = "hbm:weapon.shotgunPump";
config.name = "Franchi SPAS-12";
config.manufacturer = "Black Mesa Armory";
config.name = "spas12";
config.manufacturer = EnumGunManufacturer.BLACK_MESA;
config.comment.add("\"Here, I have a more suitable gun for you. You'll need it - Catch!\"");
config.comment.add("Alt-fire with Mouse 2 (Right-click) to fire 2 shells at once");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
config.config = HbmCollection.twelveGauge;
config.animations.put(AnimType.CYCLE, new BusAnimation()
.addBus("SPAS_RECOIL_TRANSLATE", new BusAnimationSequence()
@ -68,10 +90,12 @@ public class Gun12GaugeFactory {
)
);
config.ejector = EJECTOR_SPAS;
return config;
}
public static GunConfiguration getSpas12AltConfig() {
public static GunConfiguration getSpas12AltConfig() {
GunConfiguration config = new GunConfiguration();
@ -85,14 +109,9 @@ public static GunConfiguration getSpas12AltConfig() {
config.firingSound = "hbm:weapon.shotgunPump";
config.reloadType = GunConfiguration.RELOAD_SINGLE;
config.config = HbmCollection.twelveGauge;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
config.ejector = EJECTOR_SPAS_ALT;
return config;
}
@ -115,16 +134,12 @@ public static GunConfiguration getSpas12AltConfig() {
config.reloadSound = GunConfiguration.RSOUND_REVOLVER;
config.firingSound = "hbm:weapon.shotgunShoot";
config.name = "Uboinik Revolving Shotgun";
config.manufacturer = "Metro Gunsmiths";
config.name = "uboinik";
config.manufacturer = EnumGunManufacturer.METRO;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
config.config = HbmCollection.twelveGauge;
config.ejector = EJECTOR_UBOINIK;
return config;
}
@ -171,17 +186,13 @@ public static GunConfiguration getSpas12AltConfig() {
)
);
config.name = "Double-Barreled Combat Shotgun";
config.manufacturer = "Union Aerospace Corporation";
config.name = "supershotty";
config.manufacturer = EnumGunManufacturer.UAC;
config.comment.add("God-damned ARCH-VILES!");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G12_DU);
config.config.add(BulletConfigSyncingUtil.G12_AM);
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
config.config = HbmCollection.twelveGauge;
config.ejector = EJECTOR_SSG;
return config;
}
@ -190,31 +201,35 @@ public static GunConfiguration getSpas12AltConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_12gauge;
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.STOCK));
bullet.dmgMin = 5;
bullet.dmgMax = 7;
bullet.spentCasing = CASING12GAUGE.clone().register("12GaStock").setColor(0x2847FF, SpentCasing.COLOR_CASE_12GA);
return bullet;
}
public static BulletConfiguration get12GaugeFireConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
BulletConfiguration bullet = get12GaugeConfig();
bullet.ammo = ModItems.ammo_12gauge_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.INCENDIARY));
bullet.wear = 15;
bullet.dmgMin = 5;
bullet.dmgMax = 7;
bullet.incendiary = 5;
bullet.spentCasing = CASING12GAUGE.clone().register("12GaInc").setColor(0xFF6329, SpentCasing.COLOR_CASE_12GA).setupSmoke(1F, 0.5D, 60, 40);
return bullet;
}
public static BulletConfiguration get12GaugeShrapnelConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
BulletConfiguration bullet = get12GaugeConfig();
bullet.ammo = ModItems.ammo_12gauge_shrapnel;
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.SHRAPNEL));
bullet.wear = 15;
bullet.dmgMin = 10;
bullet.dmgMax = 17;
@ -222,6 +237,8 @@ public static GunConfiguration getSpas12AltConfig() {
bullet.HBRC = 80;
bullet.LBRC = 95;
bullet.spentCasing = CASING12GAUGE.clone().register("12GaShrap").setColor(0xF0E800, SpentCasing.COLOR_CASE_12GA);
return bullet;
}
@ -229,13 +246,15 @@ public static GunConfiguration getSpas12AltConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_12gauge_du;
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.DU));
bullet.wear = 20;
bullet.dmgMin = 18;
bullet.dmgMax = 22;
bullet.doesPenetrate = true;
bullet.leadChance = 50;
bullet.spentCasing = CASING12GAUGE.clone().register("12GaDU").setColor(0x62A362, SpentCasing.COLOR_CASE_12GA);
return bullet;
}
@ -243,7 +262,7 @@ public static GunConfiguration getSpas12AltConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_12gauge_marauder;
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.MARAUDER));
bullet.wear = 20;
bullet.dmgMin = 100;
bullet.dmgMax = 500;
@ -260,6 +279,8 @@ public static GunConfiguration getSpas12AltConfig() {
};
bullet.spentCasing = CASING12GAUGE.clone().register("12GaAM").setColor(0x416645, SpentCasing.COLOR_CASE_12GA);
return bullet;
}
@ -267,7 +288,61 @@ public static GunConfiguration getSpas12AltConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardAirstrikeConfig();
bullet.ammo = ModItems.ammo_12gauge_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.SLEEK));
bullet.spentCasing = CASING12GAUGE.clone().register("12GaIF").setColor(0x2A2A2A, SpentCasing.COLOR_CASE_12GA);
return bullet;
}
public static BulletConfiguration get12GaugePercussionConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.PERCUSSION));
bullet.velocity = 2F;
bullet.spread = 0F;
bullet.wear = 10;
bullet.dmgMin = 30F;
bullet.dmgMax = 30F;
bullet.maxAge = 0;
bullet.spentCasing = CASING12GAUGE.clone().register("12GaPerc").setColor(0x9E1616, SpentCasing.COLOR_CASE_12GA).setupSmoke(1F, 0.5D, 60, 40);
bullet.bUpdate = new IBulletUpdateBehavior() {
@Override
public void behaveUpdate(EntityBulletBase bullet) {
if(!bullet.worldObj.isRemote) {
Vec3 vec = Vec3.createVectorHelper(bullet.motionX, bullet.motionY, bullet.motionZ);
double radius = 4;
double x = bullet.posX + vec.xCoord;
double y = bullet.posY + vec.yCoord;
double z = bullet.posZ + vec.zCoord;
AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(x, y, z, x, y, z).expand(radius, radius, radius);
List<Entity> list = bullet.worldObj.getEntitiesWithinAABBExcludingEntity(bullet.shooter, aabb);
for(Entity e : list) {
DamageSource source = bullet.shooter instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) bullet.shooter) : DamageSource.magic;
e.attackEntityFrom(source, 30F);
}
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "plasmablast");
data.setFloat("r", 0.75F);
data.setFloat("g", 0.75F);
data.setFloat("b", 0.75F);
data.setFloat("pitch", (float) -bullet.rotationPitch + 90);
data.setFloat("yaw", (float) bullet.rotationYaw);
data.setFloat("scale", 2F);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(bullet.dimension, x, y, z, 100));
bullet.setDead();
}
}
};
return bullet;
}

View File

@ -2,10 +2,16 @@ package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo20Gauge;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
import com.hbm.render.anim.BusAnimationSequence;
@ -14,9 +20,18 @@ import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Vec3;
public class Gun20GaugeFactory {
private static final CasingEjector EJECTOR_SHOTGUN;
private static final SpentCasing CASING20GAUGE;
static {
EJECTOR_SHOTGUN = new CasingEjector().setMotion(Vec3.createVectorHelper(-0.4, 0.95, 0)).setOffset(Vec3.createVectorHelper(-0.55, 0, 0.5)).setAngleRange(0.01F, 0.05F);
CASING20GAUGE = new SpentCasing(CasingType.SHOTGUN).setScale(1.25F).setBounceMotion(0.01F, 0.05F).setupSmoke(0.25F, 0.5D, 60, 20);
}
public static GunConfiguration getShotgunConfig() {
GunConfiguration config = new GunConfiguration();
@ -48,17 +63,9 @@ public class Gun20GaugeFactory {
)
);
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G20_NORMAL);
config.config.add(BulletConfigSyncingUtil.G20_SLUG);
config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G20_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC);
config.config.add(BulletConfigSyncingUtil.G20_SHOCK);
config.config.add(BulletConfigSyncingUtil.G20_WITHER);
config.config.add(BulletConfigSyncingUtil.G20_SLEEK);
config.config = HbmCollection.twentyGauge;
config.ejector = EJECTOR_SHOTGUN;
return config;
}
@ -72,20 +79,10 @@ public class Gun20GaugeFactory {
config.firingSound = "hbm:weapon.revolverShootAlt";
config.firingPitch = 0.75F;
config.name = "Winchester Model 1887";
config.manufacturer = "Winchester Repeating Arms Company";
config.name = "win1887";
config.manufacturer = EnumGunManufacturer.WINCHESTER;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G20_NORMAL);
config.config.add(BulletConfigSyncingUtil.G20_SLUG);
config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G20_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC);
config.config.add(BulletConfigSyncingUtil.G20_SHOCK);
config.config.add(BulletConfigSyncingUtil.G20_WITHER);
config.config.add(BulletConfigSyncingUtil.G20_SLEEK);
config.config = HbmCollection.twentyGauge;
return config;
}
@ -99,20 +96,10 @@ public class Gun20GaugeFactory {
config.firingSound = "hbm:weapon.revolverShootAlt";
config.firingPitch = 0.75F;
config.name = "Winchester Model 1887 Inox";
config.manufacturer = "Winchester Repeating Arms Company";
config.name = "win1887Inox";
config.manufacturer = EnumGunManufacturer.WINCHESTER;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G20_NORMAL);
config.config.add(BulletConfigSyncingUtil.G20_SLUG);
config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G20_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC);
config.config.add(BulletConfigSyncingUtil.G20_SHOCK);
config.config.add(BulletConfigSyncingUtil.G20_WITHER);
config.config.add(BulletConfigSyncingUtil.G20_SLEEK);
config.config = HbmCollection.twentyGauge;
return config;
}
@ -145,20 +132,10 @@ public class Gun20GaugeFactory {
)
);
config.name = "Remington Model 700";
config.manufacturer = "Remington Arms Company";
config.name = "win20Inox";
config.manufacturer = EnumGunManufacturer.WINCHESTER;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G20_SLUG);
config.config.add(BulletConfigSyncingUtil.G20_NORMAL);
config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G20_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC);
config.config.add(BulletConfigSyncingUtil.G20_SHOCK);
config.config.add(BulletConfigSyncingUtil.G20_WITHER);
config.config.add(BulletConfigSyncingUtil.G20_SLEEK);
config.config = HbmCollection.twentyGauge;
return config;
}
@ -191,20 +168,10 @@ public class Gun20GaugeFactory {
)
);
config.name = "Winchester Model 20 Polymer";
config.manufacturer = "Winchester Repeating Arms Company";
config.name = "win20Poly";
config.manufacturer = EnumGunManufacturer.WINCHESTER;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G20_SLUG);
config.config.add(BulletConfigSyncingUtil.G20_NORMAL);
config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G20_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC);
config.config.add(BulletConfigSyncingUtil.G20_SHOCK);
config.config.add(BulletConfigSyncingUtil.G20_WITHER);
config.config.add(BulletConfigSyncingUtil.G20_SLEEK);
config.config = HbmCollection.twentyGauge;
return config;
}
@ -237,20 +204,10 @@ public class Gun20GaugeFactory {
)
);
config.name = "Winchester Model 20 D-25A";
config.manufacturer = "Winchester Repeating Arms Company / Big MT";
config.name = "win20Satur";
config.manufacturer = EnumGunManufacturer.WINCHESTER_BIGMT;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G20_SLUG_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_NORMAL_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_FLECHETTE_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHRAPNEL);
config.config.add(BulletConfigSyncingUtil.G20_EXPLOSIVE_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_CAUSTIC_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SHOCK_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_WITHER_FIRE);
config.config.add(BulletConfigSyncingUtil.G20_SLEEK);
config.config = HbmCollection.twentyGauge;
return config;
}
@ -259,10 +216,12 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.STOCK));
bullet.dmgMin = 3;
bullet.dmgMax = 5;
bullet.spentCasing = CASING20GAUGE.clone().register("20GaStock").setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -270,12 +229,14 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_20gauge_slug;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.SLUG));
bullet.dmgMin = 18;
bullet.dmgMax = 22;
bullet.wear = 7;
bullet.style = BulletConfiguration.STYLE_NORMAL;
bullet.spentCasing = CASING20GAUGE.clone().register("20GaSlug").setColor(0x2A2A2A, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -283,7 +244,7 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_flechette;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.FLECHETTE));
bullet.dmgMin = 8;
bullet.dmgMax = 15;
bullet.wear = 15;
@ -291,6 +252,8 @@ public class Gun20GaugeFactory {
bullet.HBRC = 2;
bullet.LBRC = 95;
bullet.spentCasing = CASING20GAUGE.clone().register("20GaFlech").setColor(0x2847FF, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -298,12 +261,14 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.INCENDIARY));
bullet.dmgMin = 3;
bullet.dmgMax = 6;
bullet.wear = 15;
bullet.incendiary = 5;
bullet.spentCasing = CASING20GAUGE.clone().register("20GaInc").setColor(0xFF6329, SpentCasing.COLOR_CASE_BRASS).setupSmoke(1F, 0.5D, 60, 40);
return bullet;
}
@ -311,7 +276,7 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_shrapnel;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.SHRAPNEL));
bullet.wear = 15;
bullet.dmgMin = 7;
bullet.dmgMax = 12;
@ -319,6 +284,8 @@ public class Gun20GaugeFactory {
bullet.HBRC = 80;
bullet.LBRC = 95;
bullet.spentCasing = CASING20GAUGE.clone().register("20GaShrap").setColor(0xF0E800, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -326,12 +293,14 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_explosive;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.EXPLOSIVE));
bullet.dmgMin = 7;
bullet.dmgMax = 12;
bullet.wear = 25;
bullet.explosive = 0.5F;
bullet.spentCasing = CASING20GAUGE.clone().register("20GaExp").setColor(0xF0E800, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -339,7 +308,7 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_caustic;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.CAUSTIC));
bullet.dmgMin = 3;
bullet.dmgMax = 7;
bullet.wear = 25;
@ -351,6 +320,8 @@ public class Gun20GaugeFactory {
bullet.effects = new ArrayList();
bullet.effects.add(new PotionEffect(Potion.poison.id, 10 * 20, 1));
bullet.spentCasing = CASING20GAUGE.clone().register("20GaCaus").setColor(0x64E800, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -358,7 +329,7 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_shock;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.SHOCK));
bullet.dmgMin = 4;
bullet.dmgMax = 8;
bullet.wear = 25;
@ -371,6 +342,8 @@ public class Gun20GaugeFactory {
bullet.effects.add(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 1));
bullet.effects.add(new PotionEffect(Potion.weakness.id, 10 * 20, 4));
bullet.spentCasing = CASING20GAUGE.clone().register("20GaShock").setColor(0x00EFEF, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -378,13 +351,15 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_20gauge_wither;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.WITHER));
bullet.dmgMin = 4;
bullet.dmgMax = 8;
bullet.effects = new ArrayList();
bullet.effects.add(new PotionEffect(Potion.wither.id, 10 * 20, 2));
bullet.spentCasing = CASING20GAUGE.clone().register("20GaWith").setColor(0x391717, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}
@ -392,7 +367,9 @@ public class Gun20GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardAirstrikeConfig();
bullet.ammo = ModItems.ammo_20gauge_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.SLEEK));
bullet.spentCasing = CASING20GAUGE.clone().register("20GaIF").setColor(0x2A2A2A, SpentCasing.COLOR_CASE_BRASS);
return bullet;
}

View File

@ -1,15 +1,27 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo22LR;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class Gun22LRFactory {
private static final CasingEjector EJECTOR_22LR;
private static final SpentCasing CASING22LR;
static {
EJECTOR_22LR = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, -0.2, 0.35).setAngleRange(0.01F, 0.03F);
CASING22LR = new SpentCasing(CasingType.STRAIGHT).setScale(0.8F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS);
}
public static GunConfiguration getUziConfig() {
GunConfiguration config = new GunConfiguration();
@ -29,14 +41,13 @@ public class Gun22LRFactory {
config.firingSound = "hbm:weapon.uziShoot";
config.reloadSoundEnd = false;
config.name = "IMI Uzi";
config.manufacturer = "Israel Military Industries";
config.name = "uzi";
config.manufacturer = EnumGunManufacturer.IMI;
config.comment.add("Mom, where are my mittens?");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.LR22_NORMAL);
config.config.add(BulletConfigSyncingUtil.LR22_AP);
config.config.add(BulletConfigSyncingUtil.CHL_LR22);
config.config = HbmCollection.twentyTwoLR;
config.ejector = EJECTOR_22LR;
return config;
}
@ -47,13 +58,10 @@ public class Gun22LRFactory {
config.durability = 4500;
config.name = "IMI Uzi D-25A";
config.manufacturer = "IMI / Big MT";
config.name = "uziSatur";
config.manufacturer = EnumGunManufacturer.IMI_BIGMT;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.LR22_NORMAL_FIRE);
config.config.add(BulletConfigSyncingUtil.LR22_AP_FIRE);
config.config.add(BulletConfigSyncingUtil.CHL_LR22_FIRE);
config.config = HbmCollection.twentyTwoLRFire;
return config;
}
@ -63,11 +71,13 @@ public class Gun22LRFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_22lr;
bullet.ammo = new ComparableStack(ModItems.ammo_22lr.stackFromEnum(Ammo22LR.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 6;
bullet.dmgMax = 8;
bullet.spentCasing = CASING22LR.clone().register("22LRStock");
return bullet;
}
@ -75,13 +85,15 @@ public class Gun22LRFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_22lr_ap;
bullet.ammo = new ComparableStack(ModItems.ammo_22lr.stackFromEnum(Ammo22LR.AP));
bullet.spread *= inaccuracy;
bullet.dmgMin = 12;
bullet.dmgMax = 16;
bullet.leadChance = 10;
bullet.wear = 15;
bullet.spentCasing = CASING22LR.clone().register("22LRAP");
return bullet;
}

View File

@ -4,16 +4,33 @@ import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.lib.ModDamageSource;
import com.hbm.potion.HbmPotion;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Vec3;
public class Gun357MagnumFactory {
private static final CasingEjector EJECTOR_REVOLVER;
private static final SpentCasing CASING357;
private static final SpentCasing CASINGNM;
static {
EJECTOR_REVOLVER = new CasingEjector().setMotion(Vec3.createVectorHelper(0, 0, -0.03)).setOffset(Vec3.createVectorHelper(0, -0.15, 0)).setAngleRange(0.01F, 0.05F).setAfterReload().setAmount(6);
CASING357 = new SpentCasing(CasingType.STRAIGHT).setBounceMotion(0.01F, 0.05F);
CASINGNM = new SpentCasing(CasingType.SHOTGUN).setScale(1.25F).setBounceMotion(0.01F, 0.05F).setColor(0xC7AB1C, 0x6D63A6).register("357N2");
}
public static GunConfiguration getBaseConfig() {
GunConfiguration config = new GunConfiguration();
@ -32,6 +49,8 @@ public class Gun357MagnumFactory {
config.firingSound = "hbm:weapon.revolverShoot";
config.reloadSoundEnd = false;
config.ejector = EJECTOR_REVOLVER;
return config;
}
@ -41,8 +60,8 @@ public class Gun357MagnumFactory {
config.durability = 2000;
config.name = "FFI Viper";
config.manufacturer = "FlimFlam Industries";
config.name = "ffiV";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.IRON_REVOLVER);
@ -57,8 +76,8 @@ public class Gun357MagnumFactory {
config.durability = 3500;
config.name = "FFI Viper Inox";
config.manufacturer = "FlimFlam Industries";
config.name = "ffiVInox";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.STEEL_REVOLVER);
@ -73,8 +92,8 @@ public class Gun357MagnumFactory {
config.durability = 3500;
config.name = "FFI Viper D-25A";
config.manufacturer = "FlimFlam Industries";
config.name = "ffivSatur";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.SATURNITE_REVOLVER);
@ -89,8 +108,8 @@ public class Gun357MagnumFactory {
config.durability = 2000;
config.name = "FFI Viper Lead";
config.manufacturer = "FlimFlam Industries";
config.name = "ffiVLead";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.LEAD_REVOLVER);
@ -105,8 +124,8 @@ public class Gun357MagnumFactory {
config.durability = 2500;
config.name = "FFI Viper Bling";
config.manufacturer = "FlimFlam Industries";
config.name = "ffivBling";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.GOLD_REVOLVER);
@ -124,8 +143,8 @@ public class Gun357MagnumFactory {
config.durability = 5000;
config.firingSound = "hbm:weapon.heavyShoot";
config.name = "Britannia Standard Issue Motorized Handgun";
config.manufacturer = "BAE Systems plc";
config.name = "revolverCursed";
config.manufacturer = EnumGunManufacturer.BAE;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.CURSED_REVOLVER);
@ -141,8 +160,8 @@ public class Gun357MagnumFactory {
config.durability = 7500;
config.firingSound = "hbm:weapon.schrabidiumShoot";
config.name = "FFI Viper Ultra";
config.manufacturer = "FlimFlam Industries";
config.name = "ffiVUltra";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.SCHRABIDIUM_REVOLVER);
@ -158,8 +177,8 @@ public class Gun357MagnumFactory {
config.durability = 4000;
config.firingSound = "hbm:weapon.schrabidiumShoot";
config.name = "FFI Viper N1";
config.manufacturer = "FlimFlam Industries";
config.name = "ffiVN1";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.NIGHT_REVOLVER);
@ -176,8 +195,8 @@ public class Gun357MagnumFactory {
config.firingSound = "hbm:weapon.schrabidiumShoot";
config.crosshair = Crosshair.NONE;
config.name = "FFI Viper N2";
config.manufacturer = "FlimFlam Industries";
config.name = "ffiVN2";
config.manufacturer = EnumGunManufacturer.FLIMFLAM;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.NIGHT2_REVOLVER);
@ -185,27 +204,6 @@ public class Gun357MagnumFactory {
return config;
}
public static GunConfiguration getRevolverBioConfig() {
GunConfiguration config = getBaseConfig();
config.durability = 100000;
config.firingSound = "hbm:weapon.deagleShoot";
config.reloadDuration = 53;
config.crosshair = Crosshair.CIRCLE;
config.name = "RI No. 2 Mark 1";
config.manufacturer = "Ryan Industries";
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.IRON_HS);
config.config.add(BulletConfigSyncingUtil.STEEL_HS);
config.config.add(BulletConfigSyncingUtil.GOLD_HS);
config.config.add(BulletConfigSyncingUtil.DESH_HS);
return config;
}
//// // // // // ////// ////// //////
// // // // // // // // //
//// // // // // //// // //////
@ -216,20 +214,11 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_iron_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.IRON));
bullet.dmgMin = 8;
bullet.dmgMax = 10;
return bullet;
}
public static BulletConfiguration getRevSteelConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_ammo;
bullet.dmgMin = 18;
bullet.dmgMax = 22;
bullet.spentCasing = CASING357.clone().register("357Iron").setColor(0xA8A8A8);
return bullet;
}
@ -238,13 +227,28 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_lead_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.LEAD));
bullet.dmgMin = 18;
bullet.dmgMax = 22;
bullet.spentCasing = CASING357.clone().register("357Lead").setColor(0x646470);
return bullet;
}
public static BulletConfiguration getRevNuclearConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.NUCLEAR));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.effects = new ArrayList();
bullet.effects.add(new PotionEffect(HbmPotion.radiation.id, 10 * 20, 4));
bullet.spentCasing = CASING357.clone().register("357Nuc").setColor(0xFEFEFE);
return bullet;
}
@ -252,10 +256,12 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_gold_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.GOLD));
bullet.dmgMin = 25;
bullet.dmgMax = 28;
bullet.spentCasing = CASING357.clone().register("357Gold").setColor(0xF9FF3E);
return bullet;
}
@ -263,10 +269,12 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_357_desh;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.DESH));
bullet.dmgMin = 30;
bullet.dmgMax = 33;
bullet.spentCasing = CASING357.clone().register("357Desh").setColor(0xF22929);
return bullet;
}
@ -274,11 +282,13 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_schrabidium_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.SCHRABIDIUM));
bullet.dmgMin = 10000;
bullet.dmgMax = 100000;
bullet.instakill = true;
bullet.spentCasing = CASING357.clone().register("357Schrab").setColor(0x32FFFF);
return bullet;
}
@ -286,21 +296,25 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_cursed_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.STEEL));
bullet.dmgMin = 18;
bullet.dmgMax = 25;
bullet.spentCasing = CASING357.clone().register("357Cursed").setColor(0x565656);
return bullet;
}
public static BulletConfiguration getRevNightmareConfig() {
public static BulletConfiguration getRevNightmare1Config() {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.gun_revolver_nightmare_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.NIGHTMARE1));
bullet.dmgMin = 1;
bullet.dmgMax = 100;
bullet.spentCasing = CASING357.clone().register("357N1").setColor(0x3A3A3A);
return bullet;
}
@ -308,7 +322,7 @@ public class Gun357MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.gun_revolver_nightmare2_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_357.stackFromEnum(Ammo357Magnum.NIGHTMARE2));
bullet.spread *= 10;
bullet.bulletsMin = 4;
bullet.bulletsMax = 6;
@ -321,6 +335,8 @@ public class Gun357MagnumFactory {
bullet.damageType = ModDamageSource.s_laser;
bullet.spentCasing = CASINGNM;
return bullet;
}

View File

@ -9,12 +9,20 @@ import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.entity.projectile.EntityDuchessGambit;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHitBehavior;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo44Magnum;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.RefStrings;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
@ -22,9 +30,19 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import net.minecraft.entity.Entity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Vec3;
public class Gun44MagnumFactory {
private static final CasingEjector EJECTOR_PIP;
private static final SpentCasing CASING44;
static {
EJECTOR_PIP = new CasingEjector().setMotion(Vec3.createVectorHelper(0, 0, -0.05)).setOffset(Vec3.createVectorHelper(0, -0.15, 0)).setAngleRange(0.01F, 0.05F).setAfterReload().setAmount(6);
CASING44 = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F, 1.0F, 1.5F).setBounceMotion(0.01F, 0.05F).setColor(SpentCasing.COLOR_CASE_44);
}
public static GunConfiguration getBaseConfig() {
GunConfiguration config = new GunConfiguration();
@ -43,6 +61,10 @@ public class Gun44MagnumFactory {
config.firingSound = "hbm:weapon.revolverShootAlt";
config.reloadSoundEnd = false;
config.config.addAll(HbmCollection.fourtyFourMagBasic);
config.ejector = EJECTOR_PIP;
return config;
}
@ -52,41 +74,33 @@ public class Gun44MagnumFactory {
config.durability = 2500;
config.name = "IF-18 Horseshoe";
config.manufacturer = "Ironshod Firearms";
config.name = "ifHorseshoe";
config.manufacturer = EnumGunManufacturer.IF;
config.comment.add("Fallout New Vegas wasn't THAT good.");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.M44_NORMAL);
config.config.add(BulletConfigSyncingUtil.M44_AP);
config.config.add(BulletConfigSyncingUtil.M44_DU);
config.config.add(BulletConfigSyncingUtil.M44_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.M44_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_M44);
config.config.add(BulletConfigSyncingUtil.M44_ROCKET);
return config;
}
public static final ResourceLocation scope_lilmac = new ResourceLocation(RefStrings.MODID, "textures/misc/scope_44.png");
public static GunConfiguration getMacintoshConfig() {
GunConfiguration config = getBaseConfig();
config.durability = 4000;
config.name = "IF-18 Horseshoe Scoped";
config.manufacturer = "Ironshod Firearms";
config.name = "ifScope";
config.manufacturer = EnumGunManufacturer.IF;
config.comment.add("Poppin' mentats like tic tacs");
config.hasSights = true;
config.absoluteFOV = true;
config.zoomFOV = 0.25F;
config.scopeTexture = scope_lilmac;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.M44_PIP);
config.config.add(BulletConfigSyncingUtil.M44_NORMAL);
config.config.add(BulletConfigSyncingUtil.M44_AP);
config.config.add(BulletConfigSyncingUtil.M44_DU);
config.config.add(BulletConfigSyncingUtil.M44_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.M44_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_M44);
config.config.add(BulletConfigSyncingUtil.M44_ROCKET);
config.config.addAll(HbmCollection.fourtyFourMagBasic);
return config;
}
@ -98,19 +112,15 @@ public class Gun44MagnumFactory {
config.durability = 4000;
config.ammoCap = 5;
config.name = "IF-18 Horseshoe Vanity";
config.manufacturer = "Ironshod Firearms";
config.name = "ifVanity";
config.manufacturer = EnumGunManufacturer.IF;
config.comment.add("Alcoholism is cool!");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.M44_BJ);
config.config.add(BulletConfigSyncingUtil.M44_NORMAL);
config.config.add(BulletConfigSyncingUtil.M44_AP);
config.config.add(BulletConfigSyncingUtil.M44_DU);
config.config.add(BulletConfigSyncingUtil.M44_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.M44_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_M44);
config.config.add(BulletConfigSyncingUtil.M44_ROCKET);
config.config.addAll(HbmCollection.fourtyFourMagBasic);
config.ejector = EJECTOR_PIP.clone().setAmount(5);
return config;
}
@ -122,20 +132,14 @@ public class Gun44MagnumFactory {
config.durability = 4000;
config.ammoCap = 6;
config.name = "IF-18 Horseshoe Silver Storm";
config.manufacturer = "Ironshod Firearms";
config.name = "ifStorm";
config.manufacturer = EnumGunManufacturer.IF;
config.comment.add("Our friendship is based on abusive behaviour");
config.comment.add("and mutual hate. It's not that complicated.");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.M44_SILVER);
config.config.add(BulletConfigSyncingUtil.M44_NORMAL);
config.config.add(BulletConfigSyncingUtil.M44_AP);
config.config.add(BulletConfigSyncingUtil.M44_DU);
config.config.add(BulletConfigSyncingUtil.M44_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.M44_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_M44);
config.config.add(BulletConfigSyncingUtil.M44_ROCKET);
config.config.addAll(HbmCollection.fourtyFourMagBasic);
return config;
}
@ -147,22 +151,15 @@ public class Gun44MagnumFactory {
config.durability = 4000;
config.ammoCap = 64;
config.name = "IF-18 Horseshoe Bottomless Pit";
config.manufacturer = "Ironshod Firearms R&D";
config.name = "ifPit";
config.manufacturer = EnumGunManufacturer.IF;
config.comment.add("Explore the other side");
config.comment.add("...from afar!");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.M44_NORMAL);
config.config.add(BulletConfigSyncingUtil.M44_AP);
config.config.add(BulletConfigSyncingUtil.M44_DU);
config.config.add(BulletConfigSyncingUtil.M44_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.M44_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_M44);
config.config.add(BulletConfigSyncingUtil.M44_PIP);
config.config.add(BulletConfigSyncingUtil.M44_BJ);
config.config.add(BulletConfigSyncingUtil.M44_SILVER);
config.config.add(BulletConfigSyncingUtil.M44_ROCKET);
config.config.addAll(HbmCollection.fourtyFourMagAll);
config.ejector = EJECTOR_PIP.clone().setAmount(64);
return config;
}
@ -171,10 +168,12 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.STOCK));
bullet.dmgMin = 18;
bullet.dmgMax = 26;
bullet.spentCasing = CASING44.clone().register("44NoPip");
return bullet;
}
@ -182,12 +181,14 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_ap;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.AP));
bullet.dmgMin = 25;
bullet.dmgMax = 32;
bullet.wear = 15;
bullet.leadChance = 10;
bullet.spentCasing = CASING44.clone().register("44AP");
return bullet;
}
@ -195,12 +196,14 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_du;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.DU));
bullet.dmgMin = 28;
bullet.dmgMax = 40;
bullet.wear = 25;
bullet.leadChance = 50;
bullet.spentCasing = CASING44.clone().register("44DU");
return bullet;
}
@ -208,7 +211,7 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.PHOSPHORUS));
bullet.dmgMin = 18;
bullet.dmgMax = 26;
bullet.wear = 15;
@ -235,6 +238,8 @@ public class Gun44MagnumFactory {
}
};
bullet.spentCasing = CASING44.clone().register("44Phos");
return bullet;
}
@ -242,12 +247,14 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_star;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.STAR));
bullet.dmgMin = 42;
bullet.dmgMax = 50;
bullet.wear = 25;
bullet.leadChance = 100;
bullet.spentCasing = CASING44.clone().register("44Star");
return bullet;
}
@ -255,7 +262,7 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_pip;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.PIP));
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.wear = 25;
@ -285,6 +292,8 @@ public class Gun44MagnumFactory {
}
};
bullet.spentCasing = CASING44.clone().register("44Pip").setColor(0x532C64);
return bullet;
}
@ -292,7 +301,7 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_bj;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.BJ));
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.wear = 25;
@ -323,6 +332,8 @@ public class Gun44MagnumFactory {
};
bullet.spentCasing = CASING44.clone().register("44BJ").setColor(0x632B2C);
return bullet;
}
@ -330,7 +341,7 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_44_silver;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.SILVER));
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.wear = 25;
@ -361,6 +372,8 @@ public class Gun44MagnumFactory {
};
bullet.spentCasing = CASING44.clone().register("44Silver").setColor(0x2B5963);
return bullet;
}
@ -368,11 +381,13 @@ public class Gun44MagnumFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_44_rocket;
bullet.ammo = new ComparableStack(ModItems.ammo_44.stackFromEnum(Ammo44Magnum.ROCKET));
bullet.velocity = 5;
bullet.explosive = 15F;
bullet.trail = 1;
bullet.spentCasing = CASING44.clone().register("44Rocket");
return bullet;
}

View File

@ -0,0 +1,207 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo45ACP;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.util.Vec3;
public class Gun45ACPFactory {
private static final CasingEjector EJECTOR_REVOLVER;
private static final SpentCasing CASING45;
static {
EJECTOR_REVOLVER = new CasingEjector().setMotion(Vec3.createVectorHelper(0, 0, -0.03)).setOffset(Vec3.createVectorHelper(0, -0.15, 0)).setAngleRange(0.01F, 0.05F).setAfterReload().setAmount(6);
CASING45 = new SpentCasing(CasingType.STRAIGHT).setBounceMotion(0.01F, 0.05F).setScale(1.25F, 1.25F, 1F).setColor(SpentCasing.COLOR_CASE_BRASS).register("45ACP");
}
public static GunConfiguration getBaseConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 10;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.reloadDuration = 10;
config.firingDuration = 0;
config.ammoCap = 6;
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.L_CLASSIC;
config.reloadSound = GunConfiguration.RSOUND_REVOLVER;
config.firingSound = "hbm:weapon.revolverShoot";
config.reloadSoundEnd = false;
config.ejector = EJECTOR_REVOLVER;
return config;
}
public static GunConfiguration getThompsonConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 2;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_AUTO;
config.reloadDuration = 20;
config.firingDuration = 0;
config.ammoCap = 30;
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.L_SPLIT;
config.durability = 5000;
config.reloadSound = GunConfiguration.RSOUND_MAG;
config.firingSound = "hbm:weapon.rifleShoot";
config.reloadSoundEnd = false;
config.name = "tommy";
config.manufacturer = EnumGunManufacturer.AUTO_ORDINANCE;
config.config = new ArrayList<Integer>();
config.config.addAll(HbmCollection.fourtyFiveACP);
return config;
}
public static GunConfiguration getRevolverBioConfig() {
GunConfiguration config = getBaseConfig();
config.durability = 100000;
config.firingSound = "hbm:weapon.deagleShoot";
config.reloadDuration = 53;
config.crosshair = Crosshair.CIRCLE;
config.name = "bio";
config.manufacturer = EnumGunManufacturer.RYAN;
config.config = HbmCollection.fourtyFiveACP;
return config;
}
public static GunConfiguration getUACPistolConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 4;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_MANUAL;
config.reloadDuration = 10;
config.firingDuration = 8;
config.ammoCap = 16;
config.durability = 10000;
config.reloadType = 1;
config.allowsInfinity = true;
config.hasSights = true;
config.crosshair = Crosshair.CROSS;
config.reloadSound = "hbm:weapon.pistolReloadPB3";
config.firingSound = "hbm:weapon.pistolFirePB3";
config.reloadSoundEnd = true;
config.name = "uacPistol";
config.manufacturer = EnumGunManufacturer.UAC;
config.config.addAll(HbmCollection.fourtyFiveACP);
config.animations.put(AnimType.CYCLE, new BusAnimation()
.addBus("SLIDE", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 10))// Wait for hammer
.addKeyframe(new BusAnimationKeyframe(0, 0, -3.5, 40))// Slide back
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 40)))// Return
.addBus("HAMMER", new BusAnimationSequence()
.addKeyframe(new BusAnimationKeyframe(15, 0, 0, 10))
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 40))));
return config;
}
public static GunConfiguration getUACSMGConfig() {
GunConfiguration config = new GunConfiguration();
config.rateOfFire = 1;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_AUTO;
config.reloadDuration = 10;
config.firingDuration = 4;
config.ammoCap = 40;
config.durability = 40000;
config.reloadType = 1;
config.allowsInfinity = true;
config.hasSights = true;
config.crosshair = Crosshair.CROSS;
config.reloadSound = "hbm:weapon.SMGMagInPB3";
config.firingSound = "hbm:weapon.SMGFirePB3";
config.firingPitch = 1.15F;
config.reloadSoundEnd = true;
config.name = "uacSMG";
config.manufacturer = EnumGunManufacturer.UAC;
config.config.addAll(HbmCollection.fourtyFiveACP);
return config;
}
static float inaccuracy = 5;
public static BulletConfiguration get45AutoConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_45.stackFromEnum(Ammo45ACP.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMax = 12;
bullet.dmgMin = 16;
bullet.spentCasing = CASING45;
return bullet;
}
public static BulletConfiguration get45AutoAPConfig() {
BulletConfiguration bullet = get45AutoConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_45.stackFromEnum(Ammo45ACP.AP));
bullet.dmgMax = 18;
bullet.dmgMin = 26;
bullet.wear = 15;
bullet.leadChance = 10;
bullet.spentCasing = CASING45;
return bullet;
}
public static BulletConfiguration get45AutoDUConfig() {
BulletConfiguration bullet = get45AutoConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_45.stackFromEnum(Ammo45ACP.DU));
bullet.dmgMax = 30;
bullet.dmgMin = 44;
bullet.wear = 25;
bullet.leadChance = 50;
bullet.spentCasing = CASING45;
return bullet;
}
}

View File

@ -1,6 +1,5 @@
package com.hbm.handler.guncfg;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
@ -11,14 +10,21 @@ import com.hbm.explosion.ExplosionNT.ExAttrib;
import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHurtBehavior;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo4Gauge;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.lib.ModDamageSource;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
@ -27,17 +33,25 @@ import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.ReflectionHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Vec3;
import net.minecraftforge.common.IExtendedEntityProperties;
public class Gun4GaugeFactory {
private static final CasingEjector EJECTOR_SHOTGUN;
private static final SpentCasing CASING4GAUGE;
static {
EJECTOR_SHOTGUN = new CasingEjector().setMotion(Vec3.createVectorHelper(-0.4, 0.4, 0)).setOffset(Vec3.createVectorHelper(-0.5, 0, 0.5)).setAngleRange(0.01F, 0.03F);
CASING4GAUGE = new SpentCasing(CasingType.SHOTGUN).setScale(2.5F).setBounceMotion(0.01F, 0.03F);
}
private static GunConfiguration getShotgunConfig() {
GunConfiguration config = new GunConfiguration();
@ -52,9 +66,13 @@ public class Gun4GaugeFactory {
config.reloadType = GunConfiguration.RELOAD_SINGLE;
config.allowsInfinity = true;
config.hasSights = true;
config.absoluteFOV = true;
config.zoomFOV = 0.5F;
config.crosshair = Crosshair.L_CIRCLE;
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
config.ejector = EJECTOR_SHOTGUN;
return config;
}
@ -67,24 +85,10 @@ public class Gun4GaugeFactory {
config.firingSound = "hbm:weapon.revolverShootAlt";
config.firingPitch = 0.65F;
config.name = "KS-23";
config.manufacturer = "Tulsky Oruzheiny Zavod";
config.name = "ks23";
config.manufacturer = EnumGunManufacturer.TULSKY;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G4_NORMAL);
config.config.add(BulletConfigSyncingUtil.G4_SLUG);
config.config.add(BulletConfigSyncingUtil.G4_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G4_FLECHETTE_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.G4_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G4_SEMTEX);
config.config.add(BulletConfigSyncingUtil.G4_BALEFIRE);
config.config.add(BulletConfigSyncingUtil.G4_KAMPF);
config.config.add(BulletConfigSyncingUtil.G4_CANISTER);
config.config.add(BulletConfigSyncingUtil.G4_CLAW);
config.config.add(BulletConfigSyncingUtil.G4_VAMPIRE);
config.config.add(BulletConfigSyncingUtil.G4_VOID);
config.config.add(BulletConfigSyncingUtil.G4_TITAN);
config.config.add(BulletConfigSyncingUtil.G4_SLEEK);
config.config = HbmCollection.fourGauge;
return config;
}
@ -102,8 +106,10 @@ public class Gun4GaugeFactory {
config.firingSound = "hbm:weapon.sauergun";
config.firingPitch = 1.0F;
config.name = "Sauer Shotgun";
config.manufacturer = "Cube 2: Sauerbraten";
config.ejector = EJECTOR_SHOTGUN.clone().setDelay(12);
config.name = "sauer";
config.manufacturer = EnumGunManufacturer.CUBE;
config.animations.put(AnimType.CYCLE, new BusAnimation()
.addBus("SAUER_RECOIL", new BusAnimationSequence()
@ -129,21 +135,7 @@ public class Gun4GaugeFactory {
)
);
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.G4_NORMAL);
config.config.add(BulletConfigSyncingUtil.G4_SLUG);
config.config.add(BulletConfigSyncingUtil.G4_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.G4_FLECHETTE_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.G4_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.G4_SEMTEX);
config.config.add(BulletConfigSyncingUtil.G4_BALEFIRE);
config.config.add(BulletConfigSyncingUtil.G4_KAMPF);
config.config.add(BulletConfigSyncingUtil.G4_CANISTER);
config.config.add(BulletConfigSyncingUtil.G4_CLAW);
config.config.add(BulletConfigSyncingUtil.G4_VAMPIRE);
config.config.add(BulletConfigSyncingUtil.G4_VOID);
config.config.add(BulletConfigSyncingUtil.G4_TITAN);
config.config.add(BulletConfigSyncingUtil.G4_SLEEK);
config.config = HbmCollection.fourGauge;
return config;
}
@ -152,12 +144,14 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_4gauge;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.STOCK));
bullet.dmgMin = 5;
bullet.dmgMax = 8;
bullet.bulletsMin *= 2;
bullet.bulletsMax *= 2;
bullet.spentCasing = CASING4GAUGE.clone().register("4GaStock").setColor(0xFFD800, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -165,12 +159,14 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_4gauge_slug;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.SLUG));
bullet.dmgMin = 25;
bullet.dmgMax = 32;
bullet.wear = 7;
bullet.style = BulletConfiguration.STYLE_NORMAL;
bullet.spentCasing = CASING4GAUGE.clone().register("4GaSlug").setColor(0xE01A1A, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -178,7 +174,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_4gauge_flechette;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.FLECHETTE));
bullet.dmgMin = 8;
bullet.dmgMax = 15;
bullet.bulletsMin *= 2;
@ -188,6 +184,8 @@ public class Gun4GaugeFactory {
bullet.HBRC = 2;
bullet.LBRC = 95;
bullet.spentCasing = CASING4GAUGE.clone().register("4GaFlech").setColor(0x1537FF, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -195,7 +193,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_4gauge_flechette;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.FLECHETTE_PHOSPHORUS));
bullet.dmgMin = 8;
bullet.dmgMax = 15;
bullet.bulletsMin *= 2;
@ -204,8 +202,6 @@ public class Gun4GaugeFactory {
bullet.style = BulletConfiguration.STYLE_FLECHETTE;
bullet.HBRC = 2;
bullet.LBRC = 95;
bullet.ammo = ModItems.ammo_4gauge_flechette_phosphorus;
bullet.incendiary = 5;
PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true);
@ -228,6 +224,8 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaPhos").setColor(0xF6871A, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -235,7 +233,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_4gauge_explosive;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.EXPLOSIVE));
bullet.velocity *= 2;
bullet.gravity *= 2;
bullet.dmgMin = 20;
@ -243,6 +241,8 @@ public class Gun4GaugeFactory {
bullet.wear = 25;
bullet.trail = 1;
bullet.spentCasing = CASING4GAUGE.clone().register("4GaExp").setColor(0x3F8243, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -250,7 +250,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_4gauge_semtex;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.MINING));
bullet.velocity *= 2;
bullet.gravity *= 2;
bullet.dmgMin = 10;
@ -277,6 +277,8 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaSem").setColor(0x5C5C5C, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -284,7 +286,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_4gauge_balefire;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.BALEFIRE));
bullet.velocity *= 2;
bullet.gravity *= 2;
bullet.dmgMin = 50;
@ -310,6 +312,8 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaBale").setColor(0x7BFF44, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -317,7 +321,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_4gauge_kampf;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.KAMPF));
bullet.spread = 0.0F;
bullet.gravity = 0.0D;
bullet.wear = 15;
@ -326,6 +330,8 @@ public class Gun4GaugeFactory {
bullet.trail = 4;
bullet.vPFX = "smoke";
bullet.spentCasing = CASING4GAUGE.clone().register("4GaKampf").setColor(0xE7BA48, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -333,7 +339,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_4gauge_canister;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.CANISTER));
bullet.spread = 0.0F;
bullet.gravity = 0.0D;
bullet.wear = 15;
@ -364,6 +370,8 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaCan").setColor(0xCACACA, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -371,16 +379,18 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardAirstrikeConfig();
bullet.ammo = ModItems.ammo_4gauge_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.SLEEK));
bullet.spentCasing = CASING4GAUGE.clone().register("4GaIF").setColor(0x1D1D1D, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
public static BulletConfiguration get4GaugeClawConfig() {
BulletConfiguration bullet = get4GaugeConfig();
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_4gauge_claw;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.CLAW));
bullet.dmgMin = 6;
bullet.dmgMax = 9;
bullet.bulletsMin *= 2;
@ -410,14 +420,16 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaClaw").setColor(0x5E38CC, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
public static BulletConfiguration get4GaugeVampireConfig() {
BulletConfiguration bullet = get4GaugeConfig();
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_4gauge_vampire;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.VAMPIRE));
bullet.dmgMin = 6;
bullet.dmgMax = 9;
bullet.bulletsMin *= 2;
@ -448,14 +460,16 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaVamp").setColor(0x278400, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
public static BulletConfiguration get4GaugeVoidConfig() {
BulletConfiguration bullet = get4GaugeConfig();
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
bullet.ammo = ModItems.ammo_4gauge_void;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.VOID));
bullet.dmgMin = 6;
bullet.dmgMax = 9;
bullet.bulletsMin *= 2;
@ -479,6 +493,8 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaVoid").setColor(0x3F3F3F, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
@ -486,7 +502,7 @@ public class Gun4GaugeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_4gauge_titan;
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.QUACK));
bullet.velocity *= 2D;
bullet.spread = 0.0F;
bullet.gravity = 0.0D;
@ -514,13 +530,6 @@ public class Gun4GaugeFactory {
bullet.worldObj.removeEntity(creature);
bullet.worldObj.unloadEntities(new ArrayList() {{ add(creature); }});
//creature.isDead = true;
/*try {
Method m = Class.forName("net.minecraft.entity.deity.EntityDeity").getDeclaredMethod("setTitanHealth", double.class);
m.setAccessible(true);
m.invoke(creature, 0.0D);
} catch (Exception ex) { }*/
}
}
@ -529,6 +538,8 @@ public class Gun4GaugeFactory {
}
};
bullet.spentCasing = CASING4GAUGE.clone().register("4GaDucc").setColor(0x1E1E1E, SpentCasing.COLOR_CASE_4GA);
return bullet;
}
}

View File

@ -1,15 +1,27 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo50AE;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class Gun50AEFactory {
private static final CasingEjector EJECTOR_PISTOL;
private static final SpentCasing CASING50AE;
static {
EJECTOR_PISTOL = new CasingEjector().setMotion(-0.3, 0.7, 0).setOffset(-0.5, 0, 0.5).setAngleRange(0.01F, 0.03F);
CASING50AE = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F).setBounceMotion(0.01F, 0.03F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(0.25F, 0.5D, 60, 20);
}
public static GunConfiguration getBaseConfig() {
GunConfiguration config = new GunConfiguration();
@ -37,30 +49,32 @@ public class Gun50AEFactory {
config.durability = 2500;
config.name = "IMI Desert Eagle";
config.manufacturer = "Magnum Research / Israel Military Industries";
config.name = "deagle";
config.manufacturer = EnumGunManufacturer.MAGNUM_R_IMI;
config.absoluteFOV = true;
config.zoomFOV = 0.5F;
config.hasSights = true;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.AE50_NORMAL);
config.config.add(BulletConfigSyncingUtil.AE50_AP);
config.config.add(BulletConfigSyncingUtil.AE50_DU);
config.config.add(BulletConfigSyncingUtil.AE50_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_AE50);
config.config = HbmCollection.fiftyAE;
config.ejector = EJECTOR_PISTOL;
return config;
}
static float inaccuracy = 0.0005F;
private static float inaccuracy = 0.0005F;
public static BulletConfiguration get50AEConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_50ae;
bullet.ammo = new ComparableStack(ModItems.ammo_50ae.stackFromEnum(Ammo50AE.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 28;
bullet.dmgMax = 32;
bullet.spentCasing = CASING50AE.clone().register("50AEStock");
return bullet;
}
@ -68,13 +82,15 @@ public class Gun50AEFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_50ae_ap;
bullet.ammo = new ComparableStack(ModItems.ammo_50ae.stackFromEnum(Ammo50AE.AP));
bullet.spread *= inaccuracy;
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.leadChance = 10;
bullet.wear = 15;
bullet.spentCasing = CASING50AE.clone().register("50AEAP");
return bullet;
}
@ -82,13 +98,15 @@ public class Gun50AEFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_50ae_du;
bullet.ammo = new ComparableStack(ModItems.ammo_50ae.stackFromEnum(Ammo50AE.DU));
bullet.spread *= inaccuracy;
bullet.dmgMin = 38;
bullet.dmgMax = 46;
bullet.leadChance = 50;
bullet.wear = 25;
bullet.spentCasing = CASING50AE.clone().register("50AEDU");
return bullet;
}
@ -96,13 +114,15 @@ public class Gun50AEFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_50ae_star;
bullet.ammo = new ComparableStack(ModItems.ammo_50ae.stackFromEnum(Ammo50AE.STAR));
bullet.spread *= inaccuracy;
bullet.dmgMin = 52;
bullet.dmgMax = 60;
bullet.leadChance = 100;
bullet.wear = 25;
bullet.spentCasing = CASING50AE.clone().register("50AEStar");
return bullet;
}

View File

@ -5,12 +5,20 @@ import java.util.ArrayList;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHitBehavior;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo50BMG;
import com.hbm.items.ItemAmmoEnums.AmmoLunaticSniper;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
@ -29,6 +37,18 @@ import net.minecraft.potion.PotionEffect;
public class Gun50BMGFactory {
private static final CasingEjector EJECTOR_BMG;
private static final CasingEjector EJECTOR_SNIPER;
private static final SpentCasing CASING50BMG;
private static final SpentCasing CASINGLUNA;
static {
EJECTOR_BMG = new CasingEjector().setMotion(-0.35, 0.9, 0).setOffset(-0.45, -0.2, 0.35).setAngleRange(0.01F, 0.05F);
EJECTOR_SNIPER = new CasingEjector().setMotion(-2, 0.15, 0).setOffset(-0.45, -0.2, 0.35).setAngleRange(0.02F, 0.05F);
CASING50BMG = new SpentCasing(CasingType.BOTTLENECK).setScale(3F).setBounceMotion(0.01F, 0.05F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(0.125F, 0.5D, 60, 20);
CASINGLUNA = new SpentCasing(CasingType.BOTTLENECK).setScale(4F).setBounceMotion(0.02F, 0.05F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(0.125F, 0.5D, 60, 30);
}
public static GunConfiguration getCalamityConfig() {
GunConfiguration config = new GunConfiguration();
@ -62,19 +82,12 @@ public class Gun50BMGFactory {
)
);
config.name = "Universal-Maschinengewehr Modell 42 - .50 Mod";
config.manufacturer = "Wilhelm-Gustloff-Werke";
config.name = "mg42";
config.manufacturer = EnumGunManufacturer.WGW;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.BMG50_NORMAL);
config.config.add(BulletConfigSyncingUtil.BMG50_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.BMG50_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.BMG50_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.BMG50_AP);
config.config.add(BulletConfigSyncingUtil.BMG50_DU);
config.config.add(BulletConfigSyncingUtil.BMG50_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_BMG50);
config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK);
config.config = HbmCollection.fiftyBMG;
config.ejector = EJECTOR_BMG;
return config;
}
@ -97,23 +110,65 @@ public class Gun50BMGFactory {
config.reloadSound = GunConfiguration.RSOUND_MAG;
config.firingSound = "hbm:weapon.calShoot";
config.name = "Double Maxim gun";
config.manufacturer = "???";
config.name = "maximDouble";
config.manufacturer = EnumGunManufacturer.UNKNOWN;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.BMG50_NORMAL);
config.config.add(BulletConfigSyncingUtil.BMG50_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.BMG50_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.BMG50_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.BMG50_AP);
config.config.add(BulletConfigSyncingUtil.BMG50_DU);
config.config.add(BulletConfigSyncingUtil.BMG50_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_BMG50);
config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK);
config.config = HbmCollection.fiftyBMG;
config.ejector = EJECTOR_BMG;
return config;
}
public static BulletConfiguration getLunaticSabotRound() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_luna_sniper.stackFromEnum(AmmoLunaticSniper.SABOT));
bullet.spread = 0.0F;
bullet.dmgMax = 500F;
bullet.dmgMin = 450F;
bullet.headshotMult = 2.5f;
bullet.wear = 2000;
bullet.velocity = 100;
bullet.doesPenetrate = true;
bullet.leadChance = 20;
bullet.incendiary = 10;
bullet.blockDamage = true;
bullet.bImpact = (projectile, x, y, z) -> projectile.worldObj.newExplosion(projectile, x, y, z, 5.0F, true, false);
bullet.spentCasing = CASINGLUNA.clone().register("LunaStock");
return bullet;
}
public static BulletConfiguration getLunaticIncendiaryRound() {
BulletConfiguration bullet = getLunaticSabotRound().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_luna_sniper.stackFromEnum(AmmoLunaticSniper.INCENDIARY));
bullet.ammo.meta = 1;
bullet.incendiary = 50;
bullet.spentCasing = CASINGLUNA.clone().register("LunaInc");
return bullet;
}
public static BulletConfiguration getLunaticExplosiveRound() {
BulletConfiguration bullet = getLunaticSabotRound().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_luna_sniper.stackFromEnum(AmmoLunaticSniper.EXPLOSIVE));
bullet.ammo.meta = 2;
bullet.explosive = 25;
bullet.bImpact = (projectile, x, y, z) -> projectile.worldObj.newExplosion(projectile, x, y, z, 25.0F, true, false);
bullet.spentCasing = CASINGLUNA.clone().register("LunaExp");
return bullet;
}
public static GunConfiguration getAR15Config() {
GunConfiguration config = new GunConfiguration();
@ -132,8 +187,8 @@ public class Gun50BMGFactory {
config.reloadSound = GunConfiguration.RSOUND_MAG;
config.firingSound = "hbm:turret.howard_fire";
config.name = "AR-15 .50 BMG Mod";
config.manufacturer = "Armalite";
config.name = "ar15_50";
config.manufacturer = EnumGunManufacturer.ARMALITE;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.BMG50_FLECHETTE_AM);
@ -149,6 +204,8 @@ public class Gun50BMGFactory {
config.config.add(BulletConfigSyncingUtil.CHL_BMG50);
config.config.add(BulletConfigSyncingUtil.BMG50_SLEEK);
config.ejector = EJECTOR_BMG;
return config;
}
@ -157,11 +214,13 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.spentCasing = CASING50BMG.clone().register("50BMGStock");
return bullet;
}
@ -169,13 +228,15 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.INCENDIARY));
bullet.spread *= inaccuracy;
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.wear = 15;
bullet.incendiary = 5;
bullet.spentCasing = CASING50BMG.clone().register("50BMGInc");
return bullet;
}
@ -183,7 +244,7 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.PHOSPHORUS));
bullet.spread *= inaccuracy;
bullet.dmgMin = 30;
bullet.dmgMax = 36;
@ -211,6 +272,8 @@ public class Gun50BMGFactory {
}
};
bullet.spentCasing = CASING50BMG.clone().register("50BMGPhos");
return bullet;
}
@ -218,13 +281,15 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_explosive;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.EXPLOSIVE));
bullet.spread *= inaccuracy;
bullet.dmgMin = 60;
bullet.dmgMax = 64;
bullet.wear = 25;
bullet.explosive = 1;
bullet.spentCasing = CASING50BMG.clone().register("50BMGExp");
return bullet;
}
@ -232,13 +297,15 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_ap;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.AP));
bullet.spread *= inaccuracy;
bullet.dmgMin = 62;
bullet.dmgMax = 68;
bullet.wear = 15;
bullet.leadChance = 10;
bullet.spentCasing = CASING50BMG.clone().register("50BMGAP");
return bullet;
}
@ -246,13 +313,15 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_du;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.DU));
bullet.spread *= inaccuracy;
bullet.dmgMin = 80;
bullet.dmgMax = 86;
bullet.wear = 25;
bullet.leadChance = 50;
bullet.spentCasing = CASING50BMG.clone().register("50BMGDU");
return bullet;
}
@ -260,13 +329,15 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_star;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.STAR));
bullet.spread *= inaccuracy;
bullet.dmgMin = 98;
bullet.dmgMax = 102;
bullet.wear = 25;
bullet.leadChance = 100;
bullet.spentCasing = CASING50BMG.clone().register("50BMGStar");
return bullet;
}
@ -274,7 +345,7 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.SLEEK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 50;
bullet.dmgMax = 70;
@ -317,6 +388,8 @@ public class Gun50BMGFactory {
}
};
bullet.spentCasing = CASING50BMG.clone().register("50BMGIF");
return bullet;
}
@ -324,12 +397,14 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_flechette;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.FLECHETTE));
bullet.spread *= inaccuracy;
bullet.dmgMin = 50;
bullet.dmgMax = 54;
bullet.style = bullet.STYLE_FLECHETTE;
bullet.spentCasing = CASING50BMG.clone().register("50BMGFlech");
return bullet;
}
@ -337,7 +412,7 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_flechette_am;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.FLECHETTE_AM));
bullet.spread *= inaccuracy;
bullet.dmgMin = 60;
bullet.dmgMax = 64;
@ -357,6 +432,8 @@ public class Gun50BMGFactory {
}
};
bullet.spentCasing = CASING50BMG.clone().register("50BMGAM");
return bullet;
}
@ -364,7 +441,7 @@ public class Gun50BMGFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_50bmg_flechette_po;
bullet.ammo = new ComparableStack(ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.FLECHETTE_PO));
bullet.spread *= inaccuracy;
bullet.dmgMin = 60;
bullet.dmgMax = 64;
@ -384,6 +461,8 @@ public class Gun50BMGFactory {
}
};
bullet.spentCasing = CASING50BMG.clone().register("50BMGPO");
return bullet;
}
}

View File

@ -5,12 +5,19 @@ import java.util.ArrayList;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHitBehavior;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.Ammo556mm;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
@ -25,6 +32,16 @@ import net.minecraft.potion.PotionEffect;
public class Gun556mmFactory {
private static final CasingEjector EJECTOR_RIFLE;
private static final CasingEjector EJECTOR_GRENADE;
private static final SpentCasing CASING556;
static {
EJECTOR_RIFLE = new CasingEjector().setMotion(-0.35, 0.6, 0).setOffset(-0.35, 0, 0.35).setAngleRange(0.01F, 0.03F);
EJECTOR_GRENADE = new CasingEjector().setAngleRange(0.02F, 0.03F).setDelay(30);
CASING556 = new SpentCasing(CasingType.BOTTLENECK).setScale(1.25F).setBounceMotion(0.01F, 0.03F).setColor(SpentCasing.COLOR_CASE_BRASS);
}
public static GunConfiguration getEuphieConfig() {
GunConfiguration config = new GunConfiguration();
@ -45,22 +62,15 @@ public class Gun556mmFactory {
config.firingSound = "hbm:weapon.hksShoot";
config.reloadSoundEnd = false;
config.name = "Britannian Standard Issue Assault Rifle";
config.manufacturer = "BAE Systems plc";
config.name = "baeAR";
config.manufacturer = EnumGunManufacturer.BAE;
config.comment.add("Why is this gun so sticky?");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.R556_NORMAL);
config.config.add(BulletConfigSyncingUtil.R556_GOLD);
config.config.add(BulletConfigSyncingUtil.R556_TRACER);
config.config.add(BulletConfigSyncingUtil.R556_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.R556_AP);
config.config.add(BulletConfigSyncingUtil.R556_DU);
config.config.add(BulletConfigSyncingUtil.R556_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_R556);
config.config.add(BulletConfigSyncingUtil.R556_SLEEK);
config.config.add(BulletConfigSyncingUtil.R556_K);
//config.config = new ArrayList();
//config.config.add(BulletConfigSyncingUtil.R556_GOLD);
config.config = HbmCollection.NATO;
return config;
}
@ -92,21 +102,16 @@ public class Gun556mmFactory {
)
);
config.name = "H&R SPIW";
config.manufacturer = "Harrington & Richardson";
config.name = "spiw";
config.manufacturer = EnumGunManufacturer.H_AND_R;
config.comment.add("Launch some flechettes in the breeze");
config.comment.add("Find his arms nailed to the trees");
config.comment.add("Napalm sticks to kids");
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_DU);
config.config.add(BulletConfigSyncingUtil.CHL_R556_FLECHETTE);
config.config.add(BulletConfigSyncingUtil.R556_FLECHETTE_SLEEK);
config.config.add(BulletConfigSyncingUtil.R556_K);
config.config = HbmCollection.NATOFlechette;
config.ejector = EJECTOR_RIFLE;
return config;
}
@ -130,32 +135,25 @@ public class Gun556mmFactory {
config.reloadSound = GunConfiguration.RSOUND_GRENADE;
config.reloadSoundEnd = false;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.GRENADE_NORMAL);
config.config.add(BulletConfigSyncingUtil.GRENADE_HE);
config.config.add(BulletConfigSyncingUtil.GRENADE_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.GRENADE_PHOSPHORUS);
config.config.add(BulletConfigSyncingUtil.GRENADE_CHEMICAL);
config.config.add(BulletConfigSyncingUtil.GRENADE_CONCUSSION);
config.config.add(BulletConfigSyncingUtil.GRENADE_FINNED);
config.config.add(BulletConfigSyncingUtil.GRENADE_SLEEK);
config.config.add(BulletConfigSyncingUtil.GRENADE_NUCLEAR);
config.config.add(BulletConfigSyncingUtil.GRENADE_TRACER);
config.config.add(BulletConfigSyncingUtil.GRENADE_KAMPF);
config.config = HbmCollection.grenade;
config.ejector = EJECTOR_GRENADE;
return config;
}
static float inaccuracy = 2.5F;
private static float inaccuracy = 2.5F;
public static BulletConfiguration get556Config() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_556;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 16;
bullet.dmgMax = 20;
bullet.spentCasing = CASING556.clone().register("556Stock");
return bullet;
}
@ -163,11 +161,13 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_566_gold;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.GOLD));
bullet.dmgMin = 250;
bullet.dmgMax = 320;
bullet.spread = 0.0F;
bullet.spentCasing = null;
return bullet;
}
@ -175,7 +175,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.PHOSPHORUS));
bullet.wear = 15;
bullet.incendiary = 5;
bullet.doesPenetrate = false;
@ -200,6 +200,8 @@ public class Gun556mmFactory {
}
};
bullet.spentCasing = CASING556.clone().register("556Phos");
return bullet;
}
@ -207,12 +209,14 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_ap;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.AP));
bullet.dmgMin = 20;
bullet.dmgMax = 26;
bullet.wear = 15;
bullet.leadChance = 10;
bullet.spentCasing = CASING556.clone().register("556AP");
return bullet;
}
@ -220,12 +224,14 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_du;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.DU));
bullet.dmgMin = 24;
bullet.dmgMax = 32;
bullet.wear = 25;
bullet.leadChance = 50;
bullet.spentCasing = CASING556.clone().register("556DU");
return bullet;
}
@ -233,12 +239,14 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_star;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.STAR));
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.wear = 25;
bullet.leadChance = 100;
bullet.spentCasing = CASING556.clone().register("556Star");
return bullet;
}
@ -246,7 +254,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.SLEEK));
bullet.dmgMin = 45;
bullet.dmgMax = 50;
bullet.wear = 10;
@ -288,6 +296,8 @@ public class Gun556mmFactory {
}
};
bullet.spentCasing = CASING556.clone().register("556IF");
return bullet;
}
@ -295,9 +305,11 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_tracer;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.TRACER));
bullet.vPFX = "reddust";
bullet.spentCasing = CASING556.clone().register("556Trac");
return bullet;
}
@ -305,7 +317,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = ModItems.ammo_556_flechette;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE));
bullet.dmgMin = 26;
bullet.dmgMax = 32;
bullet.HBRC = 2;
@ -314,6 +326,8 @@ public class Gun556mmFactory {
bullet.style = BulletConfiguration.STYLE_FLECHETTE;
bullet.doesPenetrate = false;
bullet.spentCasing = CASING556.clone().register("556Flec");
return bullet;
}
@ -321,9 +335,11 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = ModItems.ammo_556_flechette_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE_INCENDIARY));
bullet.incendiary = 5;
bullet.spentCasing = CASING556.clone().register("556FlecInc");
return bullet;
}
@ -331,7 +347,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = ModItems.ammo_556_flechette_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE_PHOSPHORUS));
bullet.incendiary = 5;
PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true);
@ -354,6 +370,8 @@ public class Gun556mmFactory {
}
};
bullet.spentCasing = CASING556.clone().register("556FlecPhos");
return bullet;
}
@ -361,13 +379,15 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = ModItems.ammo_556_flechette_du;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE_DU));
bullet.dmgMin = 46;
bullet.dmgMax = 52;
bullet.wear = 25;
bullet.leadChance = 50;
bullet.doesPenetrate = true;
bullet.spentCasing = CASING556.clone().register("556FlecDU");
return bullet;
}
@ -375,7 +395,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = ModItems.ammo_556_flechette_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.FLECHETTE_SLEEK));
bullet.dmgMin = 45;
bullet.dmgMax = 50;
bullet.wear = 10;
@ -417,6 +437,8 @@ public class Gun556mmFactory {
}
};
bullet.spentCasing = CASING556.clone().register("556FlecIF");
return bullet;
}
@ -424,7 +446,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_556_k;
bullet.ammo = new ComparableStack(ModItems.ammo_556.stackFromEnum(Ammo556mm.K));
bullet.dmgMin = 0;
bullet.dmgMax = 0;
bullet.maxAge = 0;

View File

@ -1,15 +1,27 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.Ammo5mm;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class Gun5mmFactory {
private static final CasingEjector EJECTOR_MINIGUN;
private static final SpentCasing CASING5MM;
static {
EJECTOR_MINIGUN = new CasingEjector().setMotion(-0.4, 0.1, 0).setOffset(-0.35, -0.2, 0.35).setAngleRange(0.01F, 0.03F).setAmount(5);
CASING5MM = new SpentCasing(CasingType.STRAIGHT).setScale(1.25F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS).setMaxAge(100);
}
public static GunConfiguration getMinigunConfig() {
GunConfiguration config = new GunConfiguration();
@ -27,12 +39,9 @@ public class Gun5mmFactory {
config.durability = 10000;
config.firingSound = "hbm:weapon.lacunaeShoot";
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.R5_NORMAL);
config.config.add(BulletConfigSyncingUtil.R5_EXPLOSIVE);
config.config.add(BulletConfigSyncingUtil.R5_DU);
config.config.add(BulletConfigSyncingUtil.R5_STAR);
config.config.add(BulletConfigSyncingUtil.CHL_R5);
config.config = HbmCollection.fiveMM;
config.ejector = EJECTOR_MINIGUN;
return config;
}
@ -41,8 +50,8 @@ public class Gun5mmFactory {
GunConfiguration config = getMinigunConfig();
config.name = "CZ53 Personal Minigun";
config.manufacturer = "Rockwell International Corporation";
config.name = "cz53";
config.manufacturer = EnumGunManufacturer.ROCKWELL;
return config;
}
@ -52,8 +61,8 @@ public class Gun5mmFactory {
GunConfiguration config = getMinigunConfig();
config.durability = 15000;
config.name = "CZ57 Avenger Minigun";
config.manufacturer = "Rockwell International Corporation";
config.name = "cz57";
config.manufacturer = EnumGunManufacturer.ROCKWELL;
return config;
}
@ -63,29 +72,26 @@ public class Gun5mmFactory {
GunConfiguration config = getMinigunConfig();
config.durability = 25000;
config.name = "Auntie Lacunae";
config.manufacturer = "Rockwell International Corporation?";
config.name = "lacunae";
config.manufacturer = EnumGunManufacturer.ROCKWELL_U;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.R5_NORMAL_BOLT);
config.config.add(BulletConfigSyncingUtil.R5_EXPLOSIVE_BOLT);
config.config.add(BulletConfigSyncingUtil.R5_DU_BOLT);
config.config.add(BulletConfigSyncingUtil.R5_STAR_BOLT);
config.config.add(BulletConfigSyncingUtil.CHL_R5_BOLT);
config.config = HbmCollection.fiveMMBolt;
return config;
}
static float inaccuracy = 10;
private static float inaccuracy = 10;
public static BulletConfiguration get5mmConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_5mm;
bullet.ammo = new ComparableStack(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 12;
bullet.dmgMax = 14;
bullet.spentCasing = CASING5MM.clone().register("5mmStock");
return bullet;
}
@ -93,13 +99,15 @@ public class Gun5mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_5mm_explosive;
bullet.ammo = new ComparableStack(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.EXPLOSIVE));
bullet.spread *= inaccuracy;
bullet.dmgMin = 30;
bullet.dmgMax = 32;
bullet.explosive = 1F;
bullet.wear = 25;
bullet.spentCasing = CASING5MM.clone().register("5mmExp");
return bullet;
}
@ -107,13 +115,15 @@ public class Gun5mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_5mm_du;
bullet.ammo = new ComparableStack(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.DU));
bullet.spread *= inaccuracy;
bullet.dmgMin = 36;
bullet.dmgMax = 40;
bullet.wear = 25;
bullet.leadChance = 50;
bullet.spentCasing = CASING5MM.clone().register("5mmDU");
return bullet;
}
@ -121,13 +131,15 @@ public class Gun5mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_5mm_star;
bullet.ammo = new ComparableStack(ModItems.ammo_5mm.stackFromEnum(Ammo5mm.STAR));
bullet.spread *= inaccuracy;
bullet.dmgMin = 46;
bullet.dmgMax = 50;
bullet.wear = 25;
bullet.leadChance = 100;
bullet.spentCasing = CASING5MM.clone().register("5mmStar");
return bullet;
}

View File

@ -3,12 +3,15 @@ package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHurtBehavior;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.Ammo75Bolt;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.lib.ModDamageSource;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -72,23 +75,20 @@ public class Gun75BoltFactory {
)
);
config.name = "Manticora Pattern Boltgun";
config.manufacturer = "Cerix Magnus";
config.name = "bolter";
config.manufacturer = EnumGunManufacturer.CERIX;
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.B75_NORMAL);
config.config.add(BulletConfigSyncingUtil.B75_INCENDIARY);
config.config.add(BulletConfigSyncingUtil.B75_HE);
config.config = HbmCollection.seventyFive;
return config;
}
static float inaccuracy = 0.5F;
private static float inaccuracy = 0.5F;
public static BulletConfiguration get75BoltConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_75bolt;
bullet.ammo = new ComparableStack(ModItems.ammo_75bolt.stackFromEnum(Ammo75Bolt.STOCK));
bullet.ammoCount = 30;
bullet.spread *= inaccuracy;
bullet.dmgMin = 74;
@ -126,7 +126,7 @@ public class Gun75BoltFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_75bolt_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_75bolt.stackFromEnum(Ammo75Bolt.INCENDIARY));
bullet.ammoCount = 30;
bullet.spread *= inaccuracy;
bullet.dmgMin = 72;
@ -164,7 +164,7 @@ public class Gun75BoltFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_75bolt_he;
bullet.ammo = new ComparableStack(ModItems.ammo_75bolt.stackFromEnum(Ammo75Bolt.HE));
bullet.ammoCount = 30;
bullet.spread *= inaccuracy;
bullet.dmgMin = 94;

View File

@ -0,0 +1,192 @@
package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo762NATO;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.potion.PotionEffect;
public class Gun762mmFactory {
private static final CasingEjector EJECTOR_RIFLE;
private static final SpentCasing CASING762NATO;
static {
EJECTOR_RIFLE = new CasingEjector().setMotion(-0.35, 0.6, 0).setOffset(-0.35, 0, 0.35).setAngleRange(0.01F, 0.03F);
CASING762NATO = new SpentCasing(CasingType.BOTTLENECK).setScale(1.7F).setBounceMotion(0.01F, 0.05F).setColor(SpentCasing.COLOR_CASE_BRASS);
}
public static GunConfiguration getUACDMRConfig() {
final GunConfiguration config = new GunConfiguration();
config.rateOfFire = 4;
config.roundsPerCycle = 1;
config.gunMode = GunConfiguration.MODE_NORMAL;
config.firingMode = GunConfiguration.FIRE_AUTO;
config.reloadDuration = 30;
config.firingDuration = 8;
config.ammoCap = 30;
config.durability = 30000;
config.reloadType = 1;
config.allowsInfinity = true;
config.hasSights = true;
config.crosshair = Crosshair.CROSS;
config.reloadSound = "hbm:weapon.DMRMagInPB3";
config.firingSound = "hbm:weapon.DMRShootPB3Alt";
config.reloadSoundEnd = true;
config.name = "uacDMR";
config.manufacturer = EnumGunManufacturer.UAC;
config.config.addAll(HbmCollection.threeZeroEight);
config.ejector = EJECTOR_RIFLE;
return config;
}
public static GunConfiguration getUACCarbineConfig() {
final GunConfiguration config = getUACDMRConfig();
config.rateOfFire = 2;
config.reloadDuration = 20;
config.ammoCap = 40;
config.durability = 40000;
config.crosshair = Crosshair.SPLIT;
config.reloadSound = "hbm:weapon.carbineMagInPB3";
config.firingSound = "hbm:weapon.carbineShootPB3";
config.name = "uacCarbine";
return config;
}
public static GunConfiguration getUACLMGConfig() {
final GunConfiguration config = getUACCarbineConfig();
config.ammoCap = 60;
config.durability = 50000;
config.crosshair = Crosshair.BOX;
config.reloadSound = "hbm:weapon.LMGMagInPB3";
config.firingSound = "hbm:weapon.LMGShootPB3Alt";
config.name = "uacLMG";
return config;
}
public static GunConfiguration getM60Config() {
final GunConfiguration config = new GunConfiguration();
config.rateOfFire = 2;
config.durability = 10000;
config.roundsPerCycle = 1;
config.firingMode = GunConfiguration.FIRE_AUTO;
config.reloadType = GunConfiguration.RELOAD_NONE;
config.ammoCap = 0;
config.allowsInfinity = true;
config.hasSights = true;
config.crosshair = Crosshair.L_BOX;
config.firingSound = "hbm:weapon.LMGShootPB3";
config.name = "m60";
config.manufacturer = EnumGunManufacturer.SACO;
config.comment.add("\"Get some!\"");
config.comment.add(" ~ Stuart Brown (aka Ahoy)");
config.config.addAll(HbmCollection.threeZeroEight);
config.ejector = EJECTOR_RIFLE;
return config;
}
public static BulletConfiguration get762NATOConfig() {
final BulletConfiguration bullet = Gun556mmFactory.get556Config().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_762.stackFromEnum(Ammo762NATO.STOCK));
bullet.dmgMax *= 2;
bullet.dmgMin *= 2;
bullet.velocity *= 2.5;
bullet.maxAge *= 2;
bullet.spread /= 2;
bullet.spentCasing = CASING762NATO.clone().register("762NATOStock");
return bullet;
}
public static BulletConfiguration get762APConfig() {
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_762.stackFromEnum(Ammo762NATO.AP));
bullet.dmgMax *= 1.5;
bullet.dmgMin *= 1.5;
bullet.spentCasing = CASING762NATO.clone().register("762NATOAP");
return bullet;
}
public static BulletConfiguration get762DUConfig() {
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_762.stackFromEnum(Ammo762NATO.DU));
bullet.dmgMax *= 2;
bullet.dmgMin *= 2;
bullet.spentCasing = CASING762NATO.clone().register("762NATODU");
return bullet;
}
public static BulletConfiguration get762TracerConfig() {
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_762.stackFromEnum(Ammo762NATO.TRACER));
bullet.vPFX = "reddust";
bullet.spentCasing = CASING762NATO.clone().register("762NATOTrac");
return bullet;
}
public static BulletConfiguration get762WPConfig() {
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_762.stackFromEnum(Ammo762NATO.PHOSPHORUS));
bullet.setToFire(20 * 5);
bullet.vPFX = "reddust";
final PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true);
eff.getCurativeItems().clear();
bullet.effects = new ArrayList<PotionEffect>();
bullet.effects.add(new PotionEffect(eff));
bullet.spentCasing = CASING762NATO.clone().register("762NATOPhos");
return bullet;
}
public static BulletConfiguration get762BlankConfig() {
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_762.stackFromEnum(Ammo762NATO.BLANK));
bullet.dmgMax = 0;
bullet.dmgMin = 0;
bullet.maxAge = 0;
bullet.spentCasing = CASING762NATO.clone().register("762NATOK");
return bullet;
}
}

View File

@ -4,12 +4,26 @@ import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo9mm;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class Gun9mmFactory {
private static final CasingEjector EJECTOR_SMG;
private static final SpentCasing CASING9MM;
static {
EJECTOR_SMG = new CasingEjector().setMotion(-0.3, 0.6, 0).setOffset(-0.35, -0.2, 0.55).setAngleRange(0.01F, 0.03F);
CASING9MM = new SpentCasing(CasingType.STRAIGHT).setScale(1F, 1F, 0.6F).setBounceMotion(0.01F, 0.03F).setColor(SpentCasing.COLOR_CASE_BRASS);
}
public static GunConfiguration getMP40Config() {
GunConfiguration config = new GunConfiguration();
@ -29,8 +43,8 @@ public class Gun9mmFactory {
config.firingSound = "hbm:weapon.rifleShoot";
config.reloadSoundEnd = false;
config.name = "Maschinenpistole 40";
config.manufacturer = "Erfurter Maschinenfabrik Geipel";
config.name = "mp40";
config.manufacturer = EnumGunManufacturer.NAZI;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.P9_NORMAL);
@ -39,10 +53,13 @@ public class Gun9mmFactory {
config.config.add(BulletConfigSyncingUtil.CHL_P9);
config.config.add(BulletConfigSyncingUtil.P9_ROCKET);
config.ejector = EJECTOR_SMG;
return config;
}
public static GunConfiguration getThompsonConfig() {
//rechambered to .45
/*public static GunConfiguration getThompsonConfig() {
GunConfiguration config = new GunConfiguration();
@ -61,8 +78,8 @@ public class Gun9mmFactory {
config.firingSound = "hbm:weapon.rifleShoot";
config.reloadSoundEnd = false;
config.name = "M1A1 Submachine Gun 9mm Mod";
config.manufacturer = "Auto-Ordnance Corporation";
config.name = "tommy9";
config.manufacturer = EnumGunManufacturer.AUTO_ORDINANCE;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.P9_NORMAL);
@ -72,18 +89,20 @@ public class Gun9mmFactory {
config.config.add(BulletConfigSyncingUtil.P9_ROCKET);
return config;
}
}*/
static float inaccuracy = 5;
public static BulletConfiguration get9mmConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_9mm;
bullet.ammo = new ComparableStack(ModItems.ammo_9mm.stackFromEnum(Ammo9mm.STOCK));
bullet.spread *= inaccuracy;
bullet.dmgMin = 10;
bullet.dmgMax = 14;
bullet.spentCasing = CASING9MM.clone().register("9MMStock");
return bullet;
}
@ -91,13 +110,15 @@ public class Gun9mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_9mm_ap;
bullet.ammo = new ComparableStack(ModItems.ammo_9mm.stackFromEnum(Ammo9mm.AP));
bullet.spread *= inaccuracy;
bullet.dmgMin = 18;
bullet.dmgMax = 20;
bullet.leadChance = 10;
bullet.wear = 15;
bullet.spentCasing = CASING9MM.clone().register("9MMAP");
return bullet;
}
@ -105,13 +126,15 @@ public class Gun9mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardPistolConfig();
bullet.ammo = ModItems.ammo_9mm_du;
bullet.ammo = new ComparableStack(ModItems.ammo_9mm.stackFromEnum(Ammo9mm.DU));
bullet.spread *= inaccuracy;
bullet.dmgMin = 22;
bullet.dmgMax = 26;
bullet.leadChance = 50;
bullet.wear = 25;
bullet.spentCasing = CASING9MM.clone().register("9MMDU");
return bullet;
}
@ -119,11 +142,13 @@ public class Gun9mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_9mm_rocket;
bullet.ammo = new ComparableStack(ModItems.ammo_9mm.stackFromEnum(Ammo9mm.ROCKET));
bullet.velocity = 5;
bullet.explosive = 7.5F;
bullet.trail = 5;
bullet.spentCasing = CASING9MM.clone().register("9MMRocket");
return bullet;
}

View File

@ -3,20 +3,32 @@ package com.hbm.handler.guncfg;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfiguration;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.Ammo240Shell;
import com.hbm.items.ModItems;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
public class GunCannonFactory {
protected static SpentCasing CASINNG240MM;
static {
CASINNG240MM = new SpentCasing(CasingType.BOTTLENECK).setScale(7.5F).setBounceMotion(0.02F, 0.05F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(1F, 0.5D, 60, 20);
}
public static BulletConfiguration getShellConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardShellConfig();
bullet.ammo = ModItems.ammo_shell;
bullet.ammo = new ComparableStack(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.STOCK));
bullet.dmgMin = 25;
bullet.dmgMax = 35;
bullet.explosive = 4F;
bullet.blockDamage = false;
bullet.spentCasing = CASINNG240MM.register("240MM"); //same instance everywhere, only register once
return bullet;
}
@ -24,12 +36,14 @@ public class GunCannonFactory {
BulletConfiguration bullet = BulletConfigFactory.standardShellConfig();
bullet.ammo = ModItems.ammo_shell_explosive;
bullet.ammo = new ComparableStack(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.EXPLOSIVE));
bullet.dmgMin = 35;
bullet.dmgMax = 45;
bullet.explosive = 4F;
bullet.blockDamage = true;
bullet.spentCasing = CASINNG240MM;
return bullet;
}
@ -37,12 +51,14 @@ public class GunCannonFactory {
BulletConfiguration bullet = BulletConfigFactory.standardShellConfig();
bullet.ammo = ModItems.ammo_shell_apfsds_t;
bullet.ammo = new ComparableStack(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.APFSDS_T));
bullet.dmgMin = 50;
bullet.dmgMax = 55;
bullet.doesPenetrate = true;
bullet.style = BulletConfiguration.STYLE_APDS;
bullet.spentCasing = CASINNG240MM;
return bullet;
}
@ -50,12 +66,14 @@ public class GunCannonFactory {
BulletConfiguration bullet = BulletConfigFactory.standardShellConfig();
bullet.ammo = ModItems.ammo_shell_apfsds_du;
bullet.ammo = new ComparableStack(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.APFSDS_DU));
bullet.dmgMin = 70;
bullet.dmgMax = 80;
bullet.doesPenetrate = true;
bullet.style = BulletConfiguration.STYLE_APDS;
bullet.spentCasing = CASINNG240MM;
return bullet;
}
@ -63,7 +81,7 @@ public class GunCannonFactory {
BulletConfiguration bullet = BulletConfigFactory.standardShellConfig();
bullet.ammo = ModItems.ammo_shell_w9;
bullet.ammo = new ComparableStack(ModItems.ammo_shell.stackFromEnum(Ammo240Shell.W9));
bullet.dmgMin = 100;
bullet.dmgMax = 150;
@ -75,6 +93,8 @@ public class GunCannonFactory {
}
};
bullet.spentCasing = CASINNG240MM;
return bullet;
}

View File

@ -1,14 +1,24 @@
package com.hbm.handler.guncfg;
import com.hbm.handler.BulletConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
public class GunDGKFactory {
public static final SpentCasing CASINGDGK;
static {
CASINGDGK = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(0.02F, 0.5D, 60, 20).setMaxAge(60); //3 instead of 12 seconds
}
public static BulletConfiguration getDGKConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_dgk;
bullet.ammo = new ComparableStack(ModItems.ammo_dgk);
bullet.spentCasing = CASINGDGK.register("DGK");
return bullet;
}

View File

@ -8,8 +8,11 @@ import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletHurtBehavior;
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.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.main.MainRegistry;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
@ -42,8 +45,8 @@ public class GunDartFactory {
config.reloadSoundEnd = false;
config.showAmmo = true;
config.name = "Needle Gun";
config.manufacturer = "-";
config.name = "dart";
config.manufacturer = EnumGunManufacturer.NONE;
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.NEEDLE_GPS);
@ -73,8 +76,8 @@ public class GunDartFactory {
config.reloadSoundEnd = false;
config.showAmmo = true;
config.name = "NERF blaster of unknown design";
config.manufacturer = "Hasbro";
config.name = "nerf";
config.manufacturer = EnumGunManufacturer.HASBRO;
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.DART_NORMAL);
@ -87,7 +90,7 @@ public class GunDartFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_dart;
bullet.ammo = new ComparableStack(ModItems.ammo_dart.stackFromEnum(AmmoDart.GPS));
bullet.velocity = 5.0F;
bullet.spread = 0;
bullet.dmgMin = 1;
@ -133,7 +136,7 @@ public class GunDartFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_dart_nuclear;
bullet.ammo = new ComparableStack(ModItems.ammo_dart.stackFromEnum(AmmoDart.NUCLEAR));
bullet.velocity = 5.0F;
bullet.spread = 0;
bullet.dmgMin = 1;
@ -170,7 +173,7 @@ public class GunDartFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.ammo_dart_nerf;
bullet.ammo = new ComparableStack(ModItems.ammo_dart.stackFromEnum(AmmoDart.NERF));
bullet.velocity = 1.0F;
bullet.gravity = 0.04D;
bullet.dmgMin = 0;

View File

@ -10,6 +10,8 @@ import com.hbm.interfaces.IBomb;
import com.hbm.interfaces.IBomb.BombReturnCode;
import com.hbm.main.MainRegistry;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.PlayerInformPacket;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
@ -44,8 +46,8 @@ public class GunDetonatorFactory {
config.reloadSoundEnd = false;
config.showAmmo = true;
config.name = "Hopeville Laser Detonator";
config.manufacturer = "WestTek";
config.name = "laserDet";
config.manufacturer = EnumGunManufacturer.WESTTEK;
config.config = new ArrayList();
config.config.add(BulletConfigSyncingUtil.DET_BOLT);
@ -79,7 +81,7 @@ public class GunDetonatorFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = Items.redstone;
bullet.ammo = new ComparableStack(Items.redstone);
bullet.spread = 0.0F;
bullet.maxAge = 100;
bullet.dmgMin = 0;

View File

@ -11,7 +11,11 @@ import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.AmmoFireExt;
import com.hbm.items.ItemAmmoEnums.AmmoFlamethrower;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
@ -42,7 +46,7 @@ public class GunEnergyFactory {
config.crosshair = Crosshair.CIRCLE;
config.name = "Chemical Thrower";
config.manufacturer = "Langford Research Laboratories";
config.manufacturer = EnumGunManufacturer.LANGFORD;
config.config = new ArrayList<Integer>();
@ -67,7 +71,7 @@ public class GunEnergyFactory {
config.firingSound = "hbm:weapon.teslaShoot";
config.name = "EMP Orb Projector";
config.manufacturer = "MWT Prototype Labs";
config.manufacturer = EnumGunManufacturer.MWT;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.SPECIAL_EMP);
@ -95,7 +99,7 @@ public class GunEnergyFactory {
config.reloadSound = "hbm:weapon.flamerReload";
config.name = "Heavy Duty Flamer";
config.manufacturer = "MWT Prototype Labs";
config.manufacturer = EnumGunManufacturer.MWT;
config.comment.add("Dragon-slaying: Advanced techniques, part 1:");
config.comment.add("Try not to get eaten by the dragon.");
@ -132,7 +136,7 @@ public class GunEnergyFactory {
config.reloadSound = "hbm:weapon.b92Reload";
config.name = "EMC101 Prismatic Negative Energy Cannon";
config.manufacturer = "MWT Prototype Labs";
config.manufacturer = EnumGunManufacturer.MWT;
config.comment.add("Taste the rainbow!");
@ -162,7 +166,7 @@ public class GunEnergyFactory {
config.reloadSound = "hbm:weapon.flamerReload";
config.name = "PROTEX Fire Exinguisher 6kg";
config.manufacturer = "Gloria GmbH";
config.manufacturer = EnumGunManufacturer.GLORIA;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.FEXT_NORMAL);
@ -184,7 +188,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.gun_emp_ammo;
bullet.ammo = new ComparableStack(ModItems.gun_emp_ammo);
bullet.velocity = 1F;
bullet.spread = 0.0F;
@ -217,7 +221,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.ammo_fuel;
bullet.ammo = new ComparableStack(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.DIESEL));
bullet.ammoCount = 100;
bullet.velocity = 0.75F;
@ -265,7 +269,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = getFlameConfig();
bullet.ammo = ModItems.ammo_fuel_napalm;
bullet.ammo = new ComparableStack(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.NAPALM));
bullet.wear = 2;
bullet.dmgMin = 4;
bullet.dmgMax = 6;
@ -278,7 +282,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = getFlameConfig();
bullet.ammo = ModItems.ammo_fuel_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.PHOSPHORUS));
bullet.wear = 2;
bullet.spread = 0.0F;
bullet.bulletsMin = 1;
@ -297,7 +301,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = getFlameConfig();
bullet.ammo = ModItems.ammo_fuel_vaporizer;
bullet.ammo = new ComparableStack(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.VAPORIZER));
bullet.wear = 4;
bullet.spread = 0.25F;
bullet.bulletsMin = 8;
@ -322,7 +326,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = getFlameConfig();
bullet.ammo = ModItems.ammo_fuel_gas;
bullet.ammo = new ComparableStack(ModItems.ammo_fuel.stackFromEnum(AmmoFlamethrower.CHLORINE));
bullet.wear = 1;
bullet.spread = 0.05F;
bullet.gravity = 0D;
@ -344,7 +348,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.ammo_fireext;
bullet.ammo = new ComparableStack(ModItems.ammo_fireext.stackFromEnum(AmmoFireExt.WATER));
bullet.ammoCount = 300;
bullet.velocity = 0.75F;
@ -432,7 +436,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = getFextConfig();
bullet.ammo = ModItems.ammo_fireext_foam;
bullet.ammo = new ComparableStack(ModItems.ammo_fireext.stackFromEnum(AmmoFireExt.FOAM));
bullet.spread = 0.05F;
bullet.bImpact = new IBulletImpactBehavior() {
@ -513,7 +517,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = getFextConfig();
bullet.ammo = ModItems.ammo_fireext_sand;
bullet.ammo = new ComparableStack(ModItems.ammo_fireext.stackFromEnum(AmmoFireExt.SAND));
bullet.spread = 0.1F;
bullet.bImpact = new IBulletImpactBehavior() {
@ -578,7 +582,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.nugget_euphemium;
bullet.ammo = new ComparableStack(ModItems.nugget_euphemium);
bullet.ammoCount = 1000;
bullet.wear = 1;
bullet.velocity = 1F;
@ -621,7 +625,7 @@ public class GunEnergyFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.nothing;
bullet.ammo = new ComparableStack(ModItems.nothing);
bullet.dmgMin = 100;
bullet.dmgMax = 150;
bullet.velocity = 1F;

View File

@ -13,7 +13,10 @@ import com.hbm.handler.GunConfiguration;
import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
@ -43,8 +46,8 @@ public class GunFatmanFactory {
config.reloadSound = GunConfiguration.RSOUND_FATMAN;
config.reloadSoundEnd = false;
config.name = "M-42 Tactical Nuclear Catapult";
config.manufacturer = "Fort Strong";
config.name = "m42";
config.manufacturer = EnumGunManufacturer.F_STRONG;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.NUKE_NORMAL);
@ -63,8 +66,8 @@ public class GunFatmanFactory {
GunConfiguration config = getFatmanConfig();
config.name = "M-42 Experimental MIRV";
config.manufacturer = "Fort Strong";
config.name = "m42MIRV";
config.manufacturer = EnumGunManufacturer.F_STRONG;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_NORMAL);
@ -81,8 +84,8 @@ public class GunFatmanFactory {
GunConfiguration config = getFatmanConfig();
config.name = "Balefire Egg Launcher";
config.manufacturer = "Fort Strong";
config.name = "bel";
config.manufacturer = EnumGunManufacturer.F_STRONG;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.NUKE_AMAT);
@ -108,8 +111,8 @@ public class GunFatmanFactory {
config.reloadSound = GunConfiguration.RSOUND_FATMAN;
config.reloadSoundEnd = false;
config.name = "M-42 Tactical Nuclear Catapult";
config.manufacturer = "Fort Strong";
config.name = "m42";
config.manufacturer = EnumGunManufacturer.F_STRONG;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_NORMAL);
@ -127,7 +130,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.STOCK));
bullet.bImpact = new IBulletImpactBehavior() {
@ -143,7 +146,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeLowConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_low;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.LOW));
bullet.bImpact = new IBulletImpactBehavior() {
@ -159,7 +162,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeHighConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_high;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.HIGH));
bullet.bImpact = new IBulletImpactBehavior() {
@ -175,7 +178,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeTotsConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_tots;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.TOTS));
bullet.bulletsMin = 8;
bullet.bulletsMax = 8;
bullet.spread = 0.1F;
@ -195,7 +198,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeSafeConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_safe;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.SAFE));
bullet.bImpact = new IBulletImpactBehavior() {
@ -211,7 +214,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukePumpkinConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_pumpkin;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.PUMPKIN));
bullet.explosive = 10F;
bullet.bImpact = new IBulletImpactBehavior() {
@ -242,7 +245,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeBarrelConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_barrel;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.BARREL));
bullet.explosive = 3F;
bullet.style = bullet.STYLE_BARREL;
@ -300,7 +303,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeConfig();
bullet.ammo = ModItems.ammo_mirv;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV));
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -337,7 +340,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeLowConfig();
bullet.ammo = ModItems.ammo_mirv_low;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_LOW));
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -374,7 +377,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeHighConfig();
bullet.ammo = ModItems.ammo_mirv_high;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_HIGH));
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -411,7 +414,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeSafeConfig();
bullet.ammo = ModItems.ammo_mirv_safe;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_SAFE));
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -448,7 +451,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeConfig();
bullet.ammo = ModItems.ammo_mirv_special;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.MIRV_SPECIAL));
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -496,7 +499,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.gun_bf_ammo;
bullet.ammo = new ComparableStack(ModItems.ammo_nuke.stackFromEnum(AmmoFatman.BALEFIRE));
bullet.style = BulletConfiguration.STYLE_BF;
bullet.bImpact = new IBulletImpactBehavior() {

View File

@ -5,7 +5,9 @@ import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class GunGaussFactory {
@ -27,8 +29,8 @@ public class GunGaussFactory {
config.durability = 6000;
config.firingSound = "hbm:weapon.tauShoot";
config.name = "XVL1456 Tau Cannon";
config.manufacturer = "Black Mesa Research Facility";
config.name = "tau";
config.manufacturer = EnumGunManufacturer.BLACK_MESA;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.SPECIAL_GAUSS);
@ -60,7 +62,7 @@ public class GunGaussFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.gun_xvl1456_ammo;
bullet.ammo = new ComparableStack(ModItems.gun_xvl1456_ammo);
bullet.dmgMin = 6;
bullet.dmgMax = 9;
bullet.trail = 1;

View File

@ -5,13 +5,27 @@ import java.util.ArrayList;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoGrenade;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
public class GunGrenadeFactory {
private static final CasingEjector EJECTOR_LAUNCHER;
private static final SpentCasing CASING40MM;
static {
EJECTOR_LAUNCHER = new CasingEjector().setAngleRange(0.02F, 0.03F).setAfterReload();
CASING40MM = new SpentCasing(CasingType.STRAIGHT).setScale(4F, 4F, 3F).setBounceMotion(0.02F, 0.03F).setColor(0x777777).setupSmoke(1F, 0.5D, 60, 40);
}
public static GunConfiguration getHK69Config() {
GunConfiguration config = new GunConfiguration();
@ -31,8 +45,8 @@ public class GunGrenadeFactory {
config.reloadSound = GunConfiguration.RSOUND_GRENADE;
config.reloadSoundEnd = false;
config.name = "Granatpistole HK69";
config.manufacturer = "Heckler & Koch";
config.name = "gPistol";
config.manufacturer = EnumGunManufacturer.H_AND_K;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.GRENADE_NORMAL);
@ -48,6 +62,8 @@ public class GunGrenadeFactory {
config.config.add(BulletConfigSyncingUtil.GRENADE_KAMPF);
config.durability = 300;
config.ejector = EJECTOR_LAUNCHER;
return config;
}
@ -55,13 +71,15 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.STOCK));
bullet.velocity = 2.0F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.wear = 10;
bullet.trail = 0;
bullet.spentCasing = CASING40MM.clone().register("40MMStock");
return bullet;
}
@ -69,7 +87,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_he;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.HE));
bullet.velocity = 2.0F;
bullet.dmgMin = 20;
bullet.dmgMax = 15;
@ -77,6 +95,8 @@ public class GunGrenadeFactory {
bullet.explosive = 5.0F;
bullet.trail = 1;
bullet.spentCasing = CASING40MM.clone().register("40MMHE");
return bullet;
}
@ -84,7 +104,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.INCENDIARY));
bullet.velocity = 2.0F;
bullet.dmgMin = 15;
bullet.dmgMax = 15;
@ -92,6 +112,8 @@ public class GunGrenadeFactory {
bullet.trail = 0;
bullet.incendiary = 2;
bullet.spentCasing = CASING40MM.clone().register("40MMInc");
return bullet;
}
@ -99,7 +121,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.PHOSPHORUS));
bullet.velocity = 2.0F;
bullet.dmgMin = 15;
bullet.dmgMax = 15;
@ -109,6 +131,8 @@ public class GunGrenadeFactory {
bullet.bImpact = BulletConfigFactory.getPhosphorousEffect(10, 60 * 20, 100, 0.5D, 1F);
bullet.spentCasing = CASING40MM.clone().register("40MMPhos");
return bullet;
}
@ -116,7 +140,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_toxic;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.CHLORINE));
bullet.velocity = 2.0F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
@ -125,6 +149,8 @@ public class GunGrenadeFactory {
bullet.explosive = 0;
bullet.chlorine = 50;
bullet.spentCasing = CASING40MM.clone().register("40MMTox");
return bullet;
}
@ -132,7 +158,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.SLEEK));
bullet.velocity = 2.0F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
@ -141,6 +167,8 @@ public class GunGrenadeFactory {
bullet.explosive = 7.5F;
bullet.jolt = 6.5D;
bullet.spentCasing = CASING40MM.clone().register("40MMIF");
return bullet;
}
@ -148,7 +176,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_concussion;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.CONCUSSION));
bullet.velocity = 2.0F;
bullet.dmgMin = 15;
bullet.dmgMax = 20;
@ -156,6 +184,8 @@ public class GunGrenadeFactory {
bullet.explosive = 10.0F;
bullet.trail = 3;
bullet.spentCasing = CASING40MM.clone().register("40MMCon");
return bullet;
}
@ -163,11 +193,13 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = getGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_finned;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.FINNED));
bullet.gravity = 0.02;
bullet.explosive = 1.5F;
bullet.trail = 5;
bullet.spentCasing = CASING40MM.clone().register("40MMFin");
return bullet;
}
@ -175,7 +207,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = getGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_nuclear;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.NUCLEAR));
bullet.velocity = 4;
bullet.explosive = 0.0F;
@ -187,6 +219,8 @@ public class GunGrenadeFactory {
}
};
bullet.spentCasing = CASING40MM.clone().register("40MMNuke");
return bullet;
}
@ -194,13 +228,15 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.ammo_grenade_tracer;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.TRACER));
bullet.velocity = 2.0F;
bullet.wear = 10;
bullet.explosive = 0F;
bullet.trail = 5;
bullet.vPFX = "bluedust";
bullet.spentCasing = CASING40MM.clone().register("40MMTrac").setColor(0xEEEEEE);
return bullet;
}
@ -208,7 +244,7 @@ public class GunGrenadeFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_grenade_kampf;
bullet.ammo = new ComparableStack(ModItems.ammo_grenade.stackFromEnum(AmmoGrenade.KAMPF));
bullet.spread = 0.0F;
bullet.gravity = 0.0D;
bullet.wear = 15;
@ -217,6 +253,8 @@ public class GunGrenadeFactory {
bullet.trail = 4;
bullet.vPFX = "smoke";
//bullet.spentCasing = CASING40MM.clone().register("40MMKampf").setColor(0xEBC35E); //does not eject, whole cartridge leaves the gun
return bullet;
}
}

View File

@ -9,6 +9,7 @@ import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
@ -29,7 +30,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = new BulletConfiguration();
bullet.ammo = ModItems.coin_maskman;
bullet.ammo = new ComparableStack(ModItems.coin_maskman);
bullet.velocity = 0.25F;
bullet.spread = 0.000F;
bullet.wear = 10;
@ -84,7 +85,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.coin_maskman;
bullet.ammo = new ComparableStack(ModItems.coin_maskman);
bullet.spread = 0.0F;
bullet.dmgMin = 15;
bullet.dmgMax = 20;
@ -102,7 +103,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.coin_maskman;
bullet.ammo = new ComparableStack(ModItems.coin_maskman);
bullet.spread = 0.0F;
bullet.dmgMin = 5;
bullet.dmgMax = 10;
@ -118,7 +119,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.coin_maskman;
bullet.ammo = new ComparableStack(ModItems.coin_maskman);
bullet.spread = 0.0F;
bullet.dmgMin = 15;
bullet.dmgMax = 20;
@ -151,7 +152,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.coin_maskman;
bullet.ammo = new ComparableStack(ModItems.coin_maskman);
bullet.gravity = 0.1D;
bullet.velocity = 1.0F;
bullet.dmgMin = 15;
@ -167,7 +168,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = ModItems.coin_maskman;
bullet.ammo = new ComparableStack(ModItems.coin_maskman);
bullet.gravity = 0.1D;
bullet.velocity = 1.0F;
bullet.dmgMin = 20;
@ -205,7 +206,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.coin_worm;
bullet.ammo = new ComparableStack(ModItems.coin_worm);
bullet.spread = 0.0F;
bullet.maxAge = 60;
bullet.dmgMin = 15;
@ -222,7 +223,7 @@ public class GunNPCFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.coin_worm;
bullet.ammo = new ComparableStack(ModItems.coin_worm);
bullet.spread = 0.0F;
bullet.maxAge = 100;
bullet.dmgMin = 35;

View File

@ -2,12 +2,21 @@ package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.blocks.generic.RedBarrel;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.lib.ModDamageSource;
import com.hbm.potion.HbmPotion;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect;
public class GunOSIPRFactory {
public static GunConfiguration getOSIPRConfig() {
@ -24,13 +33,13 @@ public class GunOSIPRFactory {
config.reloadType = GunConfiguration.RELOAD_FULL;
config.allowsInfinity = true;
config.crosshair = Crosshair.L_ARROWS;
config.durability = 10000;
config.durability = 50_000;
config.reloadSound = "hbm:weapon.osiprReload";
config.firingSound = "hbm:weapon.osiprShoot";
config.reloadSoundEnd = false;
config.name = "Overwatch Standard Issue Pulse Rifle";
config.manufacturer = "The Universal Union";
config.name = "osipr";
config.manufacturer = EnumGunManufacturer.COMBINE;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.SPECIAL_OSIPR);
@ -59,24 +68,71 @@ public class GunOSIPRFactory {
return config;
}
static float inaccuracy = 5;
static float inaccuracy = 1.25F;
public static BulletConfiguration getPulseConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.gun_osipr_ammo;
bullet.ammo = new ComparableStack(ModItems.gun_osipr_ammo);
bullet.ammoCount = 30;
bullet.doesRicochet = false;
bullet.spread *= inaccuracy;
bullet.dmgMin = 3;
bullet.dmgMax = 5;
bullet.dmgMin = 15;
bullet.dmgMax = 21;
bullet.trail = 2;
return bullet;
}
public static BulletConfiguration getPulseChargedConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = ModItems.gun_osipr_ammo2;
bullet.ammo = new ComparableStack(ModItems.gun_osipr_ammo2);
bullet.ricochetAngle = 360;
bullet.LBRC = 100;
bullet.HBRC = 100;
bullet.bounceMod = 1;
bullet.style = BulletConfiguration.STYLE_ORB;
bullet.damageType = ModDamageSource.s_combineball;
bullet.liveAfterImpact = true;
bullet.spread = 0;
bullet.gravity = 0;
bullet.maxAge = 150;
bullet.velocity = 2;
bullet.bHurt = (ball, entity) -> {
if(entity instanceof EntityLivingBase) {
EntityLivingBase entityLiving = (EntityLivingBase) entity;
entity.addVelocity(ball.motionX / 2, ball.motionY / 2, ball.motionZ / 2);
if(entity == ball.shooter)
return;
if(entityLiving.getHealth() <= 1000) {
entityLiving.addPotionEffect(new PotionEffect(HbmPotion.bang.id, 1, 0));
entityLiving.setLastAttacker(ball.shooter);
} else if(entityLiving.getHealth() > 1000) {
ball.setDead();
return;
}
}
};
bullet.bRicochet = (ball, x, y, z) -> {
Block block = ball.worldObj.getBlock(x, y, z);
if(block instanceof RedBarrel)
((RedBarrel) block).explode(ball.worldObj, x, y, z);
};
bullet.bImpact = (ball, x, y, z) -> {
final Block block = ball.worldObj.getBlock(x, y, z);
if(block instanceof RedBarrel)
((RedBarrel) block).explode(ball.worldObj, x, y, z);
};
return bullet;
}

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.util.EnumChatFormatting;
@ -27,7 +28,7 @@ public class GunPoweredFactory {
config.chargeRate = 2500;
config.name = "LIY2001 Anti-Material Electromagnetic Rifle Prototype";
config.manufacturer = "OxfordEM technologies";
config.manufacturer = EnumGunManufacturer.OXFORD;
config.config = new ArrayList<Integer>();
config.config.add(BulletConfigSyncingUtil.GLASS_EMRADIO);
@ -41,35 +42,6 @@ public class GunPoweredFactory {
return config;
}
/*public static BulletConfiguration getGlassBoltConfig() {
BulletConfiguration bullet = new BulletConfiguration();
bullet.velocity = 2.0F;
bullet.spread = 0F;
bullet.dmgMin = 30;
bullet.dmgMax = 40;
bullet.bulletsMin = 1;
bullet.bulletsMax = 1;
bullet.gravity = 0D;
bullet.maxAge = 100;
bullet.doesRicochet = true;
bullet.ricochetAngle = 90;
bullet.HBRC = 2;
bullet.LBRC = 90;
bullet.bounceMod = 1;
bullet.doesPenetrate = true;
bullet.style = BulletConfiguration.STYLE_BOLT;
bullet.plink = BulletConfiguration.PLINK_ENERGY;
bullet.trail = BulletConfiguration.BOLT_LASER;
bullet.dischargePerShot = 1000;
bullet.firingRate = 5;
bullet.modeName = "testMode";
bullet.chatColour = EnumChatFormatting.RED;
return bullet;
}*/
public static BulletConfiguration getEMRadioConfig() {
BulletConfiguration bullet = new BulletConfiguration();

View File

@ -10,7 +10,10 @@ import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletImpactBehavior;
import com.hbm.interfaces.IBulletRicochetBehavior;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.AmmoRocket;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.BusAnimationKeyframe;
import com.hbm.render.anim.BusAnimationSequence;
@ -40,8 +43,8 @@ public class GunRocketFactory {
config.reloadSound = GunConfiguration.RSOUND_LAUNCHER;
config.reloadSoundEnd = false;
config.name = "Carl Gustav Recoilless Rifle M1";
config.manufacturer = "Saab Bofors Dynamics";
config.name = "gustav";
config.manufacturer = EnumGunManufacturer.SAAB;
config.comment.add("Fun fact of the day: Recoilless");
config.comment.add("rifles don't actually fire rockets.");
@ -103,8 +106,8 @@ public class GunRocketFactory {
)
);
config.name = "OpenQuadro Guided Man-Portable Missile Launcher";
config.manufacturer = "Open Mann Co.";
config.name = "quadro";
config.manufacturer = EnumGunManufacturer.MANN;
config.comment.add("For the next three hundred years, people who needed to get to the second");
config.comment.add("floor used the only method available to them, which was rocket jumping.");
config.comment.add("This persisted until 1857, when the young bearded inventor named");
@ -134,8 +137,8 @@ public class GunRocketFactory {
config.reloadDuration = 20;
config.name = "M1 Karl-Gerät";
config.manufacturer = "???";
config.name = "karl";
config.manufacturer = EnumGunManufacturer.UNKNOWN;
config.comment.clear();
config.config = new ArrayList<Integer>();
@ -159,8 +162,8 @@ public class GunRocketFactory {
config.reloadDuration = 25;
config.hasSights = true;
config.name = "Raketenpanzerbüchse 54";
config.manufacturer = "Enzinger Union";
config.name = "panz";
config.manufacturer = EnumGunManufacturer.ENZINGER;
config.comment.clear();
config.comment.add("Panzer-Shrek");
@ -173,7 +176,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.STOCK));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.explosive = 4F;
@ -186,7 +189,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_he;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.HE));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.wear = 15;
@ -200,7 +203,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.INCENDIARY));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.wear = 15;
@ -215,7 +218,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_emp;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.EMP));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.explosive = 2.5F;
@ -229,7 +232,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_sleek;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.SLEEK));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.explosive = 10F;
@ -244,7 +247,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_shrapnel;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.SHRAPNEL));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.explosive = 4F;
@ -258,7 +261,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_glare;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.GLARE));
bullet.velocity = 5.0F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
@ -274,7 +277,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_nuclear;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.NUCLEAR));
bullet.velocity = 1.5F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
@ -298,7 +301,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_toxic;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.CHLORINE));
bullet.velocity = 1.5F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
@ -314,7 +317,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_rpc;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.RPC));
bullet.velocity = 3.0F;
bullet.dmgMin = 20;
bullet.dmgMax = 25;
@ -329,6 +332,7 @@ public class GunRocketFactory {
bullet.bRicochet = new IBulletRicochetBehavior() {
@Override
public void behaveBlockRicochet(EntityBulletBase bullet, int bX, int bY, int bZ) {
World worldObj = bullet.worldObj;
if(!worldObj.isRemote &&
@ -347,7 +351,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_phosphorus;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.PHOSPHORUS));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.wear = 15;
@ -364,7 +368,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_canister;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.CANISTER));
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.explosive = 2F;
@ -399,7 +403,7 @@ public class GunRocketFactory {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_rocket_digamma;
bullet.ammo = new ComparableStack(ModItems.ammo_rocket.stackFromEnum(AmmoRocket.DIGAMMA));
bullet.velocity = 0.5F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
@ -422,22 +426,6 @@ public class GunRocketFactory {
spear.posY = bullet.posY + 100;
bullet.worldObj.spawnEntityInWorld(spear);
/*for(int i = 0; i < 250; i++) {
double ix = bullet.posX + bullet.worldObj.rand.nextGaussian() * 15;
double iy = bullet.posY + bullet.worldObj.rand.nextGaussian() * 2;
double iz = bullet.posZ + bullet.worldObj.rand.nextGaussian() * 15;
ExAttrib at = Vec3.createVectorHelper(ix - bullet.posX, 0, iz - bullet.posZ).lengthVector() < 20 ? ExAttrib.DIGAMMA_CIRCUIT : ExAttrib.DIGAMMA;
new ExplosionNT(bullet.worldObj, bullet, ix, iy, iz, 7.5F)
.addAttrib(ExAttrib.NOHURT)
.addAttrib(ExAttrib.NOPARTICLE)
.addAttrib(ExAttrib.NODROP)
.addAttrib(ExAttrib.NOSOUND)
.addAttrib(at).explode();
}*/
}
};

View File

@ -3,13 +3,15 @@ package com.hbm.handler.guncfg;
import java.util.ArrayList;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.entity.projectile.EntityRocket;
import com.hbm.entity.projectile.EntityRocketHoming;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemAmmoEnums.AmmoStinger;
import com.hbm.items.ModItems;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import net.minecraft.entity.player.EntityPlayer;
@ -34,8 +36,8 @@ public class GunRocketHomingFactory {
config.reloadSound = GunConfiguration.RSOUND_LAUNCHER;
config.reloadSoundEnd = false;
config.name = "FIM-92 Stinger man-portable air-defense system";
config.manufacturer = "Raytheon Missile Systems";
config.name = "stinger";
config.manufacturer = EnumGunManufacturer.RAYTHEON;
config.comment.add("Woosh, beep-beep-beep!");
config.config = new ArrayList<Integer>();
@ -66,8 +68,8 @@ GunConfiguration config = new GunConfiguration();
config.reloadSound = GunConfiguration.RSOUND_LAUNCHER;
config.reloadSoundEnd = false;
config.name = "The One Sky Stinger";
config.manufacturer = "Equestria Missile Systems";
config.name = "stingerOneSky";
config.manufacturer = EnumGunManufacturer.EQUESTRIA;
config.comment.add("Oh, I get it, because of the...nyeees!");
config.comment.add("It all makes sense now!");
config.comment.add("");
@ -90,7 +92,7 @@ GunConfiguration config = new GunConfiguration();
public static BulletConfiguration getRocketStingerConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_stinger_rocket;
bullet.ammo = new ComparableStack(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.STOCK));
bullet.dmgMin = 20;
bullet.dmgMax = 25;
bullet.explosive = 4F;
@ -126,7 +128,7 @@ GunConfiguration config = new GunConfiguration();
public static BulletConfiguration getRocketStingerHEConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_stinger_rocket_he;
bullet.ammo = new ComparableStack(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.HE));
bullet.dmgMin = 30;
bullet.dmgMax = 35;
bullet.explosive = 8F;
@ -163,7 +165,7 @@ GunConfiguration config = new GunConfiguration();
public static BulletConfiguration getRocketStingerIncendiaryConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_stinger_rocket_incendiary;
bullet.ammo = new ComparableStack(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.INCENDIARY));
bullet.dmgMin = 15;
bullet.dmgMax = 20;
bullet.explosive = 4F;
@ -200,7 +202,7 @@ GunConfiguration config = new GunConfiguration();
public static BulletConfiguration getRocketStingerNuclearConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_stinger_rocket_nuclear;
bullet.ammo = new ComparableStack(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.NUCLEAR));
bullet.dmgMin = 50;
bullet.dmgMax = 55;
bullet.explosive = 15F;
@ -215,17 +217,20 @@ GunConfiguration config = new GunConfiguration();
if(!bullet.worldObj.isRemote) {
EntityPlayer player = bullet.worldObj.getClosestPlayerToEntity(bullet, -1.0D);
EntityRocketHoming rocket = new EntityRocketHoming(bullet.worldObj, player, 1.0F, 5.0F, 4);
if(player.getHeldItem().getItem() == ModItems.gun_skystinger && !player.isSneaking()) {
EntityRocketHoming rocket2 = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 4);
rocket = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 4);
rocket.setIsCritical(true);
rocket2.setIsCritical(true);
bullet.worldObj.spawnEntityInWorld(rocket2);
if(player.getDistanceToEntity(bullet) < 16) {
EntityRocketHoming rocket = new EntityRocketHoming(bullet.worldObj, player, 1.0F, 5.0F, 4);
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.gun_skystinger && !player.isSneaking()) {
EntityRocketHoming rocket2 = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 4);
rocket = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 4);
rocket.setIsCritical(true);
rocket2.setIsCritical(true);
bullet.worldObj.spawnEntityInWorld(rocket2);
}
rocket.homingMod = 5;
rocket.homingRadius = 25;
bullet.worldObj.spawnEntityInWorld(rocket);
}
rocket.homingMod = 5;
rocket.homingRadius = 25;
bullet.worldObj.spawnEntityInWorld(rocket);
bullet.setDead();
}
@ -237,7 +242,7 @@ GunConfiguration config = new GunConfiguration();
public static BulletConfiguration getRocketStingerBonesConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardRocketConfig();
bullet.ammo = ModItems.ammo_stinger_rocket_bones;
bullet.ammo = new ComparableStack(ModItems.ammo_stinger_rocket.stackFromEnum(AmmoStinger.BONES));
bullet.dmgMin = 20;
bullet.dmgMax = 25;
bullet.explosive = 8F;
@ -251,17 +256,20 @@ GunConfiguration config = new GunConfiguration();
if(!bullet.worldObj.isRemote) {
EntityPlayer player = bullet.worldObj.getClosestPlayerToEntity(bullet, -1.0D);
EntityRocketHoming rocket = new EntityRocketHoming(bullet.worldObj, player, 1.0F, 5.0F, 42);
if(player.getHeldItem().getItem() == ModItems.gun_skystinger && !player.isSneaking()) {
EntityRocketHoming rocket2 = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 42);
rocket = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 42);
rocket.setIsCritical(true);
rocket2.setIsCritical(true);
bullet.worldObj.spawnEntityInWorld(rocket2);
if(player.getDistanceToEntity(bullet) < 16) {
EntityRocketHoming rocket = new EntityRocketHoming(bullet.worldObj, player, 1.0F, 5.0F, 42);
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.gun_skystinger && !player.isSneaking()) {
EntityRocketHoming rocket2 = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 42);
rocket = new EntityRocketHoming(bullet.worldObj, player, 1.5F, 15.0F, 42);
rocket.setIsCritical(true);
rocket2.setIsCritical(true);
bullet.worldObj.spawnEntityInWorld(rocket2);
}
rocket.homingMod = 5;
rocket.homingRadius = 25;
bullet.worldObj.spawnEntityInWorld(rocket);
}
rocket.homingMod = 5;
rocket.homingRadius = 25;
bullet.worldObj.spawnEntityInWorld(rocket);
bullet.setDead();
}

View File

@ -26,6 +26,7 @@ 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.items.ItemAmmoEnums;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemAssemblyTemplate;
import com.hbm.items.machine.ItemDrillbit.EnumDrillType;
@ -612,7 +613,7 @@ public class AssemblerRecipes {
new OreDictStack(ASBESTOS.ingot(), 8)
}, 200);
makeRecipe(new ComparableStack(ModItems.ammo_75bolt, 2), new AStack[] {
makeRecipe(new ComparableStack(ModItems.ammo_75bolt, 2, ItemAmmoEnums.Ammo75Bolt.STOCK.ordinal()), new AStack[] {
new OreDictStack(STEEL.plate(), 2),
new OreDictStack(CU.plate(), 1),
new ComparableStack(ModItems.primer_50, 5),
@ -622,7 +623,7 @@ public class AssemblerRecipes {
new OreDictStack(U238.ingot(), 1)
}, 60);
makeRecipe(new ComparableStack(ModItems.ammo_75bolt_incendiary, 2), new AStack[] {
makeRecipe(new ComparableStack(ModItems.ammo_75bolt, 2, ItemAmmoEnums.Ammo75Bolt.INCENDIARY.ordinal()), new AStack[] {
new OreDictStack(STEEL.plate(), 2),
new OreDictStack(CU.plate(), 1),
new ComparableStack(ModItems.primer_50, 5),
@ -632,7 +633,7 @@ public class AssemblerRecipes {
new OreDictStack(P_WHITE.ingot(), 3)
}, 60);
makeRecipe(new ComparableStack(ModItems.ammo_75bolt_he, 2), new AStack[] {
makeRecipe(new ComparableStack(ModItems.ammo_75bolt, 2, ItemAmmoEnums.Ammo75Bolt.HE.ordinal()), new AStack[] {
new OreDictStack(STEEL.plate(), 2),
new OreDictStack(CU.plate(), 1),
new ComparableStack(ModItems.primer_50, 5),

View File

@ -8,6 +8,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 net.minecraft.init.Items;
@ -44,17 +45,17 @@ public class MagicRecipes {
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_pip),
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_bj),
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_silver),
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),
@ -90,7 +91,7 @@ public class MagicRecipes {
new ComparableStack(ModItems.ingot_polymer),
new OreDictStack("plateGold")));
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_dart_nuclear, 4),
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_dart, 4, ItemAmmoEnums.AmmoDart.NUCLEAR.ordinal()),
new ComparableStack(ModItems.plate_polymer),
new ComparableStack(ModItems.nugget_pu239),
new ComparableStack(ModItems.circuit_aluminium)));

View File

@ -8,6 +8,9 @@ import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.items.ItemEnums.EnumBriquetteType;
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.ItemStamp.StampType;
@ -76,30 +79,33 @@ public class PressRecipes {
makeRecipe(StampType.WIRE, new OreDictStack(ALLOY.ingot()), new ItemStack(ModItems.wire_advanced_alloy, 8));
makeRecipe(StampType.WIRE, new OreDictStack(MAGTUNG.ingot()), new ItemStack(ModItems.wire_magnetized_tungsten, 8));
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_raw), ModItems.circuit_aluminium);
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_bismuth_raw), ModItems.circuit_bismuth);
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_arsenic_raw), ModItems.circuit_arsenic);
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_raw), ModItems.circuit_aluminium);
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_bismuth_raw), ModItems.circuit_bismuth);
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_arsenic_raw), ModItems.circuit_arsenic);
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_tantalium_raw), ModItems.circuit_tantalium);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_iron), ModItems.gun_revolver_iron_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_steel), ModItems.gun_revolver_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_lead), ModItems.gun_revolver_lead_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_gold), ModItems.gun_revolver_gold_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_schrabidium), ModItems.gun_revolver_schrabidium_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_nightmare), ModItems.gun_revolver_nightmare_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_desh), ModItems.ammo_357_desh);
makeRecipe(StampType.C357, new OreDictStack(STEEL.ingot()), ModItems.gun_revolver_cursed_ammo);
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_iron), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.IRON));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_steel), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.LEAD));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_lead), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.NUCLEAR));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_gold), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.GOLD));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_schrabidium), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.SCHRABIDIUM));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_nightmare), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.NIGHTMARE1));
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_desh), ModItems.ammo_357.stackFromEnum(Ammo357Magnum.DESH));
makeRecipe(StampType.C357, new OreDictStack(STEEL.ingot()), ModItems.ammo_357.stackFromEnum(24, Ammo357Magnum.STEEL));
makeRecipe(StampType.C44, new ComparableStack(ModItems.assembly_nopip), ModItems.ammo_44);
makeRecipe(StampType.C44, new ComparableStack(ModItems.assembly_nopip), ModItems.ammo_44);
makeRecipe(StampType.C44, new ComparableStack(ModItems.assembly_45), ModItems.ammo_45);
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_smg), ModItems.ammo_9mm);
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_uzi), ModItems.ammo_22lr);
makeRecipe(StampType.C9, new OreDictStack(GOLD.ingot()), ModItems.ammo_566_gold);
makeRecipe(StampType.C9, new OreDictStack(GOLD.ingot()), ModItems.ammo_556.stackFromEnum(32, Ammo556mm.GOLD));
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_lacunae), ModItems.ammo_5mm);
makeRecipe(StampType.C9, new ComparableStack(ModItems.assembly_556), ModItems.ammo_556);
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_calamity), ModItems.ammo_50bmg);
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_actionexpress), ModItems.ammo_50ae);
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_luna), ModItems.ammo_luna_sniper.stackFromEnum(AmmoLunaticSniper.SABOT));
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_762), ModItems.ammo_762);
}
public static void makeRecipe(StampType type, AStack in, Item out) {

View File

@ -11,6 +11,7 @@ import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.recipes.AssemblerRecipes;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ModItems;
import com.hbm.items.food.ItemFlask.EnumInfusion;
@ -499,86 +500,95 @@ public class AnvilRecipes {
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] {new OreDictStack(IRON.plate()), new ComparableStack(Items.redstone)}, new AnvilOutput(new ItemStack(ModItems.primer_buckshot))).setTier(1));
Object[][] recs = new Object[][] {
{ModItems.ammo_12gauge, P_RED.dust(), ModItems.ammo_12gauge_incendiary, 20, 2},
{ModItems.ammo_12gauge, Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_12gauge_shrapnel, 20, 2},
{ModItems.ammo_12gauge, U238.ingot(), ModItems.ammo_12gauge_du, 20, 3},
{ModItems.ammo_12gauge, ModItems.coin_maskman, ModItems.ammo_12gauge_sleek, 100, 4},
{ModItems.ammo_12gauge.stackFromEnum(20, Ammo12Gauge.STOCK), P_RED.dust(), ModItems.ammo_12gauge.stackFromEnum(20, Ammo12Gauge.INCENDIARY), 2},
{ModItems.ammo_12gauge.stackFromEnum(20, Ammo12Gauge.STOCK), Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_12gauge.stackFromEnum(20, Ammo12Gauge.SHRAPNEL), 2},
{ModItems.ammo_12gauge.stackFromEnum(20, Ammo12Gauge.STOCK), U238.ingot(), ModItems.ammo_12gauge.stackFromEnum(20, Ammo12Gauge.DU), 3},
{ModItems.ammo_12gauge.stackFromEnum(100, Ammo12Gauge.STOCK), ModItems.coin_maskman, ModItems.ammo_12gauge.stackFromEnum(100, Ammo12Gauge.SLEEK), 4},
{ModItems.ammo_20gauge, P_RED.dust(), ModItems.ammo_20gauge_incendiary, 20, 2},
{ModItems.ammo_20gauge, Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_20gauge_shrapnel, 20, 2},
{ModItems.ammo_20gauge, ModItems.powder_poison, ModItems.ammo_20gauge_caustic, 20, 2},
{ModItems.ammo_20gauge, DIAMOND.dust(), ModItems.ammo_20gauge_shock, 20, 2},
{ModItems.ammo_20gauge, Item.getItemFromBlock(Blocks.soul_sand), ModItems.ammo_20gauge_wither, 10, 3},
{ModItems.ammo_20gauge, ModItems.coin_maskman, ModItems.ammo_20gauge_sleek, 100, 4},
{ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.STOCK), P_RED.dust(), ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.INCENDIARY), 2},
{ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.STOCK), Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.SHRAPNEL), 2},
{ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.STOCK), ModItems.powder_poison, ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.CAUSTIC), 2},
{ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.STOCK), DIAMOND.dust(), ModItems.ammo_20gauge.stackFromEnum(20, Ammo20Gauge.SHOCK), 2},
{ModItems.ammo_20gauge.stackFromEnum(10, Ammo20Gauge.STOCK), Item.getItemFromBlock(Blocks.soul_sand), ModItems.ammo_20gauge.stackFromEnum(10, Ammo20Gauge.WITHER), 3},
{ModItems.ammo_20gauge.stackFromEnum(100, Ammo20Gauge.STOCK), ModItems.coin_maskman, ModItems.ammo_20gauge.stackFromEnum(100, Ammo20Gauge.SLEEK), 4},
{ModItems.ammo_4gauge_flechette, P_WHITE.ingot(), ModItems.ammo_4gauge_flechette_phosphorus, 20, 2},
{ModItems.ammo_4gauge_explosive, ModItems.egg_balefire_shard, ModItems.ammo_4gauge_balefire, 10, 4},
{ModItems.ammo_4gauge_explosive, ModItems.ammo_rocket, ModItems.ammo_4gauge_kampf, 4, 2},
{ModItems.ammo_4gauge_kampf, ModItems.pellet_canister, ModItems.ammo_4gauge_canister, 10, 3},
{ModItems.ammo_4gauge, ModItems.pellet_claws, ModItems.ammo_4gauge_claw, 4, 5},
{ModItems.ammo_4gauge, ModItems.toothpicks, ModItems.ammo_4gauge_vampire, 4, 5},
{ModItems.ammo_4gauge, ModItems.pellet_charged, ModItems.ammo_4gauge_void, 1, 5},
{ModItems.ammo_4gauge, ModItems.coin_maskman, ModItems.ammo_4gauge_sleek, 100, 4},
{ModItems.ammo_4gauge.stackFromEnum(20, Ammo4Gauge.FLECHETTE), P_WHITE.ingot(), ModItems.ammo_4gauge.stackFromEnum(20, Ammo4Gauge.FLECHETTE_PHOSPHORUS), 2},
{ModItems.ammo_4gauge.stackFromEnum(10, Ammo4Gauge.EXPLOSIVE), ModItems.egg_balefire_shard, ModItems.ammo_4gauge.stackFromEnum(10, 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(10, Ammo4Gauge.KAMPF), ModItems.pellet_canister, ModItems.ammo_4gauge.stackFromEnum(10, 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(100, Ammo4Gauge.STOCK), ModItems.coin_maskman, ModItems.ammo_4gauge.stackFromEnum(100, Ammo4Gauge.SLEEK), 4},
{ModItems.ammo_44, DURA.ingot(), ModItems.ammo_44_ap, 20, 2},
{ModItems.ammo_44, U238.ingot(), ModItems.ammo_44_du, 20, 2},
{ModItems.ammo_44, P_WHITE.ingot(), ModItems.ammo_44_phosphorus, 20, 2},
{ModItems.ammo_44_du, STAR.ingot(), ModItems.ammo_44_star, 10, 3},
{ModItems.ammo_44, ModItems.pellet_chlorophyte, ModItems.ammo_44_chlorophyte, 10, 3},
{ModItems.ammo_44.stackFromEnum(20, Ammo44Magnum.STOCK), DURA.ingot(), ModItems.ammo_44.stackFromEnum(20, Ammo44Magnum.AP), 2},
{ModItems.ammo_44.stackFromEnum(20, Ammo44Magnum.STOCK), U238.ingot(), ModItems.ammo_44.stackFromEnum(20, Ammo44Magnum.DU), 2},
{ModItems.ammo_44.stackFromEnum(20, Ammo44Magnum.STOCK), P_WHITE.ingot(), ModItems.ammo_44.stackFromEnum(20, Ammo44Magnum.PHOSPHORUS), 2},
{ModItems.ammo_44.stackFromEnum(10, Ammo44Magnum.DU), STAR.ingot(), ModItems.ammo_44.stackFromEnum(10, Ammo44Magnum.STAR), 3},
{ModItems.ammo_44.stackFromEnum(10, Ammo44Magnum.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_44.stackFromEnum(10, Ammo44Magnum.CHLOROPHYTE), 3},
{ModItems.ammo_5mm, ANY_HIGHEXPLOSIVE.ingot(), ModItems.ammo_5mm_explosive, 20, 2},
{ModItems.ammo_5mm, U238.ingot(), ModItems.ammo_5mm_du, 20, 2},
{ModItems.ammo_5mm, STAR.ingot(), ModItems.ammo_5mm_star, 10, 3},
{ModItems.ammo_5mm, ModItems.pellet_chlorophyte, ModItems.ammo_5mm_chlorophyte, 10, 3},
{ModItems.ammo_45.stackFromEnum(20, Ammo45ACP.STOCK), DURA.ingot(), ModItems.ammo_45.stackFromEnum(20, Ammo45ACP.AP), 3},
{ModItems.ammo_45.stackFromEnum(10, Ammo45ACP.DU), U238.ingot(), ModItems.ammo_45.stackFromEnum(10, Ammo45ACP.DU), 3},
{ModItems.ammo_9mm, DURA.ingot(), ModItems.ammo_9mm_ap, 20, 2},
{ModItems.ammo_9mm, U238.ingot(), ModItems.ammo_9mm_du, 20, 2},
{ModItems.ammo_9mm, ModItems.pellet_chlorophyte, ModItems.ammo_9mm_chlorophyte, 10, 3},
{ModItems.ammo_5mm.stackFromEnum(100, Ammo5mm.STOCK), ModItems.ingot_semtex, ModItems.ammo_5mm.stackFromEnum(100, Ammo5mm.EXPLOSIVE), 2},
{ModItems.ammo_5mm.stackFromEnum(100, Ammo5mm.STOCK), U238.ingot(), ModItems.ammo_5mm.stackFromEnum(100, Ammo5mm.DU), 2},
{ModItems.ammo_5mm.stackFromEnum(25, Ammo5mm.DU), STAR.ingot(), ModItems.ammo_5mm.stackFromEnum(25, Ammo5mm.STAR), 3},
{ModItems.ammo_5mm.stackFromEnum(100, Ammo5mm.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_5mm.stackFromEnum(100, Ammo5mm.CHLOROPHYTE), 3},
{ModItems.ammo_22lr, DURA.ingot(), ModItems.ammo_22lr_ap, 20, 2},
{ModItems.ammo_22lr, ModItems.pellet_chlorophyte, ModItems.ammo_22lr_chlorophyte, 10, 3},
{ModItems.ammo_9mm.stackFromEnum(20, Ammo9mm.STOCK), DURA.ingot(), ModItems.ammo_9mm.stackFromEnum(20, Ammo9mm.AP), 2},
{ModItems.ammo_9mm.stackFromEnum(20, Ammo9mm.STOCK), U238.ingot(), ModItems.ammo_9mm.stackFromEnum(20, Ammo9mm.DU), 2},
{ModItems.ammo_9mm.stackFromEnum(10, Ammo9mm.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_9mm.stackFromEnum(10, Ammo9mm.CHLOROPHYTE), 3},
{ModItems.ammo_50bmg, P_RED.dust(), ModItems.ammo_50bmg_incendiary, 20, 2},
{ModItems.ammo_50bmg, P_WHITE.ingot(), ModItems.ammo_50bmg_phosphorus, 20, 2},
{ModItems.ammo_50bmg, ANY_HIGHEXPLOSIVE.ingot(), ModItems.ammo_50bmg_explosive, 20, 2},
{ModItems.ammo_50bmg, DURA.ingot(), ModItems.ammo_50bmg_ap, 20, 2},
{ModItems.ammo_50bmg, U238.ingot(), ModItems.ammo_50bmg_du, 20, 2},
{ModItems.ammo_50bmg_du, STAR.ingot(), ModItems.ammo_50bmg_star, 10, 3},
{ModItems.ammo_50bmg, ModItems.pellet_chlorophyte, ModItems.ammo_50bmg_chlorophyte, 10, 3},
{ModItems.ammo_50bmg, ModItems.coin_maskman, ModItems.ammo_50bmg_sleek, 100, 4},
{ModItems.ammo_50bmg, ModItems.pellet_flechette, ModItems.ammo_50bmg_flechette, 20, 2},
{ModItems.ammo_50bmg_flechette, ModItems.nugget_am_mix, ModItems.ammo_50bmg_flechette_am, 10, 3},
{ModItems.ammo_50bmg_flechette, ModItems.powder_polonium, ModItems.ammo_50bmg_flechette_po, 20, 3},
{ModItems.ammo_22lr.stackFromEnum(20, Ammo22LR.STOCK), DURA.ingot(), ModItems.ammo_22lr.stackFromEnum(20, Ammo22LR.AP), 2},
{ModItems.ammo_22lr.stackFromEnum(10, Ammo22LR.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_22lr.stackFromEnum(10, Ammo22LR.CHLOROPHYTE), 3},
{ModItems.ammo_50ae, DURA.ingot(), ModItems.ammo_50ae_ap, 20, 2},
{ModItems.ammo_50ae, U238.ingot(), ModItems.ammo_50ae_du, 20, 2},
{ModItems.ammo_50ae_du, STAR.ingot(), ModItems.ammo_50ae_star, 10, 3},
{ModItems.ammo_50ae, ModItems.pellet_chlorophyte, ModItems.ammo_50ae_chlorophyte, 10, 3},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.STOCK), P_RED.dust(), ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.INCENDIARY), 2},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.STOCK), P_WHITE.ingot(), ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.PHOSPHORUS), 2},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.STOCK), ModItems.ingot_semtex, ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.EXPLOSIVE), 2},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.STOCK), DURA.ingot(), ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.AP), 2},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.STOCK), U238.ingot(), ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.DU), 2},
{ModItems.ammo_50bmg.stackFromEnum(10, Ammo50BMG.DU), STAR.ingot(), ModItems.ammo_50bmg.stackFromEnum(10, Ammo50BMG.STAR), 3},
{ModItems.ammo_50bmg.stackFromEnum(10, Ammo50BMG.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_50bmg.stackFromEnum(10, Ammo50BMG.CHLOROPHYTE), 3},
{ModItems.ammo_50bmg.stackFromEnum(100, Ammo50BMG.STOCK), ModItems.coin_maskman, ModItems.ammo_50bmg.stackFromEnum(100, Ammo50BMG.SLEEK), 4},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.STOCK), ModItems.pellet_flechette, ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.FLECHETTE), 2},
{ModItems.ammo_50bmg.stackFromEnum(10, Ammo50BMG.FLECHETTE), ModItems.nugget_am_mix, ModItems.ammo_50bmg.stackFromEnum(10, Ammo50BMG.FLECHETTE_AM), 3},
{ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.FLECHETTE), ModItems.powder_polonium, ModItems.ammo_50bmg.stackFromEnum(20, Ammo50BMG.FLECHETTE_PO), 3},
{ModItems.ammo_556, P_WHITE.ingot(), ModItems.ammo_556_phosphorus, 20, 2},
{ModItems.ammo_556, DURA.ingot(), ModItems.ammo_556_ap, 20, 2},
{ModItems.ammo_556, U238.ingot(), ModItems.ammo_556_du, 20, 2},
{ModItems.ammo_556_du, STAR.ingot(), ModItems.ammo_556_star, 10, 3},
{ModItems.ammo_556, ModItems.pellet_chlorophyte, ModItems.ammo_556_chlorophyte, 10, 3},
{ModItems.ammo_556, ModItems.coin_maskman, ModItems.ammo_556_sleek, 100, 4},
{ModItems.ammo_556, Items.redstone, ModItems.ammo_556_tracer, 20, 2},
{ModItems.ammo_556, ModItems.pellet_flechette, ModItems.ammo_556_flechette, 20, 2},
{ModItems.ammo_556_flechette, P_RED.dust(), ModItems.ammo_556_flechette_incendiary, 20, 2},
{ModItems.ammo_556_flechette, P_WHITE.ingot(), ModItems.ammo_556_flechette_phosphorus, 20, 2},
{ModItems.ammo_556_flechette, U238.ingot(), ModItems.ammo_556_flechette_du, 20, 2},
{ModItems.ammo_556_flechette, ModItems.coin_maskman, ModItems.ammo_556_flechette_sleek, 100, 4},
{ModItems.ammo_556_flechette, ModItems.pellet_chlorophyte, ModItems.ammo_556_flechette_chlorophyte, 10, 3},
{ModItems.ammo_50ae.stackFromEnum(20, Ammo50AE.STOCK), DURA.ingot(), ModItems.ammo_50ae.stackFromEnum(20, Ammo50AE.AP), 2},
{ModItems.ammo_50ae.stackFromEnum(20, Ammo50AE.STOCK), U238.ingot(), ModItems.ammo_50ae.stackFromEnum(20, Ammo50AE.DU), 2},
{ModItems.ammo_50ae.stackFromEnum(10, Ammo50AE.DU), STAR.ingot(), ModItems.ammo_50ae.stackFromEnum(10, Ammo50AE.STAR), 3},
{ModItems.ammo_50ae.stackFromEnum(10, Ammo50AE.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_50ae.stackFromEnum(10, Ammo50AE.CHLOROPHYTE), 3},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.STOCK), P_WHITE.ingot(), ModItems.ammo_556.stackFromEnum(20, Ammo556mm.PHOSPHORUS), 2},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.STOCK), DURA.ingot(), ModItems.ammo_556.stackFromEnum(20, Ammo556mm.AP), 2},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.STOCK), U238.ingot(), ModItems.ammo_556.stackFromEnum(20, Ammo556mm.DU), 2},
{ModItems.ammo_556.stackFromEnum(10, Ammo556mm.DU), STAR.ingot(), ModItems.ammo_556.stackFromEnum(10, Ammo556mm.STAR), 3},
{ModItems.ammo_556.stackFromEnum(10, Ammo556mm.STOCK), ModItems.pellet_chlorophyte, ModItems.ammo_556.stackFromEnum(10, Ammo556mm.CHLOROPHYTE), 3},
{ModItems.ammo_556.stackFromEnum(100, Ammo556mm.STOCK), ModItems.coin_maskman, ModItems.ammo_556.stackFromEnum(100, Ammo556mm.SLEEK), 4},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.STOCK), Items.redstone, ModItems.ammo_556.stackFromEnum(20, Ammo556mm.TRACER), 2},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.STOCK), ModItems.pellet_flechette, ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE), 2},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE), P_RED.dust(), ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE_INCENDIARY), 2},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE), P_WHITE.ingot(), ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE_PHOSPHORUS), 2},
{ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE), U238.ingot(), ModItems.ammo_556.stackFromEnum(20, Ammo556mm.FLECHETTE_DU), 2},
{ModItems.ammo_556.stackFromEnum(100, Ammo556mm.FLECHETTE), ModItems.coin_maskman, ModItems.ammo_556.stackFromEnum(100, Ammo556mm.FLECHETTE_SLEEK), 4},
{ModItems.ammo_556.stackFromEnum(10, Ammo556mm.FLECHETTE), ModItems.pellet_chlorophyte, ModItems.ammo_556.stackFromEnum(10, Ammo556mm.FLECHETTE_CHLOROPHYTE), 3},
{ModItems.ammo_762.stackFromEnum(20, Ammo762NATO.STOCK), Items.redstone, ModItems.ammo_762.stackFromEnum(20, Ammo762NATO.TRACER), 2},
{ModItems.ammo_762.stackFromEnum(20, Ammo762NATO.STOCK), DURA.ingot(), ModItems.ammo_762.stackFromEnum(20, Ammo762NATO.AP), 2},
{ModItems.ammo_762.stackFromEnum(20, Ammo762NATO.STOCK), P_WHITE.ingot(), ModItems.ammo_762.stackFromEnum(20, Ammo762NATO.PHOSPHORUS), 2},
{ModItems.ammo_762.stackFromEnum(10, Ammo762NATO.STOCK), U238.ingot(), ModItems.ammo_762.stackFromEnum(20, 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[] { new ComparableStack((Item)objs[0], (int)objs[3]), new ComparableStack((Item)objs[1], 1) },
new AnvilOutput(new ItemStack((Item)objs[2], (int)objs[3]))).setTier((int)objs[4]));
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[] { new ComparableStack((Item)objs[0], (int)objs[3]), new OreDictStack((String)objs[1], 1) },
new AnvilOutput(new ItemStack((Item)objs[2], (int)objs[3]))).setTier((int)objs[4]));
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] { ammoIn, new OreDictStack((String)objs[1], 1) }, new AnvilOutput(out)).setTier((int)objs[3]));
}
}
}

View File

@ -0,0 +1,759 @@
package com.hbm.items;
import java.util.Set;
import com.google.common.collect.ImmutableSet;
import com.hbm.items.weapon.ItemAmmo.AmmoItemTrait;
import com.hbm.lib.HbmCollection;
public class ItemAmmoEnums {
public enum AmmoLunaticSniper implements IAmmoItemEnum {
SABOT("ammo_luna"),
INCENDIARY("ammo_luna_incendiary"),
EXPLOSIVE("ammo_luna_explosive");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoLunaticSniper(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoFireExt implements IAmmoItemEnum {
WATER("ammo_fireext"),
FOAM("ammo_fireext_foam"),
SAND("ammo_fireext_sand");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoFireExt(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoFlamethrower implements IAmmoItemEnum {
DIESEL("ammo_fuel"),
NAPALM("ammo_fuel_napalm", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_RANGE, AmmoItemTrait.CON_HEAVY_WEAR),
PHOSPHORUS("ammo_fuel_phosphorus", AmmoItemTrait.PRO_PHOSPHORUS_SPLASH, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_RANGE, AmmoItemTrait.PRO_RANGE, AmmoItemTrait.PRO_ACCURATE1, AmmoItemTrait.NEU_WARCRIME1, AmmoItemTrait.CON_SING_PROJECTILE, AmmoItemTrait.CON_HEAVY_WEAR),
VAPORIZER("ammo_fuel_vaporizer", AmmoItemTrait.PRO_PHOSPHORUS, AmmoItemTrait.PRO_FLAMES, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_ERASER, AmmoItemTrait.CON_ACCURACY2, AmmoItemTrait.CON_RANGE2, AmmoItemTrait.CON_HEAVY_WEAR, AmmoItemTrait.CON_LING_FIRE),
CHLORINE("ammo_fuel_gas", AmmoItemTrait.PRO_NO_GRAVITY, AmmoItemTrait.PRO_POISON_GAS, AmmoItemTrait.CON_NO_DAMAGE, AmmoItemTrait.CON_NO_FIRE);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoFlamethrower(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoMisc implements IAmmoItemEnum {
//LUNA_SNIPER("ammo_lunar", Gun50BMGFactory.getLunaticSabotRound(), AmmoItemTrait.PRO_HEAVY_DAMAGE, AmmoItemTrait.PRO_ACCURATE2, AmmoItemTrait.NEU_HEAVY_METAL),
DGK("ammo_dkg");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoMisc(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoStinger implements IAmmoItemEnum {
STOCK("ammo_stinger_rocket"),
HE("ammo_stinger_rocket_he", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.CON_WEAR),
INCENDIARY("ammo_stinger_rocket_incendiary", HbmCollection.IncendiaryType),
NUCLEAR("ammo_stinger_rocket_nuclear", AmmoItemTrait.PRO_NUCLEAR, AmmoItemTrait.CON_SUPER_WEAR),
BONES("ammo_stinger_rocket_bones");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoStinger(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private AmmoStinger(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoRocket implements IAmmoItemEnum {
STOCK("ammo_rocket"),
HE("ammo_rocket_he", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.CON_WEAR),
INCENDIARY("ammo_rocket_incendiary", HbmCollection.IncendiaryType),
EMP("ammo_rocket_emp", AmmoItemTrait.PRO_EMP, AmmoItemTrait.CON_RADIUS),
SLEEK("ammo_rocket_sleek", AmmoItemTrait.PRO_RADIUS_HIGH, AmmoItemTrait.PRO_NO_GRAVITY, AmmoItemTrait.CON_SPEED),
SHRAPNEL("ammo_rocket_shrapnel", AmmoItemTrait.PRO_SHRAPNEL),
GLARE("ammo_rocket_glare", AmmoItemTrait.PRO_SPEED, AmmoItemTrait.PRO_INCENDIARY, AmmoItemTrait.CON_WEAR),
NUCLEAR("ammo_rocket_nuclear", AmmoItemTrait.PRO_NUCLEAR, AmmoItemTrait.CON_SUPER_WEAR, AmmoItemTrait.CON_SPEED),
CHLORINE("ammo_rocket_toxic", AmmoItemTrait.PRO_CHLORINE, AmmoItemTrait.CON_NO_EXPLODE1, AmmoItemTrait.CON_SPEED),
RPC("ammo_rocket_rpc", AmmoItemTrait.PRO_CHAINSAW, AmmoItemTrait.PRO_PENETRATION, AmmoItemTrait.PRO_NO_GRAVITY, AmmoItemTrait.CON_WEAR, AmmoItemTrait.CON_NO_EXPLODE1, AmmoItemTrait.NEU_UHH ),
PHOSPHORUS("ammo_rocket_phosphorus", HbmCollection.PhosphorusTypeSpecial),
CANISTER("ammo_rocket_canister"),
DIGAMMA("ammo_rocket_digamma");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoRocket(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private AmmoRocket(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoGrenade implements IAmmoItemEnum {
STOCK("ammo_grenade"),
HE("ammo_grenade_he", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.CON_WEAR),
INCENDIARY("ammo_grenade_incendiary", AmmoItemTrait.PRO_INCENDIARY, AmmoItemTrait.CON_WEAR),
PHOSPHORUS("ammo_grenade_phosphorus", AmmoItemTrait.PRO_PHOSPHORUS_SPLASH, AmmoItemTrait.NEU_WARCRIME1, AmmoItemTrait.CON_WEAR),
CHLORINE("ammo_grenade_toxic", AmmoItemTrait.PRO_CHLORINE, AmmoItemTrait.CON_NO_EXPLODE1),
SLEEK("ammo_grenade_sleek", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.NEU_JOLT),
CONCUSSION("ammo_grenade_concussion", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.CON_NO_EXPLODE2),
FINNED("ammo_grenade_finned", AmmoItemTrait.PRO_GRAVITY, AmmoItemTrait.CON_RADIUS),
NUCLEAR("ammo_grenade_nuclear", AmmoItemTrait.PRO_NUCLEAR, AmmoItemTrait.PRO_RANGE, AmmoItemTrait.CON_HEAVY_WEAR),
TRACER("ammo_grenade_tracer", AmmoItemTrait.NEU_BLANK),
KAMPF("ammo_grenade_kampf", AmmoItemTrait.PRO_ROCKET_PROPELLED, AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.PRO_ACCURATE1, AmmoItemTrait.CON_WEAR);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoGrenade(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoFatman implements IAmmoItemEnum {
STOCK("ammo_nuke"),
LOW("ammo_nuke_low", AmmoItemTrait.CON_RADIUS),
HIGH("ammo_nuke_high", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.PRO_FALLOUT),
TOTS("ammo_nuke_tots", AmmoItemTrait.PRO_BOMB_COUNT, AmmoItemTrait.NEU_FUN, AmmoItemTrait.CON_ACCURACY2, AmmoItemTrait.CON_RADIUS, AmmoItemTrait.CON_NO_MIRV),
SAFE("ammo_nuke_safe", AmmoItemTrait.CON_RADIUS, AmmoItemTrait.CON_NO_EXPLODE2),
PUMPKIN("ammo_nuke_pumpkin", AmmoItemTrait.CON_NN),
MIRV("ammo_mirv"),
MIRV_LOW("ammo_mirv_low", AmmoItemTrait.CON_RADIUS),
MIRV_HIGH("ammo_mirv_high", AmmoItemTrait.PRO_RADIUS, AmmoItemTrait.PRO_FALLOUT),
MIRV_SAFE("ammo_mirv_safe", AmmoItemTrait.CON_RADIUS, AmmoItemTrait.CON_NO_EXPLODE2),
MIRV_SPECIAL("ammo_mirv_special"),
BALEFIRE("gun_bf_ammo"),
BARREL("ammo_nuke_barrel");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoFatman(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum AmmoDart implements IAmmoItemEnum {
GPS("ammo_dart"),
NUCLEAR("ammo_dart_nuclear"),
NERF("ammo_dart_nerf");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private AmmoDart(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo240Shell implements IAmmoItemEnum {
STOCK("ammo_shell"),
EXPLOSIVE("ammo_shell_explosive"),
APFSDS_T("ammo_shell_apfsds_t"),
APFSDS_DU("ammo_shell_apfsds_du"),
W9("ammo_shell_w9");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo240Shell(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo9mm implements IAmmoItemEnum {
STOCK("ammo_9mm"),
AP("ammo_9mm_ap", HbmCollection.APType),
DU("ammo_9mm_du", HbmCollection.DUType),
CHLOROPHYTE("ammo_9mm_chlorophyte", HbmCollection.ChlorophyteType),
ROCKET("ammo_9mm_rocket", AmmoItemTrait.PRO_ROCKET, AmmoItemTrait.NEU_UHH);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo9mm(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo9mm(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo762NATO implements IAmmoItemEnum {
STOCK("ammo_762"),
AP("ammo_762_ap", HbmCollection.APType),
DU("ammo_762_du", HbmCollection.DUType),
TRACER("ammo_762_tracer", AmmoItemTrait.NEU_TRACER),
PHOSPHORUS("ammo_762_phosphorus", HbmCollection.PhosphorusType),
BLANK("ammo_762_k", AmmoItemTrait.NEU_BLANK);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo762NATO(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo762NATO(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo75Bolt implements IAmmoItemEnum {
STOCK("ammo_75bolt"),
INCENDIARY("ammo_75bolt_incendiary"),
HE("ammo_75bolt_he");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo75Bolt(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo5mm implements IAmmoItemEnum {
STOCK("ammo_5mm"),
EXPLOSIVE("ammo_5mm_explosive", HbmCollection.ExplosiveType),
DU("ammo_5mm_du", HbmCollection.DUType),
STAR("ammo_5mm_star", HbmCollection.StarmetalType),
CHLOROPHYTE("ammo_5mm_chlorophyte", HbmCollection.ChlorophyteType);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo5mm(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo5mm(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo556mm implements IAmmoItemEnum {
STOCK("ammo_556"),
GOLD("gun_pm_ammo"),
PHOSPHORUS("ammo_556_phosphorus", HbmCollection.PhosphorusType),
AP("ammo_556_ap", HbmCollection.APType),
DU("ammo_556_du", HbmCollection.DUType),
STAR("ammo_556_star", HbmCollection.StarmetalType),
CHLOROPHYTE("ammo_556_chlorophyte", HbmCollection.ChlorophyteType),
SLEEK("ammo_556_sleek", AmmoItemTrait.NEU_MASKMAN_METEORITE),
TRACER("ammo_556_tracer", AmmoItemTrait.NEU_TRACER),
FLECHETTE("ammo_556_flechette", HbmCollection.FlechetteType),
FLECHETTE_INCENDIARY("ammo_556_flechette_incendiary", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_INCENDIARY, AmmoItemTrait.NEU_LESS_BOUNCY, AmmoItemTrait.CON_WEAR, AmmoItemTrait.CON_PENETRATION),
FLECHETTE_PHOSPHORUS("ammo_556_flechette_phosphorus", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_PHOSPHORUS, AmmoItemTrait.NEU_WARCRIME2, AmmoItemTrait.NEU_LESS_BOUNCY, AmmoItemTrait.CON_WEAR, AmmoItemTrait.CON_PENETRATION),
FLECHETTE_DU("ammo_556_flechette_du", AmmoItemTrait.PRO_HEAVY_DAMAGE, AmmoItemTrait.PRO_PENETRATION, AmmoItemTrait.NEU_HEAVY_METAL, AmmoItemTrait.NEU_LESS_BOUNCY, AmmoItemTrait.CON_HEAVY_WEAR),
FLECHETTE_CHLOROPHYTE("ammo_556_flechette_chlorophyte", HbmCollection.ChlorophyteType),
FLECHETTE_SLEEK("ammo_556_flechette_sleek", AmmoItemTrait.NEU_MASKMAN_METEORITE),
K("ammo_556_k", AmmoItemTrait.NEU_BLANK);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo556mm(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo556mm(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo50BMG implements IAmmoItemEnum {
STOCK("ammo_50bmg"),
INCENDIARY("ammo_50bmg_incendiary", HbmCollection.IncendiaryType),
PHOSPHORUS("ammo_50bmg_phosphorus", HbmCollection.PhosphorusType),
EXPLOSIVE("ammo_50bmg_explosive", HbmCollection.ExplosiveType),
AP("ammo_50bmg_ap", HbmCollection.APType),
DU("ammo_50bmg_du", HbmCollection.DUType),
STAR("ammo_50bmg_star", HbmCollection.StarmetalType),
CHLOROPHYTE("ammo_50bmg_chlorophyte", HbmCollection.ChlorophyteType),
SLEEK("ammo_50bmg_sleek", AmmoItemTrait.NEU_MASKMAN_METEORITE),
FLECHETTE("ammo_50bmg_flechette", AmmoItemTrait.PRO_DAMAGE),
FLECHETTE_AM("ammo_50bmg_flechette_am", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_UHH),
FLECHETTE_PO("ammo_50bmg_flechette_po", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_UHH);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo50BMG(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo50BMG(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo50AE implements IAmmoItemEnum {
STOCK("ammo_50ae"),
AP("ammo_50ae_ap", HbmCollection.APType),
DU("ammo_50ae_du", HbmCollection.DUType),
STAR("ammo_50ae_star", HbmCollection.StarmetalType),
CHLOROPHYTE("ammo_50ae_chlorophyte", HbmCollection.ChlorophyteType);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo50AE(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo50AE(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo4Gauge implements IAmmoItemEnum {
STOCK("ammo_4gauge"),
SLUG("ammo_4gauge_slug", AmmoItemTrait.PRO_ACCURATE2, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_WEAR, AmmoItemTrait.CON_SING_PROJECTILE),
FLECHETTE("ammo_4gauge_flechette", HbmCollection.FlechetteType),
FLECHETTE_PHOSPHORUS("ammo_4gauge_flechette_phosphorus", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_PHOSPHORUS, AmmoItemTrait.NEU_WARCRIME2, AmmoItemTrait.NEU_LESS_BOUNCY, AmmoItemTrait.CON_WEAR),
EXPLOSIVE("ammo_4gauge_explosive", AmmoItemTrait.PRO_EXPLOSIVE, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_40MM, AmmoItemTrait.CON_HEAVY_WEAR, AmmoItemTrait.CON_SING_PROJECTILE),
MINING("ammo_4gauge_semtex", AmmoItemTrait.PRO_EXPLOSIVE, AmmoItemTrait.PRO_MINING, AmmoItemTrait.CON_NO_EXPLODE3, AmmoItemTrait.CON_HEAVY_WEAR, AmmoItemTrait.CON_SING_PROJECTILE),
BALEFIRE("ammo_4gauge_balefire", AmmoItemTrait.PRO_EXPLOSIVE, AmmoItemTrait.PRO_BALEFIRE, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.CON_HEAVY_WEAR, AmmoItemTrait.CON_SING_PROJECTILE),
KAMPF("ammo_4gauge_kampf", AmmoItemTrait.PRO_EXPLOSIVE, AmmoItemTrait.PRO_ROCKET_PROPELLED, AmmoItemTrait.PRO_ACCURATE1, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.CON_WEAR, AmmoItemTrait.CON_SING_PROJECTILE),
CANISTER("ammo_4gauge_canister"),
SLEEK("ammo_4gauge_sleek", AmmoItemTrait.NEU_MASKMAN_FLECHETTE),
CLAW("ammo_4gauge_claw"),
VAMPIRE("ammo_4gauge_vampire"),
VOID("ammo_4gauge_void"),
QUACK("ammo_4gauge_titan", AmmoItemTrait.PRO_MARAUDER, AmmoItemTrait.NEU_NO_CON);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo4Gauge(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo4Gauge(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo45ACP implements IAmmoItemEnum {
STOCK("ammo_45"),
AP("ammo_45_ap", HbmCollection.APType),
DU("ammo_45_du", HbmCollection.DUType);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo45ACP(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo45ACP(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo44Magnum implements IAmmoItemEnum {
STOCK("ammo_44"),
AP("ammo_44_ap", HbmCollection.APType),
DU("ammo_44_du", HbmCollection.DUType),
PHOSPHORUS("ammo_44_phosphorus", HbmCollection.PhosphorusType),
STAR("ammo_44_star", HbmCollection.StarmetalType),
CHLOROPHYTE("ammo_44_chlorophyte", HbmCollection.ChlorophyteType),
PIP("ammo_44_pip", AmmoItemTrait.NEU_BOXCAR, AmmoItemTrait.CON_DAMAGE),
BJ("ammo_44_bj", AmmoItemTrait.NEU_BOAT, AmmoItemTrait.CON_DAMAGE),
SILVER("ammo_44_silver", AmmoItemTrait.NEU_BUILDING, AmmoItemTrait.CON_DAMAGE),
ROCKET("ammo_44_rocket", AmmoItemTrait.PRO_ROCKET, AmmoItemTrait.NEU_UHH);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo44Magnum(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo44Magnum(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo357Magnum implements IAmmoItemEnum {
IRON("gun_revolver_iron_ammo"),
LEAD("gun_revolver_ammo"),
NUCLEAR("gun_revolver_lead_ammo"),
GOLD("gun_revolver_gold_ammo"),
DESH("ammo_357_desh", AmmoItemTrait.PRO_FIT_357, AmmoItemTrait.PRO_DAMAGE_SLIGHT),
SCHRABIDIUM("gun_revolver_schrabidium_ammo"),
STEEL("gun_revolver_cursed_ammo"),
NIGHTMARE1("gun_revolver_nightmare_ammo"),
NIGHTMARE2("gun_revolver_nightmare2_ammo");
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo357Magnum(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo22LR implements IAmmoItemEnum {
STOCK("ammo_22lr"),
AP("ammo_22lr_ap", HbmCollection.APType),
CHLOROPHYTE("ammo_22lr_chlorophyte", HbmCollection.ChlorophyteType);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo22LR(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo22LR(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo20Gauge implements IAmmoItemEnum {
STOCK("ammo_20gauge"),
SLUG("ammo_20gauge_slug", AmmoItemTrait.PRO_ACCURATE2, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_WEAR, AmmoItemTrait.CON_SING_PROJECTILE),
FLECHETTE("ammo_20gauge_flechette", HbmCollection.FlechetteType),
INCENDIARY("ammo_20gauge_incendiary", AmmoItemTrait.PRO_INCENDIARY, AmmoItemTrait.CON_WEAR),
SHRAPNEL("ammo_20gauge_shrapnel", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_MORE_BOUNCY, AmmoItemTrait.CON_WEAR),
EXPLOSIVE("ammo_20gauge_explosive", HbmCollection.ExplosiveType),
CAUSTIC("ammo_20gauge_caustic", AmmoItemTrait.PRO_TOXIC, AmmoItemTrait.PRO_CAUSTIC, AmmoItemTrait.NEU_NO_BOUNCE, AmmoItemTrait.CON_HEAVY_WEAR),
SHOCK("ammo_20gauge_shock", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_STUNNING, AmmoItemTrait.PRO_EMP, AmmoItemTrait.NEU_NO_BOUNCE, AmmoItemTrait.CON_HEAVY_WEAR),
WITHER("ammo_20gauge_wither", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_WITHERING),
SLEEK("ammo_20gauge_sleek", AmmoItemTrait.NEU_MASKMAN_FLECHETTE);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo20Gauge(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
private Ammo20Gauge(String unloc, Set<AmmoItemTrait> traits) {
this.traits = traits;
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public enum Ammo12Gauge implements IAmmoItemEnum {
STOCK("ammo_12gauge"),
INCENDIARY("ammo_12gauge_incendiary", AmmoItemTrait.PRO_INCENDIARY, AmmoItemTrait.CON_WEAR),
SHRAPNEL("ammo_12gauge_shrapnel", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_MORE_BOUNCY, AmmoItemTrait.CON_WEAR),
DU("ammo_12gauge_du", AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_PENETRATION, AmmoItemTrait.NEU_HEAVY_METAL, AmmoItemTrait.CON_HEAVY_WEAR),
MARAUDER("ammo_12gauge_marauder", AmmoItemTrait.PRO_MARAUDER, AmmoItemTrait.NEU_NO_CON),
SLEEK("ammo_12gauge_sleek", AmmoItemTrait.NEU_MASKMAN_FLECHETTE),
PERCUSSION("ammo_12gauge_percussion", AmmoItemTrait.PRO_PERCUSSION, AmmoItemTrait.CON_NO_PROJECTILE);
private final Set<AmmoItemTrait> traits;
private final String unloc;
private Ammo12Gauge(String unloc, AmmoItemTrait... traits) {
this.traits = safeAssign(traits);
this.unloc = unloc;
}
@Override
public Set<AmmoItemTrait> getTraits() {
return traits;
}
@Override
public String getInternalName() {
return unloc;
}
}
public interface IAmmoItemEnum {
public Set<AmmoItemTrait> getTraits();
public String getInternalName();
}
static Set<AmmoItemTrait> safeAssign(AmmoItemTrait[] traits) {
return traits == null ? ImmutableSet.of() : ImmutableSet.copyOf(traits);
}
}

View File

@ -3,9 +3,8 @@ package com.hbm.items;
import java.util.List;
import java.util.Random;
import com.hbm.config.GeneralConfig;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.util.ArmorUtil;
import com.hbm.util.I18nUtil;
import cpw.mods.fml.relauncher.Side;
@ -74,30 +73,32 @@ public class ItemCustomLore extends Item {
static int setSize = 0;
@Override
public EnumRarity getRarity(ItemStack p_77613_1_) {
return this.rarity != null ? rarity : super.getRarity(p_77613_1_);
}
@Override
public EnumRarity getRarity(ItemStack stack) {
return this.rarity != null ? rarity : super.getRarity(stack);
}
@Override
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack p_77636_1_)
{
if(this == ModItems.rune_isa ||
this == ModItems.rune_dagaz ||
this == ModItems.rune_hagalaz ||
this == ModItems.rune_jera ||
this == ModItems.rune_thurisaz ||
this == ModItems.egg_balefire_shard ||
this == ModItems.egg_balefire) {
return true;
}
public boolean hasEffect(ItemStack p_77636_1_) {
if(this == ModItems.rune_isa || this == ModItems.rune_dagaz ||
this == ModItems.rune_hagalaz || this == ModItems.rune_jera ||
this == ModItems.rune_thurisaz || this == ModItems.egg_balefire_shard ||
this == ModItems.egg_balefire) {
return true;
}
return false;
}
return false;
}
public ItemCustomLore setRarity(EnumRarity rarity) {
this.rarity = rarity;
public ItemCustomLore setRarity(EnumRarity rarity) {
this.rarity = rarity;
return this;
}
}
@Override
public Item setUnlocalizedName(String uloc) {
setTextureName(RefStrings.MODID + ':' + uloc);
return super.setUnlocalizedName(uloc);
}
}

View File

@ -71,9 +71,7 @@ public class ItemEnumMulti extends Item {
}
}
/*
* Returns null when the wrong enum is passed. Only really used for recipes anyway so it's good.
*/
/** Returns null when the wrong enum is passed. Only really used for recipes anyway so it's good. */
public ItemStack stackFromEnum(int count, Enum num) {
if(num.getClass() != this.theEnum)

View File

@ -0,0 +1,41 @@
package com.hbm.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class ItemRemap extends Item {
Item remapItem;
int remapMeta;
public ItemRemap(Item item, int meta) {
this.remapItem = item;
this.remapMeta = meta;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int meta) {
return this.remapItem.getIconFromDamage(this.remapMeta);
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean held) {
if(!(entity instanceof EntityPlayer)) return;
EntityPlayer player = (EntityPlayer) entity;
player.inventory.setInventorySlotContents(slot, new ItemStack(this.remapItem, stack.stackSize, this.remapMeta));
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int pass) {
return 0xFF8080;
}
}

View File

@ -9,6 +9,7 @@ import com.hbm.handler.WeaponAbility;
import com.hbm.handler.guncfg.*;
import com.hbm.interfaces.ICustomWarhead.SaltedFuel.HalfLifeType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ItemAmmoEnums.*;
import com.hbm.items.ItemEnums.*;
import com.hbm.items.armor.*;
import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart;
@ -602,11 +603,14 @@ public class ModItems {
public static Item assembly_nopip;
public static Item assembly_smg;
public static Item assembly_556;
public static Item assembly_762;
public static Item assembly_45;
public static Item assembly_uzi;
public static Item assembly_actionexpress;
public static Item assembly_calamity;
public static Item assembly_lacunae;
public static Item assembly_nuke;
public static Item assembly_luna;
public static Item folly_shell;
public static Item folly_bullet;
@ -874,6 +878,7 @@ public class ModItems {
public static Item particle_lutece;
public static Item pellet_antimatter;
public static Item singularity_micro;
public static Item singularity;
public static Item singularity_counter_resonant;
public static Item singularity_super_heated;
@ -1472,7 +1477,34 @@ public class ModItems {
public static Item sat_coord;
public static Item sat_designator;
public static Item ammo_12gauge;
public static ItemEnumMulti ammo_misc;
public static ItemEnumMulti ammo_12gauge;
public static ItemEnumMulti ammo_20gauge;
public static ItemEnumMulti ammo_4gauge;
public static ItemEnumMulti ammo_357;
public static ItemEnumMulti ammo_44;
public static ItemEnumMulti ammo_5mm;
public static ItemEnumMulti ammo_9mm;
public static ItemEnumMulti ammo_45;
public static ItemEnumMulti ammo_556;
public static ItemEnumMulti ammo_762;
public static ItemEnumMulti ammo_22lr;
public static ItemEnumMulti ammo_50ae;
public static ItemEnumMulti ammo_50bmg;
public static ItemEnumMulti ammo_75bolt;
public static ItemEnumMulti ammo_rocket;
public static ItemEnumMulti ammo_grenade;
public static ItemEnumMulti ammo_shell;
public static ItemEnumMulti ammo_nuke;
public static ItemEnumMulti ammo_fuel;
public static ItemEnumMulti ammo_fireext;
public static ItemEnumMulti ammo_dart;
public static ItemEnumMulti ammo_stinger_rocket;
public static ItemEnumMulti ammo_luna_sniper;
public static Item ammo_cell;
/*public static Item ammo_12gauge;
public static Item ammo_12gauge_incendiary;
public static Item ammo_12gauge_shrapnel;
public static Item ammo_12gauge_du;
@ -1561,11 +1593,11 @@ public class ModItems {
public static Item ammo_50bmg_sleek;
public static Item ammo_75bolt;
public static Item ammo_75bolt_incendiary;
public static Item ammo_75bolt_he;
public static Item ammo_75bolt_he;*/
public static Item ammo_folly;
public static Item ammo_folly_nuclear;
public static Item ammo_folly_du;
public static Item ammo_rocket;
/*public static Item ammo_rocket;
public static Item ammo_rocket_he;
public static Item ammo_rocket_incendiary;
public static Item ammo_rocket_phosphorus;
@ -1593,11 +1625,11 @@ public class ModItems {
public static Item ammo_shell_explosive;
public static Item ammo_shell_apfsds_t;
public static Item ammo_shell_apfsds_du;
public static Item ammo_shell_w9;
public static Item ammo_shell_w9;*/
public static Item ammo_dgk;
public static Item ammo_arty;
public static Item ammo_himars;
public static Item ammo_nuke;
/*public static Item ammo_nuke;
public static Item ammo_nuke_low;
public static Item ammo_nuke_high;
public static Item ammo_nuke_tots;
@ -1625,7 +1657,7 @@ public class ModItems {
public static Item ammo_stinger_rocket_he;
public static Item ammo_stinger_rocket_incendiary;
public static Item ammo_stinger_rocket_nuclear;
public static Item ammo_stinger_rocket_bones;
public static Item ammo_stinger_rocket_bones;*/
public static Item gun_rpg;
//public static Item gun_rpg_ammo;
@ -1638,21 +1670,21 @@ public class ModItems {
//public static Item gun_stinger_ammo;
public static Item gun_revolver;
public static Item gun_revolver_saturnite;
public static Item gun_revolver_ammo;
//public static Item gun_revolver_ammo;
public static Item gun_revolver_iron;
public static Item gun_revolver_iron_ammo;
//public static Item gun_revolver_iron_ammo;
public static Item gun_revolver_gold;
public static Item gun_revolver_gold_ammo;
//public static Item gun_revolver_gold_ammo;
public static Item gun_revolver_lead;
public static Item gun_revolver_lead_ammo;
//public static Item gun_revolver_lead_ammo;
public static Item gun_revolver_schrabidium;
public static Item gun_revolver_schrabidium_ammo;
//public static Item gun_revolver_schrabidium_ammo;
public static Item gun_revolver_cursed;
public static Item gun_revolver_cursed_ammo;
//public static Item gun_revolver_cursed_ammo;
public static Item gun_revolver_nightmare;
public static Item gun_revolver_nightmare_ammo;
//public static Item gun_revolver_nightmare_ammo;
public static Item gun_revolver_nightmare2;
public static Item gun_revolver_nightmare2_ammo;
//public static Item gun_revolver_nightmare2_ammo;
public static Item gun_revolver_pip;
//public static Item gun_revolver_pip_ammo;
public static Item gun_revolver_nopip;
@ -1720,7 +1752,6 @@ public class ModItems {
public static Item gun_mp;
public static Item gun_bolter;
public static Item gun_bolter_digamma;
public static Item gun_brimstone;
public static Item gun_zomg;
public static Item gun_super_shotgun;
public static Item gun_moist_nugget;
@ -1748,6 +1779,11 @@ public class ModItems {
public static Item gun_detonator;
public static Item gun_glass_cannon;
// We'll figure this part out later
//public static Item gun_llr, gun_mlr, gun_hlr, gun_twr, gun_lunatic, gun_lunatic_shotty, gun_lunatic_marksman;
//public static Item gun_uac_pistol, gun_uac_dmr, gun_uac_carbine, gun_uac_lmg;
//public static Item gun_m2, gun_benelli, gun_benelli_mod, gun_g36, spear_bishamonten, pagoda;
public static Item crucible;
public static Item stick_dynamite;
@ -1828,6 +1864,7 @@ public class ModItems {
public static Item peas;
public static Item marshmallow;
public static Item cheese;
public static Item quesadilla;
public static Item med_ipecac;
public static Item med_ptsd;
@ -3231,11 +3268,14 @@ public class ModItems {
assembly_nopip = new Item().setUnlocalizedName("assembly_nopip").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nopip");
assembly_smg = new Item().setUnlocalizedName("assembly_smg").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_smg");
assembly_556 = new Item().setUnlocalizedName("assembly_556").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_556");
assembly_762 = new Item().setUnlocalizedName("assembly_762").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_762");
assembly_45 = new Item().setUnlocalizedName("assembly_45").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_45");
assembly_uzi = new Item().setUnlocalizedName("assembly_uzi").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_uzi");
assembly_actionexpress = new Item().setUnlocalizedName("assembly_actionexpress").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_actionexpress");
assembly_calamity = new Item().setUnlocalizedName("assembly_calamity").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_calamity");
assembly_lacunae = new Item().setUnlocalizedName("assembly_lacunae").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_lacunae");
assembly_nuke = new Item().setUnlocalizedName("assembly_nuke").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nuke");
assembly_luna = new Item().setUnlocalizedName("assembly_luna").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_luna");
folly_shell = new Item().setUnlocalizedName("folly_shell").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":folly_shell");
folly_bullet = new Item().setUnlocalizedName("folly_bullet").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":folly_bullet");
folly_bullet_nuclear = new Item().setUnlocalizedName("folly_bullet_nuclear").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":folly_bullet_nuclear");
@ -3319,6 +3359,7 @@ public class ModItems {
particle_sparkticle = new Item().setUnlocalizedName("particle_sparkticle").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_sparkticle");
particle_digamma = new ItemDigamma(60).setUnlocalizedName("particle_digamma").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_digamma");
particle_lutece = new Item().setUnlocalizedName("particle_lutece").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_lutece");
singularity_micro = new ItemDrop().setUnlocalizedName("singularity_micro").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity_micro");
singularity = new ItemDrop().setUnlocalizedName("singularity").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity");
singularity_counter_resonant = new ItemDrop().setUnlocalizedName("singularity_counter_resonant").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.nuclear_waste).setTextureName(RefStrings.MODID + ":singularity_alt");
@ -3449,7 +3490,7 @@ public class ModItems {
iv_xp_empty = new ItemSimpleConsumable().setUseActionServer((stack, user) -> {
if(user.experienceTotal >= 100) {
ItemSimpleConsumable.giveSoundAndDecrement(stack, user, "hbm:item.syringe", new ItemStack(ModItems.iv_xp));
EnchantmentUtil.setExperience(user, user.experienceTotal - 100);
EnchantmentUtil.setExperience(user, EnchantmentUtil.getTotalExperience(user) - 100);
}
}).setUnlocalizedName("iv_xp_empty").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":iv_xp_empty");
@ -4241,7 +4282,34 @@ public class ModItems {
missile_skin_soviet_stank = new ItemCustomLore().setUnlocalizedName("missile_skin_soviet_stank").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_soviet_stank");
missile_skin_metal = new ItemCustomLore().setUnlocalizedName("missile_skin_metal").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_skin_metal");
ammo_12gauge = new ItemAmmo().setUnlocalizedName("ammo_12gauge");
ammo_12gauge = new ItemAmmo(Ammo12Gauge.class).setUnlocalizedName("ammo_12gauge");
ammo_20gauge = new ItemAmmo(Ammo20Gauge.class).setUnlocalizedName("ammo_20gauge");
ammo_4gauge = new ItemAmmo(Ammo4Gauge.class).setUnlocalizedName("ammo_4gauge");
ammo_5mm = new ItemAmmo(Ammo5mm.class).setUnlocalizedName("ammo_5mm");
ammo_9mm = new ItemAmmo(Ammo9mm.class).setUnlocalizedName("ammo_9mm");
ammo_45 = new ItemAmmo(Ammo45ACP.class).setUnlocalizedName("ammo_45");
ammo_556 = new ItemAmmo(Ammo556mm.class).setUnlocalizedName("ammo_556");
ammo_762 = new ItemAmmo(Ammo762NATO.class).setUnlocalizedName("ammo_762");
ammo_50ae = new ItemAmmo(Ammo50AE.class).setUnlocalizedName("ammo_50ae");
ammo_50bmg = new ItemAmmo(Ammo50BMG.class).setUnlocalizedName("ammo_50bmg");
ammo_75bolt = new ItemAmmo(Ammo75Bolt.class).setUnlocalizedName("ammo_75bolt");
ammo_357 = new ItemAmmo(Ammo357Magnum.class).setUnlocalizedName("ammo_357");
ammo_44 = new ItemAmmo(Ammo44Magnum.class).setUnlocalizedName("ammo_44");
ammo_22lr = new ItemAmmo(Ammo22LR.class).setUnlocalizedName("ammo_22lr");
ammo_rocket = new ItemAmmo(AmmoRocket.class).setUnlocalizedName("ammo_rocket");
ammo_grenade = new ItemAmmo(AmmoGrenade.class).setUnlocalizedName("ammo_grenade");
ammo_shell = new ItemAmmo(Ammo240Shell.class).setUnlocalizedName("ammo_shell");
ammo_dgk = new ItemCustomLore().setUnlocalizedName("ammo_dgk").setCreativeTab(MainRegistry.weaponTab);
ammo_nuke = new ItemAmmo(AmmoFatman.class).setUnlocalizedName("ammo_nuke");
ammo_fuel = new ItemAmmo(AmmoFlamethrower.class).setUnlocalizedName("ammo_fuel");
ammo_fireext = new ItemAmmo(AmmoFireExt.class).setUnlocalizedName("ammo_fireext");
ammo_cell = new ItemCustomLore().setCreativeTab(MainRegistry.weaponTab).setUnlocalizedName("ammo_cell").setMaxStackSize(16);
ammo_dart = (ItemEnumMulti) new ItemAmmo(AmmoDart.class).setUnlocalizedName("ammo_dart").setMaxStackSize(16);
ammo_stinger_rocket = new ItemAmmo(AmmoStinger.class).setUnlocalizedName("ammo_stinger_rocket");
ammo_luna_sniper = new ItemAmmo(AmmoLunaticSniper.class).setUnlocalizedName("ammo_luna_sniper");
ammo_misc = new ItemAmmo(AmmoMisc.class).setUnlocalizedName("ammo_misc");
/*ammo_12gauge = new ItemAmmo().setUnlocalizedName("ammo_12gauge");
ammo_12gauge_incendiary = new ItemAmmo().setUnlocalizedName("ammo_12gauge_incendiary");
ammo_12gauge_shrapnel = new ItemAmmo().setUnlocalizedName("ammo_12gauge_shrapnel");
ammo_12gauge_du = new ItemAmmo().setUnlocalizedName("ammo_12gauge_du");
@ -4361,11 +4429,14 @@ public class ModItems {
ammo_shell_explosive = new ItemAmmo().setUnlocalizedName("ammo_shell_explosive");
ammo_shell_apfsds_t = new ItemAmmo().setUnlocalizedName("ammo_shell_apfsds_t");
ammo_shell_apfsds_du = new ItemAmmo().setUnlocalizedName("ammo_shell_apfsds_du");
ammo_shell_w9 = new ItemAmmo().setUnlocalizedName("ammo_shell_w9");
ammo_dgk = new ItemAmmo().setUnlocalizedName("ammo_dgk");
ammo_shell_w9 = new ItemAmmo().setUnlocalizedName("ammo_shell_w9");*/
ammo_folly = new ItemCustomLore().setUnlocalizedName("ammo_folly");
ammo_folly_nuclear = new ItemCustomLore().setUnlocalizedName("ammo_folly_nuclear");
ammo_folly_du = new ItemCustomLore().setUnlocalizedName("ammo_folly_du");
//ammo_dgk = new ItemCustomLore().setUnlocalizedName("ammo_dgk");
ammo_arty = new ItemAmmoArty().setUnlocalizedName("ammo_arty");
ammo_himars = new ItemAmmoHIMARS().setUnlocalizedName("ammo_himars");
ammo_nuke = new ItemAmmo().setUnlocalizedName("ammo_nuke");
/*ammo_nuke = new ItemAmmo().setUnlocalizedName("ammo_nuke");
ammo_nuke_low = new ItemAmmo().setUnlocalizedName("ammo_nuke_low");
ammo_nuke_high = new ItemAmmo().setUnlocalizedName("ammo_nuke_high");
ammo_nuke_tots = new ItemAmmo().setUnlocalizedName("ammo_nuke_tots");
@ -4393,7 +4464,7 @@ public class ModItems {
ammo_stinger_rocket_he = new ItemAmmo().setUnlocalizedName("ammo_stinger_rocket_he");
ammo_stinger_rocket_incendiary = new ItemAmmo().setUnlocalizedName("ammo_stinger_rocket_incendiary");
ammo_stinger_rocket_nuclear = new ItemAmmo().setUnlocalizedName("ammo_stinger_rocket_nuclear");
ammo_stinger_rocket_bones = new ItemAmmo().setUnlocalizedName("ammo_stinger_rocket_bones");
ammo_stinger_rocket_bones = new ItemAmmo().setUnlocalizedName("ammo_stinger_rocket_bones");*/
gun_rpg = new ItemGunBase(GunRocketFactory.getGustavConfig()).setUnlocalizedName("gun_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_rpg");
gun_karl = new ItemGunBase(GunRocketFactory.getKarlConfig()).setUnlocalizedName("gun_karl").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_karl");
@ -4404,22 +4475,22 @@ public class ModItems {
gun_stinger = new ItemGunBase(GunRocketHomingFactory.getStingerConfig()).setUnlocalizedName("gun_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_stinger");
gun_skystinger = new ItemGunBase(GunRocketHomingFactory.getSkyStingerConfig()).setUnlocalizedName("gun_skystinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_skystinger");
//gun_stinger_ammo = new Item().setUnlocalizedName("gun_stinger_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_stinger_ammo");
gun_revolver_ammo = new Item().setUnlocalizedName("gun_revolver_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_ammo");
//gun_revolver_ammo = new Item().setUnlocalizedName("gun_revolver_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_ammo");
gun_revolver = new ItemGunBase(Gun357MagnumFactory.getRevolverConfig()).setUnlocalizedName("gun_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver");
gun_revolver_saturnite = new ItemGunBase(Gun357MagnumFactory.getRevolverSaturniteConfig()).setUnlocalizedName("gun_revolver_saturnite").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_saturnite");
gun_revolver_iron_ammo = new Item().setUnlocalizedName("gun_revolver_iron_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_iron_ammo");
//gun_revolver_iron_ammo = new Item().setUnlocalizedName("gun_revolver_iron_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_iron_ammo");
gun_revolver_iron = new ItemGunBase(Gun357MagnumFactory.getRevolverIronConfig()).setUnlocalizedName("gun_revolver_iron").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_iron");
gun_revolver_gold_ammo = new Item().setUnlocalizedName("gun_revolver_gold_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_gold_ammo");
//gun_revolver_gold_ammo = new Item().setUnlocalizedName("gun_revolver_gold_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_gold_ammo");
gun_revolver_gold = new ItemGunBase(Gun357MagnumFactory.getRevolverGoldConfig()).setUnlocalizedName("gun_revolver_gold").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_gold");
gun_revolver_lead_ammo = new Item().setUnlocalizedName("gun_revolver_lead_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_lead_ammo");
//gun_revolver_lead_ammo = new Item().setUnlocalizedName("gun_revolver_lead_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_lead_ammo");
gun_revolver_lead = new ItemGunBase(Gun357MagnumFactory.getRevolverLeadConfig()).setUnlocalizedName("gun_revolver_lead").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_lead");
gun_revolver_schrabidium_ammo = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("gun_revolver_schrabidium_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_schrabidium_ammo");
//gun_revolver_schrabidium_ammo = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("gun_revolver_schrabidium_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_schrabidium_ammo");
gun_revolver_schrabidium = new ItemGunBase(Gun357MagnumFactory.getRevolverSchrabidiumConfig()).setUnlocalizedName("gun_revolver_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_schrabidium");
gun_revolver_cursed_ammo = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("gun_revolver_cursed_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_cursed_ammo");
//gun_revolver_cursed_ammo = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("gun_revolver_cursed_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_cursed_ammo");
gun_revolver_cursed = new ItemGunBase(Gun357MagnumFactory.getRevolverCursedConfig()).setUnlocalizedName("gun_revolver_cursed").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_cursed");
gun_revolver_nightmare_ammo = new ItemCustomLore().setUnlocalizedName("gun_revolver_nightmare_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare_ammo");
//gun_revolver_nightmare_ammo = new ItemCustomLore().setUnlocalizedName("gun_revolver_nightmare_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare_ammo");
gun_revolver_nightmare = new ItemGunBase(Gun357MagnumFactory.getRevolverNightmareConfig()).setUnlocalizedName("gun_revolver_nightmare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare");
gun_revolver_nightmare2_ammo = new ItemCustomLore().setUnlocalizedName("gun_revolver_nightmare2_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare2_ammo");
//gun_revolver_nightmare2_ammo = new ItemCustomLore().setUnlocalizedName("gun_revolver_nightmare2_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare2_ammo");
gun_revolver_nightmare2 = new ItemGunBase(Gun357MagnumFactory.getRevolverNightmare2Config()).setUnlocalizedName("gun_revolver_nightmare2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_nightmare2");
//gun_revolver_pip_ammo = new ItemCustomLore().setUnlocalizedName("gun_revolver_pip_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_revolver_pip_ammo");
gun_revolver_pip = new ItemGunBase(Gun44MagnumFactory.getMacintoshConfig()).setUnlocalizedName("gun_revolver_pip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_pip");
@ -4429,7 +4500,7 @@ public class ModItems {
gun_revolver_silver = new ItemGunBase(Gun44MagnumFactory.getSilverConfig()).setUnlocalizedName("gun_revolver_silver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_silver");
gun_revolver_red = new ItemGunBase(Gun44MagnumFactory.getRedConfig()).setUnlocalizedName("gun_revolver_red").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_red");
gun_deagle = new ItemGunBase(Gun50AEFactory.getDeagleConfig()).setUnlocalizedName("gun_deagle").setFull3D().setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_deagle");
gun_bio_revolver = new ItemGunBio(Gun357MagnumFactory.getRevolverBioConfig()).setUnlocalizedName("gun_bio_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bio_revolver");
gun_bio_revolver = new ItemGunBio(Gun45ACPFactory.getRevolverBioConfig()).setUnlocalizedName("gun_bio_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bio_revolver");
gun_flechette = new ItemGunBase(Gun556mmFactory.getSPIWConfig(), Gun556mmFactory.getGLauncherConfig()).setUnlocalizedName("gun_flechette").setFull3D().setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_flechette");
gun_ar15 = new ItemGunBase(Gun50BMGFactory.getAR15Config()).setUnlocalizedName("gun_ar15").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_ar15");
//gun_calamity_ammo = new ItemCustomLore().setUnlocalizedName("gun_calamity_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_calamity_ammo");
@ -4450,7 +4521,7 @@ public class ModItems {
gun_chemthrower = new ItemGunChemthrower().setUnlocalizedName("gun_chemthrower").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fatman");
//gun_mp40_ammo = new Item().setUnlocalizedName("gun_mp40_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_mp40_ammo");
gun_mp40 = new ItemGunBase(Gun9mmFactory.getMP40Config()).setUnlocalizedName("gun_mp40").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_mp40");
gun_thompson = new ItemGunBase(Gun9mmFactory.getThompsonConfig()).setUnlocalizedName("gun_thompson").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_thompson");
gun_thompson = new ItemGunBase(Gun45ACPFactory.getThompsonConfig()).setUnlocalizedName("gun_thompson").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_thompson");
//gun_uzi_ammo = new Item().setUnlocalizedName("gun_uzi_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_uzi_ammo");
gun_uzi = new ItemGunBase(Gun22LRFactory.getUziConfig()).setUnlocalizedName("gun_uzi").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi");
gun_uzi_silencer = new ItemGunBase(Gun22LRFactory.getUziConfig().silenced()).setUnlocalizedName("gun_uzi_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_silencer");
@ -4485,11 +4556,10 @@ public class ModItems {
gun_cryolator_ammo = new Item().setUnlocalizedName("gun_cryolator_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryolator_ammo");
gun_cryolator = new GunCryolator().setUnlocalizedName("gun_cryolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_cryolator");
gun_fireext = new ItemGunBase(GunEnergyFactory.getExtConfig()).setUnlocalizedName("gun_fireext").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_fireext");
ammo_566_gold = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("gun_mp_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_pm_ammo");
//ammo_566_gold = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("gun_mp_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_pm_ammo");
gun_mp = new ItemGunBase(Gun556mmFactory.getEuphieConfig()).setUnlocalizedName("gun_mp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_pm");
gun_bolter = new ItemGunBase(Gun75BoltFactory.getBolterConfig()).setUnlocalizedName("gun_bolter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolter");
gun_bolter_digamma = new ItemGunBase(Gun75BoltFactory.getBolterConfig()).setUnlocalizedName("gun_bolter_digamma").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_bolter_digamma");
gun_brimstone = new GunBrimstone().setUnlocalizedName("gun_brimstone").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_brimstone");
gun_zomg = new ItemGunBase(GunEnergyFactory.getZOMGConfig()).setUnlocalizedName("gun_zomg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_zomg");
gun_revolver_inverted = new GunSuicide().setUnlocalizedName("gun_revolver_inverted").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_revolver_inverted");
gun_emp_ammo = new Item().setUnlocalizedName("gun_emp_ammo").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_emp_ammo");
@ -4602,6 +4672,7 @@ public class ModItems {
peas = new ItemPeas().setUnlocalizedName("peas").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":peas");
marshmallow = new ItemMarshmallow().setUnlocalizedName("marshmallow").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":marshmallow");
cheese = new ItemLemon(5, 10, false).setUnlocalizedName("cheese").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":cheese");
quesadilla = new ItemLemon(8, 10, false).setUnlocalizedName("cheese_quesadilla").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":quesadilla");
mucho_mango = new ItemMuchoMango(10).setUnlocalizedName("mucho_mango").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":mucho_mango");
defuser = new ItemTooling(ToolType.DEFUSER, 100).setUnlocalizedName("defuser").setMaxStackSize(1).setFull3D().setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":defuser");
@ -4809,39 +4880,39 @@ public class ModItems {
loot_15 = new ItemLootCrate().setUnlocalizedName("loot_15").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":loot_15");
loot_misc = new ItemLootCrate().setUnlocalizedName("loot_misc").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":loot_misc");
clip_revolver_iron = new ItemClip().setUnlocalizedName("clip_revolver_iron").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_iron");
clip_revolver = new ItemClip().setUnlocalizedName("clip_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver");
clip_revolver_gold = new ItemClip().setUnlocalizedName("clip_revolver_gold").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_gold");
clip_revolver_lead = new ItemClip().setUnlocalizedName("clip_revolver_lead").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_lead");
clip_revolver_schrabidium = new ItemClip().setUnlocalizedName("clip_revolver_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_schrabidium");
clip_revolver_cursed = new ItemClip().setUnlocalizedName("clip_revolver_cursed").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_cursed");
clip_revolver_nightmare = new ItemClip().setUnlocalizedName("clip_revolver_nightmare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_nightmare");
clip_revolver_nightmare2 = new ItemClip().setUnlocalizedName("clip_revolver_nightmare2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_nightmare2");
clip_revolver_pip = new ItemClip().setUnlocalizedName("clip_revolver_pip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_pip");
clip_revolver_nopip = new ItemClip().setUnlocalizedName("clip_revolver_nopip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_nopip");
clip_rpg = new ItemClip().setUnlocalizedName("clip_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_rpg_alt");
clip_stinger = new ItemClip().setUnlocalizedName("clip_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_stinger");
clip_fatman = new ItemClip().setUnlocalizedName("clip_fatman").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_fatman");
clip_mirv = new ItemClip().setUnlocalizedName("clip_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_mirv");
clip_bf = new ItemClip().setUnlocalizedName("clip_bf").setCreativeTab(null).setTextureName(RefStrings.MODID + ":clip_bf");
clip_mp40 = new ItemClip().setUnlocalizedName("clip_mp40").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_mp40");
clip_uzi = new ItemClip().setUnlocalizedName("clip_uzi").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_uzi");
clip_uboinik = new ItemClip().setUnlocalizedName("clip_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_uboinik");
clip_lever_action = new ItemClip().setUnlocalizedName("clip_lever_action").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_lever_action");
clip_bolt_action = new ItemClip().setUnlocalizedName("clip_bolt_action").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_bolt_action");
clip_osipr = new ItemClip().setUnlocalizedName("clip_osipr").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_osipr");
clip_immolator = new ItemClip().setUnlocalizedName("clip_immolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_immolator");
clip_cryolator = new ItemClip().setUnlocalizedName("clip_cryolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_cryolator");
clip_mp = new ItemClip().setUnlocalizedName("clip_mp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_mp");
clip_xvl1456 = new ItemClip().setUnlocalizedName("clip_xvl1456").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_xvl1456");
clip_emp = new ItemClip().setUnlocalizedName("clip_emp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_emp");
clip_jack = new ItemClip().setUnlocalizedName("clip_jack").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_jack");
clip_spark = new ItemClip().setUnlocalizedName("clip_spark").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_spark");
clip_hp = new ItemClip().setUnlocalizedName("clip_hp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_hp");
clip_euthanasia = new ItemClip().setUnlocalizedName("clip_euthanasia").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_euthanasia");
clip_defabricator = new ItemClip().setUnlocalizedName("clip_defabricator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_defabricator");
clip_revolver_iron = new ItemClip(ammo_357.stackFromEnum(20, Ammo357Magnum.IRON)).setUnlocalizedName("clip_revolver_iron").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_iron");
clip_revolver = new ItemClip(ammo_357.stackFromEnum(12, Ammo357Magnum.LEAD)).setUnlocalizedName("clip_revolver").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver");
clip_revolver_gold = new ItemClip(ammo_357.stackFromEnum(6, Ammo357Magnum.GOLD)).setUnlocalizedName("clip_revolver_gold").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_gold");
clip_revolver_lead = new ItemClip(ammo_357.stackFromEnum(6, Ammo357Magnum.NUCLEAR)).setUnlocalizedName("clip_revolver_lead").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_lead");
clip_revolver_schrabidium = new ItemClip(ammo_357.stackFromEnum(2, Ammo357Magnum.SCHRABIDIUM)).setUnlocalizedName("clip_revolver_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_schrabidium");
clip_revolver_cursed = new ItemClip(ammo_357.stackFromEnum(17, Ammo357Magnum.STEEL)).setUnlocalizedName("clip_revolver_cursed").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_cursed");
clip_revolver_nightmare = new ItemClip(ammo_357.stackFromEnum(6, Ammo357Magnum.NIGHTMARE1)).setUnlocalizedName("clip_revolver_nightmare").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_nightmare");
clip_revolver_nightmare2 = new ItemClip(ammo_357.stackFromEnum(6, Ammo357Magnum.NIGHTMARE2)).setUnlocalizedName("clip_revolver_nightmare2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_nightmare2");
clip_revolver_pip = new ItemClip(ammo_44.stackFromEnum(6, Ammo44Magnum.PIP)).setUnlocalizedName("clip_revolver_pip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_pip");
clip_revolver_nopip = new ItemClip(ammo_44.stackFromEnum(6, Ammo44Magnum.STOCK)).setUnlocalizedName("clip_revolver_nopip").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_revolver_nopip");
clip_rpg = new ItemClip(ammo_rocket.stackFromEnum(4, AmmoRocket.STOCK)).setUnlocalizedName("clip_rpg").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_rpg_alt");
clip_stinger = new ItemClip(ammo_stinger_rocket.stackFromEnum(4, AmmoStinger.STOCK)).setUnlocalizedName("clip_stinger").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_stinger");
clip_fatman = new ItemClip(ammo_nuke.stackFromEnum(6, AmmoFatman.STOCK)).setUnlocalizedName("clip_fatman").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_fatman");
clip_mirv = new ItemClip(ammo_nuke.stackFromEnum(3, AmmoFatman.MIRV)).setUnlocalizedName("clip_mirv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_mirv");
clip_bf = new ItemClip(ammo_nuke.stackFromEnum(2, AmmoFatman.BALEFIRE)).setUnlocalizedName("clip_bf").setCreativeTab(null).setTextureName(RefStrings.MODID + ":clip_bf");
clip_mp40 = new ItemClip(ammo_9mm.stackFromEnum(32, Ammo9mm.STOCK)).setUnlocalizedName("clip_mp40").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_mp40");
clip_uzi = new ItemClip(ammo_22lr.stackFromEnum(32, Ammo22LR.STOCK)).setUnlocalizedName("clip_uzi").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_uzi");
clip_uboinik = new ItemClip(ammo_12gauge.stackFromEnum(12, Ammo12Gauge.STOCK)).setUnlocalizedName("clip_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_uboinik");
clip_lever_action = new ItemClip(ammo_20gauge.stackFromEnum(12, Ammo20Gauge.STOCK)).setUnlocalizedName("clip_lever_action").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_lever_action");
clip_bolt_action = new ItemClip(ammo_20gauge.stackFromEnum(12, Ammo20Gauge.SLUG)).setUnlocalizedName("clip_bolt_action").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_bolt_action");
clip_osipr = new ItemClip(new ItemStack(gun_osipr_ammo, 3)).setUnlocalizedName("clip_osipr").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_osipr");
clip_immolator = new ItemClip(new ItemStack(gun_immolator_ammo, 60)).setUnlocalizedName("clip_immolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_immolator");
clip_cryolator = new ItemClip(new ItemStack(gun_cryolator_ammo, 60)).setUnlocalizedName("clip_cryolator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_cryolator");
clip_mp = new ItemClip(ammo_556.stackFromEnum(2, Ammo556mm.GOLD)).setUnlocalizedName("clip_mp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_mp");
clip_xvl1456 = new ItemClip(new ItemStack(gun_xvl1456_ammo, 50)).setUnlocalizedName("clip_xvl1456").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_xvl1456");
clip_emp = new ItemClip(new ItemStack(gun_emp_ammo, 12)).setUnlocalizedName("clip_emp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_emp");
clip_jack = new ItemClip(new ItemStack(gun_jack_ammo, 12)).setUnlocalizedName("clip_jack").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_jack");
clip_spark = new ItemClip(new ItemStack(gun_spark_ammo, 12)).setUnlocalizedName("clip_spark").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_spark");
clip_hp = new ItemClip(new ItemStack(gun_hp_ammo, 24)).setUnlocalizedName("clip_hp").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_hp");
clip_euthanasia = new ItemClip(new ItemStack(gun_euthanasia_ammo, 32)).setUnlocalizedName("clip_euthanasia").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_euthanasia");
clip_defabricator = new ItemClip(new ItemStack(gun_defabricator_ammo, 50)).setUnlocalizedName("clip_defabricator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":clip_defabricator");
ammo_container = new ItemClip().setUnlocalizedName("ammo_container").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_container");
ammo_container = new ItemAmmoContainer().setUnlocalizedName("ammo_container").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":ammo_container");
ingot_euphemium = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("ingot_euphemium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_euphemium");
nugget_euphemium = new ItemCustomLore().setRarity(EnumRarity.epic).setUnlocalizedName("nugget_euphemium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_euphemium");
@ -6435,11 +6506,14 @@ public class ModItems {
GameRegistry.registerItem(assembly_nopip, assembly_nopip.getUnlocalizedName());
GameRegistry.registerItem(assembly_smg, assembly_smg.getUnlocalizedName());
GameRegistry.registerItem(assembly_556, assembly_556.getUnlocalizedName());
GameRegistry.registerItem(assembly_762, assembly_762.getUnlocalizedName());
GameRegistry.registerItem(assembly_45, assembly_45.getUnlocalizedName());
GameRegistry.registerItem(assembly_uzi, assembly_uzi.getUnlocalizedName());
GameRegistry.registerItem(assembly_lacunae, assembly_lacunae.getUnlocalizedName());
GameRegistry.registerItem(assembly_actionexpress, assembly_actionexpress.getUnlocalizedName());
GameRegistry.registerItem(assembly_calamity, assembly_calamity.getUnlocalizedName());
GameRegistry.registerItem(assembly_nuke, assembly_nuke.getUnlocalizedName());
GameRegistry.registerItem(assembly_luna, assembly_luna.getUnlocalizedName());
//Folly Parts
GameRegistry.registerItem(folly_shell, folly_shell.getUnlocalizedName());
@ -6533,7 +6607,8 @@ public class ModItems {
GameRegistry.registerItem(particle_digamma, particle_digamma.getUnlocalizedName());
GameRegistry.registerItem(particle_lutece, particle_lutece.getUnlocalizedName());
//OMG how the hell is that even possible!?
//Singularities, black holes and other cosmic horrors
GameRegistry.registerItem(singularity_micro, singularity_micro.getUnlocalizedName());
GameRegistry.registerItem(singularity, singularity.getUnlocalizedName());
GameRegistry.registerItem(singularity_counter_resonant, singularity_counter_resonant.getUnlocalizedName());
GameRegistry.registerItem(singularity_super_heated, singularity_super_heated.getUnlocalizedName());
@ -7286,7 +7361,6 @@ public class ModItems {
GameRegistry.registerItem(gun_mp, gun_mp.getUnlocalizedName());
GameRegistry.registerItem(gun_bolter, gun_bolter.getUnlocalizedName());
GameRegistry.registerItem(gun_bolter_digamma, gun_bolter_digamma.getUnlocalizedName());
GameRegistry.registerItem(gun_brimstone, gun_brimstone.getUnlocalizedName());
GameRegistry.registerItem(gun_zomg, gun_zomg.getUnlocalizedName());
GameRegistry.registerItem(gun_emp, gun_emp.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_inverted, gun_revolver_inverted.getUnlocalizedName());
@ -7308,7 +7382,7 @@ public class ModItems {
GameRegistry.registerItem(gun_glass_cannon, gun_glass_cannon.getUnlocalizedName());
//Ammo
GameRegistry.registerItem(gun_revolver_iron_ammo, gun_revolver_iron_ammo.getUnlocalizedName());
/*GameRegistry.registerItem(gun_revolver_iron_ammo, gun_revolver_iron_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_ammo, gun_revolver_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_gold_ammo, gun_revolver_gold_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_lead_ammo, gun_revolver_lead_ammo.getUnlocalizedName());
@ -7316,7 +7390,7 @@ public class ModItems {
GameRegistry.registerItem(gun_revolver_cursed_ammo, gun_revolver_cursed_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_nightmare_ammo, gun_revolver_nightmare_ammo.getUnlocalizedName());
GameRegistry.registerItem(ammo_357_desh, ammo_357_desh.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_nightmare2_ammo, gun_revolver_nightmare2_ammo.getUnlocalizedName());
GameRegistry.registerItem(gun_revolver_nightmare2_ammo, gun_revolver_nightmare2_ammo.getUnlocalizedName());*/
//GameRegistry.registerItem(gun_revolver_pip_ammo, gun_revolver_pip_ammo.getUnlocalizedName());
//GameRegistry.registerItem(gun_revolver_nopip_ammo, gun_revolver_nopip_ammo.getUnlocalizedName());
//GameRegistry.registerItem(gun_calamity_ammo, gun_calamity_ammo.getUnlocalizedName());
@ -7345,6 +7419,31 @@ public class ModItems {
GameRegistry.registerItem(gun_euthanasia_ammo, gun_euthanasia_ammo.getUnlocalizedName());
GameRegistry.registerItem(ammo_12gauge, ammo_12gauge.getUnlocalizedName());
GameRegistry.registerItem(ammo_20gauge, ammo_20gauge.getUnlocalizedName());
GameRegistry.registerItem(ammo_4gauge, ammo_4gauge.getUnlocalizedName());
GameRegistry.registerItem(ammo_357, ammo_357.getUnlocalizedName());
GameRegistry.registerItem(ammo_44, ammo_44.getUnlocalizedName());
GameRegistry.registerItem(ammo_45, ammo_45.getUnlocalizedName());
GameRegistry.registerItem(ammo_5mm, ammo_5mm.getUnlocalizedName());
GameRegistry.registerItem(ammo_9mm, ammo_9mm.getUnlocalizedName());
GameRegistry.registerItem(ammo_556, ammo_556.getUnlocalizedName());
GameRegistry.registerItem(ammo_762, ammo_762.getUnlocalizedName());
GameRegistry.registerItem(ammo_22lr, ammo_22lr.getUnlocalizedName());
GameRegistry.registerItem(ammo_50ae, ammo_50ae.getUnlocalizedName());
GameRegistry.registerItem(ammo_50bmg, ammo_50bmg.getUnlocalizedName());
GameRegistry.registerItem(ammo_75bolt, ammo_75bolt.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke, ammo_nuke.getUnlocalizedName());
GameRegistry.registerItem(ammo_fuel, ammo_fuel.getUnlocalizedName());
GameRegistry.registerItem(ammo_fireext, ammo_fireext.getUnlocalizedName());
GameRegistry.registerItem(ammo_cell, ammo_cell.getUnlocalizedName());
GameRegistry.registerItem(ammo_dart, ammo_dart.getUnlocalizedName());
GameRegistry.registerItem(ammo_rocket, ammo_rocket.getUnlocalizedName());
GameRegistry.registerItem(ammo_stinger_rocket, ammo_stinger_rocket.getUnlocalizedName());
GameRegistry.registerItem(ammo_luna_sniper, ammo_luna_sniper.getUnlocalizedName());
GameRegistry.registerItem(ammo_grenade, ammo_grenade.getUnlocalizedName());
GameRegistry.registerItem(ammo_shell, ammo_shell.getUnlocalizedName());
/*GameRegistry.registerItem(ammo_12gauge, ammo_12gauge.getUnlocalizedName());
GameRegistry.registerItem(ammo_12gauge_incendiary, ammo_12gauge_incendiary.getUnlocalizedName());
GameRegistry.registerItem(ammo_12gauge_shrapnel, ammo_12gauge_shrapnel.getUnlocalizedName());
GameRegistry.registerItem(ammo_12gauge_du, ammo_12gauge_du.getUnlocalizedName());
@ -7478,11 +7577,11 @@ public class ModItems {
GameRegistry.registerItem(ammo_shell_explosive, ammo_shell_explosive.getUnlocalizedName());
GameRegistry.registerItem(ammo_shell_apfsds_t, ammo_shell_apfsds_t.getUnlocalizedName());
GameRegistry.registerItem(ammo_shell_apfsds_du, ammo_shell_apfsds_du.getUnlocalizedName());
GameRegistry.registerItem(ammo_shell_w9, ammo_shell_w9.getUnlocalizedName());
GameRegistry.registerItem(ammo_shell_w9, ammo_shell_w9.getUnlocalizedName());*/
GameRegistry.registerItem(ammo_dgk, ammo_dgk.getUnlocalizedName());
GameRegistry.registerItem(ammo_arty, ammo_arty.getUnlocalizedName());
GameRegistry.registerItem(ammo_himars, ammo_himars.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke, ammo_nuke.getUnlocalizedName());
/*GameRegistry.registerItem(ammo_nuke, ammo_nuke.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke_low, ammo_nuke_low.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke_high, ammo_nuke_high.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke_tots, ammo_nuke_tots.getUnlocalizedName());
@ -7493,7 +7592,7 @@ public class ModItems {
GameRegistry.registerItem(ammo_mirv_low, ammo_mirv_low.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv_high, ammo_mirv_high.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv_safe, ammo_mirv_safe.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv_special, ammo_mirv_special.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv_special, ammo_mirv_special.getUnlocalizedName());*/
GameRegistry.registerItem(ammo_folly, ammo_folly.getUnlocalizedName());
GameRegistry.registerItem(ammo_folly_nuclear, ammo_folly_nuclear.getUnlocalizedName());
GameRegistry.registerItem(ammo_folly_du, ammo_folly_du.getUnlocalizedName());
@ -7765,6 +7864,7 @@ public class ModItems {
GameRegistry.registerItem(peas, peas.getUnlocalizedName());
GameRegistry.registerItem(marshmallow, marshmallow.getUnlocalizedName());
GameRegistry.registerItem(cheese, cheese.getUnlocalizedName());
GameRegistry.registerItem(quesadilla, quesadilla.getUnlocalizedName());
GameRegistry.registerItem(med_ipecac, med_ipecac.getUnlocalizedName());
GameRegistry.registerItem(med_ptsd, med_ptsd.getUnlocalizedName());
GameRegistry.registerItem(canteen_13, canteen_13.getUnlocalizedName());
@ -8329,5 +8429,151 @@ public class ModItems {
GameRegistry.registerItem(digamma_up_on_top, digamma_up_on_top.getUnlocalizedName());
GameRegistry.registerItem(mysteryshovel, mysteryshovel.getUnlocalizedName());
GameRegistry.registerItem(memory, memory.getUnlocalizedName());
addRemap("ammo_nuke_tots", 5594, ammo_nuke, AmmoFatman.TOTS);
addRemap("ammo_12gauge_incendiary", 5455, ammo_12gauge, Ammo12Gauge.INCENDIARY);
addRemap("ammo_12gauge_shrapnel", 5456, ammo_12gauge, Ammo12Gauge.SHRAPNEL);
addRemap("ammo_stinger_rocket_bones", 5572, ammo_stinger_rocket, AmmoStinger.BONES);
addRemap("ammo_556_flechette_phosphorus", 5515, ammo_556, Ammo556mm.FLECHETTE_PHOSPHORUS);
addRemap("ammo_50ae_chlorophyte", 5527, ammo_50ae, Ammo50AE.CHLOROPHYTE);
addRemap("gun_revolver_nightmare2_ammo", 5440, ammo_357, Ammo357Magnum.NIGHTMARE2);
addRemap("gun_revolver_iron_ammo", 5432, ammo_357, Ammo357Magnum.IRON);
addRemap("ammo_50bmg_star", 5534, ammo_50bmg, Ammo50BMG.STAR);
addRemap("ammo_556_star", 5509, ammo_556, Ammo556mm.STAR);
addRemap("ammo_556_flechette", 5513, ammo_556, Ammo556mm.FLECHETTE);
addRemap("ammo_12gauge_du", 5457, ammo_12gauge, Ammo12Gauge.DU);
addRemap("ammo_shell_apfsds_t", 5586, ammo_shell, Ammo240Shell.APFSDS_T);
addRemap("ammo_4gauge_void", 5481, ammo_4gauge, Ammo4Gauge.VOID);
addRemap("ammo_shell_apfsds_du", 5587, ammo_shell, Ammo240Shell.APFSDS_DU);
addRemap("ammo_fireext_foam", 5549, ammo_fireext, AmmoFireExt.FOAM);
addRemap("ammo_556_flechette_chlorophyte", 5517, ammo_556, Ammo556mm.FLECHETTE_CHLOROPHYTE);
addRemap("ammo_fuel_vaporizer", 5546, ammo_fuel, AmmoFlamethrower.VAPORIZER);
addRemap("ammo_4gauge_titan", 5482, ammo_4gauge, Ammo4Gauge.QUACK);
addRemap("ammo_556_phosphorus", 5506, ammo_556, Ammo556mm.PHOSPHORUS);
addRemap("ammo_4gauge_flechette_phosphorus", 5473, ammo_4gauge, Ammo4Gauge.FLECHETTE_PHOSPHORUS);
addRemap("ammo_shell_w9", 5588, ammo_shell, Ammo240Shell.W9);
addRemap("gun_revolver_gold_ammo", 5434, ammo_357, Ammo357Magnum.GOLD);
addRemap("ammo_556_flechette_du", 5516, ammo_556, Ammo556mm.FLECHETTE_DU);
addRemap("ammo_20gauge_incendiary", 5463, ammo_20gauge, Ammo20Gauge.INCENDIARY);
addRemap("ammo_shell_explosive", 5585, ammo_shell, Ammo240Shell.EXPLOSIVE);
addRemap("ammo_20gauge_explosive", 5465, ammo_20gauge, Ammo20Gauge.EXPLOSIVE);
addRemap("ammo_556_k", 5519, ammo_556, Ammo556mm.K);
addRemap("ammo_44_phosphorus", 5487, ammo_44, Ammo44Magnum.PHOSPHORUS);
addRemap("gun_revolver_cursed_ammo", 5437, ammo_357, Ammo357Magnum.STEEL);
addRemap("ammo_556_flechette_incendiary", 5514, ammo_556, Ammo556mm.FLECHETTE_INCENDIARY);
addRemap("ammo_75bolt_he", 5542, ammo_75bolt, Ammo75Bolt.HE);
addRemap("ammo_20gauge_flechette", 5462, ammo_20gauge, Ammo20Gauge.FLECHETTE);
addRemap("ammo_rocket_shrapnel", 5559, ammo_rocket, AmmoRocket.SHRAPNEL);
addRemap("ammo_556_chlorophyte", 5510, ammo_556, Ammo556mm.CHLOROPHYTE);
addRemap("ammo_12gauge_marauder", 5459, ammo_12gauge, Ammo12Gauge.MARAUDER);
addRemap("ammo_50bmg_chlorophyte", 5535, ammo_50bmg, Ammo50BMG.CHLOROPHYTE);
addRemap("ammo_rocket_emp", 5560, ammo_rocket, AmmoRocket.EMP);
addRemap("ammo_4gauge_vampire", 5480, ammo_4gauge, Ammo4Gauge.VAMPIRE);
addRemap("ammo_5mm_du", 5496, ammo_5mm, Ammo5mm.DU);
addRemap("ammo_9mm_rocket", 5503, ammo_9mm, Ammo9mm.ROCKET);
addRemap("gun_revolver_ammo", 5433, ammo_357, Ammo357Magnum.LEAD);
addRemap("ammo_grenade_sleek", 5580, ammo_grenade, AmmoGrenade.SLEEK);
addRemap("ammo_4gauge_slug", 5471, ammo_4gauge, Ammo4Gauge.SLUG);
addRemap("ammo_4gauge_kampf", 5477, ammo_4gauge, Ammo4Gauge.KAMPF);
addRemap("ammo_20gauge_shrapnel", 5464, ammo_20gauge, Ammo20Gauge.SHRAPNEL);
addRemap("ammo_5mm_explosive", 5495, ammo_5mm, Ammo5mm.EXPLOSIVE);
addRemap("gun_revolver_nightmare_ammo", 5438, ammo_357, Ammo357Magnum.NIGHTMARE1);
addRemap("ammo_stinger_rocket_he", 5569, ammo_stinger_rocket, AmmoStinger.HE);
addRemap("ammo_20gauge_caustic", 5466, ammo_20gauge, Ammo20Gauge.CAUSTIC);
addRemap("ammo_4gauge_semtex", 5475, ammo_4gauge, Ammo4Gauge.MINING);
addRemap("ammo_grenade_kampf", 5583, ammo_grenade, AmmoGrenade.KAMPF);
addRemap("ammo_556_flechette_sleek", 5518, ammo_556, Ammo556mm.FLECHETTE_SLEEK);
addRemap("ammo_mirv_special", 5602, ammo_nuke, AmmoFatman.MIRV_SPECIAL);
addRemap("ammo_50bmg_flechette", 5536, ammo_50bmg, Ammo50BMG.FLECHETTE);
addRemap("ammo_556_sleek", 5511, ammo_556, Ammo556mm.SLEEK);
addRemap("ammo_9mm_chlorophyte", 5502, ammo_9mm, Ammo9mm.CHLOROPHYTE);
addRemap("ammo_nuke_barrel", 5597, ammo_nuke, AmmoFatman.BARREL);
addRemap("ammo_nuke_low", 5592, ammo_nuke, AmmoFatman.LOW);
addRemap("ammo_fireext_sand", 5550, ammo_fireext, AmmoFireExt.SAND);
addRemap("ammo_44_silver", 5492, ammo_44, Ammo44Magnum.SILVER);
addRemap("ammo_grenade_concussion", 5578, ammo_grenade, AmmoGrenade.CONCUSSION);
addRemap("ammo_20gauge_shock", 5467, ammo_20gauge, Ammo20Gauge.SHOCK);
addRemap("ammo_4gauge_flechette", 5472, ammo_4gauge, Ammo4Gauge.FLECHETTE);
addRemap("ammo_rocket_toxic", 5562, ammo_rocket, AmmoRocket.CHLORINE);
addRemap("ammo_50bmg_explosive", 5531, ammo_50bmg, Ammo50BMG.EXPLOSIVE);
addRemap("ammo_grenade_finned", 5579, ammo_grenade, AmmoGrenade.FINNED);
addRemap("ammo_dart_nuclear", 5553, ammo_dart, AmmoDart.NUCLEAR);
addRemap("ammo_grenade_phosphorus", 5576, ammo_grenade, AmmoGrenade.PHOSPHORUS);
addRemap("ammo_5mm_star", 5497, ammo_5mm, Ammo5mm.STAR);
addRemap("ammo_4gauge_sleek", 5483, ammo_4gauge, Ammo4Gauge.SLEEK);
addRemap("ammo_mirv_high", 5600, ammo_nuke, AmmoFatman.MIRV_HIGH);
addRemap("ammo_5mm_chlorophyte", 5498, ammo_5mm, Ammo5mm.CHLOROPHYTE);
addRemap("ammo_50bmg_flechette_po", 5538, ammo_50bmg, Ammo50BMG.FLECHETTE_PO);
addRemap("ammo_50ae_star", 5526, ammo_50ae, Ammo50AE.STAR);
addRemap("ammo_50bmg_flechette_am", 5537, ammo_50bmg, Ammo50BMG.FLECHETTE_AM);
addRemap("ammo_9mm_ap", 5500, ammo_9mm, Ammo9mm.AP);
addRemap("ammo_mirv", 5598, ammo_nuke, AmmoFatman.MIRV);
addRemap("ammo_4gauge_claw", 5479, ammo_4gauge, Ammo4Gauge.CLAW);
addRemap("ammo_rocket_glare", 5561, ammo_rocket, AmmoRocket.GLARE);
addRemap("ammo_stinger_rocket_incendiary", 5570, ammo_stinger_rocket, AmmoStinger.INCENDIARY);
addRemap("ammo_rocket_incendiary", 5557, ammo_rocket, AmmoRocket.INCENDIARY);
addRemap("ammo_50ae_ap", 5524, ammo_50ae, Ammo50AE.AP);
addRemap("ammo_mirv_safe", 5601, ammo_nuke, AmmoFatman.MIRV_SAFE);
addRemap("ammo_4gauge_canister", 5478, ammo_4gauge, Ammo4Gauge.CANISTER);
addRemap("ammo_50ae_du", 5525, ammo_50ae, Ammo50AE.DU);
addRemap("ammo_44_ap", 5485, ammo_44, Ammo44Magnum.AP);
addRemap("ammo_44_bj", 5491, ammo_44, Ammo44Magnum.BJ);
addRemap("ammo_rocket_sleek", 5564, ammo_rocket, AmmoRocket.SLEEK);
addRemap("ammo_nuke_high", 5593, ammo_nuke, AmmoFatman.HIGH);
addRemap("ammo_grenade_incendiary", 5575, ammo_grenade, AmmoGrenade.INCENDIARY);
addRemap("ammo_44_du", 5486, ammo_44, Ammo44Magnum.DU);
addRemap("ammo_50bmg_ap", 5532, ammo_50bmg, Ammo50BMG.AP);
addRemap("ammo_50bmg_du", 5533, ammo_50bmg, Ammo50BMG.DU);
addRemap("ammo_9mm_du", 5501, ammo_9mm, Ammo9mm.DU);
addRemap("ammo_20gauge_slug", 5461, ammo_20gauge, Ammo20Gauge.SLUG);
addRemap("ammo_grenade_tracer", 5582, ammo_grenade, AmmoGrenade.TRACER);
addRemap("ammo_fuel_phosphorus", 5545, ammo_fuel, AmmoFlamethrower.PHOSPHORUS);
addRemap("ammo_44_pip", 5490, ammo_44, Ammo44Magnum.PIP);
addRemap("ammo_grenade_toxic", 5577, ammo_grenade, AmmoGrenade.CHLORINE);
addRemap("ammo_nuke_safe", 5595, ammo_nuke, AmmoFatman.SAFE);
addRemap("gun_mp_ammo", 5505, ammo_556, Ammo556mm.GOLD);
addRemap("gun_revolver_lead_ammo", 5435, ammo_357, Ammo357Magnum.NUCLEAR);
addRemap("ammo_stinger_rocket_nuclear", 5571, ammo_stinger_rocket, AmmoStinger.NUCLEAR);
addRemap("ammo_grenade_nuclear", 5581, ammo_grenade, AmmoGrenade.NUCLEAR);
addRemap("ammo_rocket_digamma", 5567, ammo_rocket, AmmoRocket.DIGAMMA);
addRemap("ammo_rocket_nuclear", 5565, ammo_rocket, AmmoRocket.NUCLEAR);
addRemap("ammo_mirv_low", 5599, ammo_nuke, AmmoFatman.MIRV_LOW);
addRemap("ammo_44_chlorophyte", 5489, ammo_44, Ammo44Magnum.CHLOROPHYTE);
addRemap("ammo_22lr_chlorophyte", 5522, ammo_22lr, Ammo22LR.CHLOROPHYTE);
addRemap("ammo_12gauge_sleek", 5458, ammo_12gauge, Ammo12Gauge.SLEEK);
addRemap("ammo_20gauge_sleek", 5469, ammo_20gauge, Ammo20Gauge.SLEEK);
addRemap("ammo_4gauge_explosive", 5474, ammo_4gauge, Ammo4Gauge.EXPLOSIVE);
addRemap("ammo_50bmg_incendiary", 5529, ammo_50bmg, Ammo50BMG.INCENDIARY);
addRemap("ammo_556_du", 5508, ammo_556, Ammo556mm.DU);
addRemap("ammo_fuel_napalm", 5544, ammo_fuel, AmmoFlamethrower.NAPALM);
addRemap("gun_revolver_schrabidium_ammo", 5436, ammo_357, Ammo357Magnum.SCHRABIDIUM);
addRemap("ammo_556_ap", 5507, ammo_556, Ammo556mm.AP);
addRemap("ammo_20gauge_wither", 5468, ammo_20gauge, Ammo20Gauge.WITHER);
addRemap("ammo_rocket_rpc", 5566, ammo_rocket, AmmoRocket.RPC);
addRemap("ammo_fuel_gas", 5547, ammo_fuel, AmmoFlamethrower.CHLORINE);
addRemap("ammo_22lr_ap", 5521, ammo_22lr, Ammo22LR.AP);
addRemap("ammo_grenade_he", 5574, ammo_grenade, AmmoGrenade.HE);
addRemap("ammo_4gauge_balefire", 5476, ammo_4gauge, Ammo4Gauge.BALEFIRE);
addRemap("ammo_357_desh", 5439, ammo_357, Ammo357Magnum.DESH);
addRemap("ammo_nuke_pumpkin", 5596, ammo_nuke, AmmoFatman.PUMPKIN);
addRemap("ammo_44_star", 5488, ammo_44, Ammo44Magnum.STAR);
addRemap("ammo_50bmg_sleek", 5539, ammo_50bmg, Ammo50BMG.SLEEK);
addRemap("ammo_dart_nerf", 5554, ammo_dart, AmmoDart.NERF);
addRemap("ammo_50bmg_phosphorus", 5530, ammo_50bmg, Ammo50BMG.PHOSPHORUS);
addRemap("ammo_44_rocket", 5493, ammo_44, Ammo44Magnum.ROCKET);
addRemap("ammo_rocket_he", 5556, ammo_rocket, AmmoRocket.HE);
addRemap("ammo_556_tracer", 5512, ammo_556, Ammo556mm.TRACER);
addRemap("ammo_75bolt_incendiary", 5541, ammo_75bolt, Ammo75Bolt.INCENDIARY);
addRemap("ammo_rocket_canister", 5563, ammo_rocket, AmmoRocket.CANISTER);
addRemap("ammo_rocket_phosphorus", 5558, ammo_rocket, AmmoRocket.PHOSPHORUS);
}
public static void addRemap(String unloc, int removoingTheseWouldTakeForever, Item item, Enum sub) {
addRemap(unloc, item, sub.ordinal());
}
public static void addRemap(String unloc, Item item, int meta) {
Item remap = new ItemRemap(item, meta).setUnlocalizedName(unloc).setTextureName(RefStrings.MODID + ":plate_armor_titanium");
GameRegistry.registerItem(remap, remap.getUnlocalizedName());
}
}

View File

@ -220,6 +220,10 @@ public class ItemLemon extends ItemFood {
if(this == ModItems.peas) {
list.add("He accepts your offering.");
}
if(this == ModItems.quesadilla) {
list.add("That's what a 50 year old yeast infection does to you.");
}
}

View File

@ -9,13 +9,13 @@ import com.hbm.items.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.resources.I18n;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
public class ItemFluidIcon extends Item {
@ -71,8 +71,9 @@ public class ItemFluidIcon extends Item {
return stack.getTagCompound().getInteger("fill");
}
@Override
public String getItemStackDisplayName(ItemStack stack) {
String s = (I18n.format(Fluids.fromID(stack.getItemDamage()).getUnlocalizedName())).trim();
String s = (StatCollector.translateToLocal(Fluids.fromID(stack.getItemDamage()).getUnlocalizedName())).trim();
if(s != null) {
return s;
@ -81,27 +82,6 @@ public class ItemFluidIcon extends Item {
return "Unknown";
}
/*
* @Override
*
* @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() {
* return true; }
*
* @Override
*
* @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister
* p_94581_1_) { super.registerIcons(p_94581_1_);
*
* this.overlayIcon =
* p_94581_1_.registerIcon("hbm:fluid_identifier_overlay"); }
*
* @Override
*
* @SideOnly(Side.CLIENT) public IIcon getIconFromDamageForRenderPass(int
* p_77618_1_, int p_77618_2_) { return p_77618_2_ == 1 ? this.overlayIcon :
* super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); }
*/
@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack stack, int p_82790_2_) {

View File

@ -0,0 +1,67 @@
package com.hbm.items.tool;
import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemGunBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemAmmoContainer extends Item {
public static final List<Integer> configBlacklist = new ArrayList();
public ItemAmmoContainer() {
this.setMaxDamage(1);
configBlacklist.add(BulletConfigSyncingUtil.SCHRABIDIUM_REVOLVER);
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
for(ItemStack slot : player.inventory.mainInventory) {
if(slot == null || !(slot.getItem() instanceof ItemGunBase)) continue;
List<GunConfiguration> cfgs = new ArrayList();
ItemGunBase gun = (ItemGunBase) slot.getItem();
if(gun.mainConfig != null) cfgs.add(gun.mainConfig);
if(gun.altConfig != null) cfgs.add(gun.altConfig);
for(GunConfiguration cfg : cfgs) {
if(cfg.config.isEmpty()) continue;
Integer first = cfg.config.get(0);
if(configBlacklist.contains(first)) continue;
BulletConfiguration bullet = BulletConfigSyncingUtil.pullConfig(first);
if(bullet == null) continue;
if(bullet.ammo == null) continue;
ItemStack ammo = bullet.ammo.toStack();
//for belt-fed guns: 64 is main config, 1 if alt config
//for reloaded guns: mag capacity divided by reload amount (equals one stack)
ammo.stackSize = cfg.reloadType == cfg.RELOAD_NONE ? cfg == gun.mainConfig ? 64 : 1 : (int) Math.ceil((double) cfg.ammoCap / (double) bullet.ammoCount);
player.inventory.addItemStackToInventory(ammo);
}
}
stack.stackSize--;
if(stack.stackSize <= 0)
stack.damageItem(5, player);
return stack;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if(this == ModItems.ammo_container) {
list.add("Gives ammo for most held weapons.");
}
}
}

View File

@ -1,281 +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.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 GunBoltAction extends Item {
Random rand = new Random();
public int dmgMin = 16;
public int dmgMax = 28;
public GunBoltAction() {
this.maxStackSize = 1;
if(this == ModItems.gun_bolt_action)
this.setMaxDamage(750);
if(this == ModItems.gun_bolt_action_green)
this.setMaxDamage(500);
if(this == ModItems.gun_bolt_action_saturnite) {
this.setMaxDamage(2500);
dmgMin = 24;
dmgMax = 36;
}
}
/**
* 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_slug)) {
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;
}
EntityBullet entityarrow1;
entityarrow1 = new EntityBullet(p_77615_2_, p_77615_3_, 3.0F, dmgMin, dmgMax, false, false);
entityarrow1.setDamage(dmgMin + rand.nextInt(dmgMax - dmgMin));
if(this == ModItems.gun_bolt_action_saturnite)
entityarrow1.fire = true;
p_77615_1_.damageItem(1, p_77615_3_);
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.revolverShoot", 5.0F, 0.75F);
if (flag) { } else {
p_77615_3_.inventory.consumeInventoryItem(ModItems.ammo_20gauge_slug);
}
if (!p_77615_2_.isRemote) {
p_77615_2_.spawnEntityInWorld(entityarrow1);
}
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;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
if(this == ModItems.gun_bolt_action) {
list.add("-Star in a movie");
list.add("-Have a laugh with a horse");
list.add("-Ride a tipping train");
list.add("-Lose friend to native americans");
}
if(this == ModItems.gun_bolt_action_green) {
list.add("Floppy disks and pink, flashy orbs.");
}
if(this == ModItems.gun_bolt_action_saturnite) {
list.add("Shiny shooter made from D-25A alloy.");
}
list.add("");
list.add("Ammo: 12x74 Slug");
if(this == ModItems.gun_bolt_action_saturnite) {
list.add("Damage: 24 - 36");
list.add("Sets enemy on fire.");
} else {
list.add("Damage: 16 - 28");
}
}
@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 getLevRotationFromAnim(ItemStack stack) {
float rad = 0.0174533F;
rad *= 10F;
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.1F;
if(i > 9 && i < 15)
return (10 * 0.1F) - ((i - 5) * 0.1F);
return 0;
}
@Override
public EnumRarity getRarity(ItemStack p_77613_1_) {
if(this == ModItems.gun_bolt_action_saturnite)
return EnumRarity.rare;
return EnumRarity.uncommon;
}
}

View File

@ -1,90 +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.EntityLaser;
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 GunBrimstone extends Item {
Random rand = new Random();
public GunBrimstone() {
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.ammo_566_gold)) && count % 1 == 0) {
EntityLaser laser = new EntityLaser(world, player);
//world.playSoundAtEntity(player, "hbm:weapon.rifleShoot", 1.0F, 0.8F + (rand.nextFloat() * 0.4F));
if (!flag) {
player.inventory.consumeInventoryItem(ModItems.gun_dash_ammo);
}
if (!world.isRemote) {
world.spawnEntityInWorld(laser);
}
}
}
@Override
public int getItemEnchantability() {
return 0;
}
@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", 5, 0));
return multimap;
}
}

View File

@ -1,102 +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 GunMP extends Item {
Random rand = new Random();
public GunMP() {
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.ammo_566_gold)) && count % 3 == 0) {
EntityBullet entityarrow = new EntityBullet(world, player, 3.0F, 100, 150, false, false);
entityarrow.setDamage(100 + rand.nextInt(50));
// 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.ammo_566_gold);
}
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("Isn't that name a little contrary,");
list.add("you can't be a pacifist AND");
list.add("shoot people. Logic errors aside,");
list.add("whose blood is that? The former");
list.add("user's? The victim's? Both?");
list.add("");
list.add("Ammo: Small Propellantless Machine Gun Round");
list.add("Damage: 100 - 150");
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", 5, 0));
return multimap;
}
}

View File

@ -1,237 +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.entity.projectile.EntityNightmareBlast;
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.EnumRarity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
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 GunNightmare extends Item {
private int dmgMin;
private int dmgMax;
public Item ammo;
Random rand = new Random();
public GunNightmare() {
this.maxStackSize = 1;
if (this == ModItems.gun_revolver_nightmare) {
this.dmgMin = 1;
this.dmgMax = 100;
this.ammo = ModItems.gun_revolver_nightmare_ammo;
}
if (this == ModItems.gun_revolver_nightmare2) {
this.dmgMin = 25;
this.dmgMax = 150;
this.ammo = ModItems.gun_revolver_nightmare2_ammo;
}
}
@Override
public EnumRarity getRarity(ItemStack p_77613_1_) {
return EnumRarity.uncommon;
}
@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;
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 (this == ModItems.gun_revolver_nightmare) {
EntityBullet entityarrow;
entityarrow = new EntityBullet(p_77615_2_, p_77615_3_, 3.0F, dmgMin, dmgMax, false, false);
entityarrow.setDamage(1 + rand.nextInt(99));
if (!p_77615_2_.isRemote) {
p_77615_2_.spawnEntityInWorld(entityarrow);
}
}
if (this == ModItems.gun_revolver_nightmare2) {
EntityNightmareBlast entityarrow0;
EntityNightmareBlast entityarrow1;
EntityNightmareBlast entityarrow2;
EntityNightmareBlast entityarrow3;
EntityNightmareBlast entityarrow4;
EntityNightmareBlast entityarrow5;
EntityNightmareBlast entityarrow6;
EntityNightmareBlast entityarrow7;
EntityNightmareBlast entityarrow8;
EntityNightmareBlast entityarrow9;
entityarrow0 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow0.setDamage(25 + rand.nextInt(150 - 25));
entityarrow1 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow1.setDamage(25 + rand.nextInt(150 - 25));
entityarrow2 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow2.setDamage(25 + rand.nextInt(150 - 25));
entityarrow3 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow3.setDamage(25 + rand.nextInt(150 - 25));
entityarrow4 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow4.setDamage(25 + rand.nextInt(150 - 25));
entityarrow5 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow5.setDamage(25 + rand.nextInt(150 - 25));
entityarrow6 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow6.setDamage(25 + rand.nextInt(150 - 25));
entityarrow7 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow7.setDamage(25 + rand.nextInt(150 - 25));
entityarrow8 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow8.setDamage(25 + rand.nextInt(150 - 25));
entityarrow9 = new EntityNightmareBlast(p_77615_2_, p_77615_3_, 3.0F);
entityarrow9.setDamage(25 + rand.nextInt(150 - 25));
if (!p_77615_2_.isRemote) {
p_77615_2_.spawnEntityInWorld(entityarrow0);
p_77615_2_.spawnEntityInWorld(entityarrow1);
p_77615_2_.spawnEntityInWorld(entityarrow2);
p_77615_2_.spawnEntityInWorld(entityarrow3);
p_77615_2_.spawnEntityInWorld(entityarrow4);
p_77615_2_.spawnEntityInWorld(entityarrow5);
p_77615_2_.spawnEntityInWorld(entityarrow6);
p_77615_2_.spawnEntityInWorld(entityarrow7);
p_77615_2_.spawnEntityInWorld(entityarrow8);
p_77615_2_.spawnEntityInWorld(entityarrow9);
}
}
p_77615_2_.playSoundAtEntity(p_77615_3_, "hbm:weapon.schrabidiumShoot", 1.0F, 1.0F);
boolean flag = p_77615_3_.capabilities.isCreativeMode
|| EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, p_77615_1_) > 0;
if (!flag)
p_77615_1_.setItemDamage(p_77615_1_.getItemDamage() + 1);
}
@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_.isSneaking()) {
if (p_77659_1_.getItemDamage() < 6) {
p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_));
} else {
if(p_77659_2_.isRemote)
p_77659_3_.addChatMessage(new ChatComponentText("[Nightmare] Out of ammo! Shift right-click to reload!"));
}
} else if(p_77659_1_.getItemDamage() > 0) {
int j = 0;
for(int i = 0; i < 6; i++) {
if(p_77659_1_.getItem() == ModItems.gun_revolver_nightmare && p_77659_3_.inventory.consumeInventoryItem(ModItems.gun_revolver_nightmare_ammo)) {
p_77659_1_.setItemDamage(p_77659_1_.getItemDamage() - 1);
j++;
}
if(p_77659_1_.getItem() == ModItems.gun_revolver_nightmare2 && p_77659_3_.inventory.consumeInventoryItem(ModItems.gun_revolver_nightmare2_ammo)) {
p_77659_1_.setItemDamage(p_77659_1_.getItemDamage() - 1);
j++;
}
if(p_77659_1_.getItemDamage() == 0)
break;
}
if(j > 0) {
if(p_77659_2_.isRemote)
p_77659_3_.addChatMessage(new ChatComponentText("[Nightmare] Reloaded!"));
p_77659_3_.swingItem();
}
}
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) {
if (this == ModItems.gun_revolver_nightmare) {
list.add("Never let a cat doze on your belly when you sleep.");
list.add("");
list.add("Ammo: Nightmare Bullets");
list.add("Damage: 1 - 100");
}
if (this == ModItems.gun_revolver_nightmare2) {
list.add("Ominous references. *shivers*");
list.add("");
list.add("Ammo: Laser Buckshot");
list.add("Damage: 25 - 150");
}
}
@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

@ -40,7 +40,7 @@ public class GunSuicide extends Item {
this.setMaxDamage(500);
}
this.ammo = ModItems.gun_revolver_ammo;
this.ammo = ModItems.ammo_357;
}
/**

View File

@ -1,22 +1,29 @@
package com.hbm.items.weapon;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.Set;
import com.hbm.handler.indexing.AmmoIndex;
import com.hbm.handler.indexing.AmmoIndex.AmmoTrait;
import com.hbm.items.ItemAmmoEnums.AmmoRocket;
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;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
public class ItemAmmo extends Item {
public class ItemAmmo extends ItemEnumMulti {
//TODO: implement all this
public enum AmmoItemTrait {
CON_ACCURACY2,
CON_DAMAGE,
@ -29,6 +36,7 @@ public class ItemAmmo extends Item {
CON_NO_EXPLODE3,
CON_NO_FIRE,
CON_NO_MIRV,
CON_NO_PROJECTILE,
CON_PENETRATION,
CON_RADIUS,
CON_RANGE2,
@ -81,6 +89,7 @@ public class ItemAmmo extends Item {
PRO_NO_GRAVITY,
PRO_NUCLEAR,
PRO_PENETRATION,
PRO_PERCUSSION,
PRO_PHOSPHORUS,
PRO_PHOSPHORUS_SPLASH,
PRO_POISON_GAS,
@ -103,659 +112,68 @@ public class ItemAmmo extends Item {
}
}
private AmmoItemTrait[] traits;
private final String altName;
public ItemAmmo(AmmoItemTrait... traits) {
this.traits = traits;
this.setCreativeTab(MainRegistry.weaponTab);
public ItemAmmo(Class<? extends Enum<?>> clazz) {
this(clazz, "");
}
public ItemAmmo(Class<? extends Enum<?>> clazz, String altName) {
super(clazz, true, true);
setCreativeTab(MainRegistry.weaponTab);
this.altName = altName;
}
@Override
public Item setUnlocalizedName(String unlocalizedName) {
super.setUnlocalizedName(unlocalizedName);
this.setTextureName(RefStrings.MODID + ":"+ unlocalizedName);
return this;
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
super.addInformation(stack, player, list, ext);
if(!altName.isEmpty()) list.add(EnumChatFormatting.ITALIC + I18nUtil.resolveKey(altName));
if(stack.getItem() == ModItems.ammo_rocket && stack.getItemDamage() == AmmoRocket.DIGAMMA.ordinal()) {
list.add(player.worldObj.rand.nextInt(3) < 2 ? EnumChatFormatting.RED + "COVER YOURSELF IN OIL" : EnumChatFormatting.RED + "" + EnumChatFormatting.OBFUSCATED + "COVER YOURSELF IN OIL");
}
IAmmoItemEnum item = (IAmmoItemEnum) EnumUtil.grabEnumSafely(theEnum, stack.getItemDamage());
Set<AmmoItemTrait> ammoTraits = item.getTraits();
if(ammoTraits.size() > 0) {
ArrayList<AmmoItemTrait> sortedTraits = new ArrayList<AmmoItemTrait>(ammoTraits);
sortedTraits.sort(Comparator.reverseOrder());
for(AmmoItemTrait trait : sortedTraits) {
final EnumChatFormatting color;
switch(trait.toString().substring(0, 3)) {
case "PRO": color = EnumChatFormatting.BLUE; break;
case "NEU": color = EnumChatFormatting.YELLOW; break;
case "CON": color = EnumChatFormatting.RED; break;
default: color = EnumChatFormatting.DARK_GRAY; break;
}
list.add(color + I18nUtil.resolveKey(trait.key));
}
}
}
public ItemAmmo index(AmmoTrait... traits) {
AmmoIndex.registerAmmo(this, traits);
return this;
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister reg) {
Enum[] enums = theEnum.getEnumConstants();
this.icons = new IIcon[enums.length];
for(int i = 0; i < icons.length; i++) {
IAmmoItemEnum num = (IAmmoItemEnum) enums[i];
this.icons[i] = reg.registerIcon(RefStrings.MODID + ":" + num.getInternalName());
}
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
//12 GAUGE
if(this == ModItems.ammo_12gauge_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Incendiary");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_12gauge_shrapnel) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* Extra bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_12gauge_du) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Penetrating");
list.add(EnumChatFormatting.YELLOW + "* Heavy Metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_12gauge_marauder) {
list.add(EnumChatFormatting.BLUE + "+ Instantly removes annoying and unbalanced enemies");
list.add(EnumChatFormatting.YELLOW + "* No drawbacks lole");
}
if(this == ModItems.ammo_12gauge_sleek) {
list.add(EnumChatFormatting.YELLOW + "* Fires a tracer which summons a storm of DU-flechettes");
}
//20 GAUGE
if(this == ModItems.ammo_20gauge_flechette) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_20gauge_slug) {
list.add(EnumChatFormatting.BLUE + "+ Near-perfect accuracy");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.RED + "- Single projectile");
}
if(this == ModItems.ammo_20gauge_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Incendiary");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_20gauge_shrapnel) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* Extra bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_20gauge_explosive) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_20gauge_caustic) {
list.add(EnumChatFormatting.BLUE + "+ Toxic");
list.add(EnumChatFormatting.BLUE + "+ Caustic");
list.add(EnumChatFormatting.YELLOW + "* Not bouncy");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_20gauge_shock) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Stunning");
list.add(EnumChatFormatting.BLUE + "+ EMP");
list.add(EnumChatFormatting.YELLOW + "* Not bouncy");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_20gauge_wither) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Withering");
}
if(this == ModItems.ammo_20gauge_sleek) {
list.add(EnumChatFormatting.YELLOW + "* Fires a tracer which summons a storm of DU-flechettes");
}
//23mm
if(this == ModItems.ammo_4gauge_flechette) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_4gauge_flechette_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Induces phosphorus burns");
list.add(EnumChatFormatting.YELLOW + "* Twice the warcrime in a single round!");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_4gauge_slug) {
list.add(EnumChatFormatting.BLUE + "+ Near-perfect accuracy");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.RED + "- Single projectile");
}
if(this == ModItems.ammo_4gauge_explosive) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* It's a 40mm grenade that we squeezed to fit the barrel!");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
list.add(EnumChatFormatting.RED + "- Single projectile");
}
if(this == ModItems.ammo_4gauge_semtex) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Explosion drops all blocks");
list.add(EnumChatFormatting.RED + "- No splash damage");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
list.add(EnumChatFormatting.RED + "- Single projectile");
}
if(this == ModItems.ammo_4gauge_balefire) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Balefire");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
list.add(EnumChatFormatting.RED + "- Single projectile");
}
if(this == ModItems.ammo_4gauge_kampf) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Rocket Propelled");
list.add(EnumChatFormatting.BLUE + "+ Increased accuracy");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Single projectile");
}
if(this == ModItems.ammo_4gauge_sleek) {
list.add(EnumChatFormatting.YELLOW + "* Fires a tracer which summons a storm of DU-flechettes");
}
//.357 MAGNUM
if(this == ModItems.ammo_357_desh) {
list.add(EnumChatFormatting.BLUE + "+ Fits every .357 model");
list.add(EnumChatFormatting.BLUE + "+ Above-average damage");
}
//.44 MAGNUM
if(this == ModItems.ammo_44_ap) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_44_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_44_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Induces phosphorus burns");
list.add(EnumChatFormatting.YELLOW + "* Technically a warcrime");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_44_pip) {
list.add(EnumChatFormatting.BLUE + "+ Boxcar");
list.add(EnumChatFormatting.RED + "- Highly decreased damage");
}
if(this == ModItems.ammo_44_bj) {
list.add(EnumChatFormatting.BLUE + "+ Boat");
list.add(EnumChatFormatting.RED + "- Highly decreased damage");
}
if(this == ModItems.ammo_44_silver) {
list.add(EnumChatFormatting.BLUE + "+ Building");
list.add(EnumChatFormatting.RED + "- Highly decreased damage");
}
if(this == ModItems.ammo_44_rocket) {
list.add(EnumChatFormatting.BLUE + "+ Rocket");
list.add(EnumChatFormatting.YELLOW + "* Uhhhh");
}
if(this == ModItems.ammo_44_star) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_44_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
//5mm
if(this == ModItems.ammo_5mm_explosive) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_5mm_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_5mm_star) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_5mm_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
//9mm
if(this == ModItems.ammo_9mm_ap) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_9mm_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_9mm_rocket) {
list.add(EnumChatFormatting.BLUE + "+ Rocket");
list.add(EnumChatFormatting.YELLOW + "* Uhhhh");
}
if(this == ModItems.ammo_9mm_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
//.22LR
if(this == ModItems.ammo_22lr_ap) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_22lr_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
//.50 BMG
if(this == ModItems.ammo_50bmg) {
list.add(EnumChatFormatting.YELLOW + "12.7mm anti-materiel round");
list.add(EnumChatFormatting.YELLOW + "You shoot down planes with these, using");
list.add(EnumChatFormatting.YELLOW + "them against people would be nasty.");
}
if(this == ModItems.ammo_50bmg_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Incendiary");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_50bmg_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Induces phosphorus burns");
list.add(EnumChatFormatting.YELLOW + "* Technically a warcrime");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_50bmg_explosive) {
list.add(EnumChatFormatting.BLUE + "+ Explosive");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_50bmg_ap) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_50bmg_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_50bmg_star) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_50bmg_sleek) {
list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite");
}
if(this == ModItems.ammo_50bmg_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_50bmg_flechette) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
}
if(this == ModItems.ammo_50bmg_flechette_am) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.GREEN + "+ Highly Radioactive");
list.add(EnumChatFormatting.YELLOW + "* Yes.");
}
if(this == ModItems.ammo_50bmg_flechette_po) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.GREEN + "+ Highly Radioactive");
list.add(EnumChatFormatting.YELLOW + "* Maybe?");
}
//.50 AE
if(this == ModItems.ammo_50ae_ap) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_50ae_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_50ae_star) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_50ae_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
//84mm ROCKETS
if(this == ModItems.ammo_rocket_he) {
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_rocket_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Incendiary explosion");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_rocket_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Phosphorus splash");
list.add(EnumChatFormatting.YELLOW + "* Technically a warcrime");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_rocket_shrapnel) {
list.add(EnumChatFormatting.BLUE + "+ Shrapnel");
}
if(this == ModItems.ammo_rocket_emp) {
list.add(EnumChatFormatting.BLUE + "+ EMP");
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
}
if(this == ModItems.ammo_rocket_glare) {
list.add(EnumChatFormatting.BLUE + "+ Increased projectile speed");
list.add(EnumChatFormatting.BLUE + "+ Incendiary explosion");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_rocket_toxic) {
list.add(EnumChatFormatting.BLUE + "+ Chlorine gas");
list.add(EnumChatFormatting.RED + "- No explosion");
list.add(EnumChatFormatting.RED + "- Decreased projectile speed");
}
if(this == ModItems.ammo_rocket_sleek) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased blast radius");
list.add(EnumChatFormatting.BLUE + "+ Not affected by gravity");
list.add(EnumChatFormatting.YELLOW + "* Jolt");
}
if(this == ModItems.ammo_rocket_nuclear) {
list.add(EnumChatFormatting.BLUE + "+ Nuclear");
list.add(EnumChatFormatting.RED + "- Very highly increased wear");
list.add(EnumChatFormatting.RED + "- Decreased projectile speed");
}
if(this == ModItems.ammo_rocket_rpc) {
list.add(EnumChatFormatting.BLUE + "+ Chainsaw");
list.add(EnumChatFormatting.BLUE + "+ Penetrating");
list.add(EnumChatFormatting.BLUE + "+ Not affected by gravity");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Non-explosive");
list.add(EnumChatFormatting.YELLOW + "* Uhhhh");
}
if(this == ModItems.ammo_rocket_digamma) {
if(new Random().nextInt(3) < 2)
list.add(EnumChatFormatting.RED + "COVER YOURSELF IN OIL");
else
list.add(EnumChatFormatting.RED + "" + EnumChatFormatting.OBFUSCATED + "COVER YOURSELF IN OIL");
}
//40mm GRENADES
if(this == ModItems.ammo_grenade_he) {
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_grenade_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Incendiary explosion");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_grenade_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Phosphorus splash");
list.add(EnumChatFormatting.YELLOW + "* Technically a warcrime");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_grenade_toxic) {
list.add(EnumChatFormatting.BLUE + "+ Chlorine gas");
list.add(EnumChatFormatting.RED + "- No explosion");
}
if(this == ModItems.ammo_grenade_concussion) {
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.RED + "- No block damage");
}
if(this == ModItems.ammo_grenade_finned) {
list.add(EnumChatFormatting.BLUE + "+ Decreased gravity");
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
}
if(this == ModItems.ammo_grenade_sleek) {
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.YELLOW + "* Jolt");
}
if(this == ModItems.ammo_grenade_nuclear) {
list.add(EnumChatFormatting.BLUE + "+ Nuclear");
list.add(EnumChatFormatting.BLUE + "+ Increased range");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_grenade_kampf) {
list.add(EnumChatFormatting.BLUE + "+ Rocket Propelled");
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.BLUE + "+ Increased accuracy");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
//FUEL
if(this == ModItems.ammo_fuel_napalm) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Increased range");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_fuel_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Phosphorus splash");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Increased range");
list.add(EnumChatFormatting.BLUE + "+ Increased accuracy");
list.add(EnumChatFormatting.YELLOW + "* Technically a warcrime");
list.add(EnumChatFormatting.RED + "- Single projectile");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_fuel_vaporizer) {
list.add(EnumChatFormatting.BLUE + "+ Induces phosphorus burns");
list.add(EnumChatFormatting.BLUE + "+ Increased flame count");
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* For removing big mistakes");
list.add(EnumChatFormatting.RED + "- Highly decreased accuracy");
list.add(EnumChatFormatting.RED + "- Highly decreased range");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
list.add(EnumChatFormatting.RED + "- No lingering fire");
}
if(this == ModItems.ammo_fuel_gas) {
list.add(EnumChatFormatting.BLUE + "+ No gravity");
list.add(EnumChatFormatting.BLUE + "+ Poison splash");
list.add(EnumChatFormatting.RED + "- No damage");
list.add(EnumChatFormatting.RED + "- Not incendiary");
}
//FIRE EXT
if(this == ModItems.ammo_fireext_foam) {
list.add(EnumChatFormatting.BLUE + "+ Can put out any fire type");
list.add(EnumChatFormatting.BLUE + "+ Creates protective foam layer");
list.add(EnumChatFormatting.YELLOW + "* Broader spray");
}
if(this == ModItems.ammo_fireext_sand) {
list.add(EnumChatFormatting.BLUE + "+ Creates protective sand layer");
list.add(EnumChatFormatting.YELLOW + "* Very broad spray");
list.add(EnumChatFormatting.RED + "- No extinguishing AoE");
}
//5.56mm
if(this == ModItems.ammo_556_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Induces phosphorus burns");
list.add(EnumChatFormatting.YELLOW + "* Technically a warcrime");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_556_ap) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.RED + "- Increased wear");
}
if(this == ModItems.ammo_556_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_556_star) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.YELLOW + "* Starmetal");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_556_sleek) {
list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite");
}
if(this == ModItems.ammo_556_flechette) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_556_flechette_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Incendiary");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_556_flechette_phosphorus) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Induces phosphorus burns");
list.add(EnumChatFormatting.YELLOW + "* Twice the warcrime in a single round!");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Increased wear");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_556_flechette_du) {
list.add(EnumChatFormatting.BLUE + "+ Highly increased damage");
list.add(EnumChatFormatting.BLUE + "+ Penetrating");
list.add(EnumChatFormatting.YELLOW + "* Heavy metal");
list.add(EnumChatFormatting.YELLOW + "* Less bouncy");
list.add(EnumChatFormatting.RED + "- Highly increased wear");
}
if(this == ModItems.ammo_556_flechette_sleek) {
list.add(EnumChatFormatting.YELLOW + "* Fires a high-damage round that summons a small meteorite");
}
if(this == ModItems.ammo_556_tracer) {
list.add(EnumChatFormatting.YELLOW + "* Tracer");
}
if(this == ModItems.ammo_556_k) {
list.add(EnumChatFormatting.YELLOW + "* It's a blank");
}
if(this == ModItems.ammo_556_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
if(this == ModItems.ammo_556_flechette_chlorophyte) {
list.add(EnumChatFormatting.BLUE + "+ Increased damage");
list.add(EnumChatFormatting.BLUE + "+ Decreased wear");
list.add(EnumChatFormatting.DARK_GREEN + "* Chlorophyte");
list.add(EnumChatFormatting.YELLOW + "* Homing");
list.add(EnumChatFormatting.RED + "- Not penetrating");
}
//BOLTS
if(this == ModItems.ammo_75bolt) {
list.add(EnumChatFormatting.YELLOW + "Gyro-stabilized armor-piercing");
list.add(EnumChatFormatting.YELLOW + "DU round with tandem charge");
}
if(this == ModItems.ammo_75bolt_incendiary) {
list.add(EnumChatFormatting.YELLOW + "Armor-piercing explosive round");
list.add(EnumChatFormatting.YELLOW + "filled with oxy-phosphorous gel");
}
if(this == ModItems.ammo_75bolt_he) {
list.add(EnumChatFormatting.YELLOW + "Armor-piercing penetrator filled");
list.add(EnumChatFormatting.YELLOW + "with a powerful explosive charge");
}
//NUKES
if(this== ModItems.ammo_nuke_low) {
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
}
if(this== ModItems.ammo_nuke_high) {
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.BLUE + "+ Fallout");
}
if(this== ModItems.ammo_nuke_tots) {
list.add(EnumChatFormatting.BLUE + "+ Increased bomb count");
list.add(EnumChatFormatting.YELLOW + "* Fun for the whole family!");
list.add(EnumChatFormatting.RED + "- Highly decreased accuracy");
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
list.add(EnumChatFormatting.RED + "- Not recommended for the Proto MIRV");
}
if(this== ModItems.ammo_nuke_safe) {
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
list.add(EnumChatFormatting.RED + "- No block damage");
}
if(this== ModItems.ammo_nuke_pumpkin) {
list.add(EnumChatFormatting.RED + "- Not even a nuke");
}
//MIRV
if(this== ModItems.ammo_mirv_low) {
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
}
if(this== ModItems.ammo_mirv_high) {
list.add(EnumChatFormatting.BLUE + "+ Increased blast radius");
list.add(EnumChatFormatting.BLUE + "+ Fallout");
}
if(this== ModItems.ammo_mirv_safe) {
list.add(EnumChatFormatting.RED + "- Decreased blast radius");
list.add(EnumChatFormatting.RED + "- No block damage");
}
if(this== ModItems.ammo_mirv_special) {
list.add(EnumChatFormatting.BLUE + "+ 6 Low-yield mini nukes");
list.add(EnumChatFormatting.BLUE + "+ 6 Mini nukes");
list.add(EnumChatFormatting.BLUE + "+ 6 Tiny tots");
list.add(EnumChatFormatting.BLUE + "+ 6 Balefire shells");
list.add(EnumChatFormatting.WHITE + "* Sticky!");
}
//FOLLY
if(this == ModItems.ammo_folly) {
list.add(EnumChatFormatting.BLUE + "+ Focused starmetal reaction blast");
}
if(this == ModItems.ammo_folly_nuclear) {
list.add(EnumChatFormatting.BLUE + "+ Howitzer mini nuke shell");
}
if(this == ModItems.ammo_folly_du) {
list.add(EnumChatFormatting.BLUE + "+ Howitzer 17kg U238 shell");
}
//STINGER
if(this == ModItems.ammo_stinger_rocket) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
}
if(this == ModItems.ammo_stinger_rocket_he) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.BLUE + "+ Increased Blast Radius");
list.add(EnumChatFormatting.RED + "- Increased Wear");
}
if(this == ModItems.ammo_stinger_rocket_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.BLUE + "+ Incendiary explosion");
list.add(EnumChatFormatting.RED + "- Slightly Increased wear");
}
if(this == ModItems.ammo_stinger_rocket_nuclear) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.BLUE + "+ Nuclear");
list.add(EnumChatFormatting.RED + "- Highly Increased wear");
}
if(this == ModItems.ammo_stinger_rocket_bones) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES");
list.add(EnumChatFormatting.YELLOW + "* WELCOME ABOARD MATEYS!");
list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES");
list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES");
list.add(EnumChatFormatting.YELLOW + "* SPIN THE WHEEL FOR THE TREASURE TO TAKE");
}
public String getUnlocalizedName(ItemStack stack) {
IAmmoItemEnum num = EnumUtil.grabEnumSafely(theEnum, stack.getItemDamage());
return "item." + num.getInternalName();
}
@Override
public ItemEnumMulti setUnlocalizedName(String uloc) {
setTextureName(RefStrings.MODID + ':' + uloc);
return (ItemEnumMulti) super.setUnlocalizedName(uloc);
}
}

View File

@ -13,13 +13,15 @@ import com.hbm.explosion.ExplosionNukeSmall;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorCross;
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.particle.SpentCasing.CasingType;
import com.hbm.potion.HbmPotion;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
@ -171,14 +173,16 @@ public class ItemAmmoArty extends Item {
return "item." + itemTypes[Math.abs(stack.getItemDamage()) % itemTypes.length].name;
}
protected static SpentCasing SIXTEEN_INCH_CASE = new SpentCasing(CasingType.STRAIGHT).setScale(15F, 15F, 10F).setupSmoke(1F, 1D, 200, 60).setMaxAge(300);
public abstract class ArtilleryShell {
String name;
public SpentCasing casing;
public ArtilleryShell() { }
public ArtilleryShell(String name) {
public ArtilleryShell(String name, int casingColor) {
this.name = name;
this.casing = SIXTEEN_INCH_CASE.clone().register(name).setColor(casingColor);
}
public abstract void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop);
@ -193,7 +197,7 @@ public class ItemAmmoArty extends Item {
xnt.setBlockAllocator(new BlockAllocatorStandard(48));
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
}
xnt.setEntityProcessor(new EntityProcessorStandard().withRangeMod(rangeMod));
xnt.setEntityProcessor(new EntityProcessorCross(7.5D).withRangeMod(rangeMod));
xnt.setPlayerProcessor(new PlayerProcessorStandard());
xnt.setSFX(new ExplosionEffectStandard());
xnt.explode();
@ -231,12 +235,12 @@ public class ItemAmmoArty extends Item {
private void init() {
/* STANDARD SHELLS */
this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); }};
this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); }};
this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); }};
this.itemTypes[NORMAL] = new ArtilleryShell("ammo_arty", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 10F, 3F, false); }};
this.itemTypes[CLASSIC] = new ArtilleryShell("ammo_arty_classic", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 5F, false); }};
this.itemTypes[EXPLOSIVE] = new ArtilleryShell("ammo_arty_he", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { standardExplosion(shell, mop, 15F, 3F, true); }};
/* MINI NUKE */
this.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke") {
this.itemTypes[MINI_NUKE] = new ArtilleryShell("ammo_arty_mini_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) {
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
shell.killAndClear();
Vec3 vec = Vec3.createVectorHelper(shell.motionX, shell.motionY, shell.motionZ).normalize();
@ -245,7 +249,7 @@ public class ItemAmmoArty extends Item {
};
/* FULL NUKE */
this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke") {
this.itemTypes[NUKE] = new ArtilleryShell("ammo_arty_nuke", SpentCasing.COLOR_CASE_16INCH_NUKE) {
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
shell.worldObj.spawnEntityInWorld(EntityNukeExplosionMK5.statFac(shell.worldObj, BombConfig.missileRadius, mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord));
EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(shell.worldObj, 1000, BombConfig.missileRadius * 0.005F);
@ -258,7 +262,7 @@ public class ItemAmmoArty extends Item {
};
/* PHOSPHORUS */
this.itemTypes[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus") {
this.itemTypes[PHOSPHORUS] = new ArtilleryShell("ammo_arty_phosphorus", SpentCasing.COLOR_CASE_16INCH_PHOS) {
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
standardExplosion(shell, mop, 10F, 3F, false);
shell.worldObj.playSoundEffect(shell.posX, shell.posY, shell.posZ, "hbm:weapon.explosionMedium", 20.0F, 0.9F + shell.worldObj.rand.nextFloat() * 0.2F);
@ -287,7 +291,7 @@ public class ItemAmmoArty extends Item {
};
/* THIS DOOFUS */
this.itemTypes[CARGO] = new ArtilleryShell("ammo_arty_cargo") { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
this.itemTypes[CARGO] = new ArtilleryShell("ammo_arty_cargo", SpentCasing.COLOR_CASE_16INCH) { public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) {
if(mop.typeOfHit == MovingObjectType.BLOCK) {
shell.setPosition(mop.hitVec.xCoord, mop.hitVec.yCoord, mop.hitVec.zCoord);
shell.getStuck(mop.blockX, mop.blockY, mop.blockZ);
@ -295,11 +299,11 @@ public class ItemAmmoArty extends Item {
}};
/* CLUSTER SHELLS */
this.itemTypes[PHOSPHORUS_MULTI] = new ArtilleryShell("ammo_arty_phosphorus_multi") {
this.itemTypes[PHOSPHORUS_MULTI] = new ArtilleryShell("ammo_arty_phosphorus_multi", SpentCasing.COLOR_CASE_16INCH_PHOS) {
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.itemTypes[PHOSPHORUS].onImpact(shell, mop); }
public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, PHOSPHORUS, 10, 300, 5); }
};
this.itemTypes[MINI_NUKE_MULTI] = new ArtilleryShell("ammo_arty_mini_nuke_multi") {
this.itemTypes[MINI_NUKE_MULTI] = new ArtilleryShell("ammo_arty_mini_nuke_multi", SpentCasing.COLOR_CASE_16INCH_NUKE) {
public void onImpact(EntityArtilleryShell shell, MovingObjectPosition mop) { ItemAmmoArty.this.itemTypes[MINI_NUKE].onImpact(shell, mop); }
public void onUpdate(EntityArtilleryShell shell) { standardCluster(shell, MINI_NUKE, 5, 300, 5); }
};

View File

@ -6,7 +6,7 @@ import com.hbm.entity.projectile.EntityArtilleryRocket;
import com.hbm.explosion.vanillant.ExplosionVNT;
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorStandard;
import com.hbm.explosion.vanillant.standard.EntityProcessorCross;
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
import com.hbm.lib.RefStrings;
@ -74,7 +74,7 @@ public class ItemAmmoHIMARS extends Item {
xnt.setBlockAllocator(new BlockAllocatorStandard(48));
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
}
xnt.setEntityProcessor(new EntityProcessorStandard().withRangeMod(rangeMod));
xnt.setEntityProcessor(new EntityProcessorCross(7.5).withRangeMod(rangeMod));
xnt.setPlayerProcessor(new PlayerProcessorStandard());
xnt.setSFX(new ExplosionEffectStandard());
xnt.explode();

View File

@ -1,9 +1,5 @@
package com.hbm.items.weapon;
import java.util.List;
import com.hbm.items.ModItems;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -11,392 +7,26 @@ import net.minecraft.world.World;
public class ItemClip extends Item {
public ItemClip()
{
this.setMaxDamage(1);
}
private ItemStack toGive;
public ItemClip(ItemStack stack) {
toGive = stack;
this.setMaxDamage(1);
}
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(toGive == null) return stack;
ItemStack ammo = toGive.copy();
player.inventory.addItemStackToInventory(ammo);
stack.stackSize--;
if(stack.stackSize <= 0)
stack.damageItem(5, player);
if(this == ModItems.clip_revolver_iron)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_iron_ammo, 20)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_iron_ammo, 20), false);
}
}
if(this == ModItems.clip_revolver)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_ammo, 12)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_ammo, 12), false);
}
}
if(this == ModItems.clip_revolver_gold)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_gold_ammo, 4)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_gold_ammo, 4), false);
}
}
if(this == ModItems.clip_revolver_schrabidium)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_schrabidium_ammo, 2)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_schrabidium_ammo, 2), false);
}
}
if(this == ModItems.clip_rpg)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_rocket, 3)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_rpg_ammo, 3), false);
}
}
if(this == ModItems.clip_osipr)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_osipr_ammo, 30)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_osipr_ammo, 30), false);
}
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_osipr_ammo2, 1)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_osipr_ammo2, 1), false);
}
}
if(this == ModItems.clip_xvl1456)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_xvl1456_ammo, 60)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_xvl1456_ammo, 60), false);
}
}
if(this == ModItems.clip_revolver_lead)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_lead_ammo, 12)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_lead_ammo, 12), false);
}
}
if(this == ModItems.clip_revolver_cursed)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_cursed_ammo, 17)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_revolver_cursed_ammo, 17), false);
}
}
if(this == ModItems.clip_fatman)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_nuke, 6)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_fatman_ammo, 6), false);
}
}
if(this == ModItems.clip_mp)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_566_gold, 30)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp_ammo, 30), false);
}
}
if(this == ModItems.clip_mp40)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_9mm, 32)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_uzi)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_22lr, 32)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_uzi_ammo, 32), false);
}
}
if(this == ModItems.clip_uboinik)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_12gauge, 24)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_uboinik_ammo, 24), false);
}
}
if(this == ModItems.clip_lever_action)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge, 24)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_lever_action_ammo, 24), false);
}
}
if(this == ModItems.clip_bolt_action)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge_slug, 24)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_bolt_action_ammo, 24), false);
}
}
if(this == ModItems.clip_mirv)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_mirv, 3)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_bf)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_bf_ammo, 2)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_immolator)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_immolator_ammo, 60)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_cryolator)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_cryolator_ammo, 60)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_emp)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_emp_ammo, 6)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_revolver_nightmare)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_nightmare_ammo, 6)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_revolver_nightmare2)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 6)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_revolver_pip)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_44_pip, 6)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_revolver_nopip)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_44, 12)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_stinger)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_stinger_rocket, 3)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_jack)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_jack_ammo, 6)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_spark)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_spark_ammo, 4)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_hp)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_hp_ammo, 8)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_euthanasia)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_euthanasia_ammo, 16)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.clip_defabricator)
{
if (!player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_defabricator_ammo, 12)))
{
//player.dropPlayerItemWithRandomChoice(new ItemStack(ModItems.gun_mp40_ammo, 32), false);
}
}
if(this == ModItems.ammo_container)
{
if(player.inventory.hasItem(ModItems.gun_revolver_iron))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_iron_ammo, 24));
if(player.inventory.hasItem(ModItems.gun_revolver))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_ammo, 12));
if(player.inventory.hasItem(ModItems.gun_revolver_gold))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_gold_ammo, 4));
if(player.inventory.hasItem(ModItems.gun_revolver_lead))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_lead_ammo, 6));
if(player.inventory.hasItem(ModItems.gun_revolver_schrabidium))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_schrabidium_ammo, 2));
if(player.inventory.hasItem(ModItems.gun_revolver_cursed))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_cursed_ammo, 8));
if(player.inventory.hasItem(ModItems.gun_revolver_nightmare))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_nightmare_ammo, 6));
if(player.inventory.hasItem(ModItems.gun_revolver_nightmare2))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 3));
if(player.inventory.hasItem(ModItems.gun_revolver_pip))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_44_pip, 12));
if(player.inventory.hasItem(ModItems.gun_revolver_nopip))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_44, 12));
if(player.inventory.hasItem(ModItems.gun_revolver_blackjack))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_44_bj, 12));
if(player.inventory.hasItem(ModItems.gun_revolver_red))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_44, 12));
if(player.inventory.hasItem(ModItems.gun_calamity))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_50bmg, 16));
if(player.inventory.hasItem(ModItems.gun_calamity_dual))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_50bmg, 32));
if(player.inventory.hasItem(ModItems.gun_minigun)) {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
}
if(player.inventory.hasItem(ModItems.gun_avenger)) {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
}
if(player.inventory.hasItem(ModItems.gun_lacunae)) {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_5mm, 64));
}
if(player.inventory.hasItem(ModItems.gun_rpg))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_rocket, 3));
if(player.inventory.hasItem(ModItems.gun_stinger))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_stinger_rocket, 2));
if(player.inventory.hasItem(ModItems.gun_skystinger))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_stinger_rocket_he, 2));
if(player.inventory.hasItem(ModItems.gun_fatman))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_nuke, 2));
if(player.inventory.hasItem(ModItems.gun_proto))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_nuke, 8));
if(player.inventory.hasItem(ModItems.gun_mirv))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_mirv, 1));
if(player.inventory.hasItem(ModItems.gun_bf))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_bf_ammo, 1));
if(player.inventory.hasItem(ModItems.gun_mp40))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_9mm, 32));
if(player.inventory.hasItem(ModItems.gun_uzi))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_22lr, 32));
if(player.inventory.hasItem(ModItems.gun_uzi_silencer))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_22lr, 32));
if(player.inventory.hasItem(ModItems.gun_uzi_saturnite))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_22lr, 32));
if(player.inventory.hasItem(ModItems.gun_uzi_saturnite_silencer))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_22lr, 32));
if(player.inventory.hasItem(ModItems.gun_uboinik))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_12gauge, 12));
if(player.inventory.hasItem(ModItems.gun_lever_action))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge, 12));
if(player.inventory.hasItem(ModItems.gun_lever_action_dark))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge, 12));
if(player.inventory.hasItem(ModItems.gun_lever_action_sonata))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge, 1));
if(player.inventory.hasItem(ModItems.gun_bolt_action))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge_flechette, 12));
if(player.inventory.hasItem(ModItems.gun_bolt_action_green))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_20gauge_flechette, 12));
if(player.inventory.hasItem(ModItems.gun_xvl1456))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_xvl1456_ammo, 40));
if(player.inventory.hasItem(ModItems.gun_osipr)) {
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_osipr_ammo, 30));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_osipr_ammo2, 1));
}
if(player.inventory.hasItem(ModItems.gun_immolator))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_immolator_ammo, 40));
if(player.inventory.hasItem(ModItems.gun_cryolator))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_cryolator_ammo, 40));
if(player.inventory.hasItem(ModItems.gun_mp))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.ammo_566_gold, 34));
if(player.inventory.hasItem(ModItems.gun_zomg))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.nugget_euphemium, 1));
if(player.inventory.hasItem(ModItems.gun_emp))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_emp_ammo, 8));
if(player.inventory.hasItem(ModItems.gun_revolver_inverted))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_ammo, 1));
if(player.inventory.hasItem(ModItems.gun_revolver_inverted))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_revolver_ammo, 1));
if(player.inventory.hasItem(ModItems.gun_jack))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_jack_ammo, 3));
if(player.inventory.hasItem(ModItems.gun_spark))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_spark_ammo, 2));
if(player.inventory.hasItem(ModItems.gun_hp))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_hp_ammo, 6));
if(player.inventory.hasItem(ModItems.gun_euthanasia))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_euthanasia_ammo, 8));
if(player.inventory.hasItem(ModItems.gun_defabricator))
player.inventory.addItemStackToInventory(new ItemStack(ModItems.gun_defabricator_ammo, 6));
}
return stack;
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
if(this == ModItems.ammo_container)
{
list.add("Gives ammo for all held weapons.");
}
}
}

View File

@ -8,10 +8,15 @@ import com.hbm.config.GeneralConfig;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.GunConfiguration;
import com.hbm.handler.HbmKeybinds;
import com.hbm.interfaces.IHoldableWeapon;
import com.hbm.interfaces.IItemHUD;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.IEquipReceiver;
import com.hbm.lib.HbmCollection;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.GunAnimationPacket;
import com.hbm.packet.GunButtonPacket;
import com.hbm.packet.PacketDispatcher;
@ -19,12 +24,14 @@ import com.hbm.render.anim.BusAnimation;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import com.hbm.util.I18nUtil;
import com.hbm.util.InventoryUtil;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@ -39,7 +46,7 @@ import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD, IEquipReceiver {
public GunConfiguration mainConfig;
public GunConfiguration altConfig;
@ -107,7 +114,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(mainConfig.reloadType != mainConfig.RELOAD_NONE || (altConfig != null && altConfig.reloadType != 0)) {
if(GameSettings.isKeyDown(HbmKeybinds.reloadKey) && (getMag(stack) < mainConfig.ammoCap || hasInfinity(stack, mainConfig))) {
if(GameSettings.isKeyDown(HbmKeybinds.reloadKey) && Minecraft.getMinecraft().currentScreen == null && (getMag(stack) < mainConfig.ammoCap || hasInfinity(stack, mainConfig))) {
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 2));
setIsReloading(stack, true);
resetReloadCycle(stack);
@ -138,6 +145,20 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(getIsReloading(stack) && isCurrentItem) {
reload2(stack, world, player);
}
BulletConfiguration queued = getCasing(stack);
int timer = getCasingTimer(stack);
if(queued != null && timer > 0) {
timer--;
if(timer <= 0) {
trySpawnCasing(player, mainConfig.ejector, queued, stack);
}
setCasingTimer(stack, timer);
}
}
//whether or not the gun can shoot in its current state
@ -204,6 +225,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
}
world.playSoundAtEntity(player, mainConfig.firingSound, 1.0F, mainConfig.firingPitch);
if(mainConfig.ejector != null && !mainConfig.ejector.getAfterReload())
queueCasing(player, mainConfig.ejector, config, stack);
}
//unlike fire(), being called does not automatically imply success, some things may still have to be handled before spawning the projectile
@ -214,8 +238,6 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
BulletConfiguration config = altConfig.reloadType == altConfig.RELOAD_NONE ? getBeltCfg(player, stack, false) : BulletConfigSyncingUtil.pullConfig(altConfig.config.get(getMagType(stack)));
//System.out.println(config.ammo.getUnlocalizedName());
int bullets = config.bulletsMin;
for(int k = 0; k < altConfig.roundsPerCycle; k++) {
@ -237,6 +259,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
}
world.playSoundAtEntity(player, altConfig.firingSound, 1.0F, altConfig.firingPitch);
if(altConfig.ejector != null)
queueCasing(player, altConfig.ejector, config, stack);
}
//spawns the actual projectile, can be overridden to change projectile entity
@ -278,115 +303,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
//called on click release (client side, called by update cycle)
public void endActionClient(ItemStack stack, World world, EntityPlayer player, boolean main) { }
//reload action, if existent
protected void reload(ItemStack stack, World world, EntityPlayer player) {
if(getReloadCycle(stack) < 0 && stack == player.getHeldItem()) {
//if the mag has bullet in them -> load only the same type
if(getMag(stack) > 0) {
BulletConfiguration bulletCfg = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack)));
Item ammo = bulletCfg.ammo;
//how many bullets to load
int count = 1;
if(mainConfig.reloadType == 1) {
count = mainConfig.ammoCap - getMag(stack);
}
if(count == 0)
setIsReloading(stack, false);
for(int i = 0; i < count; i++) {
if(getMag(stack) < mainConfig.ammoCap) {
if(player.inventory.hasItem(ammo)) {
player.inventory.consumeInventoryItem(ammo);
setMag(stack, Math.min(getMag(stack) + bulletCfg.ammoCount, mainConfig.ammoCap));
} else {
setIsReloading(stack, false);
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
break;
}
}
if(getMag(stack) == mainConfig.ammoCap) {
setIsReloading(stack, false);
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
break;
} else {
resetReloadCycle(stack);
}
}
//if the mag has no bullets in them -> load new type
} else {
BulletConfiguration bulletCfg = null;
//determine new type
for(Integer config : mainConfig.config) {
BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(config);
if(player.inventory.hasItem(cfg.ammo)) {
bulletCfg = cfg;
setMagType(stack, mainConfig.config.indexOf(config));
break;
}
}
//load new type if bullets are present
if(bulletCfg != null) {
int count = 1;
if(mainConfig.reloadType == 1) {
count = mainConfig.ammoCap - getMag(stack);
}
for(int i = 0; i < count; i++) {
if(getMag(stack) < mainConfig.ammoCap) {
if(player.inventory.hasItem(bulletCfg.ammo)) {
player.inventory.consumeInventoryItem(bulletCfg.ammo);
setMag(stack, Math.min(getMag(stack) + bulletCfg.ammoCount, mainConfig.ammoCap));
} else {
setIsReloading(stack, false);
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
break;
}
}
if(getMag(stack) == mainConfig.ammoCap) {
setIsReloading(stack, false);
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
break;
} else {
resetReloadCycle(stack);
}
}
}
}
} else {
setReloadCycle(stack, getReloadCycle(stack) - 1);
}
if(stack != player.getHeldItem()) {
setReloadCycle(stack, 0);
setIsReloading(stack, false);
}
}
//martin 2 reload algorithm
//now with less WET and more DRY
//compact, readable and most importantly, FUNCTIONAL
//current reload
protected void reload2(ItemStack stack, World world, EntityPlayer player) {
if(getMag(stack) >= mainConfig.ammoCap) {
@ -394,44 +311,44 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
return;
}
if(getReloadCycle(stack) < 0) {
if(getReloadCycle(stack) <= 0) {
if(getMag(stack) == 0)
BulletConfiguration prevCfg = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack)));
if (getMag(stack) == 0)
resetAmmoType(stack, world, player);
int count = 1;
if(mainConfig.reloadType == mainConfig.RELOAD_FULL) {
count = mainConfig.ammoCap - getMag(stack);
}
boolean hasLoaded = false;
BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack)));
Item ammo = cfg.ammo;
ComparableStack ammo = (ComparableStack) cfg.ammo.copy();
for(int i = 0; i < count; i++) {
final int countNeeded = (mainConfig.reloadType == GunConfiguration.RELOAD_FULL) ? mainConfig.ammoCap - getMag(stack) : 1;
final int availableStacks = InventoryUtil.countAStackMatches(player, ammo, true);
final int availableFills = availableStacks * cfg.ammoCount;
final boolean hasLoaded = availableFills > 0;
final int toAdd = Math.min(availableFills * cfg.ammoCount, countNeeded);
final int toConsume = (int) Math.ceil((double) toAdd / cfg.ammoCount);
if(player.inventory.hasItem(ammo) && getMag(stack) < mainConfig.ammoCap) {
player.inventory.consumeInventoryItem(ammo);
setMag(stack, Math.min(getMag(stack) + cfg.ammoCount, mainConfig.ammoCap));
hasLoaded = true;
} else {
setIsReloading(stack, false);
break;
}
}
if(getMag(stack) >= mainConfig.ammoCap) {
// Skip logic if cannot reload
if(availableFills == 0) {
setIsReloading(stack, false);
} else {
resetReloadCycle(stack);
return;
}
ammo.stacksize = toConsume;
setMag(stack, getMag(stack) + toAdd);
if (getMag(stack) >= mainConfig.ammoCap)
setIsReloading(stack, false);
else
resetReloadCycle(stack);
if(hasLoaded && mainConfig.reloadSoundEnd)
world.playSoundAtEntity(player, mainConfig.reloadSound, 1.0F, 1.0F);
if(mainConfig.ejector != null && mainConfig.ejector.getAfterReload())
queueCasing(player, mainConfig.ejector, prevCfg, stack);
InventoryUtil.tryConsumeAStack(player.inventory.mainInventory, 0, player.inventory.mainInventory.length, ammo);
} else {
setReloadCycle(stack, getReloadCycle(stack) - 1);
}
@ -479,20 +396,15 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(getMag(stack) == 0) {
for(Integer config : mainConfig.config) {
BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(config);
if(player.inventory.hasItem(cfg.ammo)) {
for(int config : mainConfig.config) {
if(InventoryUtil.doesPlayerHaveAStack(player, BulletConfigSyncingUtil.pullConfig(config).ammo, false, false)) {
return true;
}
}
} else {
Item ammo = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack))).ammo;
if(player.inventory.hasItem(ammo))
return true;
ComparableStack ammo = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack))).ammo;
return InventoryUtil.doesPlayerHaveAStack(player, ammo, false, false);
}
return false;
@ -501,11 +413,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
//searches the player's inv for next fitting ammo type and changes the gun's mag
protected void resetAmmoType(ItemStack stack, World world, EntityPlayer player) {
for(Integer config : mainConfig.config) {
for(int config : mainConfig.config) {
BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(config);
if(player.inventory.hasItem(cfg.ammo)) {
if(InventoryUtil.doesPlayerHaveAStack(player, cfg.ammo, false, false)) {
setMagType(stack, mainConfig.config.indexOf(config));
break;
}
@ -516,40 +427,46 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
Item ammo = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack))).ammo;
ComparableStack ammo = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack))).ammo;
if(mainConfig.ammoCap > 0)
list.add("Ammo: " + getMag(stack) + " / " + mainConfig.ammoCap);
else
list.add("Ammo: Belt");
list.add(I18nUtil.resolveKey(HbmCollection.ammo, mainConfig.ammoCap > 0 ? I18nUtil.resolveKey(HbmCollection.ammoMag, getMag(stack), mainConfig.ammoCap) : I18nUtil.resolveKey(HbmCollection.ammoBelt)));
list.add("Ammo Type: " + I18n.format(ammo.getUnlocalizedName() + ".name"));
try {
list.add(I18nUtil.resolveKey(HbmCollection.ammoType, ammo.toStack().getDisplayName()));
if(altConfig != null && altConfig.ammoCap == 0) {
Item ammo2 = BulletConfigSyncingUtil.pullConfig(altConfig.config.get(0)).ammo;
if(ammo != ammo2)
list.add("Secondary Ammo: " + I18n.format(ammo2.getUnlocalizedName() + ".name"));
if(altConfig != null && altConfig.ammoCap == 0) {
ComparableStack ammo2 = BulletConfigSyncingUtil.pullConfig(altConfig.config.get(0)).ammo;
if(!ammo.isApplicable(ammo2)) {
list.add(I18nUtil.resolveKey(HbmCollection.altAmmoType, ammo2.toStack().getDisplayName()));
}
}
}
catch (Exception e)
{
e.printStackTrace();
list.add("Error: " + e + " has occurred!");
}
int dura = mainConfig.durability - getItemWear(stack);
addAdditionalInformation(stack, list);
}
if(dura < 0)
dura = 0;
protected void addAdditionalInformation(ItemStack stack, List<String> list)
{
final BulletConfiguration bulletConfig = BulletConfigSyncingUtil.pullConfig(mainConfig.config.get(getMagType(stack)));
list.add(I18nUtil.resolveKey(HbmCollection.gunDamage, bulletConfig.dmgMin, bulletConfig.dmgMax));
int dura = Math.max(mainConfig.durability - getItemWear(stack), 0);
list.add("Durability: " + dura + " / " + mainConfig.durability);
list.add(I18nUtil.resolveKey(HbmCollection.durability, dura + " / " + mainConfig.durability));
//if(MainRegistry.enableDebugMode) {
list.add("");
list.add("Name: " + mainConfig.name);
list.add("Manufacturer: " + mainConfig.manufacturer);
//}
list.add("");
list.add(I18nUtil.resolveKey(HbmCollection.gunName, I18nUtil.resolveKey("gun.name." + mainConfig.name)));
list.add(I18nUtil.resolveKey(HbmCollection.gunMaker, I18nUtil.resolveKey(mainConfig.manufacturer.getKey())));
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));
@ -560,37 +477,33 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
}
//returns ammo item of belt-weapons
public static Item getBeltType(EntityPlayer player, ItemStack stack, boolean main) {
public static ComparableStack getBeltType(EntityPlayer player, ItemStack stack, boolean main) {
ItemGunBase gun = (ItemGunBase)stack.getItem();
GunConfiguration guncfg = main ? gun.mainConfig : (gun.altConfig != null ? gun.altConfig : gun.mainConfig);
Item ammo = BulletConfigSyncingUtil.pullConfig(guncfg.config.get(0)).ammo;
for(Integer config : guncfg.config) {
BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(config);
if(player.inventory.hasItem(cfg.ammo)) {
ammo = cfg.ammo;
break;
if(InventoryUtil.doesPlayerHaveAStack(player, cfg.ammo, false, true)) {
return cfg.ammo;
}
}
return ammo;
return BulletConfigSyncingUtil.pullConfig(guncfg.config.get(0)).ammo;
}
//returns BCFG of belt-weapons
public static BulletConfiguration getBeltCfg(EntityPlayer player, ItemStack stack, boolean main) {
ItemGunBase gun = (ItemGunBase)stack.getItem();
GunConfiguration guncfg = main ? gun.mainConfig : (gun.altConfig != null ? gun.altConfig : gun.mainConfig);
getBeltType(player, stack, main);
for(Integer config : guncfg.config) {
for(int config : guncfg.config) {
BulletConfiguration cfg = BulletConfigSyncingUtil.pullConfig(config);
if(player.inventory.hasItem(cfg.ammo)) {
if(InventoryUtil.doesPlayerHaveAStack(player, cfg.ammo, false, false)) {
return cfg;
}
}
@ -599,13 +512,14 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
}
//returns ammo capacity of belt-weapons for current ammo
public static int getBeltSize(EntityPlayer player, Item ammo) {
public static int getBeltSize(EntityPlayer player, ComparableStack ammo) {
int amount = 0;
for(ItemStack stack : player.inventory.mainInventory) {
if(stack != null && stack.getItem() == ammo)
if(stack != null && ammo.matchesRecipe(stack, true)) {
amount += stack.stackSize;
}
}
return amount;
@ -625,11 +539,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
if(hasInfinity(stack, config))
return;
if(config.reloadType != mainConfig.RELOAD_NONE) {
if(config.reloadType != GunConfiguration.RELOAD_NONE) {
setMag(stack, getMag(stack) - 1);
} else {
player.inventory.consumeInventoryItem(getBeltType(player, stack, main));
InventoryUtil.doesPlayerHaveAStack(player, getBeltType(player, stack, main), true, false);
}
}
@ -637,16 +550,6 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
return config.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
}
/*//returns main config from itemstack
public static GunConfiguration extractConfig(ItemStack stack) {
if(stack != null && stack.getItem() instanceof ItemGunBase) {
return ((ItemGunBase)stack.getItem()).mainConfig;
}
return null;
}*/
/// sets reload cycle to config defult ///
public static void resetReloadCycle(ItemStack stack) {
writeNBT(stack, "reload", ((ItemGunBase)stack.getItem()).mainConfig.reloadDuration);
@ -733,6 +636,24 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
return readNBT(stack, "magazineType");
}
/// queued casing for ejection ///
public static void setCasing(ItemStack stack, BulletConfiguration bullet) {
writeNBT(stack, "casing", BulletConfigSyncingUtil.getKey(bullet));
}
public static BulletConfiguration getCasing(ItemStack stack) {
return BulletConfigSyncingUtil.pullConfig(readNBT(stack, "casing"));
}
/// timer for ejecting casing ///
public static void setCasingTimer(ItemStack stack, int i) {
writeNBT(stack, "casingTimer", i);
}
public static int getCasingTimer(ItemStack stack) {
return readNBT(stack, "casingTimer");
}
/// NBT utility ///
public static void writeNBT(ItemStack stack, String key, int value) {
@ -769,7 +690,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
return;
}
Item ammo = bcfg.ammo;
ComparableStack ammo = bcfg.ammo;
int count = ItemGunBase.getMag(stack);
int max = gcfg.ammoCap;
boolean showammo = gcfg.showAmmo;
@ -782,15 +703,15 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
int dura = ItemGunBase.getItemWear(stack) * 50 / gcfg.durability;
RenderScreenOverlay.renderAmmo(event.resolution, Minecraft.getMinecraft().ingameGUI, new ItemStack(ammo), count, max, dura, showammo);
RenderScreenOverlay.renderAmmo(event.resolution, Minecraft.getMinecraft().ingameGUI, ammo.toStack(), count, max, dura, showammo);
if(gun.altConfig != null && gun.altConfig.reloadType == GunConfiguration.RELOAD_NONE) {
Item oldAmmo = ammo;
ComparableStack oldAmmo = ammo;
ammo = ItemGunBase.getBeltType(player, stack, false);
if(ammo != oldAmmo) {
if(!ammo.isApplicable(oldAmmo)) {
count = ItemGunBase.getBeltSize(player, ammo);
RenderScreenOverlay.renderAmmoAlt(event.resolution, Minecraft.getMinecraft().ingameGUI, new ItemStack(ammo), count);
RenderScreenOverlay.renderAmmoAlt(event.resolution, Minecraft.getMinecraft().ingameGUI, ammo.toStack(), count);
}
}
}
@ -811,4 +732,39 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
GunConfiguration config = ((ItemGunBase) stack.getItem()).mainConfig;
return config.animations.get(type);
}
@Override
public void onEquip(EntityPlayer player) {
if(!mainConfig.equipSound.isEmpty() && !player.worldObj.isRemote) {
player.worldObj.playSoundAtEntity(player, mainConfig.equipSound, 1, 1);
}
}
protected static void queueCasing(Entity entity, CasingEjector ejector, BulletConfiguration bullet, ItemStack stack) {
if(ejector == null || bullet == null || bullet.spentCasing == null) return;
if(ejector.getDelay() <= 0) {
trySpawnCasing(entity, ejector, bullet, stack);
} else {
setCasing(stack, bullet);
setCasingTimer(stack, ejector.getDelay());
}
}
protected static void trySpawnCasing(Entity entity, CasingEjector ejector, BulletConfiguration bullet, ItemStack stack) {
if(ejector == null) return; //abort if the gun can't eject bullets at all
if(bullet == null) return; //abort if there's no valid bullet cfg
if(bullet.spentCasing == null) return; //abort if the bullet is caseless
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "casing");
data.setFloat("pitch", -(float) Math.toRadians(entity.rotationPitch));
data.setFloat("yaw", (float) Math.toRadians(entity.rotationYaw));
data.setBoolean("crouched", entity.isSneaking());
data.setString("name", bullet.spentCasing.getName());
data.setInteger("ej", ejector.getId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 50));
}
}

View File

@ -77,12 +77,7 @@ public class ItemGunChemthrower extends ItemGunBase implements IFillableItem {
if(hasInfinity(stack, config))
return;
if(config.reloadType != mainConfig.RELOAD_NONE) {
setMag(stack, getMag(stack) - this.getConsumption(stack));
} else {
player.inventory.consumeInventoryItem(getBeltType(player, stack, main));
}
setMag(stack, getMag(stack) - this.getConsumption(stack));
}
@Override

View File

@ -1,6 +1,8 @@
package com.hbm.items.weapon;
import com.hbm.entity.projectile.EntityCombineBall;
import com.hbm.entity.projectile.EntityCombineBallNT;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.GunConfiguration;
import com.hbm.items.ModItems;
@ -21,6 +23,7 @@ public class ItemGunOSIPR extends ItemGunBase {
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);
@ -32,9 +35,8 @@ public class ItemGunOSIPR extends ItemGunBase {
int i = getCharge(stack);
if(i >= 20) {
EntityCombineBall entityarrow = new EntityCombineBall(player.worldObj, player, 3.0F);
entityarrow.setDamage(1000);
world.spawnEntityInWorld(entityarrow);
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);
@ -44,6 +46,7 @@ public class ItemGunOSIPR extends ItemGunBase {
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;

View File

@ -9,32 +9,22 @@ import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.handler.HbmKeybinds;
import com.hbm.interfaces.IHoldableWeapon;
import com.hbm.items.machine.ItemBattery;
import com.hbm.items.weapon.ItemGunBase;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.GunAnimationPacket;
import com.hbm.packet.GunButtonPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.PlayerInformPacket;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.render.util.RenderScreenOverlay;
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
import com.hbm.util.BobMathUtil;
import com.hbm.util.ChatBuilder;
import com.hbm.util.I18nUtil;
import api.hbm.energy.IBatteryItem;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.creativetab.CreativeTabs;
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.Item;
@ -56,28 +46,11 @@ public class ItemEnergyGunBase extends ItemGunBase implements IBatteryItem {
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add("Energy Stored: " + BobMathUtil.getShortNumber(getCharge(stack)) + "/" + BobMathUtil.getShortNumber(mainConfig.maxCharge) + "HE");
list.add("Charge rate: " + BobMathUtil.getShortNumber(mainConfig.chargeRate) + "HE/t");
BulletConfiguration config = getConfig(stack);
list.add("");
list.add("Mode: " + I18nUtil.resolveKey(config.modeName));
list.add("Mode info:");
list.add("Average damage: " + ((float)(config.dmgMax + config.dmgMin) / 2F));
list.add("Firing Rate: " + BobMathUtil.roundDecimal((1F / (((float)config.firingRate) / 20F)), 2) + " rounds per second");
list.add("Power Consumption per Shot: " + BobMathUtil.getShortNumber(config.dischargePerShot) + "HE");
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);
}
addAdditionalInformation(stack, list);
}
@Override

View File

@ -2,6 +2,8 @@ package com.hbm.lib;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemBreedingRod.*;
import com.hbm.items.special.ItemBookLore.BookLoreType;
@ -21,7 +23,7 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.ingot_titanium, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.circuit_targeting_tier1, 0, 1, 1, 5),
new WeightedRandomChestContent(ModItems.gun_revolver, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.gun_revolver_ammo, 0, 2, 6, 4),
new WeightedRandomChestContent(ModItems.ammo_357, Ammo357Magnum.LEAD.ordinal(), 2, 6, 4),
new WeightedRandomChestContent(ModItems.gun_kit_1, 0, 1, 3, 4),
new WeightedRandomChestContent(ModItems.gun_lever_action, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.ammo_20gauge, 0, 2, 6, 3),
@ -102,9 +104,9 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.ammo_rocket, 0, 1, 4, 5),
new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke_safe, 0, 1, 2, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke_low, 0, 1, 2, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke_pumpkin, 0, 1, 2, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke, AmmoFatman.SAFE.ordinal(), 1, 2, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke, AmmoFatman.LOW.ordinal(), 1, 2, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke, AmmoFatman.PUMPKIN.ordinal(), 1, 2, 1),
new WeightedRandomChestContent(ModItems.grenade_nuclear, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.grenade_smart, 0, 1, 3, 3),
new WeightedRandomChestContent(ModItems.grenade_mirv, 0, 1, 1, 2),
@ -204,14 +206,14 @@ public class HbmChestContents {
new WeightedRandomChestContent(ModItems.t45_kit, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.fusion_core, 0, 1, 1, 10),
new WeightedRandomChestContent(ModItems.gun_revolver, 0, 1, 1, 4),
new WeightedRandomChestContent(ModItems.gun_revolver_ammo, 0, 1, 24, 4),
new WeightedRandomChestContent(ModItems.ammo_357, Ammo357Magnum.LEAD.ordinal(), 1, 24, 4),
new WeightedRandomChestContent(ModItems.gun_kit_1, 0, 2, 3, 4),
new WeightedRandomChestContent(ModItems.gun_rpg, 0, 1, 1, 3),
new WeightedRandomChestContent(ModItems.ammo_rocket, 0, 1, 6, 3),
new WeightedRandomChestContent(ModItems.rod, BreedingRodType.U235.ordinal(), 1, 1, 2),
new WeightedRandomChestContent(ModItems.billet_uranium_fuel, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.ingot_uranium_fuel, 0, 1, 1, 2),
new WeightedRandomChestContent(ModItems.ammo_nuke_safe, 0, 1, 2, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke, AmmoFatman.SAFE.ordinal(), 1, 2, 1),
new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.bottle_nuka, 0, 1, 3, 6),
new WeightedRandomChestContent(ModItems.bottle_quantum, 0, 1, 1, 3),
@ -321,7 +323,7 @@ public class HbmChestContents {
public static WeightedRandomChestContent[] vault4 = new WeightedRandomChestContent[] {
new WeightedRandomChestContent(ModItems.ammo_container, 0, 3, 6, 1),
new WeightedRandomChestContent(ModItems.clip_fatman, 0, 2, 3, 1),
new WeightedRandomChestContent(ModItems.ammo_mirv, 0, 2, 3, 1),
new WeightedRandomChestContent(ModItems.ammo_nuke, AmmoFatman.MIRV.ordinal(), 2, 3, 1),
new WeightedRandomChestContent(ModItems.gun_mirv, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gun_fatman, 0, 1, 1, 1),
new WeightedRandomChestContent(ModItems.gun_proto, 0, 1, 1, 1),

View File

@ -0,0 +1,190 @@
package com.hbm.lib;
import java.util.List;
import java.util.Set;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.items.weapon.ItemAmmo.AmmoItemTrait;
public class HbmCollection {
public static final Set<AmmoItemTrait> APType = ImmutableSet.of(AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.CON_WEAR);
public static final Set<AmmoItemTrait> FlechetteType = ImmutableSet.of(AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.NEU_LESS_BOUNCY, AmmoItemTrait.CON_WEAR);
public static final Set<AmmoItemTrait> IncendiaryType = ImmutableSet.of(AmmoItemTrait.PRO_INCENDIARY, AmmoItemTrait.CON_WEAR);
public static final Set<AmmoItemTrait> PhosphorusType = ImmutableSet.of(AmmoItemTrait.PRO_PHOSPHORUS, AmmoItemTrait.NEU_WARCRIME1, AmmoItemTrait.CON_WEAR, AmmoItemTrait.CON_PENETRATION);
public static final Set<AmmoItemTrait> PhosphorusTypeSpecial = ImmutableSet.of(AmmoItemTrait.PRO_PHOSPHORUS_SPLASH, AmmoItemTrait.NEU_WARCRIME1, AmmoItemTrait.CON_WEAR);
public static final Set<AmmoItemTrait> ExplosiveType = ImmutableSet.of(AmmoItemTrait.PRO_EXPLOSIVE, AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.CON_HEAVY_WEAR);
public static final Set<AmmoItemTrait> DUType = ImmutableSet.of(AmmoItemTrait.PRO_HEAVY_DAMAGE, AmmoItemTrait.NEU_HEAVY_METAL, AmmoItemTrait.CON_HEAVY_WEAR);
public static final Set<AmmoItemTrait> StarmetalType = ImmutableSet.of(AmmoItemTrait.PRO_HEAVY_DAMAGE, AmmoItemTrait.NEU_STARMETAL, AmmoItemTrait.CON_HEAVY_WEAR);
public static final Set<AmmoItemTrait> ChlorophyteType = ImmutableSet.of(AmmoItemTrait.PRO_DAMAGE, AmmoItemTrait.PRO_WEAR, AmmoItemTrait.NEU_CHLOROPHYTE, AmmoItemTrait.NEU_HOMING, AmmoItemTrait.CON_PENETRATION);
/// BULLET COLLECTIONS
// SHOTGUNS
/** 12 GAUGE **/
public static final List<Integer> twelveGauge = ImmutableList.of(BulletConfigSyncingUtil.G12_NORMAL, BulletConfigSyncingUtil.G12_INCENDIARY, BulletConfigSyncingUtil.G12_SHRAPNEL, BulletConfigSyncingUtil.G12_DU, BulletConfigSyncingUtil.G12_AM, BulletConfigSyncingUtil.G12_SLEEK, BulletConfigSyncingUtil.G12_PERCUSSION);
/** 20 GAUGE **/
public static final List<Integer> twentyGauge = ImmutableList.of(BulletConfigSyncingUtil.G20_NORMAL, BulletConfigSyncingUtil.G20_SLUG, BulletConfigSyncingUtil.G20_FLECHETTE, BulletConfigSyncingUtil.G20_FIRE, BulletConfigSyncingUtil.G20_SHRAPNEL, BulletConfigSyncingUtil.G20_EXPLOSIVE, BulletConfigSyncingUtil.G20_CAUSTIC, BulletConfigSyncingUtil.G20_SHOCK, BulletConfigSyncingUtil.G20_WITHER, BulletConfigSyncingUtil.G20_SLEEK);
/** 4 GAUGE **/
public static final List<Integer> fourGauge = ImmutableList.of(BulletConfigSyncingUtil.G4_NORMAL, BulletConfigSyncingUtil.G4_SLUG, BulletConfigSyncingUtil.G4_FLECHETTE, BulletConfigSyncingUtil.G4_FLECHETTE_PHOSPHORUS, BulletConfigSyncingUtil.G4_EXPLOSIVE, BulletConfigSyncingUtil.G4_SEMTEX, BulletConfigSyncingUtil.G4_BALEFIRE, BulletConfigSyncingUtil.G4_KAMPF, BulletConfigSyncingUtil.G4_CANISTER, BulletConfigSyncingUtil.G4_CLAW, BulletConfigSyncingUtil.G4_VAMPIRE, BulletConfigSyncingUtil.G4_VOID, BulletConfigSyncingUtil.G4_TITAN, BulletConfigSyncingUtil.G4_SLEEK);
// PISTOL CALIBER
/** .22 LONG RIFLE **/
public static final List<Integer> twentyTwoLR = ImmutableList.of(BulletConfigSyncingUtil.LR22_NORMAL, BulletConfigSyncingUtil.LR22_AP, BulletConfigSyncingUtil.CHL_LR22);
public static final List<Integer> twentyTwoLRFire = ImmutableList.of(BulletConfigSyncingUtil.LR22_NORMAL_FIRE, BulletConfigSyncingUtil.LR22_AP_FIRE, BulletConfigSyncingUtil.CHL_LR22_FIRE);
/** .44 MAGNUM (BASIC) **/
public static final List<Integer> fourtyFourMagBasic = ImmutableList.of(BulletConfigSyncingUtil.M44_NORMAL, BulletConfigSyncingUtil.M44_AP, BulletConfigSyncingUtil.M44_DU, BulletConfigSyncingUtil.M44_PHOSPHORUS, BulletConfigSyncingUtil.M44_STAR, BulletConfigSyncingUtil.CHL_M44, BulletConfigSyncingUtil.M44_ROCKET);
/** .44 MAGNUM (ALL) **/
public static final List<Integer> fourtyFourMagAll = ImmutableList.of(BulletConfigSyncingUtil.M44_NORMAL, BulletConfigSyncingUtil.M44_AP, BulletConfigSyncingUtil.M44_DU, BulletConfigSyncingUtil.M44_PHOSPHORUS, BulletConfigSyncingUtil.M44_STAR, BulletConfigSyncingUtil.CHL_M44, BulletConfigSyncingUtil.M44_ROCKET, BulletConfigSyncingUtil.M44_PIP, BulletConfigSyncingUtil.M44_BJ, BulletConfigSyncingUtil.M44_SILVER);
/** .50 ACTION EXPRESS **/
public static final List<Integer> fiftyAE = ImmutableList.of(BulletConfigSyncingUtil.AE50_NORMAL, BulletConfigSyncingUtil.AE50_AP, BulletConfigSyncingUtil.AE50_DU, BulletConfigSyncingUtil.AE50_STAR, BulletConfigSyncingUtil.CHL_AE50);
/** 9MM Parabellum **/
public static final List<Integer> nineMM = ImmutableList.of(BulletConfigSyncingUtil.P9_NORMAL, BulletConfigSyncingUtil.P9_AP, BulletConfigSyncingUtil.P9_DU, BulletConfigSyncingUtil.CHL_P9, BulletConfigSyncingUtil.P9_ROCKET);
/** .45 AUTOMATIC COLT PISTOL **/
public static final List<Integer> fourtyFiveACP = ImmutableList.of(BulletConfigSyncingUtil.ACP_45, BulletConfigSyncingUtil.ACP_45_AP, BulletConfigSyncingUtil.ACP_45_DU);
// RIFLE CALIBER
/** .50 BROWNING MACHINE GUN **/
public static final List<Integer> fiftyBMG = ImmutableList.of(BulletConfigSyncingUtil.BMG50_NORMAL, BulletConfigSyncingUtil.BMG50_INCENDIARY, BulletConfigSyncingUtil.BMG50_PHOSPHORUS, BulletConfigSyncingUtil.BMG50_EXPLOSIVE, BulletConfigSyncingUtil.BMG50_AP, BulletConfigSyncingUtil.BMG50_DU, BulletConfigSyncingUtil.BMG50_STAR, BulletConfigSyncingUtil.CHL_BMG50, BulletConfigSyncingUtil.BMG50_SLEEK);
/** .50 BROWNING MACHINE GUN (FLECHETTE) **/
public static final List<Integer> fiftyBMGFlechette = ImmutableList.of(BulletConfigSyncingUtil.BMG50_FLECHETTE_AM, BulletConfigSyncingUtil.BMG50_FLECHETTE_NORMAL, BulletConfigSyncingUtil.BMG50_FLECHETTE_PO);
/** 5.56MMx45 NATO (BASIC) **/
public static final List<Integer> NATO = ImmutableList.of(BulletConfigSyncingUtil.R556_NORMAL, BulletConfigSyncingUtil.R556_TRACER, BulletConfigSyncingUtil.R556_PHOSPHORUS, BulletConfigSyncingUtil.R556_AP, BulletConfigSyncingUtil.R556_DU, BulletConfigSyncingUtil.R556_STAR, BulletConfigSyncingUtil.CHL_R556, BulletConfigSyncingUtil.R556_SLEEK, BulletConfigSyncingUtil.R556_K, BulletConfigSyncingUtil.R556_GOLD);
/** 5.56MMx45 NATO (FLECHETTE) **/
public static final List<Integer> NATOFlechette = ImmutableList.of(BulletConfigSyncingUtil.R556_FLECHETTE, BulletConfigSyncingUtil.R556_FLECHETTE_INCENDIARY, BulletConfigSyncingUtil.R556_FLECHETTE_PHOSPHORUS, BulletConfigSyncingUtil.R556_FLECHETTE_DU, BulletConfigSyncingUtil.CHL_R556_FLECHETTE, BulletConfigSyncingUtil.R556_FLECHETTE_SLEEK, BulletConfigSyncingUtil.R556_K);
/** 7.62x51mm NATO **/
public static final List<Integer> threeZeroEight = ImmutableList.of(BulletConfigSyncingUtil.W308);
/** 5MM **/
public static final List<Integer> fiveMM = ImmutableList.of(BulletConfigSyncingUtil.R5_NORMAL, BulletConfigSyncingUtil.R5_EXPLOSIVE, BulletConfigSyncingUtil.R5_DU, BulletConfigSyncingUtil.R5_STAR, BulletConfigSyncingUtil.CHL_R5);
/** 5MM LACUNAE **/
public static final List<Integer> fiveMMBolt = ImmutableList.of(BulletConfigSyncingUtil.R5_NORMAL_BOLT, BulletConfigSyncingUtil.R5_EXPLOSIVE_BOLT, BulletConfigSyncingUtil.R5_DU_BOLT, BulletConfigSyncingUtil.R5_STAR_BOLT, BulletConfigSyncingUtil.CHL_R5_BOLT);
// MISC
/** .75 **/
public static final List<Integer> seventyFive = ImmutableList.of(BulletConfigSyncingUtil.B75_NORMAL, BulletConfigSyncingUtil.B75_INCENDIARY, BulletConfigSyncingUtil.B75_HE);
/** 240MM SHELL **/
public static final List<Integer> cannon = ImmutableList.of(BulletConfigSyncingUtil.SHELL_NORMAL, BulletConfigSyncingUtil.SHELL_EXPLOSIVE, BulletConfigSyncingUtil.SHELL_AP, BulletConfigSyncingUtil.SHELL_DU, BulletConfigSyncingUtil.SHELL_W9);
/** FLAMETHROWER FUEL **/
public static final List<Integer> flamer = ImmutableList.of(BulletConfigSyncingUtil.FLAMER_NORMAL, BulletConfigSyncingUtil.FLAMER_NAPALM, BulletConfigSyncingUtil.FLAMER_WP, BulletConfigSyncingUtil.FLAMER_VAPORIZER, BulletConfigSyncingUtil.FLAMER_GAS);
/** MINI-NUKES **/
public static final List<Integer> fatman = ImmutableList.of(BulletConfigSyncingUtil.NUKE_NORMAL, BulletConfigSyncingUtil.NUKE_LOW, BulletConfigSyncingUtil.NUKE_HIGH, BulletConfigSyncingUtil.NUKE_TOTS, BulletConfigSyncingUtil.NUKE_SAFE, BulletConfigSyncingUtil.NUKE_PUMPKIN, BulletConfigSyncingUtil.NUKE_BARREL);
/** MIRV MINI-NUKES **/
public static final List<Integer> fatmanMIRV = ImmutableList.of(BulletConfigSyncingUtil.NUKE_MIRV_NORMAL, BulletConfigSyncingUtil.NUKE_MIRV_LOW, BulletConfigSyncingUtil.NUKE_MIRV_HIGH, BulletConfigSyncingUtil.NUKE_MIRV_SAFE, BulletConfigSyncingUtil.NUKE_MIRV_SPECIAL);
/** 40MM GRENADE **/
public static final List<Integer> grenade = ImmutableList.of(BulletConfigSyncingUtil.GRENADE_NORMAL, BulletConfigSyncingUtil.GRENADE_HE, BulletConfigSyncingUtil.GRENADE_INCENDIARY, BulletConfigSyncingUtil.GRENADE_PHOSPHORUS, BulletConfigSyncingUtil.GRENADE_CHEMICAL, BulletConfigSyncingUtil.GRENADE_CONCUSSION, BulletConfigSyncingUtil.GRENADE_FINNED, BulletConfigSyncingUtil.GRENADE_SLEEK, BulletConfigSyncingUtil.GRENADE_NUCLEAR, BulletConfigSyncingUtil.GRENADE_TRACER, BulletConfigSyncingUtil.GRENADE_KAMPF);
/** 84MM ROCKET **/
public static final List<Integer> rocket = ImmutableList.of(BulletConfigSyncingUtil.ROCKET_NORMAL, BulletConfigSyncingUtil.ROCKET_HE, BulletConfigSyncingUtil.ROCKET_INCENDIARY, BulletConfigSyncingUtil.ROCKET_PHOSPHORUS, BulletConfigSyncingUtil.ROCKET_SHRAPNEL, BulletConfigSyncingUtil.ROCKET_EMP, BulletConfigSyncingUtil.ROCKET_GLARE, BulletConfigSyncingUtil.ROCKET_TOXIC, BulletConfigSyncingUtil.ROCKET_CANISTER, BulletConfigSyncingUtil.ROCKET_SLEEK, BulletConfigSyncingUtil.ROCKET_NUKE, BulletConfigSyncingUtil.ROCKET_CHAINSAW);
/// FREQUENTLY USED TRANSLATION KEYS
// GUN MANUFACTURERS
public static enum EnumGunManufacturer {
/**Armalite**/
ARMALITE,
/**Auto-Ordnance Corporation**/
AUTO_ORDINANCE,
/**BAE Systems plc**/
BAE,
/**Benelli Armi SpA**/
BENELLI,
/**Black Mesa Research Facility**/
BLACK_MESA,
/**Cerix Magnus**/
CERIX,
/**Colt's Manufacturing Company**/
COLT,
/**The Universal Union**/
COMBINE,
/**Cube 2: Sauerbraten**/
CUBE,
/**Enzinger Union**/
ENZINGER,
/**Equestria Missile Systems**/
EQUESTRIA,
/**Fisher Price**/
F_PRICE,
/**Fort Strong**/
F_STRONG,
/**FlimFlam Industries**/
FLIMFLAM,
/**Gloria GmbH**/
GLORIA,
/**Heckler & Koch**/
H_AND_K,
/**Harrington & Richardson**/
H_AND_R,
/**Hasbro**/
HASBRO,
/**Ironshod Firearms**/
IF,
/**Israel Military Industries**/
IMI,
/**IMI / Big MT**/
IMI_BIGMT,
/**Langford Research Laboratories**/
LANGFORD,
/**Magnum Research / Israel Military Industries**/
MAGNUM_R_IMI,
/**Open Mann Co.**/
MANN,
/**Hiram Maxim**/
MAXIM,
/**Metro Gunsmiths**/
METRO,
/**MWT Prototype Labs**/
MWT,
/**Erfurter Maschinenfabrik Geipel**/
NAZI,
/**No manufacturer, just puts "-" **/
NONE,
/**OxfordEM Technologies**/
OXFORD,
/**Lunar Defense Corp**/
LUNA,
/**Raytheon Missile Systems**/
RAYTHEON,
/**Rockwell International Corporation**/
ROCKWELL,
/**Rockwell International Corporation?**/
ROCKWELL_U,
/**Ryan Industries**/
RYAN,
/**Saab Bofors Dynamics**/
SAAB,
/**Saco Defense / US Ordnance**/
SACO,
/**Tulsky Oruzheiny Zavod**/
TULSKY,
/**Union Aerospace Corporation**/
UAC,
/**Unknown manufacturer, puts "???"**/
UNKNOWN,
/**WestTek**/
WESTTEK,
/**Wilhelm-Gustloff-Werke**/
WGW,
/**Winchester Repeating Arms Company**/
WINCHESTER,
/**Winchester Repeating Arms Company / Big MT**/
WINCHESTER_BIGMT;
public String getKey() {
return "gun.make." + toString();
}
}
// GUN DETAILS
public static final String ammo = "desc.item.gun.ammo";
public static final String ammoMag = "desc.item.gun.ammoMag";
public static final String ammoBelt = "desc.item.gun.ammoBelt";
public static final String ammoEnergy = "desc.item.gun.ammoEnergy";
public static final String altAmmoEnergy = "desc.item.gun.ammoEnergyAlt";
public static final String ammoType = "desc.item.gun.ammoType";
public static final String altAmmoType = "desc.item.gun.ammoTypeAlt";
public static final String gunName = "desc.item.gun.name";
public static final String gunMaker = "desc.item.gun.manufacturer";
public static final String gunDamage = "desc.item.gun.damage";
// MISC
public static final String capacity = "desc.block.barrel.capacity";
public static final String durability = "desc.item.durability";
public static final String meltPoint = "desc.misc.meltPoint";
public static final String lctrl = "desc.misc.lctrl";
public static final String lshift = "desc.misc.lshift";
}

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4480)";
public static final String VERSION = "1.0.27 BETA (4501)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -58,6 +58,7 @@ import com.hbm.entity.mob.botprime.*;
import com.hbm.entity.mob.siege.*;
import com.hbm.entity.particle.*;
import com.hbm.entity.projectile.*;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.HbmKeybinds;
import com.hbm.handler.ImpactWorldHandler;
import com.hbm.handler.HbmKeybinds.EnumKeybind;
@ -475,7 +476,6 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_avenger, new ItemRenderOverkill());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_lacunae, new ItemRenderOverkill());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_folly, new ItemRenderOverkill());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_brimstone, new ItemRenderObj());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_hk69, new ItemRenderWeaponObj());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bio_revolver, new ItemRenderBioRevolver());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_deagle, new ItemRenderWeaponObj());
@ -1790,6 +1790,17 @@ public class ClientProxy extends ServerProxy {
RenderOverhead.queuedMarkers.put(new BlockPos(x, y, z), new Marker(color).setDist(dist).setExpire(expires > 0 ? System.currentTimeMillis() + expires : 0).withLabel(label.isEmpty() ? null : label));
}
if("casing".equals(type)) {
CasingEjector ejector = CasingEjector.fromId(data.getInteger("ej"));
if(ejector == null) return;
SpentCasing casingConfig = SpentCasing.fromName((data.getString("name")));
if(casingConfig == null) return;
for(int i = 0; i < ejector.getAmount(); i++) {
ejector.spawnCasing(man, casingConfig, world, x, y, z, data.getFloat("pitch"), data.getFloat("yaw"), data.getBoolean("crouched"));
}
}
}
private HashMap<Integer, Long> vanished = new HashMap();

View File

@ -17,6 +17,8 @@ import com.hbm.inventory.fluid.Fluids;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo50BMG;
import com.hbm.items.ItemAmmoEnums.Ammo5mm;
import com.hbm.items.ItemEnums.EnumLegendaryType;
import com.hbm.items.ItemEnums.EnumPlantType;
import com.hbm.items.ItemGenericPart.EnumPartType;
@ -229,7 +231,7 @@ public class CraftingManager {
ItemStack infinity = new ItemStack(Items.enchanted_book);
EnchantmentUtil.addEnchantment(infinity, Enchantment.infinity, 1);
addRecipeAuto(infinity, new Object[] { "SBS", "BDB", "SBS", 'S', ModItems.ammo_50bmg_star, 'B', ModItems.ammo_5mm_star, 'D', ModItems.powder_magic });
addRecipeAuto(infinity, new Object[] { "SBS", "BDB", "SBS", 'S', ModItems.ammo_50bmg.stackFromEnum(Ammo50BMG.STAR), 'B', ModItems.ammo_5mm.stackFromEnum(Ammo5mm.STAR), 'D', ModItems.powder_magic });
ItemStack unbreaking = new ItemStack(Items.enchanted_book);
EnchantmentUtil.addEnchantment(unbreaking, Enchantment.unbreaking, 3);
addRecipeAuto(unbreaking, new Object[] { "SBS", "BDB", "SBS", 'S', BIGMT.ingot(), 'B', ModItems.plate_armor_lunar, 'D', ModItems.powder_magic });

View File

@ -60,6 +60,7 @@ import com.hbm.inventory.recipes.*;
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo4Gauge;
import com.hbm.lib.HbmWorld;
import com.hbm.lib.Library;
import com.hbm.lib.RefStrings;
@ -617,7 +618,7 @@ public class MainRegistry {
achStratum = new Achievement("achievement.stratum", "stratum", -4, -2, new ItemStack(ModBlocks.stone_gneiss), null).initIndependentStat().setSpecial().registerStat();
achOmega12 = new Achievement("achievement.omega12", "omega12", 17, -1, ModItems.particle_digamma, null).initIndependentStat().setSpecial().registerStat();
achWitchtaunter = new Achievement("achievement.witchtaunter", "witchtaunter", -8, 7, ModItems.ammo_4gauge_vampire, null).initIndependentStat().setSpecial().registerStat();
achWitchtaunter = new Achievement("achievement.witchtaunter", "witchtaunter", -8, 7, ModItems.ammo_4gauge.stackFromEnum(Ammo4Gauge.VAMPIRE), null).initIndependentStat().setSpecial().registerStat();
achSlimeball = new Achievement("achievement.slimeball", "slimeball", -10, 6, Items.slime_ball, null).initIndependentStat().registerStat();
achSulfuric = new Achievement("achievement.sulfuric", "sulfuric", -10, 8, ModItems.bucket_sulfuric_acid, achSlimeball).initIndependentStat().setSpecial().registerStat();
@ -997,6 +998,7 @@ public class MainRegistry {
ignoreMappings.add("hbm:item.pirfenidone");
ignoreMappings.add("hbm:item.coin_siege");
ignoreMappings.add("hbm:item.source");
ignoreMappings.add("hbm:item.gun_brimstone");
/// REMAP ///
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);

View File

@ -19,6 +19,7 @@ import com.hbm.entity.projectile.EntityChopperMine;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.handler.ArmorModHandler;
import com.hbm.handler.GunConfiguration;
import com.hbm.handler.HTTPHandler;
import com.hbm.handler.HazmatRegistry;
import com.hbm.handler.ImpactWorldHandler;
@ -113,6 +114,7 @@ import net.minecraft.world.World;
import net.minecraft.world.WorldProviderSurface;
import net.minecraftforge.client.GuiIngameForge;
import net.minecraftforge.client.IRenderHandler;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.client.event.MouseEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
@ -219,6 +221,18 @@ public class ModEventHandlerClient {
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(0, 0, 0, 999, 0));
}
/// HANDLE SCOPE OVERLAY ///
ItemStack held = player.getHeldItem();
if(player.isSneaking() && held != null && held.getItem() instanceof ItemGunBase && event.type == event.type.HOTBAR) {
GunConfiguration config = ((ItemGunBase) held.getItem()).mainConfig;
if(config.scopeTexture != null) {
ScaledResolution resolution = event.resolution;
RenderScreenOverlay.renderScope(resolution, config.scopeTexture);
}
}
/// HANDLE FSB HUD ///
ItemStack helmet = player.inventory.armorInventory[3];
@ -327,6 +341,27 @@ public class ModEventHandlerClient {
}
}
@SubscribeEvent
public void setupFOV(FOVUpdateEvent event) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
ItemStack held = player.getHeldItem();
if(held == null) return;
if(!(held.getItem() instanceof ItemGunBase)) return;
GunConfiguration config = ((ItemGunBase) held.getItem()).mainConfig;
if(config == null) return;
if(config.zoomFOV == 0F || !player.isSneaking()) return;
if(config.absoluteFOV) {
event.newfov = config.zoomFOV;
} else {
event.newfov += config.zoomFOV;
}
}
public static boolean ducked = false;
@SubscribeEvent

View File

@ -21,29 +21,6 @@ public class ResourceManager {
////Obj TEs
//Turrets
public static final IModelCustom turret_heavy_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_heavy_base.obj"));
public static final IModelCustom turret_heavy_rotor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_heavy_rotor.obj"));
public static final IModelCustom turret_spitfire_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_spitfire_base.obj"));
public static final IModelCustom turret_spitfire_rotor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_spitfire_rotor.obj"));
public static final IModelCustom turret_cwis_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/cwis_base.obj"));
public static final IModelCustom turret_cwis_rotor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/cwis_rotor.obj"));
public static final IModelCustom turret_cheapo_base = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_cheapo_base.obj"));
public static final IModelCustom turret_cheapo_rotor = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_cheapo_rotor.obj"));
public static final IModelCustom turret_heavy_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_heavy_gun.obj"));
public static final IModelCustom turret_rocket_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_rocket_gun.obj"));
public static final IModelCustom turret_light_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_light_gun.obj"));
public static final IModelCustom turret_flamer_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_flamer_gun.obj"));
public static final IModelCustom turret_tau_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_tau_gun.obj"));
public static final IModelCustom turret_spitfire_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_spitfire_gun.obj"));
public static final IModelCustom turret_cwis_head = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/cwis_head.obj"));
public static final IModelCustom turret_cwis_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/cwis_gun.obj"));
public static final IModelCustom turret_cheapo_head = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_cheapo_head.obj"));
public static final IModelCustom turret_cheapo_gun = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/turret_cheapo_gun.obj"));
public static final IModelCustom turret_chekhov = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_chekhov.obj"));
public static final IModelCustom turret_jeremy = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_jeremy.obj"));
public static final IModelCustom turret_tauon = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/turrets/turret_tauon.obj"));
@ -340,27 +317,6 @@ public class ResourceManager {
public static final ResourceLocation universal = new ResourceLocation(RefStrings.MODID, "textures/models/TheGadget3_.png");
public static final ResourceLocation universal_bright = new ResourceLocation(RefStrings.MODID, "textures/models/turbofan_blades.png");
public static final ResourceLocation turret_heavy_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_heavy_base.png");
public static final ResourceLocation turret_heavy_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_heavy_rotor.png");
public static final ResourceLocation turret_heavy_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_heavy_gun.png");
public static final ResourceLocation turret_light_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_light_rotor.png");
public static final ResourceLocation turret_light_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_light_gun.png");
public static final ResourceLocation turret_rocket_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_rocket_rotor.png");
public static final ResourceLocation turret_rocket_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_rocket_gun.png");
public static final ResourceLocation turret_flamer_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_flamer_rotor.png");
public static final ResourceLocation turret_flamer_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_flamer_gun.png");
public static final ResourceLocation turret_tau_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_tau_rotor.png");
public static final ResourceLocation turret_tau_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_tau_gun.png");
public static final ResourceLocation turret_ciws_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/cwis_base.png");
public static final ResourceLocation turret_ciws_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/cwis_rotor.png");
public static final ResourceLocation turret_ciws_head_tex = new ResourceLocation(RefStrings.MODID, "textures/models/cwis_head.png");
public static final ResourceLocation turret_ciws_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/cwis_gun.png");
public static final ResourceLocation turret_cheapo_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_cheapo_base.png");
public static final ResourceLocation turret_cheapo_rotor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_cheapo_rotor.png");
public static final ResourceLocation turret_cheapo_head_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_cheapo_head.png");
public static final ResourceLocation turret_cheapo_gun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turret_cheapo_gun.png");
public static final ResourceLocation turret_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/base.png");
public static final ResourceLocation turret_base_friendly_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/base_friendly.png");
public static final ResourceLocation turret_carriage_tex = new ResourceLocation(RefStrings.MODID, "textures/models/turrets/carriage.png");
@ -699,7 +655,6 @@ public class ResourceManager {
public static final IModelCustom crucible = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/crucible.obj"));
public static final IModelCustom chainsaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chainsaw.obj"), false);
public static final IModelCustom brimstone = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/brimstone.obj"));
public static final IModelCustom hk69 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/hk69.obj"));
public static final IModelCustom deagle = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/deagle.obj"));
public static final IModelCustom shotty = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/supershotty.obj"));
@ -770,7 +725,6 @@ public class ResourceManager {
public static final ResourceLocation crucible_blade = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_blade.png");
public static final ResourceLocation chainsaw_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/chainsaw.png");
public static final ResourceLocation brimstone_tex = new ResourceLocation(RefStrings.MODID, "textures/models/brimstone.png");
public static final ResourceLocation hk69_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/hk69.png");
public static final ResourceLocation deagle_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/deagle.png");
public static final ResourceLocation ks23_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/ks23.png");
@ -911,6 +865,7 @@ public class ResourceManager {
//Projectiles
public static final IModelCustom projectiles = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/projectiles/projectiles.obj"));
public static final IModelCustom casings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/effect/casings.obj"));
//Bomber
public static final IModelCustom dornier = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/dornier.obj"));
@ -1036,6 +991,7 @@ public class ResourceManager {
public static final ResourceLocation rocket_mirv_tex = new ResourceLocation(RefStrings.MODID, "textures/models/projectiles/rocket_mirv.png");
public static final ResourceLocation mini_nuke_tex = new ResourceLocation(RefStrings.MODID, "textures/models/projectiles/mini_nuke.png");
public static final ResourceLocation mini_mirv_tex = new ResourceLocation(RefStrings.MODID, "textures/models/projectiles/mini_mirv.png");
public static final ResourceLocation casings_tex = new ResourceLocation(RefStrings.MODID, "textures/particle/casings.png");
//Bomber
public static final ResourceLocation dornier_0_tex = new ResourceLocation(RefStrings.MODID, "textures/models/dornier_0.png");

View File

@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.container.ContainerAnvil;
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
import com.hbm.inventory.recipes.anvil.AnvilRecipes.AnvilConstructionRecipe;
import com.hbm.items.ItemAmmoEnums;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import com.hbm.util.InventoryUtil;
@ -52,7 +53,7 @@ public class AnvilCraftPacket implements IMessage {
if(!(p.openContainer instanceof ContainerAnvil)) //player isn't even using an anvil -> bad
return null;
ContainerAnvil anvil = (ContainerAnvil)p.openContainer;
ContainerAnvil anvil = (ContainerAnvil) p.openContainer;
AnvilConstructionRecipe recipe = AnvilRecipes.getConstruction().get(m.recipeIndex);
if(!recipe.isTierValid(anvil.tier)) //player is using the wrong type of anvil -> bad
@ -71,7 +72,7 @@ public class AnvilCraftPacket implements IMessage {
p.triggerAchievement(MainRegistry.achAssembly);
if(recipe.output.get(0).stack.getItem() == ModItems.billet_pu_mix)
p.triggerAchievement(MainRegistry.achChicagoPile);
if(recipe.output.get(0).stack.getItem() == ModItems.ammo_4gauge_vampire)
if(recipe.output.get(0).stack.getItem() == ModItems.ammo_4gauge && recipe.output.get(0).stack.getItemDamage() == ItemAmmoEnums.Ammo4Gauge.VAMPIRE.ordinal())
p.triggerAchievement(MainRegistry.achWitchtaunter);
} else {

View File

@ -6,9 +6,11 @@ import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
@ -26,9 +28,14 @@ public class ParticleAmatFlash extends EntityFX {
public void renderParticle(Tessellator tess, float interp, float x, float y, float z, float tx, float tz) {
float pX = (float) ((this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX));
float pY = (float) ((this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY));
float pZ = (float) ((this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ));
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
double dX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)interp;
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)interp;
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
float pX = (float) ((this.prevPosX + (this.posX - this.prevPosX) * (double) interp - dX));
float pY = (float) ((this.prevPosY + (this.posY - this.prevPosY) * (double) interp - dY));
float pZ = (float) ((this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - dZ));
GL11.glPushMatrix();

View File

@ -11,6 +11,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
@ -67,10 +68,16 @@ public class ParticleGiblet extends EntityFX {
GL11.glDisable(GL11.GL_LIGHTING);
this.theRenderEngine.bindTexture(texture);
/* use this instead of EntityFX.interpPosN since interpPosN isn't set up correctly for the current tick for layer 3 particles */
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
double dX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)interp;
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)interp;
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
float f10 = this.particleScale * 0.1F;
float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - interpPosX);
float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - interpPosY);
float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - interpPosZ);
float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) interp - dX);
float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) interp - dY);
float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) interp - dZ);
tess.startDrawingQuads();
tess.setNormal(0.0F, 1.0F, 0.0F);

View File

@ -0,0 +1,294 @@
package com.hbm.particle;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.hbm.main.ResourceManager;
import com.hbm.util.Tuple.Pair;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleSpentCasing extends EntityFX {
public static final Random rand = new Random();
private static float dScale = 0.05F, smokeJitter = 0.001F;
private int maxSmokeGen = 120;
private double smokeLift = 0.5D;
private int nodeLife = 30;
private final List<Pair<Vec3, Double>> smokeNodes = new ArrayList();
private final TextureManager textureManager;
private final SpentCasing config;
private boolean isSmoking;
private float momentumPitch, momentumYaw;
private boolean onGroundPreviously = false;
private double maxHeight;
public ParticleSpentCasing(TextureManager textureManager, World world, double x, double y, double z, double mx, double my, double mz, float momentumPitch, float momentumYaw, SpentCasing config) {
super(world, x, y, z, 0, 0, 0);
this.textureManager = textureManager;
this.momentumPitch = momentumPitch;
this.momentumYaw = momentumYaw;
this.config = config;
this.particleMaxAge = config.getMaxAge();
this.isSmoking = rand.nextFloat() < config.getSmokeChance();
this.maxSmokeGen = config.getSmokeDuration();
this.smokeLift = config.getSmokeLift();
this.nodeLife = config.getSmokeNodeLife();
this.prevPosX = x;
this.prevPosY = y;
this.prevPosZ = z;
this.motionX = mx;
this.motionY = my;
this.motionZ = mz;
particleGravity = 8F;
maxHeight = y;
}
@Override
public int getFXLayer() {
return 3;
}
@Override
public void onUpdate() {
super.onUpdate();
if(motionY > 0 && posY > maxHeight)
maxHeight = posY;
if(!onGroundPreviously && onGround)
tryPlayBounceSound();
if(!onGroundPreviously && onGround) {
onGroundPreviously = true;
motionY = Math.log10(maxHeight - posY + 2);
momentumPitch = (float) rand.nextGaussian() * config.getBouncePitch();
momentumYaw = (float) rand.nextGaussian() * config.getBounceYaw();
maxHeight = posY;
} else if(onGroundPreviously && !onGround) {
onGroundPreviously = false;
}
if(particleAge > maxSmokeGen && !smokeNodes.isEmpty())
smokeNodes.clear();
if(isSmoking && particleAge <= maxSmokeGen) {
for(Pair<Vec3, Double> pair : smokeNodes) {
Vec3 node = pair.getKey();
node.xCoord += rand.nextGaussian() * smokeJitter;
node.zCoord += rand.nextGaussian() * smokeJitter;
node.yCoord += smokeLift * dScale;
pair.value = Math.max(0, pair.value - (1D / (double) nodeLife));
}
if(particleAge < maxSmokeGen || inWater) {
smokeNodes.add(new Pair<Vec3, Double>(Vec3.createVectorHelper(0, 0, 0), smokeNodes.isEmpty() ? 0.0D : 1D));
}
}
prevRotationPitch = rotationPitch;
prevRotationYaw = rotationYaw;
if(onGround) {
rotationPitch = 0;
} else {
rotationPitch += momentumPitch;
rotationYaw += momentumYaw;
}
}
/** Used for frame-perfect translation of smoke */
private boolean setupDeltas = false;
private double prevRenderX;
private double prevRenderY;
private double prevRenderZ;
@Override
public void renderParticle(Tessellator tessellator, float interp, float x, float y, float z, float tx, float tz) {
GL11.glPushMatrix();
RenderHelper.enableStandardItemLighting();
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glDepthMask(true);
double pX = prevPosX + (posX - prevPosX) * interp;
double pY = prevPosY + (posY - prevPosY) * interp;
double pZ = prevPosZ + (posZ - prevPosZ) * interp;
if(!setupDeltas) {
prevRenderX = pX;
prevRenderY = pY;
prevRenderZ = pZ;
setupDeltas = true;
}
int brightness = worldObj.getLightBrightnessForSkyBlocks(MathHelper.floor_double(pX), MathHelper.floor_double(pY), MathHelper.floor_double(pZ), 0);
int lX = brightness % 65536;
int lY = brightness / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
textureManager.bindTexture(ResourceManager.casings_tex);
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
double dX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)interp;
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)interp;
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
GL11.glTranslated(pX - dX, pY - dY - this.height / 4 + config.getScaleY() * 0.01, pZ - dZ);
GL11.glScalef(dScale, dScale, dScale);
GL11.glRotatef(180 - rotationYaw, 0, 1, 0);
GL11.glRotatef(-rotationPitch, 1, 0, 0);
GL11.glScalef(config.getScaleX(), config.getScaleY(), config.getScaleZ());
int index = 0;
for(String name : config.getType().partNames) {
int col = this.config.getColors()[index]; //unsafe on purpose, set your colors properly or else...!
Color color = new Color(col);
GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
ResourceManager.casings.renderPart(name);
index++;
}
GL11.glColor3f(1F, 1F, 1F);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslated(pX - dX, pY - dY - this.height / 4, pZ - dZ);
//GL11.glScalef(dScale, dScale, dScale);
//GL11.glScalef(config.getScaleX(), config.getScaleY(), config.getScaleZ());
if(!smokeNodes.isEmpty()) {
tessellator.startDrawingQuads();
tessellator.setNormal(0F, 1F, 0F);
float scale = config.getScaleX() * 0.5F * dScale;
Vec3 vec = Vec3.createVectorHelper(scale, 0, 0);
float yaw = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * interp;
vec.rotateAroundY((float) Math.toRadians(-yaw));
double deltaX = prevRenderX - pX;
double deltaY = prevRenderY - pY;
double deltaZ = prevRenderZ - pZ;
for(Pair<Vec3, Double> pair : smokeNodes) {
Vec3 pos = pair.getKey();
double mult = 1D;
pos.xCoord += deltaX * mult;
pos.yCoord += deltaY * mult;
pos.zCoord += deltaZ * mult;
}
for(int i = 0; i < smokeNodes.size() - 1; i++) {
final Pair<Vec3, Double> node = smokeNodes.get(i), past = smokeNodes.get(i + 1);
final Vec3 nodeLoc = node.getKey(), pastLoc = past.getKey();
float nodeAlpha = node.getValue().floatValue();
float pastAlpha = past.getValue().floatValue();
double timeAlpha = 1D - (double) particleAge / (double) maxSmokeGen;
nodeAlpha *= timeAlpha;
pastAlpha *= timeAlpha;
tessellator.setNormal(0F, 1F, 0F);
tessellator.setColorRGBA_F(1F, 1F, 1F, nodeAlpha);
tessellator.addVertex(nodeLoc.xCoord, nodeLoc.yCoord, nodeLoc.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, 0F);
tessellator.addVertex(nodeLoc.xCoord + vec.xCoord, nodeLoc.yCoord, nodeLoc.zCoord + vec.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, 0F);
tessellator.addVertex(pastLoc.xCoord + vec.xCoord, pastLoc.yCoord, pastLoc.zCoord + vec.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, pastAlpha);
tessellator.addVertex(pastLoc.xCoord, pastLoc.yCoord, pastLoc.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, nodeAlpha);
tessellator.addVertex(nodeLoc.xCoord, nodeLoc.yCoord, nodeLoc.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, 0F);
tessellator.addVertex(nodeLoc.xCoord - vec.xCoord, nodeLoc.yCoord, nodeLoc.zCoord - vec.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, 0F);
tessellator.addVertex(pastLoc.xCoord - vec.xCoord, pastLoc.yCoord, pastLoc.zCoord - vec.zCoord);
tessellator.setColorRGBA_F(1F, 1F, 1F, pastAlpha);
tessellator.addVertex(pastLoc.xCoord, pastLoc.yCoord, pastLoc.zCoord);
}
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_CULL_FACE);
tessellator.draw();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F);
}
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPopMatrix();
RenderHelper.disableStandardItemLighting();
prevRenderX = pX;
prevRenderY = pY;
prevRenderZ = pZ;
}
@Override
@SideOnly(Side.CLIENT)
public int getBrightnessForRender(float p_70070_1_) {
int i = MathHelper.floor_double(this.posX);
int j = MathHelper.floor_double(this.posZ);
if(this.worldObj.blockExists(i, 0, j)) {
double d0 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
int k = MathHelper.floor_double(this.posY - (double) this.yOffset + d0);
return this.worldObj.getLightBrightnessForSkyBlocks(i, k, j, 0);
} else {
return 0;
}
}
private void tryPlayBounceSound() {
String sound = config.getSound();
if(sound != null && !sound.isEmpty()) {
worldObj.playSoundAtEntity(this, sound, 2, 1);
}
}
}

View File

@ -0,0 +1,131 @@
package com.hbm.particle;
import java.util.HashMap;
/**
* Definition for spent casing particles, what style and color they should use
* @author uffr, hbm
*/
public class SpentCasing implements Cloneable {
public static final int COLOR_CASE_BRASS = 0xEBC35E;
public static final int COLOR_CASE_12GA = 0x757575;
public static final int COLOR_CASE_4GA = 0xD8D8D8;
public static final int COLOR_CASE_44 = 0x3E3E3E;
public static final int COLOR_CASE_16INCH = 0xD89128;
public static final int COLOR_CASE_16INCH_PHOS = 0xC8C8C8;
public static final int COLOR_CASE_16INCH_NUKE = 0x495443;
public static final HashMap<String, SpentCasing> casingMap = new HashMap();
public enum CasingType {
STRAIGHT("Straight"),
BOTTLENECK("Bottleneck"),
SHOTGUN("Shotgun", "ShotgunCase"), //plastic shell, brass case
AR2("AR2", "AR2Highlight"); //plug, back detailing
public final String[] partNames;
private CasingType(String... names) {
this.partNames = names;
}
}
private String registryName;
private float scaleX = 1F;
private float scaleY = 1F;
private float scaleZ = 1F;
private int[] colors;
private CasingType type;
private String bounceSound;
private float smokeChance;
private int smokeDuration;
private double smokeLift;
private int smokeNodeLife;
private float bounceYaw = 0F;
private float bouncePitch = 0F;
private int maxAge = 240;
public SpentCasing(CasingType type) {
this.type = type;
}
/** Separated from the ctor to allow for easy creation of new casings from templates that don't need to be registered */
public SpentCasing register(String name) {
this.registryName = name;
casingMap.put(name, this);
return this;
}
public SpentCasing setScale(float scale) {
this.scaleX = scale;
this.scaleY = scale;
this.scaleZ = scale;
return this;
}
public SpentCasing setScale(float x, float y, float z) {
this.scaleX = x;
this.scaleY = y;
this.scaleZ = z;
return this;
}
/** The number of colors has to match the number of objects of the chosen casing type. Brass/metal casing color has to come last to comply with the chorophyte coloring. */
public SpentCasing setColor(int... color) {
this.colors = color;
return this;
}
public SpentCasing setSound(String bounce) {
this.bounceSound = bounce;
return this;
}
public SpentCasing setupSmoke(float chance, double lift, int duration, int nodeLife) {
this.smokeChance = chance;
this.smokeDuration = duration;
this.smokeLift = lift;
this.smokeNodeLife = nodeLife;
return this;
}
public static SpentCasing fromName(String name) {
return casingMap.get(name);
}
public SpentCasing setBounceMotion(float yaw, float pitch) {
this.bounceYaw = yaw;
this.bouncePitch = pitch;
return this;
}
public SpentCasing setMaxAge(int age) {
this.maxAge = age;
return this;
}
public String getName() { return this.registryName; }
public float getScaleX() { return this.scaleX; }
public float getScaleY() { return this.scaleY; }
public float getScaleZ() { return this.scaleZ; }
public int[] getColors() { return this.colors; }
public CasingType getType() { return this.type; }
public String getSound() { return this.bounceSound; }
public float getSmokeChance() { return this.smokeChance; }
public float getBounceYaw() { return this.bounceYaw; }
public float getBouncePitch() { return this.bouncePitch; }
public int getMaxAge() { return this.maxAge; }
public int getSmokeDuration() { return this.smokeDuration; }
public double getSmokeLift() { return this.smokeLift; }
public int getSmokeNodeLife() { return this.smokeNodeLife; }
@Override
public SpentCasing clone() {
try {
return (SpentCasing) super.clone();
} catch(CloneNotSupportedException e) {
return new SpentCasing(this.type);
}
}
}

View File

@ -36,7 +36,7 @@ public class HbmPotion extends Potion {
public static HbmPotion radx;
public static HbmPotion lead;
public static HbmPotion radaway;
public static HbmPotion telekinesis;
//public static HbmPotion telekinesis;
public static HbmPotion phosphorus;
public static HbmPotion stability;
public static HbmPotion potionsickness;
@ -54,7 +54,7 @@ public class HbmPotion extends Potion {
radx = registerPotion(PotionConfig.radxID, false, 0xBB4B00, "potion.hbm_radx", 5, 0);
lead = registerPotion(PotionConfig.leadID, true, 0x767682, "potion.hbm_lead", 6, 0);
radaway = registerPotion(PotionConfig.radawayID, false, 0xBB4B00, "potion.hbm_radaway", 7, 0);
telekinesis = registerPotion(PotionConfig.telekinesisID, true, 0x00F3FF, "potion.hbm_telekinesis", 0, 1);
//telekinesis = registerPotion(PotionConfig.telekinesisID, true, 0x00F3FF, "potion.hbm_telekinesis", 0, 1);
phosphorus = registerPotion(PotionConfig.phosphorusID, true, 0xFFFF00, "potion.hbm_phosphorus", 1, 1);
stability = registerPotion(PotionConfig.stabilityID, false, 0xD0D0D0, "potion.hbm_stability", 2, 1);
potionsickness = registerPotion(PotionConfig.potionsicknessID, false, 0xff8080, "potion.hbm_potionsickness", 3, 1);
@ -148,7 +148,7 @@ public class HbmPotion extends Potion {
entity.attackEntityFrom(ModDamageSource.lead, (level + 1));
}
if(this == telekinesis) {
/*if(this == telekinesis) {
int remaining = entity.getActivePotionEffect(this).getDuration();
@ -158,7 +158,7 @@ public class HbmPotion extends Potion {
entity.motionY = -2;
entity.fallDistance = 50;
}
}
}*/
if(this == phosphorus && !entity.worldObj.isRemote) {
entity.setFire(1);
@ -171,7 +171,7 @@ public class HbmPotion extends Potion {
return par1 % 2 == 0;
}
if(this == radiation || this == radaway || this == telekinesis || this == phosphorus) {
if(this == radiation || this == radaway || /*this == telekinesis ||*/ this == phosphorus) {
return true;
}

View File

@ -8,8 +8,8 @@ import com.hbm.items.weapon.ItemGunBase;
import com.hbm.main.ResourceManager;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderFireExt implements IItemRenderer {
@ -43,14 +43,14 @@ public class ItemRenderFireExt implements IItemRenderer {
int magType = ItemGunBase.getMagType(item);
int config = ((ItemGunBase)ModItems.gun_fireext).mainConfig.config.get(magType);
Item ammo = BulletConfigSyncingUtil.pullConfig(config).ammo;
if(ammo == ModItems.ammo_fireext_foam)
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fireext_foam_tex);
else if(ammo == ModItems.ammo_fireext_sand)
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fireext_sand_tex);
else
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.fireext_tex);
int ammo = BulletConfigSyncingUtil.pullConfig(config).ammo.meta;
ResourceLocation tex;
switch (ammo) {
case 0: tex = ResourceManager.fireext_foam_tex; break;
case 1: tex = ResourceManager.fireext_sand_tex; break;
default: tex = ResourceManager.fireext_tex; break;
}
Minecraft.getMinecraft().renderEngine.bindTexture(tex);
switch(type) {

View File

@ -4,14 +4,10 @@ import org.lwjgl.opengl.GL11;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.GunB92;
import com.hbm.items.weapon.GunBoltAction;
import com.hbm.items.weapon.GunLeverAction;
import com.hbm.items.weapon.GunLeverActionS;
import com.hbm.lib.RefStrings;
import com.hbm.render.anim.HbmAnimations;
import com.hbm.render.model.ModelB92;
import com.hbm.render.model.ModelB93;
import com.hbm.render.model.ModelBoltAction;
import com.hbm.render.model.ModelLeverAction;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
@ -21,14 +17,12 @@ import net.minecraftforge.client.IItemRenderer;
public class ItemRenderGunAnim implements IItemRenderer {
protected ModelLeverAction leveraction;
protected ModelBoltAction boltaction;
protected ModelLeverAction flippedGun;
protected ModelB92 b92;
protected ModelB93 b93;
public ItemRenderGunAnim() {
leveraction = new ModelLeverAction();
boltaction = new ModelBoltAction();
flippedGun = new ModelLeverAction();
b92 = new ModelB92();
b93 = new ModelB93();
}
@ -52,24 +46,14 @@ public class ItemRenderGunAnim implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
float lever = 0;
switch(type) {
case EQUIPPED_FIRST_PERSON:
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
if(item.getItem() == ModItems.gun_lever_action || item.getItem() == ModItems.gun_lever_action_sonata)
if(item.getItem() == ModItems.gun_lever_action_sonata)
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelLeverAction.png"));
if(item.getItem() == ModItems.gun_bolt_action)
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelBoltActionDark.png"));
if(item.getItem() == ModItems.gun_lever_action_dark)
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelLeverActionDark.png"));
if(item.getItem() == ModItems.gun_bolt_action_green)
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelBoltActionGreen.png"));
if(item.getItem() == ModItems.gun_bolt_action_saturnite)
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelBoltActionSaturnite.png"));
if(item.getItem() == ModItems.gun_b92)
Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID +":textures/models/ModelB92SM.png"));
if(item.getItem() == ModItems.gun_b93)
@ -87,29 +71,12 @@ public class ItemRenderGunAnim implements IItemRenderer {
GL11.glTranslatef(2.3F, 0.2F, 0.8F);
}
if(item.getItem() == ModItems.gun_lever_action || item.getItem() == ModItems.gun_lever_action_dark) {
double[] recoil = HbmAnimations.getRelevantTransformation("LEVER_RECOIL");
GL11.glTranslated(recoil[0], recoil[1] * 4, recoil[2]);
GL11.glTranslatef(-1.5F, 0, 0);
double[] rotation = HbmAnimations.getRelevantTransformation("LEVER_ROTATE");
GL11.glRotated(rotation[2], 0.0, 0.0, 1.0);
lever = (float) Math.toRadians(rotation[2] * 2);
GL11.glTranslatef(1.5F, 0, 0);
}
if((item.getItem() == ModItems.gun_lever_action_sonata) && GunLeverActionS.getRotationFromAnim(item) > 0) {
GL11.glRotatef(GunLeverActionS.getRotationFromAnim(item) * -25, 0.0F, 0.0F, 1.0F);
GL11.glTranslatef(GunLeverActionS.getOffsetFromAnim(item) * 1.5F, 0.0F, 0.0F);
GL11.glTranslatef(0.0F, GunLeverActionS.getOffsetFromAnim(item) * -1.5F, 0.0F);
}
if((item.getItem() == ModItems.gun_bolt_action || item.getItem() == ModItems.gun_bolt_action_green || item.getItem() == ModItems.gun_bolt_action_saturnite) && GunBoltAction.getRotationFromAnim(item) > 0) {
GL11.glRotatef(GunBoltAction.getRotationFromAnim(item) * 10, 2.5F, 0.0F, 1.5F);
GL11.glTranslatef(GunBoltAction.getOffsetFromAnim(item) * -1.75F, 0.0F, 0.0F);
}
if(item.getItem() == ModItems.gun_b92 && GunB92.getRotationFromAnim(item) > 0) {
float off = GunB92.getRotationFromAnim(item) * 2;
GL11.glRotatef(GunB92.getRotationFromAnim(item) * -90, 0.0F, 0.0F, 1.0F);
@ -122,21 +89,8 @@ public class ItemRenderGunAnim implements IItemRenderer {
GL11.glTranslatef(off * -0.5F, off * -0.5F, 0.0F);
}
if(item.getItem() == ModItems.gun_bolt_action || item.getItem() == ModItems.gun_bolt_action_green ||
item.getItem() == ModItems.gun_lever_action || item.getItem() == ModItems.gun_lever_action_dark
|| item.getItem() == ModItems.gun_bolt_action_saturnite) {
GL11.glTranslatef(0.0F, -0.4F, 0.0F);
GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(5.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.2F, 0.0F, -0.2F);
}
if(item.getItem() == ModItems.gun_lever_action || item.getItem() == ModItems.gun_lever_action_dark)
leveraction.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, lever);
if(item.getItem() == ModItems.gun_lever_action_sonata)
leveraction.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunLeverActionS.getRotationFromAnim(item));
if(item.getItem() == ModItems.gun_bolt_action || item.getItem() == ModItems.gun_bolt_action_green || item.getItem() == ModItems.gun_bolt_action_saturnite)
boltaction.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunBoltAction.getLevRotationFromAnim(item), GunBoltAction.getTransFromAnim(item));
flippedGun.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunLeverActionS.getRotationFromAnim(item));
if(item.getItem() == ModItems.gun_b92)
b92.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunB92.getTransFromAnim(item));
if(item.getItem() == ModItems.gun_b93)
@ -177,12 +131,8 @@ public class ItemRenderGunAnim implements IItemRenderer {
GL11.glTranslatef(2.3F, 0.2F, 0.8F);
}
if(item.getItem() == ModItems.gun_lever_action || item.getItem() == ModItems.gun_lever_action_dark)
leveraction.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunLeverAction.getRotationFromAnim(item));
if(item.getItem() == ModItems.gun_lever_action_sonata)
leveraction.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunLeverActionS.getRotationFromAnim(item));
if(item.getItem() == ModItems.gun_bolt_action || item.getItem() == ModItems.gun_bolt_action_green || item.getItem() == ModItems.gun_bolt_action_saturnite)
boltaction.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunBoltAction.getLevRotationFromAnim(item), GunBoltAction.getTransFromAnim(item));
flippedGun.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunLeverActionS.getRotationFromAnim(item));
if(item.getItem() == ModItems.gun_b92)
b92.renderAnim((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, GunB92.getTransFromAnim(item));
if(item.getItem() == ModItems.gun_b93)

View File

@ -1,57 +0,0 @@
package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.items.ModItems;
import com.hbm.main.ResourceManager;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class ItemRenderObj implements IItemRenderer {
public ItemRenderObj() { }
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
switch(type) {
case EQUIPPED:
case EQUIPPED_FIRST_PERSON:
case ENTITY:
return true;
default: return false;
}
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return false;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
switch(type) {
case EQUIPPED_FIRST_PERSON:
GL11.glRotatef(70F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-50F, 1.0F, 0.0F, 0.0F);
GL11.glTranslatef(-0.6F, -0.9F, 0.2F);
case EQUIPPED:
case ENTITY:
default:
GL11.glPushMatrix();
if(item.getItem() == ModItems.gun_brimstone)
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.brimstone_tex);
//GL11.glRotatef(-135.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(10F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(190F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-15F, 0.0F, 0.0F, 1.0F);
GL11.glScalef(0.75F, 0.75F, 0.75F);
GL11.glTranslatef(-0.7F, -0.4F, -1.1F);
GL11.glDisable(GL11.GL_CULL_FACE);
if(item.getItem() == ModItems.gun_brimstone)
ResourceManager.brimstone.renderAll();
GL11.glPopMatrix(); break;
}
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.render.item.weapon;
import org.lwjgl.opengl.GL11;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import com.hbm.main.ResourceManager;
import net.minecraft.client.Minecraft;
@ -34,6 +35,9 @@ public class ItemRenderWeaponNovac implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
//prevent rendering when using scope
if(item.getItem() == ModItems.gun_revolver_pip && type == ItemRenderType.EQUIPPED_FIRST_PERSON && MainRegistry.proxy.me().isSneaking()) return;
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);

View File

@ -38,9 +38,7 @@ public class RenderLoot extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glTranslated(item.getX(), item.getY(), item.getZ());
if(stack.getItem() == ModItems.ammo_nuke || stack.getItem() == ModItems.ammo_nuke_low ||
stack.getItem() == ModItems.ammo_nuke_high || stack.getItem() == ModItems.ammo_nuke_safe ||
stack.getItem() == ModItems.ammo_nuke_pumpkin) {
if(stack.getItem() == ModItems.ammo_nuke) {
renderNuke();
} else if(stack.getItem() == ModItems.gun_fatman || stack.getItem() == ModItems.gun_proto || stack.getItem() == ModItems.gun_mirv) {

View File

@ -5,6 +5,7 @@ import org.lwjgl.opengl.GL12;
import com.hbm.extprop.HbmPlayerProps;
import com.hbm.interfaces.Spaghetti;
import com.hbm.interfaces.Untested;
import com.hbm.lib.RefStrings;
import net.minecraft.client.Minecraft;
@ -13,6 +14,7 @@ import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -34,59 +36,56 @@ public class RenderScreenOverlay {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
// GL11.glDisable(GL11.GL_DEPTH_TEST);
// GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
float radiation = 0;
float radiation = 0;
radiation = lastResult - prevResult;
radiation = lastResult - prevResult;
if(System.currentTimeMillis() >= lastSurvey + 1000) {
lastSurvey = System.currentTimeMillis();
prevResult = lastResult;
lastResult = in;
}
if(System.currentTimeMillis() >= lastSurvey + 1000) {
lastSurvey = System.currentTimeMillis();
prevResult = lastResult;
lastResult = in;
}
int length = 74;
int maxRad = 1000;
int bar = getScaled(in, maxRad, 74);
//if(radiation >= 1 && radiation <= 999)
// bar -= (1 + Minecraft.getMinecraft().theWorld.rand.nextInt(3));
int posX = 16;
int posY = resolution.getScaledHeight() - 18 - 2;
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
gui.drawTexturedModalRect(posX, posY, 0, 0, 94, 18);
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 19, bar, 16);
gui.drawTexturedModalRect(posX, posY, 0, 0, 94, 18);
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 19, bar, 16);
if(radiation >= 25) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
if(radiation >= 25) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
} else if(radiation >= 10) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
} else if(radiation >= 10) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
} else if(radiation >= 2.5) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
} else if(radiation >= 2.5) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
}
}
if(radiation > 1000) {
Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0xFF0000);
} else if(radiation >= 1) {
Minecraft.getMinecraft().fontRenderer.drawString(((int)Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
Minecraft.getMinecraft().fontRenderer.drawString(((int) Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
} else if(radiation > 0) {
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0xFF0000);
}
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glPopMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
}
@ -313,6 +312,48 @@ public class RenderScreenOverlay {
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
}
@Untested
public static void renderScope(ScaledResolution res, ResourceLocation tex) {
GL11.glEnable(GL11.GL_BLEND);
//GL11.glDisable(GL11.GL_DEPTH_TEST);
//GL11.glDepthMask(false);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
Minecraft.getMinecraft().renderEngine.bindTexture(tex);
Tessellator tess = Tessellator.instance;
double w = res.getScaledWidth();
double h = res.getScaledHeight();
double smallest = Math.min(w, h);
double divisor = smallest / (9D / 16D);
smallest = 9D / 16D;
double largest = Math.max(w, h) / divisor;
double hMin = h < w ? 0.5 - smallest / 2D : 0.5 - largest / 2D;
double hMax = h < w ? 0.5 + smallest / 2D : 0.5 + largest / 2D;
double wMin = w < h ? 0.5 - smallest / 2D : 0.5 - largest / 2D;
double wMax = w < h ? 0.5 + smallest / 2D : 0.5 + largest / 2D;
double depth = -300D;
tess.startDrawingQuads();
tess.addVertexWithUV(0, h, depth, wMin, hMax);
tess.addVertexWithUV(w, h, depth, wMax, hMax);
tess.addVertexWithUV(w, 0, depth, wMax, hMin);
tess.addVertexWithUV(0, 0, depth, wMin, hMin);
tess.draw();
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
public enum Crosshair {
NONE(0, 0, 0),

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.machine;
import com.hbm.items.ModItems;
import com.hbm.items.ItemAmmoEnums.Ammo4Gauge;
import com.hbm.items.tool.ItemKeyPin;
import net.minecraft.entity.player.EntityPlayer;
@ -186,7 +187,7 @@ public class TileEntityMachineKeyForge extends TileEntity implements ISidedInven
//DEBUG, remove later
if(slots[2] != null && slots[2].getItem() == ModItems.ammo_4gauge) {
slots[2] = new ItemStack(ModItems.ammo_4gauge_titan, slots[2].stackSize);
slots[2] = ModItems.ammo_4gauge.stackFromEnum(slots[2].stackSize, Ammo4Gauge.QUACK);
}
}
}

View File

@ -348,6 +348,8 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
for(EntityItem item : items) {
if(item.isDead) continue;
if(nullifier && bad.contains(item.getEntityItem().getItem())) {
item.setDead();
continue;

View File

@ -5,9 +5,11 @@ import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.entity.projectile.EntityArtilleryShell;
import com.hbm.handler.CasingEjector;
import com.hbm.inventory.container.ContainerTurretBase;
import com.hbm.inventory.gui.GUITurretArty;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.ItemAmmoArty;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
@ -210,6 +212,13 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
proj.setWhistle(true);
worldObj.spawnEntityInWorld(proj);
casingDelay = this.casingDelay();
}
@Override
public int casingDelay() {
return 7;
}
protected void updateConnections() {
@ -333,6 +342,12 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
this.didJustShoot = false;
if(casingDelay > 0) {
casingDelay--;
} else {
spawnCasing();
}
} else {
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
@ -364,6 +379,7 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
ItemStack conf = this.getShellLoaded();
if(conf != null) {
cachedCasingConfig = ItemAmmoArty.itemTypes[conf.getItemDamage()].casing;
this.spawnShell(conf);
this.conusmeAmmo(ModItems.ammo_arty);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.jeremy_fire", 25.0F, 1.0F);
@ -388,6 +404,18 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
}
}
protected static CasingEjector ejector = new CasingEjector().setMotion(0, 0.6, -1).setAngleRange(0.1F, 0.1F);
@Override
protected CasingEjector getEjector() {
return ejector;
}
@Override
protected Vec3 getCasingSpawnPos() {
return this.getTurretPos();
}
@Override
public void handleButtonPacket(int value, int meta) {
if(meta == 5) {
@ -434,6 +462,25 @@ public class TileEntityTurretArty extends TileEntityTurretBaseArtillery implemen
nbt.setShort("mode", this.mode);
}
@Override
protected void spawnCasing() {
if(cachedCasingConfig == null) return;
CasingEjector ej = getEjector();
Vec3 spawn = this.getCasingSpawnPos();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "casing");
data.setFloat("pitch", (float) 0);
data.setFloat("yaw", (float) rotationYaw);
data.setBoolean("crouched", false);
data.setString("name", cachedCasingConfig.getName());
if(ej != null) data.setInteger("ej", ej.getId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, spawn.xCoord, spawn.yCoord, spawn.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
cachedCasingConfig = null;
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerTurretBase(player.inventory, this);

View File

@ -12,13 +12,19 @@ import com.hbm.entity.missile.EntitySiegeDropship;
import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemTurretBiometry;
import com.hbm.lib.Library;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyUser;
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;
@ -31,7 +37,6 @@ import net.minecraft.entity.item.EntityMinecart;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.IAnimals;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
@ -90,6 +95,8 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
//tally marks!
public int stattrak;
public int casingDelay;
protected SpentCasing cachedCasingConfig = null;
/**
* X
@ -212,6 +219,14 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
NBTTagCompound data = this.writePacket();
this.networkPack(data, 250);
if(usesCasings() && this.casingDelay() > 0) {
if(casingDelay > 0) {
casingDelay--;
} else {
spawnCasing();
}
}
} else {
Vec3 vec = Vec3.createVectorHelper(this.getBarrelLength(), 0, 0);
@ -298,6 +313,9 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
public abstract void updateFiringTick();
public boolean usesCasings() { return false; }
public int casingDelay() { return 0; }
public BulletConfiguration getFirstConfigLoaded() {
List<Integer> list = getAmmoList();
@ -315,7 +333,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
BulletConfiguration conf = BulletConfigSyncingUtil.pullConfig(c);
if(conf.ammo == slots[i].getItem())
if(conf.ammo != null && conf.ammo.matchesRecipe(slots[i], true))
return conf;
}
}
@ -336,13 +354,21 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
proj.setThrowableHeading(vec.xCoord, vec.yCoord, vec.zCoord, bullet.velocity, bullet.spread);
worldObj.spawnEntityInWorld(proj);
if(usesCasings()) {
if(this.casingDelay() == 0) {
spawnCasing();
} else {
casingDelay = this.casingDelay();
}
}
}
public void conusmeAmmo(Item ammo) {
public void conusmeAmmo(ComparableStack ammo) {
for(int i = 1; i < 10; i++) {
if(slots[i] != null && slots[i].getItem() == ammo) {
if(slots[i] != null && ammo.matchesRecipe(slots[i], true)) {
this.decrStackSize(i, 1);
return;
@ -756,7 +782,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
BulletConfiguration config = BulletConfigSyncingUtil.pullConfig(i);
if(config != null && config.ammo != null) {
ammoStacks.add(new ItemStack(config.ammo));
ammoStacks.add(config.ammo.toStack());
}
}
@ -781,10 +807,12 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
return this.isOn;
}
@Override
public void setPower(long i) {
this.power = i;
}
@Override
public long getPower() {
return this.power;
}
@ -817,4 +845,30 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
public void closeInventory() {
this.worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "hbm:block.closeC", 1.0F, 1.0F);
}
protected Vec3 getCasingSpawnPos() {
return this.getTurretPos();
}
protected CasingEjector getEjector() {
return null;
}
protected void spawnCasing() {
if(cachedCasingConfig == null) return;
CasingEjector ej = getEjector();
Vec3 spawn = this.getCasingSpawnPos();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "casing");
data.setFloat("pitch", (float) -rotationPitch);
data.setFloat("yaw", (float) rotationYaw);
data.setBoolean("crouched", false);
data.setString("name", cachedCasingConfig.getName());
if(ej != null) data.setInteger("ej", ej.getId());
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, spawn.xCoord, spawn.yCoord, spawn.zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
cachedCasingConfig = null;
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -73,6 +74,7 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
BulletConfiguration conf = this.getFirstConfigLoaded();
if(conf != null) {
this.cachedCasingConfig = conf.spentCasing;
this.spawnBullet(conf);
this.conusmeAmmo(conf.ammo);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.chekhov_fire", 2.0F, 1.0F);
@ -92,6 +94,24 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
}
}
@Override
protected Vec3 getCasingSpawnPos() {
Vec3 pos = this.getTurretPos();
Vec3 vec = Vec3.createVectorHelper(-1.125, 0.125, 0.25);
vec.rotateAroundZ((float) -this.rotationPitch);
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
return Vec3.createVectorHelper(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord);
}
protected static CasingEjector ejector = new CasingEjector().setMotion(-0.8, 0.8, 0).setAngleRange(0.1F, 0.1F);
@Override
protected CasingEjector getEjector() {
return ejector;
}
public int getDelay() {
return 2;
}
@ -139,7 +159,11 @@ public class TileEntityTurretChekhov extends TileEntityTurretBaseNT {
@Override
public void manualSetup() {
manual = true;
}
@Override
public boolean usesCasings() {
return true;
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.CasingEjector;
public class TileEntityTurretFriendly extends TileEntityTurretChekhov {
@ -31,4 +32,11 @@ public class TileEntityTurretFriendly extends TileEntityTurretChekhov {
public int getDelay() {
return 5;
}
protected static CasingEjector ejector = new CasingEjector().setMotion(-0.3, 0.6, 0).setAngleRange(0.02F, 0.05F);
@Override
protected CasingEjector getEjector() {
return ejector;
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.entity.projectile.EntityArtilleryRocket;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.container.ContainerTurretBase;
import com.hbm.inventory.gui.GUITurretHIMARS;
import com.hbm.items.ModItems;
@ -198,7 +199,7 @@ public class TileEntityTurretHIMARS extends TileEntityTurretBaseArtillery implem
HIMARSRocket type = ItemAmmoHIMARS.itemTypes[available];
this.typeLoaded = available;
this.ammo = type.amount;
this.conusmeAmmo(ModItems.ammo_himars);
this.conusmeAmmo(new ComparableStack(ModItems.ammo_himars, 1, available));
}
}
}

View File

@ -6,9 +6,12 @@ import java.util.List;
import com.hbm.config.WeaponConfig;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.CasingEjector;
import com.hbm.handler.guncfg.GunDGKFactory;
import com.hbm.lib.ModDamageSource;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.particle.SpentCasing;
import com.hbm.util.EntityDamageUtil;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
@ -126,9 +129,16 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT {
if(loaded > 0 && this.tPos != null) {
SpentCasing cfg = GunDGKFactory.CASINGDGK;
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.9F + worldObj.rand.nextFloat() * 0.3F);
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 1F + worldObj.rand.nextFloat() * 0.3F);
for(int i = 0; i < 2; i++) {
this.cachedCasingConfig = cfg;
this.spawnCasing();
}
if(timer % 2 == 0) {
loaded--;
@ -174,4 +184,27 @@ public class TileEntityTurretHoward extends TileEntityTurretBaseNT {
super.writeToNBT(nbt);
nbt.setInteger("loaded", loaded);
}
@Override
protected Vec3 getCasingSpawnPos() {
Vec3 pos = this.getTurretPos();
Vec3 vec = Vec3.createVectorHelper(-0.875, 0.2, -0.125);
vec.rotateAroundZ((float) -this.rotationPitch);
vec.rotateAroundY((float) -(this.rotationYaw + Math.PI * 0.5));
return Vec3.createVectorHelper(pos.xCoord + vec.xCoord, pos.yCoord + vec.yCoord, pos.zCoord + vec.zCoord);
}
protected static CasingEjector ejector = new CasingEjector().setAngleRange(0.01F, 0.01F).setMotion(0, 0, -0.1);
@Override
protected CasingEjector getEjector() {
return ejector.setMotion(0.4, 0, 0).setAngleRange(0.02F, 0.03F);
}
@Override
public boolean usesCasings() {
return true;
}
}

View File

@ -1,6 +1,7 @@
package com.hbm.tileentity.turret;
import com.hbm.config.WeaponConfig;
import com.hbm.handler.guncfg.GunDGKFactory;
import com.hbm.lib.ModDamageSource;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -70,6 +71,9 @@ public class TileEntityTurretHowardDamaged extends TileEntityTurretHoward {
this.worldObj.playSoundEffect(xCoord, yCoord, zCoord, "hbm:turret.howard_fire", 4.0F, 0.7F + worldObj.rand.nextFloat() * 0.3F);
this.cachedCasingConfig = GunDGKFactory.CASINGDGK;
this.spawnCasing();
if(worldObj.rand.nextInt(100) + 1 <= WeaponConfig.ciwsHitrate * 0.5)
EntityDamageUtil.attackEntityFromIgnoreIFrame(this.target, ModDamageSource.shrapnel, 2F + worldObj.rand.nextInt(2));

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