dynamic gas mask filters, cleanup, piss-soaked rags, recipe changes

This commit is contained in:
Boblet 2021-09-07 15:59:56 +02:00
parent 34b7352f1f
commit efc382c9dc
21 changed files with 385 additions and 151 deletions

View File

@ -9,7 +9,44 @@ import net.minecraft.item.ItemStack;
public interface IGasMask {
/**
* Returns a list of HazardClasses which can not be protected against by this mask (e.g. chlorine gas for half masks)
* @param stack
* @param player
* @return an empty list if there's no blacklist
*/
public List<HazardClass> getBlacklist(ItemStack stack, EntityPlayer player);
/**
* Returns the loaded filter, if there is any
* @param stack
* @param player
* @return null if no filter is installed
*/
public ItemStack getFilter(ItemStack stack, EntityPlayer player);
public void damageFilter(ItemStack stack, EntityPlayer player);
/**
* Checks whether the provided filter can be screwed into the mask, does not take already applied filters into account (those get ejected)
* @param stack
* @param player
* @param filter
* @return
*/
public boolean isFilterApplicable(ItemStack stack, EntityPlayer player, ItemStack filter);
/**
* This will write the filter to the stack's NBT, it ignores any previously installed filter and won't eject those
* @param stack
* @param player
* @param filter
*/
public void installFilter(ItemStack stack, EntityPlayer player, ItemStack filter);
/**
* Damages the installed filter, if there is one
* @param stack
* @param player
* @param damage
*/
public void damageFilter(ItemStack stack, EntityPlayer player, int damage);
}

View File

