mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
implemented missing types for new hazard system, fixed some recipes
This commit is contained in:
parent
6b2fe8f23c
commit
e300c7dfe0
@ -20,6 +20,8 @@ public class PowderRecipes {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ingot_steel_dusted, 1), new Object[] { "ingotSteel", "dustCoal" }));
|
||||
|
||||
//Gunpowder
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 3), new Object[] { "dustSulfur", "dustNiter", Items.coal }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 3), new Object[] { "dustSulfur", "dustNiter", new ItemStack(Items.coal, 1, 1) }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 3), new Object[] { "dustSulfur", "dustSaltpeter", Items.coal }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 3), new Object[] { "dustSulfur", "dustSaltpeter", new ItemStack(Items.coal, 1, 1) }));
|
||||
|
||||
|
||||
@ -0,0 +1,17 @@
|
||||
package com.hbm.crafting.handlers;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ShapedOreRecipeExt extends ShapedOreRecipe {
|
||||
|
||||
|
||||
public ShapedOreRecipeExt(Block result, Object... recipe) { this(new ItemStack(result), recipe); }
|
||||
public ShapedOreRecipeExt(Item result, Object... recipe) { this(new ItemStack(result), recipe); }
|
||||
|
||||
public ShapedOreRecipeExt(ItemStack result, Object... recipe) {
|
||||
super(result, recipe);
|
||||
}
|
||||
}
|
||||
@ -7,10 +7,91 @@ import com.hbm.items.special.ItemHazard;
|
||||
|
||||
public class HazardRegistry {
|
||||
|
||||
//CO60 5a β− 030.00Rad/s Spicy
|
||||
//TC99 211,000a β− 002.75Rad/s Spicy
|
||||
//I181 192h β− 150.00Rad/s 2 much spice :(
|
||||
//XE135 9h β− aaaaaaaaaaaaaaaa
|
||||
//CS137 30a β− 020.00Rad/s Spicy
|
||||
//AU192 64h β− 500.00Rad/s 2 much spice :(
|
||||
//AT209 5h β+ like 2k or sth idk bruv
|
||||
//PO210 138d α 075.00Rad/s Spicy
|
||||
//RA226 1,600a α 007.50Rad/s
|
||||
//TH232 14,000,000,000a α 000.10Rad/s
|
||||
//U233 160,000a α 005.00Rad/s
|
||||
//U235 700,000,000a α 001.00Rad/s
|
||||
//U238 4,500,000,000a α 000.25Rad/s
|
||||
//NP237 2,100,000a α 002.50Rad/s
|
||||
//PU238 88a α 010.00Rad/s Spicy
|
||||
//PU239 24,000a α 005.00Rad/s
|
||||
//PU240 6,600a α 007.50Rad/s
|
||||
//PU241 14a β− 025.00Rad/s Spicy
|
||||
//AM241 432a α 008.50Rad/s
|
||||
//AM242 141a β− 009.50Rad/s
|
||||
|
||||
public static final float co60 = 30.0F;
|
||||
public static final float tc99 = 2.75F;
|
||||
public static final float i131 = 150.0F;
|
||||
public static final float xe135 = 1250.0F;
|
||||
public static final float cs137 = 20.0F;
|
||||
public static final float au198 = 500.0F;
|
||||
public static final float at209 = 2000.0F;
|
||||
public static final float po210 = 75.0F;
|
||||
public static final float ra226 = 7.5F;
|
||||
public static final float th232 = 0.1F;
|
||||
public static final float thf = 1.75F;
|
||||
public static final float u = 0.35F;
|
||||
public static final float u233 = 5.0F;
|
||||
public static final float u235 = 1.0F;
|
||||
public static final float u238 = 0.25F;
|
||||
public static final float uf = 0.5F;
|
||||
public static final float np237 = 2.5F;
|
||||
public static final float npf = 1.5F;
|
||||
public static final float pu = 7.5F;
|
||||
public static final float purg = 6.25F;
|
||||
public static final float pu238 = 10.0F;
|
||||
public static final float pu239 = 5.0F;
|
||||
public static final float pu240 = 7.5F;
|
||||
public static final float pu241 = 25.0F;
|
||||
public static final float puf = 4.25F;
|
||||
public static final float am241 = 8.5F;
|
||||
public static final float am242 = 9.5F;
|
||||
public static final float amrg = 9.0F;
|
||||
public static final float amf = 4.75F;
|
||||
public static final float mox = 2.5F;
|
||||
public static final float sa326 = 15.0F;
|
||||
public static final float sa327 = 17.5F;
|
||||
public static final float saf = 5.85F;
|
||||
public static final float radsource_mult = 0.5F;
|
||||
public static final float pobe = po210 * radsource_mult;
|
||||
public static final float rabe = ra226 * radsource_mult;
|
||||
public static final float pube = pu238 * radsource_mult;
|
||||
|
||||
public static final float sr = sa326 * 0.1F;
|
||||
public static final float sb = sa326 * 0.1F;
|
||||
public static final float trx = 25.0F;
|
||||
public static final float trn = 0.1F;
|
||||
public static final float wst = 15.0F;
|
||||
public static final float yc = u;
|
||||
public static final float fo = 10F;
|
||||
|
||||
public static final float nugget = 0.1F;
|
||||
public static final float ingot = 1.0F;
|
||||
public static final float powder_mult = 3.0F;
|
||||
public static final float powder = ingot * powder_mult;
|
||||
public static final float powder_tiny = nugget * powder_mult;
|
||||
public static final float block = 10.0F;
|
||||
public static final float crystal = block;
|
||||
public static final float billet = 0.5F;
|
||||
public static final float rtg = billet * 3;
|
||||
public static final float rod = 0.5F;
|
||||
public static final float rod_dual = rod * 2;
|
||||
public static final float rod_quad = rod * 4;
|
||||
public static final float rod_rbmk = rod * 8;
|
||||
|
||||
public static final HazardTypeBase RADIATION = new HazardTypeRadiation();
|
||||
|
||||
public static void registerItems() {
|
||||
HazardSystem.register("ingotPlutonium", makeData(RADIATION, ItemHazard.pu * ItemHazard.ingot));
|
||||
HazardSystem.register("ingotPlutonium", makeData(RADIATION, pu * ingot));
|
||||
//TODO: move all the itemhazard stuff here
|
||||
|
||||
//TODO: move this into its own method
|
||||
|
||||
33
src/main/java/com/hbm/hazard/type/HazardTypeAsbestos.java
Normal file
33
src/main/java/com/hbm/hazard/type/HazardTypeAsbestos.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeAsbestos extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
|
||||
if(!ArmorRegistry.hasProtection(target, 3, HazardClass.PARTICLE_FINE))
|
||||
HbmLivingProps.incrementAsbestos(target, (int) Math.min(level, 10));
|
||||
else
|
||||
ArmorUtil.damageGasMaskFilter(target, (int)level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.WHITE + "[" + I18nUtil.resolveKey("trait.asbestos") + "]");
|
||||
}
|
||||
|
||||
}
|
||||
32
src/main/java/com/hbm/hazard/type/HazardTypeBlinding.java
Normal file
32
src/main/java/com/hbm/hazard/type/HazardTypeBlinding.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeBlinding extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
|
||||
if(!ArmorRegistry.hasProtection(target, 3, HazardClass.LIGHT)) {
|
||||
target.addPotionEffect(new PotionEffect(Potion.blindness.id, (int)level, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.DARK_AQUA + "[" + I18nUtil.resolveKey("trait.blinding") + "]");
|
||||
}
|
||||
|
||||
}
|
||||
35
src/main/java/com/hbm/hazard/type/HazardTypeDigamma.java
Normal file
35
src/main/java/com/hbm/hazard/type/HazardTypeDigamma.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeDigamma extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
ContaminationUtil.applyDigammaData(target, level / 20F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
|
||||
level = HazardModifier.evalAllModifiers(stack, player, level, modifiers);
|
||||
|
||||
float d = (float)(Math.floor(level * 10000F)) / 10F;
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.digamma") + "]");
|
||||
list.add(EnumChatFormatting.DARK_RED + "" + d + "mDRX/s");
|
||||
|
||||
if(stack.stackSize > 1) {
|
||||
list.add(EnumChatFormatting.DARK_RED + "Stack: " + ((Math.floor(level * 10000F * stack.stackSize) / 10F) + "mDRX/s"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
34
src/main/java/com/hbm/hazard/type/HazardTypeHot.java
Normal file
34
src/main/java/com/hbm/hazard/type/HazardTypeHot.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.hbm.hazard.type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.hazard.HazardModifier;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class HazardTypeHot extends HazardTypeBase {
|
||||
|
||||
@Override
|
||||
public void onUpdate(EntityLivingBase target, float level) {
|
||||
|
||||
boolean reacher = false;
|
||||
|
||||
if(target instanceof EntityPlayer && !GeneralConfig.enable528)
|
||||
reacher = ((EntityPlayer) target).inventory.hasItem(ModItems.reacher);
|
||||
|
||||
if(!reacher && !target.isWet())
|
||||
target.setFire((int) level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addHazardInformation(EntityPlayer player, List list, float level, ItemStack stack, List<HazardModifier> modifiers) {
|
||||
list.add(EnumChatFormatting.GOLD + "[" + I18nUtil.resolveKey("trait.hot") + "]");
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.hbm.modules.ItemHazardModule;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@Deprecated
|
||||
public interface IItemHazard {
|
||||
|
||||
public ItemHazardModule getModule();
|
||||
|
||||
@ -12,6 +12,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Deprecated
|
||||
public class ItemHazard extends ItemCustomLore implements IItemHazard {
|
||||
|
||||
//CO60 5a β− 030.00Rad/s Spicy
|
||||
|
||||
@ -23,6 +23,7 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
@Deprecated
|
||||
public class ItemHazardModule {
|
||||
|
||||
/**
|
||||
@ -83,31 +84,6 @@ public class ItemHazardModule {
|
||||
public void applyEffects(EntityLivingBase entity, float mod, int slot, boolean currentItem) {
|
||||
|
||||
boolean reacher = false;
|
||||
|
||||
if(entity instanceof EntityPlayer && !GeneralConfig.enable528)
|
||||
reacher = ((EntityPlayer) entity).inventory.hasItem(ModItems.reacher);
|
||||
|
||||
if(this.radiation * tempMod > 0) {
|
||||
float rad = this.radiation * tempMod * mod / 20F;
|
||||
|
||||
if(reacher)
|
||||
rad = (float) Math.min(Math.sqrt(rad), rad); //to prevent radiation from going up when being <1
|
||||
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, rad);
|
||||
}
|
||||
|
||||
if(this.digamma * tempMod > 0)
|
||||
ContaminationUtil.applyDigammaData(entity, this.digamma * tempMod * mod / 20F);
|
||||
|
||||
if(this.fire > 0 && !reacher)
|
||||
entity.setFire(this.fire);
|
||||
|
||||
if(this.asbestos > 0) {
|
||||
if(!ArmorRegistry.hasProtection(entity, 3, HazardClass.PARTICLE_FINE))
|
||||
HbmLivingProps.incrementAsbestos(entity, (int) (this.asbestos * Math.min(mod, 10)));
|
||||
else
|
||||
ArmorUtil.damageGasMaskFilter(entity, (int) (this.asbestos));
|
||||
}
|
||||
|
||||
if(this.coal > 0) {
|
||||
if(!ArmorRegistry.hasProtection(entity, 3, HazardClass.PARTICLE_COARSE))
|
||||
@ -141,36 +117,10 @@ public class ItemHazardModule {
|
||||
player.worldObj.newExplosion(null, player.posX, player.posY + player.getEyeHeight() - player.getYOffset(), player.posZ, this.explosive, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.blinding && !ArmorRegistry.hasProtection(entity, 3, HazardClass.LIGHT)) {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 0));
|
||||
}
|
||||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
if(this.radiation * tempMod > 0) {
|
||||
list.add(EnumChatFormatting.GREEN + "[" + I18nUtil.resolveKey("trait.radioactive") + "]");
|
||||
String rad = "" + (Math.floor(radiation * tempMod * 1000) / 1000);
|
||||
list.add(EnumChatFormatting.YELLOW + (rad + "RAD/s"));
|
||||
|
||||
if(stack.stackSize > 1) {
|
||||
list.add(EnumChatFormatting.YELLOW + "Stack: " + ((Math.floor(radiation * tempMod * 1000 * stack.stackSize) / 1000) + "RAD/s"));
|
||||
}
|
||||
}
|
||||
|
||||
if(this.fire > 0) {
|
||||
list.add(EnumChatFormatting.GOLD + "[" + I18nUtil.resolveKey("trait.hot") + "]");
|
||||
}
|
||||
|
||||
if(this.blinding) {
|
||||
list.add(EnumChatFormatting.DARK_AQUA + "[" + I18nUtil.resolveKey("trait.blinding") + "]");
|
||||
}
|
||||
|
||||
if(this.asbestos > 0) {
|
||||
list.add(EnumChatFormatting.WHITE + "[" + I18nUtil.resolveKey("trait.asbestos") + "]");
|
||||
}
|
||||
|
||||
if(this.coal > 0) {
|
||||
list.add(EnumChatFormatting.DARK_GRAY + "[" + I18nUtil.resolveKey("trait.coal") + "]");
|
||||
}
|
||||
@ -183,12 +133,6 @@ public class ItemHazardModule {
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.explosive") + "]");
|
||||
}
|
||||
|
||||
if(this.digamma * tempMod > 0) {
|
||||
float d = ((int) (digamma * tempMod * 10000F)) / 10F;
|
||||
list.add(EnumChatFormatting.RED + "[" + I18nUtil.resolveKey("trait.digamma") + "]");
|
||||
list.add(EnumChatFormatting.DARK_RED + "" + d + "mDRX/s");
|
||||
}
|
||||
|
||||
int[] breeder = BreederRecipes.getFuelValue(stack);
|
||||
|
||||
if(breeder != null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user