@ -197,6 +197,8 @@ public class AnvilRecipes {
new AStack[] {new ComparableStack(ModItems.plate_dineutronium, 4), new ComparableStack(ModItems.particle_sparkticle, 1), new ComparableStack(ModItems.plate_armor_fau, 6)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_dnt))).setTier(7));
pullFromAssembler(new ComparableStack(ModItems.plate_mixed, 4), 3);
}
public static void registerConstructionAmmo() {

View File

@ -138,7 +138,7 @@ public class AssemblerRecipes {
makeRecipe(new ComparableStack(ModItems.plate_schrabidium, 2), new AStack[] {new ComparableStack(ModItems.ingot_schrabidium, 3), },30);
makeRecipe(new ComparableStack(ModItems.plate_combine_steel, 2), new AStack[] {new ComparableStack(ModItems.ingot_combine_steel, 3), },30);
makeRecipe(new ComparableStack(ModItems.plate_saturnite, 2), new AStack[] {new ComparableStack(ModItems.ingot_saturnite, 3), },30);
makeRecipe(new ComparableStack(ModItems.plate_mixed, 6), new AStack[] {new ComparableStack(ModItems.plate_advanced_alloy, 2), new OreDictStack(OreDictManager.getReflector(), 2), new ComparableStack(ModItems.plate_combine_steel, 1), new OreDictStack("plateLead", 4), },50);
makeRecipe(new ComparableStack(ModItems.plate_mixed, 4), new AStack[] {new ComparableStack(ModItems.plate_advanced_alloy, 2), new OreDictStack(OreDictManager.getReflector(), 1), new ComparableStack(ModItems.plate_saturnite, 1) },50);
makeRecipe(new ComparableStack(ModItems.wire_aluminium, 6), new AStack[] {new OreDictStack("ingotAluminum", 1), },20);
makeRecipe(new ComparableStack(ModItems.wire_copper, 6), new AStack[] {new OreDictStack("ingotCopper", 1), },20);
makeRecipe(new ComparableStack(ModItems.wire_tungsten, 6), new AStack[] {new OreDictStack("ingotTungsten", 1), },20);

View File

@ -2122,7 +2122,8 @@ public class MachineRecipes {
break;
case COLTAN_CLEANING:
output[0] = new ItemStack(ModItems.powder_coltan, 1);
output[1] = new ItemStack(ModItems.dust, 2);
output[1] = new ItemStack(ModItems.powder_niobium, 1);
output[2] = new ItemStack(ModItems.dust, 1);
break;
case COLTAN_CRYSTAL:
output[0] = new ItemStack(ModItems.gem_tantalium, 1);

View File

@ -245,6 +245,9 @@ public class ModItems {
public static Item hazmat_cloth_red;
public static Item hazmat_cloth_grey;
public static Item asbestos_cloth;
public static Item rag;
public static Item rag_damp;
public static Item rag_piss;
public static Item filter_coal;
public static Item plate_advanced_alloy;
public static Item plate_combine_steel;
@ -2470,20 +2473,20 @@ public class ModItems {
ingot_smore = new ItemFood(10, 20F, false).setUnlocalizedName("ingot_smore").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_smore");
sulfur = new Item().setUnlocalizedName("sulfur").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sulfur");
ingot_uranium_fuel = new ItemHazard(ItemHazard.uf * ItemHazard.ingot).setUnlocalizedName("ingot_uranium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_uranium_fuel");
ingot_plutonium_fuel = new ItemHazard(ItemHazard.puf * ItemHazard.ingot).setUnlocalizedName("ingot_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_plutonium_fuel");
ingot_uranium_fuel = new ItemHazard().addRadiation(ItemHazard.uf * ItemHazard.ingot).toItem().setUnlocalizedName("ingot_uranium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_uranium_fuel");
ingot_plutonium_fuel = new ItemHazard().addRadiation(ItemHazard.puf * ItemHazard.ingot).toItem().setUnlocalizedName("ingot_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_plutonium_fuel");
ingot_neptunium_fuel = new ItemHazard().addRadiation(ItemHazard.npf * ItemHazard.ingot).toItem().setUnlocalizedName("ingot_neptunium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_neptunium_fuel");
ingot_mox_fuel = new ItemHazard(ItemHazard.mox * ItemHazard.ingot).setUnlocalizedName("ingot_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_mox_fuel");
ingot_mox_fuel = new ItemHazard().addRadiation(ItemHazard.mox * ItemHazard.ingot).toItem().setUnlocalizedName("ingot_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_mox_fuel");
ingot_americium_fuel = new ItemHazard().addRadiation(ItemHazard.amf * ItemHazard.ingot).toItem().setUnlocalizedName("ingot_americium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_americium_fuel");
ingot_schrabidium_fuel = new ItemHazard(ItemHazard.saf * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidium_fuel");
ingot_thorium_fuel = new ItemHazard(ItemHazard.thf * ItemHazard.ingot).setUnlocalizedName("ingot_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_thorium_fuel");
nugget_uranium_fuel = new ItemHazard(ItemHazard.uf * ItemHazard.nugget).setUnlocalizedName("nugget_uranium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_uranium_fuel");
nugget_thorium_fuel = new ItemHazard(ItemHazard.thf * ItemHazard.nugget).setUnlocalizedName("nugget_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_thorium_fuel");
nugget_plutonium_fuel = new ItemHazard(ItemHazard.puf * ItemHazard.nugget).setUnlocalizedName("nugget_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_plutonium_fuel");
ingot_schrabidium_fuel = new ItemHazard().addRadiation(ItemHazard.saf * ItemHazard.ingot).addBlinding().toItem().setUnlocalizedName("ingot_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_schrabidium_fuel");
ingot_thorium_fuel = new ItemHazard().addRadiation(ItemHazard.thf * ItemHazard.ingot).toItem().setUnlocalizedName("ingot_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_thorium_fuel");
nugget_uranium_fuel = new ItemHazard().addRadiation(ItemHazard.uf * ItemHazard.nugget).toItem().setUnlocalizedName("nugget_uranium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_uranium_fuel");
nugget_thorium_fuel = new ItemHazard().addRadiation(ItemHazard.thf * ItemHazard.nugget).toItem().setUnlocalizedName("nugget_thorium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_thorium_fuel");
nugget_plutonium_fuel = new ItemHazard().addRadiation(ItemHazard.puf * ItemHazard.nugget).toItem().setUnlocalizedName("nugget_plutonium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_plutonium_fuel");
nugget_neptunium_fuel = new ItemHazard().addRadiation(ItemHazard.npf * ItemHazard.nugget).toItem().setUnlocalizedName("nugget_neptunium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_neptunium_fuel");
nugget_mox_fuel = new ItemHazard(ItemHazard.mox * ItemHazard.nugget).setUnlocalizedName("nugget_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_mox_fuel");
nugget_mox_fuel = new ItemHazard().addRadiation(ItemHazard.mox * ItemHazard.nugget).toItem().setUnlocalizedName("nugget_mox_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_mox_fuel");
nugget_americium_fuel = new ItemHazard().addRadiation(ItemHazard.amf * ItemHazard.nugget).toItem().setUnlocalizedName("nugget_americium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_americium_fuel");
nugget_schrabidium_fuel = new ItemHazard(ItemHazard.saf * ItemHazard.nugget, false, true).setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
nugget_schrabidium_fuel = new ItemHazard().addRadiation(ItemHazard.saf * ItemHazard.nugget).addBlinding().toItem().setUnlocalizedName("nugget_schrabidium_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_schrabidium_fuel");
ingot_advanced_alloy = new Item().setUnlocalizedName("ingot_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_advanced_alloy");
ingot_tcalloy = new Item().setUnlocalizedName("ingot_tcalloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_tcalloy");
@ -2509,7 +2512,7 @@ public class ModItems {
lithium = new ItemHazard().addHydroReactivity().toItem().setUnlocalizedName("lithium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":lithium");
ingot_zirconium = new Item().setUnlocalizedName("ingot_zirconium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_zirconium");
ingot_semtex = new ItemLemon(4, 5, true).setUnlocalizedName("ingot_semtex").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_semtex");
ingot_phosphorus = new ItemHazard(0F, true).setUnlocalizedName("ingot_phosphorus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_phosphorus");
ingot_phosphorus = new ItemHazard().addFire(5).toItem().setUnlocalizedName("ingot_phosphorus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_phosphorus");
wire_advanced_alloy = new Item().setUnlocalizedName("wire_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_advanced_alloy");
coil_advanced_alloy = new Item().setUnlocalizedName("coil_advanced_alloy").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_advanced_alloy");
coil_advanced_torus = new Item().setUnlocalizedName("coil_advanced_torus").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_advanced_torus");
@ -2671,6 +2674,9 @@ public class ModItems {
hazmat_cloth_red = new Item().setUnlocalizedName("hazmat_cloth_red").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":hazmat_cloth_red");
hazmat_cloth_grey = new Item().setUnlocalizedName("hazmat_cloth_grey").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":hazmat_cloth_grey");
asbestos_cloth = new Item().setUnlocalizedName("asbestos_cloth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":asbestos_cloth");
rag = new Item().setUnlocalizedName("rag").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":rag");
rag_damp = new Item().setUnlocalizedName("rag_damp").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":rag_damp");
rag_piss = new Item().setUnlocalizedName("rag_piss").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":rag_piss");
filter_coal = new Item().setUnlocalizedName("filter_coal").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":filter_coal");
ingot_hes = new ItemHazard(ItemHazard.saf * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_hes").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_hes");
ingot_les = new ItemHazard(ItemHazard.saf * ItemHazard.ingot, false, true).setUnlocalizedName("ingot_les").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_les");
@ -2791,10 +2797,10 @@ public class ModItems {
powder_actinium_tiny = new Item().setUnlocalizedName("powder_actinium_tiny").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_actinium_tiny");
powder_boron_tiny = new Item().setUnlocalizedName("powder_boron_tiny").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_boron_tiny");
powder_meteorite_tiny = new Item().setUnlocalizedName("powder_meteorite_tiny").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_meteorite_tiny");
powder_yellowcake = new ItemHazard(ItemHazard.u * ItemHazard.powder).setUnlocalizedName("powder_yellowcake").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_yellowcake");
powder_yellowcake = new ItemHazard().addRadiation(ItemHazard.u * ItemHazard.powder).toItem().setUnlocalizedName("powder_yellowcake").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_yellowcake");
powder_magic = new Item().setUnlocalizedName("powder_magic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_magic");
powder_cloud = new Item().setUnlocalizedName("powder_cloud").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_cloud");
powder_balefire = new ItemHazard(500F, true).setUnlocalizedName("powder_balefire").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_balefire");
powder_balefire = new ItemHazard().addRadiation(500F).addFire(5).toItem().setUnlocalizedName("powder_balefire").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_balefire");
powder_coltan_ore = new ItemHazard().addAsbestos().toItem().setUnlocalizedName("powder_coltan_ore").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_coltan_ore");
powder_coltan = new Item().setUnlocalizedName("powder_coltan").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":powder_coltan");
@ -2828,7 +2834,7 @@ public class ModItems {
wire_aluminium = new Item().setUnlocalizedName("wire_aluminium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_aluminium");
wire_copper = new Item().setUnlocalizedName("wire_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_copper");
wire_gold = new Item().setUnlocalizedName("wire_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_gold");
wire_schrabidium = new ItemHazard(ItemHazard.sa326 * ItemHazard.nugget, false, true).setUnlocalizedName("wire_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_schrabidium");
wire_schrabidium = new ItemHazard().addRadiation(ItemHazard.sa326 * ItemHazard.nugget).addBlinding().toItem().setUnlocalizedName("wire_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_schrabidium");
wire_magnetized_tungsten = new Item().setUnlocalizedName("wire_magnetized_tungsten").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wire_magnetized_tungsten");
coil_magnetized_tungsten = new Item().setUnlocalizedName("coil_magnetized_tungsten").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_magnetized_tungsten");
coil_gold = new Item().setUnlocalizedName("coil_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":coil_gold");
@ -3149,8 +3155,8 @@ public class ModItems {
pill_iodine = new ItemPill(0).setUnlocalizedName("pill_iodine").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":pill_iodine");
plan_c = new ItemPill(0).setUnlocalizedName("plan_c").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plan_c");
stealth_boy = new ItemStarterKit().setUnlocalizedName("stealth_boy").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":stealth_boy");
gas_mask_filter = new ItemSyringe().setUnlocalizedName("gas_mask_filter").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gas_mask_filter");
gas_mask_filter_mono = new ItemSyringe().setUnlocalizedName("gas_mask_filter_mono").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gas_mask_filter_mono");
gas_mask_filter = new ItemFilter().setUnlocalizedName("gas_mask_filter").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gas_mask_filter");
gas_mask_filter_mono = new ItemFilter().setUnlocalizedName("gas_mask_filter_mono").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gas_mask_filter_mono");
jetpack_tank = new ItemSyringe().setUnlocalizedName("jetpack_tank").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":jetpack_tank");
gun_kit_1 = new ItemSyringe().setUnlocalizedName("gun_kit_1").setMaxStackSize(16).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gun_kit_1");
gun_kit_2 = new ItemSyringe().setUnlocalizedName("gun_kit_2").setMaxStackSize(16).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":gun_kit_2");
@ -3288,7 +3294,7 @@ public class ModItems {
recycled_misc = new Item().setUnlocalizedName("recycled_misc").setCreativeTab(null).setTextureName(RefStrings.MODID + ":recycled_misc");
rod_empty = new Item().setUnlocalizedName("rod_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_empty");
rod_th232 = new ItemHazard(ItemHazard.th232 * ItemHazard.rod).setUnlocalizedName("rod_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_th232");
rod_th232 = new ItemHazard().addRadiation(ItemHazard.th232 * ItemHazard.rod).toItem().setUnlocalizedName("rod_th232").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_th232");
rod_uranium = new ItemHazard(ItemHazard.u * ItemHazard.rod).setUnlocalizedName("rod_uranium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_uranium");
rod_u233 = new ItemHazard(ItemHazard.u233 * ItemHazard.rod).setUnlocalizedName("rod_u233").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_u233");
rod_u235 = new ItemHazard(ItemHazard.u235 * ItemHazard.rod).setUnlocalizedName("rod_u235").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_empty).setTextureName(RefStrings.MODID + ":rod_u235");
@ -4272,9 +4278,9 @@ public class ModItems {
tsar_core = new ItemTsar(10F).setUnlocalizedName("tsar_core").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":tsar_core");
fleija_igniter = new ItemFleija(0F, false).setUnlocalizedName("fleija_igniter").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":fleija_igniter");
fleija_propellant = new ItemFleija(15F, true).setUnlocalizedName("fleija_propellant").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":fleija_propellant");
fleija_core = new ItemFleija(10F, false).setUnlocalizedName("fleija_core").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":fleija_core");
fleija_igniter = new ItemFleija().setUnlocalizedName("fleija_igniter").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":fleija_igniter");
fleija_propellant = new ItemFleija().addRadiation(15F).addBlinding().toItem().setUnlocalizedName("fleija_propellant").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":fleija_propellant");
fleija_core = new ItemFleija().addRadiation(10F).toItem().setUnlocalizedName("fleija_core").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":fleija_core");
solinium_igniter = new ItemSolinium(0F, false).setUnlocalizedName("solinium_igniter").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":solinium_igniter");
solinium_propellant = new ItemSolinium(0F, false).setUnlocalizedName("solinium_propellant").setMaxStackSize(1).setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":solinium_propellant");
@ -5073,28 +5079,31 @@ public class ModItems {
mask_of_infamy = new MaskOfInfamy(ArmorMaterial.IRON, 8, 0).setUnlocalizedName("mask_of_infamy").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":mask_of_infamy");
hazmat_helmet = new ArmorHazmat(MainRegistry.aMatHaz, 9, 0).setUnlocalizedName("hazmat_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_helmet");
hazmat_plate = new ArmorHazmat(MainRegistry.aMatHaz, 9, 1).setUnlocalizedName("hazmat_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_plate");
hazmat_legs = new ArmorHazmat(MainRegistry.aMatHaz, 9, 2).setUnlocalizedName("hazmat_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_legs");
hazmat_boots = new ArmorHazmat(MainRegistry.aMatHaz, 9, 3).setUnlocalizedName("hazmat_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_boots");
hazmat_helmet_red = new ArmorModel(MainRegistry.aMatHaz2, 9, 0).setUnlocalizedName("hazmat_helmet_red").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_helmet_red");
hazmat_plate_red = new ArmorHazmat(MainRegistry.aMatHaz2, 9, 1).setUnlocalizedName("hazmat_plate_red").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_plate_red");
hazmat_legs_red = new ArmorHazmat(MainRegistry.aMatHaz2, 9, 2).setUnlocalizedName("hazmat_legs_red").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_legs_red");
hazmat_boots_red = new ArmorHazmat(MainRegistry.aMatHaz2, 9, 3).setUnlocalizedName("hazmat_boots_red").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_boots_red");
hazmat_helmet_grey = new ArmorModel(MainRegistry.aMatHaz3, 9, 0).setUnlocalizedName("hazmat_helmet_grey").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_helmet_grey");
hazmat_plate_grey = new ArmorHazmat(MainRegistry.aMatHaz3, 9, 1).setUnlocalizedName("hazmat_plate_grey").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_plate_grey");
hazmat_legs_grey = new ArmorHazmat(MainRegistry.aMatHaz3, 9, 2).setUnlocalizedName("hazmat_legs_grey").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_legs_grey");
hazmat_boots_grey = new ArmorHazmat(MainRegistry.aMatHaz3, 9, 3).setUnlocalizedName("hazmat_boots_grey").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_boots_grey");
hazmat_paa_helmet = new ArmorHazmat(MainRegistry.aMatPaa, 9, 0).setUnlocalizedName("hazmat_paa_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_paa_helmet");
hazmat_paa_plate = new ArmorHazmat(MainRegistry.aMatPaa, 9, 1).setUnlocalizedName("hazmat_paa_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_paa_plate");
hazmat_paa_legs = new ArmorHazmat(MainRegistry.aMatPaa, 9, 2).setUnlocalizedName("hazmat_paa_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_paa_legs");
hazmat_paa_boots = new ArmorHazmat(MainRegistry.aMatPaa, 9, 3).setUnlocalizedName("hazmat_paa_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hazmat_paa_boots");
hazmat_helmet = new ArmorHazmat(MainRegistry.aMatHaz, 9, 0, RefStrings.MODID + ":textures/armor/hazmat_1.png").setUnlocalizedName("hazmat_helmet").setTextureName(RefStrings.MODID + ":hazmat_helmet");
hazmat_plate = new ArmorHazmat(MainRegistry.aMatHaz, 9, 1, RefStrings.MODID + ":textures/armor/hazmat_1.png").setUnlocalizedName("hazmat_plate").setTextureName(RefStrings.MODID + ":hazmat_plate");
hazmat_legs = new ArmorHazmat(MainRegistry.aMatHaz, 9, 2, RefStrings.MODID + ":textures/armor/hazmat_2.png").setUnlocalizedName("hazmat_legs").setTextureName(RefStrings.MODID + ":hazmat_legs");
hazmat_boots = new ArmorHazmat(MainRegistry.aMatHaz, 9, 3, RefStrings.MODID + ":textures/armor/hazmat_1.png").setUnlocalizedName("hazmat_boots").setTextureName(RefStrings.MODID + ":hazmat_boots");
hazmat_helmet_red = new ArmorHazmatMask(MainRegistry.aMatHaz2, 9, 0, "hbm:textures/models/ModelHazRed.png").setUnlocalizedName("hazmat_helmet_red").setTextureName(RefStrings.MODID + ":hazmat_helmet_red");
hazmat_plate_red = new ArmorHazmat(MainRegistry.aMatHaz2, 9, 1, RefStrings.MODID + ":textures/armor/hazmat_1_red.png").setUnlocalizedName("hazmat_plate_red").setTextureName(RefStrings.MODID + ":hazmat_plate_red");
hazmat_legs_red = new ArmorHazmat(MainRegistry.aMatHaz2, 9, 2, RefStrings.MODID + ":textures/armor/hazmat_2_red.png").setUnlocalizedName("hazmat_legs_red").setTextureName(RefStrings.MODID + ":hazmat_legs_red");
hazmat_boots_red = new ArmorHazmat(MainRegistry.aMatHaz2, 9, 3, RefStrings.MODID + ":textures/armor/hazmat_1_red.png").setUnlocalizedName("hazmat_boots_red").setTextureName(RefStrings.MODID + ":hazmat_boots_red");
hazmat_helmet_grey = new ArmorHazmatMask(MainRegistry.aMatHaz3, 9, 0, "hbm:textures/models/ModelHazGrey.png")
.setFireproof(true).setUnlocalizedName("hazmat_helmet_grey").setTextureName(RefStrings.MODID + ":hazmat_helmet_grey");
hazmat_plate_grey = new ArmorHazmat(MainRegistry.aMatHaz3, 9, 1, RefStrings.MODID + ":textures/armor/hazmat_1_grey.png").cloneStats((ArmorFSB) hazmat_helmet_grey).setUnlocalizedName("hazmat_plate_grey").setTextureName(RefStrings.MODID + ":hazmat_plate_grey");
hazmat_legs_grey = new ArmorHazmat(MainRegistry.aMatHaz3, 9, 2, RefStrings.MODID + ":textures/armor/hazmat_2_grey.png").cloneStats((ArmorFSB) hazmat_helmet_grey).setUnlocalizedName("hazmat_legs_grey").setTextureName(RefStrings.MODID + ":hazmat_legs_grey");
hazmat_boots_grey = new ArmorHazmat(MainRegistry.aMatHaz3, 9, 3, RefStrings.MODID + ":textures/armor/hazmat_1_grey.png").cloneStats((ArmorFSB) hazmat_helmet_grey).setUnlocalizedName("hazmat_boots_grey").setTextureName(RefStrings.MODID + ":hazmat_boots_grey");
hazmat_paa_helmet = new ArmorHazmat(MainRegistry.aMatPaa, 9, 0, RefStrings.MODID + ":textures/armor/hazmat_paa_1.png")
.setFireproof(true).setUnlocalizedName("hazmat_paa_helmet").setTextureName(RefStrings.MODID + ":hazmat_paa_helmet");
hazmat_paa_plate = new ArmorHazmat(MainRegistry.aMatPaa, 9, 1, RefStrings.MODID + ":textures/armor/hazmat_paa_1.png").cloneStats((ArmorFSB) hazmat_paa_helmet).setUnlocalizedName("hazmat_paa_plate").setTextureName(RefStrings.MODID + ":hazmat_paa_plate");
hazmat_paa_legs = new ArmorHazmat(MainRegistry.aMatPaa, 9, 2, RefStrings.MODID + ":textures/armor/hazmat_paa_2.png").cloneStats((ArmorFSB) hazmat_paa_helmet).setUnlocalizedName("hazmat_paa_legs").setTextureName(RefStrings.MODID + ":hazmat_paa_legs");
hazmat_paa_boots = new ArmorHazmat(MainRegistry.aMatPaa, 9, 3, RefStrings.MODID + ":textures/armor/hazmat_paa_1.png").cloneStats((ArmorFSB) hazmat_paa_helmet).setUnlocalizedName("hazmat_paa_boots").setTextureName(RefStrings.MODID + ":hazmat_paa_boots");
ArmorMaterial aMatLiquidator = EnumHelper.addArmorMaterial("HBM_LIQUIDATOR", 750, new int[] { 3, 8, 6, 3 }, 10);
aMatLiquidator.customCraftingMaterial = ModItems.plate_lead;
liquidator_helmet = new ArmorLiquidator(aMatLiquidator, 9, 0, RefStrings.MODID + ":textures/armor/liquidator_helmet.png")
.setThreshold(1.0F)
.setBlastProtection(0.25F)
.setFireproof(true)
.setStep("hbm:step.metal")
.setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land").setUnlocalizedName("liquidator_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":liquidator_helmet");
@ -5712,11 +5721,14 @@ public class ModItems {
GameRegistry.registerItem(bolt_tungsten, bolt_tungsten.getUnlocalizedName());
GameRegistry.registerItem(bolt_compound, bolt_compound.getUnlocalizedName());
//Other Plates
//Cloth
GameRegistry.registerItem(hazmat_cloth, hazmat_cloth.getUnlocalizedName());
GameRegistry.registerItem(hazmat_cloth_red, hazmat_cloth_red.getUnlocalizedName());
GameRegistry.registerItem(hazmat_cloth_grey, hazmat_cloth_grey.getUnlocalizedName());
GameRegistry.registerItem(asbestos_cloth, asbestos_cloth.getUnlocalizedName());
GameRegistry.registerItem(rag, rag.getUnlocalizedName());
GameRegistry.registerItem(rag_damp, rag_damp.getUnlocalizedName());
GameRegistry.registerItem(rag_piss, rag_piss.getUnlocalizedName());
GameRegistry.registerItem(filter_coal, filter_coal.getUnlocalizedName());
//Wires

View File

@ -10,6 +10,7 @@ import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.render.model.ModelGasMask;
import com.hbm.render.model.ModelM65;
import com.hbm.util.ArmorUtil;
import com.hbm.util.ArmorRegistry.HazardClass;
import api.hbm.item.IGasMask;
@ -140,23 +141,34 @@ public class ArmorGasMask extends ItemArmor implements IGasMask {
public List<HazardClass> getBlacklist(ItemStack stack, EntityPlayer player) {
if(this == ModItems.gas_mask_mono) {
return Arrays.asList(new HazardClass[] {HazardClass.GAS_CHLORINE, HazardClass.BACTERIA});
return Arrays.asList(new HazardClass[] {HazardClass.GAS_CHLORINE, HazardClass.GAS_CORROSIVE, HazardClass.NERVE_AGENT, HazardClass.BACTERIA});
} else {
return Arrays.asList(new HazardClass[] {HazardClass.GAS_CORROSIVE, HazardClass.NERVE_AGENT});
}
return new ArrayList();
}
@Override
public ItemStack getFilter(ItemStack stack, EntityPlayer player) {
if(stack == null || !(stack.getItem() instanceof IGasMask) || !stack.hasTagCompound())
return null;
return null;
return ArmorUtil.getGasMaskFilter(stack);
}
@Override
public void damageFilter(ItemStack stack, EntityPlayer player) {
public void installFilter(ItemStack stack, EntityPlayer player, ItemStack filter) {
ArmorUtil.installGasMaskFilter(stack, filter);
}
@Override
public void damageFilter(ItemStack stack, EntityPlayer player, int damage) {
ArmorUtil.damageGasMaskFilter(stack, damage);
}
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
ArmorUtil.addGasMaskTooltip(stack, player, list, ext);
}
@Override
public boolean isFilterApplicable(ItemStack stack, EntityPlayer player, ItemStack filter) {
return true;
}
}

View File

@ -15,70 +15,39 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.util.ResourceLocation;
public class ArmorHazmat extends ItemArmor {
public class ArmorHazmat extends ArmorFSB {
private ResourceLocation hazmatBlur = new ResourceLocation(RefStrings.MODID + ":textures/misc/overlay_hazmat.png");
public ArmorHazmat(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {
super(p_i45325_1_, p_i45325_2_, p_i45325_3_);
public ArmorHazmat(ArmorMaterial material, int layer, int slot, String texture) {
super(material, layer, slot, texture);
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer) {
if(stack.getItem().equals(ModItems.hazmat_helmet) || stack.getItem().equals(ModItems.hazmat_plate) || stack.getItem().equals(ModItems.hazmat_boots)) {
return (RefStrings.MODID + ":textures/armor/hazmat_1.png");
}
if(stack.getItem().equals(ModItems.hazmat_legs)) {
return (RefStrings.MODID + ":textures/armor/hazmat_2.png");
}
if(stack.getItem().equals(ModItems.hazmat_paa_helmet) || stack.getItem().equals(ModItems.hazmat_paa_plate) || stack.getItem().equals(ModItems.hazmat_paa_boots)) {
return (RefStrings.MODID + ":textures/armor/hazmat_paa_1.png");
}
if(stack.getItem().equals(ModItems.hazmat_paa_legs)) {
return (RefStrings.MODID + ":textures/armor/hazmat_paa_2.png");
}
if(stack.getItem().equals(ModItems.hazmat_helmet_red) || stack.getItem().equals(ModItems.hazmat_plate_red) || stack.getItem().equals(ModItems.hazmat_boots_red)) {
return (RefStrings.MODID + ":textures/armor/hazmat_1_red.png");
}
if(stack.getItem().equals(ModItems.hazmat_legs_red)) {
return (RefStrings.MODID + ":textures/armor/hazmat_2_red.png");
}
if(stack.getItem().equals(ModItems.hazmat_helmet_grey) || stack.getItem().equals(ModItems.hazmat_plate_grey) || stack.getItem().equals(ModItems.hazmat_boots_grey)) {
return (RefStrings.MODID + ":textures/armor/hazmat_1_grey.png");
}
if(stack.getItem().equals(ModItems.hazmat_legs_grey)) {
return (RefStrings.MODID + ":textures/armor/hazmat_2_grey.png");
}
else return null;
@SideOnly(Side.CLIENT)
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
if(this != ModItems.hazmat_helmet && this != ModItems.hazmat_paa_helmet)
return;
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().getTextureManager().bindTexture(hazmatBlur);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0.0D, (double) resolution.getScaledHeight(), -90.0D, 0.0D, 1.0D);
tessellator.addVertexWithUV((double) resolution.getScaledWidth(), (double) resolution.getScaledHeight(), -90.0D, 1.0D, 1.0D);
tessellator.addVertexWithUV((double) resolution.getScaledWidth(), 0.0D, -90.0D, 1.0D, 0.0D);
tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
tessellator.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);
}
@SideOnly(Side.CLIENT)
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){
if(this != ModItems.hazmat_helmet && this != ModItems.hazmat_paa_helmet)
return;
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().getTextureManager().bindTexture(hazmatBlur);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0.0D, (double)resolution.getScaledHeight(), -90.0D, 0.0D, 1.0D);
tessellator.addVertexWithUV((double)resolution.getScaledWidth(), (double)resolution.getScaledHeight(), -90.0D, 1.0D, 1.0D);
tessellator.addVertexWithUV((double)resolution.getScaledWidth(), 0.0D, -90.0D, 1.0D, 0.0D);
tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
tessellator.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);
}
}

View File

@ -0,0 +1,70 @@
package com.hbm.items.armor;
import java.util.ArrayList;
import java.util.List;
import com.hbm.render.model.ModelM65;
import com.hbm.util.ArmorRegistry.HazardClass;
import com.hbm.util.ArmorUtil;
import api.hbm.item.IGasMask;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class ArmorHazmatMask extends ArmorHazmat implements IGasMask {
@SideOnly(Side.CLIENT)
private ModelM65 modelM65;
public ArmorHazmatMask(ArmorMaterial material, int layer, int slot, String texture) {
super(material, layer, slot, texture);
}
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if (armorSlot == 0) {
if (this.modelM65 == null) {
this.modelM65 = new ModelM65();
}
return this.modelM65;
}
return null;
}
@Override
public List<HazardClass> getBlacklist(ItemStack stack, EntityPlayer player) {
return new ArrayList(); // full hood has no restrictions
}
@Override
public ItemStack getFilter(ItemStack stack, EntityPlayer player) {
return ArmorUtil.getGasMaskFilter(stack);
}
@Override
public void installFilter(ItemStack stack, EntityPlayer player, ItemStack filter) {
ArmorUtil.installGasMaskFilter(stack, filter);
}
@Override
public void damageFilter(ItemStack stack, EntityPlayer player, int damage) {
ArmorUtil.damageGasMaskFilter(stack, damage);
}
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
ArmorUtil.addGasMaskTooltip(stack, player, list, ext);
}
@Override
public boolean isFilterApplicable(ItemStack stack, EntityPlayer player, ItemStack filter) {
return true;
}
}

View File

@ -64,14 +64,6 @@ public class ArmorModel extends ItemArmor {
return this.modelGoggles;
}
}
if (this == ModItems.hazmat_helmet_red || this == ModItems.hazmat_helmet_grey) {
if (armorSlot == 0) {
if (this.modelM65 == null) {
this.modelM65 = new ModelM65();
}
return this.modelM65;
}
}
if (this == ModItems.oxy_mask) {
if (armorSlot == 0) {
if (this.modelOxy == null) {
@ -104,12 +96,6 @@ public class ArmorModel extends ItemArmor {
if (stack.getItem() == ModItems.goggles) {
return "hbm:textures/models/Goggles.png";
}
if (stack.getItem() == ModItems.hazmat_helmet_red) {
return "hbm:textures/models/ModelHazRed.png";
}
if (stack.getItem() == ModItems.hazmat_helmet_grey) {
return "hbm:textures/models/ModelHazGrey.png";
}
if (stack.getItem() == ModItems.oxy_mask) {
return null;
}

View File

@ -10,10 +10,6 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
public class ItemFleija extends ItemHazard {
public ItemFleija(float radiation, boolean blinding) {
super(radiation, false, blinding);
}
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)

View File

@ -255,18 +255,6 @@ public class ItemSyringe extends Item {
}
}
if(this == ModItems.gas_mask_filter && player.inventory.armorInventory[3] != null && (player.inventory.armorInventory[3].getItem() == ModItems.gas_mask || player.inventory.armorInventory[3].getItem() == ModItems.gas_mask_m65)) {
if(!world.isRemote) {
if(player.inventory.armorInventory[3].getItemDamage() == 0)
return stack;
player.inventory.armorInventory[3].setItemDamage(0);
world.playSoundAtEntity(player, "hbm:item.gasmaskScrew", 1.0F, 1.0F);
stack.stackSize--;
}
}
if(this == ModItems.gas_mask_filter_mono && player.inventory.armorInventory[3] != null && player.inventory.armorInventory[3].getItem() == ModItems.gas_mask_mono) {
if(!world.isRemote) {
if(player.inventory.armorInventory[3].getItemDamage() == 0)

View File

@ -0,0 +1,36 @@
package com.hbm.items.tool;
import com.hbm.util.ArmorUtil;
import api.hbm.item.IGasMask;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemFilter extends Item {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
ItemStack helmet = player.inventory.armorItemInSlot(3);
if(helmet == null)
return stack;
if(!(helmet.getItem() instanceof IGasMask))
return stack;
IGasMask mask = (IGasMask) helmet.getItem();
if(!mask.isFilterApplicable(helmet, player, stack))
return stack;
ItemStack copy = stack.copy();
stack = ArmorUtil.getGasMaskFilter(helmet);
ArmorUtil.installGasMaskFilter(helmet, copy);
world.playSoundAtEntity(player, "hbm:item.gasmaskScrew", 1.0F, 1.0F);
return stack;
}
}

View File

@ -15,6 +15,36 @@ public class ArmorRegistry {
hazardClasses.put(item, Arrays.asList(hazards));
}
public static boolean hasAllProtection(EntityPlayer player, int slot, HazardClass... clazz) {
if(ArmorUtil.checkArmorNull(player, slot))
return false;
List<HazardClass> list = hazardClasses.get(player.inventory.armorInventory[slot].getItem());
if(list == null)
return false;
return list.containsAll(Arrays.asList(clazz));
}
public static boolean hasAnyProtection(EntityPlayer player, int slot, HazardClass... clazz) {
if(ArmorUtil.checkArmorNull(player, slot))
return false;
List<HazardClass> list = hazardClasses.get(player.inventory.armorInventory[slot].getItem());
if(list == null)
return false;
for(HazardClass haz : clazz) {
if(list.contains(haz)) return true;
}
return false;
}
public static boolean hasProtection(EntityPlayer player, int slot, HazardClass clazz) {
if(ArmorUtil.checkArmorNull(player, slot))
@ -29,12 +59,15 @@ public class ArmorRegistry {
}
public static enum HazardClass {
GAS_CHLORINE("hazard.gasChlorine"),
GAS_MONOXIDE("hazard.gasMonoxide"),
GAS_INERT("hazard.gasInert"),
PARTICLE_COARSE("hazard.particleCoarse"),
PARTICLE_FINE("hazard.particleFine"),
BACTERIA("hazard.bacteria");
GAS_CHLORINE("hazard.gasChlorine"), //also attacks eyes -> no half mask
GAS_MONOXIDE("hazard.gasMonoxide"), //only affects lungs
GAS_INERT("hazard.gasInert"), //SA
PARTICLE_COARSE("hazard.particleCoarse"), //only affects lungs
PARTICLE_FINE("hazard.particleFine"), //only affects lungs
BACTERIA("hazard.bacteria"), //no half masks
NERVE_AGENT("hazard.nerveAgent"), //aggressive nerve agent, also attacks skin
GAS_CORROSIVE("hazard.corrosive"), //corrosive substance, also attacks skin
LIGHT("hazard.light");
public final String lang;

View File

@ -1,5 +1,8 @@
package com.hbm.util;
import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.ArmorModHandler;
import com.hbm.handler.HazmatRegistry;
import com.hbm.items.ModItems;
@ -12,10 +15,17 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.event.ForgeEventFactory;
public class ArmorUtil {
/*
* The less horrifying part
*/
public static void register() {
ArmorRegistry.registerHazard(ModItems.gas_mask_filter_mono, HazardClass.PARTICLE_COARSE, HazardClass.GAS_MONOXIDE);
ArmorRegistry.registerHazard(ModItems.gas_mask_filter, HazardClass.PARTICLE_COARSE, HazardClass.PARTICLE_FINE, HazardClass.GAS_CHLORINE, HazardClass.BACTERIA);
@ -47,12 +57,21 @@ public class ArmorUtil {
int j = player.inventory.armorInventory[slot].getItemDamage();
player.inventory.armorInventory[slot].setItemDamage(j += amount);
if(player.inventory.armorInventory[slot].getItemDamage() >= player.inventory.armorInventory[slot].getMaxDamage())
{
if(player.inventory.armorInventory[slot].getItemDamage() > player.inventory.armorInventory[slot].getMaxDamage())
player.inventory.armorInventory[slot] = null;
}
public static void resetFlightTime(EntityPlayer player) {
if(player instanceof EntityPlayerMP) {
EntityPlayerMP mp = (EntityPlayerMP) player;
ReflectionHelper.setPrivateValue(NetHandlerPlayServer.class, mp.playerNetServerHandler, 0, "floatingTickCount", "field_147365_f");
}
}
/*
* The more horrifying part
*/
public static boolean checkForHazmat(EntityPlayer player) {
if(checkArmor(player, ModItems.hazmat_helmet, ModItems.hazmat_plate, ModItems.hazmat_legs, ModItems.hazmat_boots) ||
@ -185,6 +204,7 @@ public class ArmorUtil {
return false;
}
@Deprecated
public static boolean checkForGasMask(EntityPlayer player) {
if(checkArmorPiece(player, ModItems.hazmat_helmet, 3)) {
@ -248,6 +268,7 @@ public class ArmorUtil {
return false;
}
@Deprecated
public static boolean checkForMonoMask(EntityPlayer player) {
if(checkArmorPiece(player, ModItems.gas_mask_mono, 3))
@ -332,11 +353,76 @@ public class ArmorUtil {
return checkArmorPiece(player, ModItems.jackt2, 2) && Library.checkForHeld(player, ModItems.shimmer_axe);
}
public static void resetFlightTime(EntityPlayer player) {
/*
* Default implementations for IGasMask items
*/
public static final String FILTERK_KEY = "hfrFilter";
public static void installGasMaskFilter(ItemStack mask, ItemStack filter) {
if(player instanceof EntityPlayerMP) {
EntityPlayerMP mp = (EntityPlayerMP) player;
ReflectionHelper.setPrivateValue(NetHandlerPlayServer.class, mp.playerNetServerHandler, 0, "floatingTickCount", "field_147365_f");
}
if(mask == null || filter == null)
return;
if(!mask.hasTagCompound())
mask.stackTagCompound = new NBTTagCompound();
NBTTagCompound attach = new NBTTagCompound();
filter.writeToNBT(attach);
mask.stackTagCompound.setTag(FILTERK_KEY, attach);
}
public static void removeFilter(ItemStack mask) {
if(mask == null)
return;
if(!mask.hasTagCompound())
return;
mask.stackTagCompound.removeTag(FILTERK_KEY);
}
public static ItemStack getGasMaskFilter(ItemStack mask) {
if(mask == null)
return null;
if(!mask.hasTagCompound())
return null;
NBTTagCompound attach = mask.stackTagCompound.getCompoundTag(FILTERK_KEY);
ItemStack filter = ItemStack.loadItemStackFromNBT(attach);
return filter;
}
public static void damageGasMaskFilter(ItemStack mask, int damage) {
ItemStack filter = getGasMaskFilter(mask);
if(filter.getMaxDamage() == 0)
return;
filter.setItemDamage(filter.getItemDamage() + damage);
if(filter.getItemDamage() > filter.getMaxDamage())
removeFilter(mask);
else
installGasMaskFilter(mask, filter);
}
public static void addGasMaskTooltip(ItemStack mask, EntityPlayer player, List list, boolean ext) {
ItemStack filter = getGasMaskFilter(mask);
if(filter == null)
return;
list.add(EnumChatFormatting.GOLD + "Installed filter:");
List<String> lore = new ArrayList();
filter.getItem().addInformation(filter, player, lore, ext);
ForgeEventFactory.onItemTooltip(filter, player, lore, ext);
lore.forEach(x -> list.add(EnumChatFormatting.YELLOW + " " + x));
}
}

View File

@ -392,10 +392,13 @@ hadron.progress=Verarbeite...
hadron.success=Abgeschlossen!
hazard.prot=Schützt vor Gefahren:
hazard.noprot=Schützt NICHT vor:
hazard.bacteria=Bakterien / Aerosole
hazard.corrosive=Ätzende Dämpfe
hazard.gasChlorine=Giftgas
hazard.gasInert=Träge Gase / Strickgas
hazard.gasMonoxide=Kohlenstoffmonoxid
hazard.nerveAgent=Nervengift
hazard.particleCoarse=Partikel
hazard.particleFine=Feinstaub

View File

@ -460,10 +460,13 @@ hadron.progress=In Progress...
hadron.success=Completed!
hazard.prot=Protects against hazards:
hazard.noprot=Does NOT protect against:
hazard.bacteria=Bacteria / Aerosols
hazard.corrosive=Corrosive Fumes
hazard.gasChlorine=Chemical Gas
hazard.gasInert=Inert Gas / Asphxiants
hazard.gasMonoxide=Carbon Monoxide
hazard.nerveAgent=Nerve Agent
hazard.particleCoarse=Airborne Particles
hazard.particleFine=Particulates

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B