Changed taint, made radiaition more meaningful, bat fix, tempfolder lore

This commit is contained in:
HbmMods 2018-07-08 21:59:29 +02:00
parent d2f8ad636a
commit 27fd496907
24 changed files with 300 additions and 165 deletions

View File

@ -34,7 +34,7 @@ public class BlockCrate extends BlockFalling {
{
dropItems(world, x, y, z);
world.setBlockToAir(x, y, z);
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 1.0F, 1.0F);
world.playSoundEffect(x, y, z, "hbm:block.crateBreak", 0.5F, 1.0F);
return true;
} else {
if(world.isRemote)

View File

@ -7,6 +7,7 @@ import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
import com.hbm.potion.PotionEffectRadiation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -190,96 +191,22 @@ public class BlockOre extends Block {
if (entity instanceof EntityLivingBase && this == ModBlocks.block_trinitite)
{
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))
{
/*Library.damageSuit(((EntityPlayer)entity), 0);
Library.damageSuit(((EntityPlayer)entity), 1);
Library.damageSuit(((EntityPlayer)entity), 2);
Library.damageSuit(((EntityPlayer)entity), 3);*/
} else if(entity instanceof EntityCreeper) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
//creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead);
entity.setDead();
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
} else if(entity instanceof EntityVillager) {
EntityZombie creep = new EntityZombie(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
entity.setDead();
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
} else if(!(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie)) {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 30 * 20, 2));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 5 * 20, 0));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 15 * 20, 0));
entity.attackEntityFrom(ModDamageSource.radiation, 0.5F);
{ } else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 45 * 20, 20));
}
}
if (entity instanceof EntityLivingBase && this == ModBlocks.block_waste)
{
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))
{
/*Library.damageSuit(((EntityPlayer)entity), 0);
Library.damageSuit(((EntityPlayer)entity), 1);
Library.damageSuit(((EntityPlayer)entity), 2);
Library.damageSuit(((EntityPlayer)entity), 3);*/
} else if(entity instanceof EntityCreeper) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
//creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead);
if(!entity.isDead)
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
entity.setDead();
} else if(entity instanceof EntityCow) {
EntityMooshroom creep = new EntityMooshroom(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
//creep.setRotationYawHead(((EntityCow)entity).rotationYawHead);
if(!entity.isDead)
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
entity.setDead();
} else if(entity instanceof EntityVillager) {
EntityZombie creep = new EntityZombie(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
entity.setDead();
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
} else if(!(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie)) {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 60 * 20, 2));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 30 * 20, 1));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.id, 10 * 20, 0));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 20 * 20, 0));
entity.attackEntityFrom(ModDamageSource.radiation, 2.5F);
{ } else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 60 * 20, 20));
}
}
if (entity instanceof EntityLivingBase && (this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red))
{
if(entity instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)entity))
{
/*Library.damageSuit(((EntityPlayer)entity), 0);
Library.damageSuit(((EntityPlayer)entity), 1);
Library.damageSuit(((EntityPlayer)entity), 2);
Library.damageSuit(((EntityPlayer)entity), 3);*/
} else if(entity instanceof EntityCreeper) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
//creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead);
if(!entity.isDead)
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
entity.setDead();
} else if(entity instanceof EntityVillager) {
EntityZombie creep = new EntityZombie(p_149724_1_);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
entity.setDead();
if(!p_149724_1_.isRemote)
p_149724_1_.spawnEntityInWorld(creep);
} else if(!(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie)) {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.id, 5 * 20, 1));
{ } else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 30 * 20, 10));
}
}

View File

@ -40,6 +40,12 @@ public class EntityFalloutRain extends Entity {
int count = (int)(Math.pow(getScale(), 2) * Math.PI / 500);
if(count > 50)
count = 50;
int maxEff = 15;
int currEff = 0;
for(int i = 0; i < count; i++) {
int x = (int) (posX + rand.nextInt((int) ((getScale() + 1) * 2)) - getScale());
int z = (int) (posZ + rand.nextInt((int) ((getScale() + 1) * 2)) - getScale());
@ -49,8 +55,9 @@ public class EntityFalloutRain extends Entity {
if(dist <= getScale()) {
if(rand.nextInt(50) == 0) {
if(currEff < maxEff && rand.nextInt(30) == 0) {
NukeEnvironmentalEffect.applyStandardAOE(worldObj, x, y, z, 5, 3);
currEff++;
} else if(worldObj.getBlock(x, y, z) == Blocks.grass) {
worldObj.setBlock(x, y, z, ModBlocks.waste_earth);

View File

@ -69,7 +69,7 @@ public class EntityNukeExplosionMK4 extends Entity {
explosion.processTip(1024);
} else if(fallout) {
EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.length * 1.8) * 10);
EntityFalloutRain fallout = new EntityFalloutRain(this.worldObj, (int)(this.length * 1.8) * 25);
fallout.posX = this.posX;
fallout.posY = this.posY;
fallout.posZ = this.posZ;

View File

@ -295,7 +295,7 @@ public class ExplosionNukeGeneric {
if (!(entity instanceof EntityPlayerMP
&& ((EntityPlayerMP) entity).theItemInWorldManager.getGameType() == GameType.CREATIVE)) {
entity.attackEntityFrom(ModDamageSource.blackhole, 10000F);
entity.attackEntityFrom(ModDamageSource.blackhole, 1000F);
}
if(!(entity instanceof EntityLivingBase) && !(entity instanceof EntityPlayerMP) && !(entity instanceof EntityBlackHole)) {

View File

@ -102,6 +102,9 @@ public class NukeEnvironmentalEffect {
} else if(in == Blocks.clay) {
b = Blocks.hardened_clay;
} else if(in.getMaterial().getCanBurn()) {
b = Blocks.fire;
chance = 100;
}
if(b != null && rand.nextInt(1000) < chance)

View File

@ -161,8 +161,9 @@ public class ItemBattery extends Item {
public static void updateDamage(ItemStack stack) {
if(!stack.hasTagCompound())
stack.stackTagCompound = new NBTTagCompound();
if(!stack.hasTagCompound()) {
stack = getFullBattery(stack.getItem()).copy();
}
stack.setItemDamage(100 - (int)((double)getCharge(stack) / (double)getMaxChargeStatic(stack) * 100D));
}

View File

@ -1,6 +1,14 @@
package com.hbm.items.special;
import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemCassette;
import com.hbm.items.tool.ItemCassette.TrackType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
public class ItemBlades extends Item {
@ -8,5 +16,29 @@ public class ItemBlades extends Item {
{
this.setMaxDamage(dura);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
{
if(this == ModItems.stamp_iron_circuit ||
this == ModItems.stamp_iron_plate ||
this == ModItems.stamp_iron_wire ||
this == ModItems.stamp_obsidian_circuit ||
this == ModItems.stamp_obsidian_plate ||
this == ModItems.stamp_obsidian_wire ||
this == ModItems.stamp_schrabidium_circuit ||
this == ModItems.stamp_schrabidium_plate ||
this == ModItems.stamp_schrabidium_wire ||
this == ModItems.stamp_steel_circuit ||
this == ModItems.stamp_steel_plate ||
this == ModItems.stamp_steel_wire ||
this == ModItems.stamp_titanium_circuit ||
this == ModItems.stamp_titanium_plate ||
this == ModItems.stamp_titanium_wire ||
this == ModItems.stamp_stone_circuit ||
this == ModItems.stamp_stone_plate ||
this == ModItems.stamp_stone_wire)
list.add("[CREATED USING TEMPLATE FOLDER]");
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.items.special;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.lib.ModDamageSource;
import com.hbm.potion.PotionEffectRadiation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -43,9 +44,7 @@ public class ItemRadioactive extends Item {
this == ModItems.pellet_mes ||
this == ModItems.pellet_neptunium ||
this == ModItems.pellet_schrabidium) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 120 * 20, 4));
living.addPotionEffect(new PotionEffect(Potion.wither.id, 30 * 20, 2));
living.attackEntityFrom(ModDamageSource.radiation, 15);
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 80 * 20, 25));
}
//Strong
@ -79,9 +78,7 @@ public class ItemRadioactive extends Item {
this == ModItems.gadget_core ||
this == ModItems.man_core ||
this == ModItems.nuclear_waste) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 45 * 20, 4));
living.addPotionEffect(new PotionEffect(Potion.wither.id, 5 * 20, 2));
living.attackEntityFrom(ModDamageSource.radiation, 3);
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 60 * 20, 20));
}
//Strong Nuggets
@ -101,9 +98,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_uranium_fuel_depleted ||
this == ModItems.rod_plutonium_fuel_depleted ||
this == ModItems.rod_mox_fuel_depleted) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 35 * 20, 4));
living.addPotionEffect(new PotionEffect(Potion.wither.id, 1 * 20, 2));
living.attackEntityFrom(ModDamageSource.radiation, 1);
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 45 * 20, 20));
}
//Medium
@ -121,8 +116,7 @@ public class ItemRadioactive extends Item {
this == ModItems.mike_core ||
this == ModItems.tsar_core ||
this == ModItems.trinitite) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 25 * 20, 4));
living.attackEntityFrom(ModDamageSource.radiation, 1);
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 30 * 20, 15));
}
//Medium Nuggets
@ -134,7 +128,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_pu238 ||
this == ModItems.rod_plutonium ||
this == ModItems.pellet_rtg_weak) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 15 * 20, 2));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 20 * 20, 15));
}
//Weak
@ -147,7 +141,7 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_dual_u238 ||
this == ModItems.rod_quad_pu238 ||
this == ModItems.rod_dual_pu238) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 15 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 20 * 20, 5));
}
//Weak Nuggets
@ -161,20 +155,19 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_dual_tritium ||
this == ModItems.rod_quad_tritium ||
this == ModItems.powder_yellowcake) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 5 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 10 * 20, 5));
}
//Powder
if (this == ModItems.powder_neptunium ||
this == ModItems.powder_plutonium) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 25 * 20, 4));
living.attackEntityFrom(ModDamageSource.radiation, 1);
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 60 * 20, 20));
living.setFire(5);
}
if (this == ModItems.powder_uranium) {
living.addPotionEffect(new PotionEffect(Potion.poison.id, 15 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 20 * 20, 5));
living.setFire(5);
}
@ -197,8 +190,8 @@ public class ItemRadioactive extends Item {
this == ModItems.rod_schrabidium_fuel ||
this == ModItems.rod_dual_schrabidium_fuel ||
this == ModItems.rod_quad_schrabidium_fuel) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 2 * 60 * 20, 0));
living.attackEntityFrom(ModDamageSource.radiation, 30);
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 100 * 20, 30));
}
if (this == ModItems.nugget_schrabidium ||
@ -206,19 +199,19 @@ public class ItemRadioactive extends Item {
this == ModItems.nugget_schrabidium_fuel ||
this == ModItems.nugget_hes ||
this == ModItems.nugget_les) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 2 * 60 * 20, 0));
living.attackEntityFrom(ModDamageSource.radiation, 10);
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 75 * 20, 30));
}
if (this == ModItems.plate_schrabidium ||
this == ModItems.wire_schrabidium) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 2 * 60 * 20, 0));
living.attackEntityFrom(ModDamageSource.radiation, 15);
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 80 * 20, 30));
}
if (this == ModItems.powder_schrabidium) {
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 2 * 60 * 20, 0));
living.attackEntityFrom(ModDamageSource.radiation, 30);
living.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 20, 0));
living.addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 100 * 20, 30));
living.setFire(5);
}
}

View File

@ -874,6 +874,9 @@ public class ItemAssemblyTemplate extends Item {
List<ItemStack> stacks = MachineRecipes.getRecipeFromTempate(stack);
ItemStack out = MachineRecipes.getOutputFromTempate(stack);
list.add("[CREATED USING TEMPLATE FOLDER]");
list.add("");
try {
list.add("Output:");
list.add(out.stackSize + "x " + out.getDisplayName());

View File

@ -115,6 +115,9 @@ public class ItemCassette extends Item {
if(!(stack.getItem() instanceof ItemCassette))
return;
list.add("[CREATED USING TEMPLATE FOLDER]");
list.add("");
list.add("Siren sound cassette:");
list.add(" Name: " + TrackType.getEnum(stack.getItemDamage()).getTrackTitle());

View File

@ -249,7 +249,10 @@ public class ItemChemistryTemplate extends Item {
ItemStack[] out = MachineRecipes.getChemOutputFromTempate(stack);
FluidStack[] outF = MachineRecipes.getFluidOutputFromTempate(stack);
//try {
list.add("[CREATED USING TEMPLATE FOLDER]");
list.add("");
try {
list.add("Outputs:");
for(int i = 0; i < 4; i++)
if(out[i] != null)
@ -271,10 +274,10 @@ public class ItemChemistryTemplate extends Item {
list.add("Production time:");
list.add(Math.floor((float)(getProcessTime(stack)) / 20 * 100) / 100 + " seconds");
//} catch(Exception e) {
// list.add("###INVALID###");
// list.add("0x334077-0x6A298F-0xDF3795-0x334077");
//}
} catch(Exception e) {
list.add("###INVALID###");
list.add("0x334077-0x6A298F-0xDF3795-0x334077");
}
}
}

View File

@ -49,7 +49,9 @@ public class ItemFluidIdentifier extends Item {
if(!(stack.getItem() instanceof ItemFluidIdentifier))
return;
list.add("[CREATED USING TEMPLATE FOLDER]");
list.add("");
list.add("Universal fluid identifier for:");
list.add(" " + I18n.format(FluidType.getEnum(stack.getItemDamage()).getUnlocalizedName()));
}

View File

@ -229,6 +229,16 @@ public class Library {
return false;
}
public static boolean checkForHaz2(EntityPlayer player) {
if(checkArmor(player, ModItems.hazmat_paa_helmet, ModItems.hazmat_paa_plate, ModItems.hazmat_paa_legs, ModItems.hazmat_paa_boots))
{
return true;
}
return false;
}
public static boolean checkForAsbestos(EntityPlayer player) {
if(checkArmor(player, ModItems.asbestos_helmet, ModItems.asbestos_plate, ModItems.asbestos_legs, ModItems.asbestos_boots))
@ -543,12 +553,51 @@ public class Library {
public static long chargeItemsFromTE(ItemStack[] slots, int index, long power, long maxPower) {
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
for(long i = 0; i < ((ItemBattery)slots[index].getItem()).getChargeRate(); i++)
long dR = ((ItemBattery)slots[index].getItem()).getDischargeRate();
while(dR >= 1000000000) {
if(power - 100000000000L >= 0 && ItemBattery.getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100000000000L;
dR -= 1000000000;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
}
while(dR >= 1000000) {
if(power - 100000000 >= 0 && ItemBattery.getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100000000;
dR -= 1000000;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
}
while(dR >= 1000) {
if(power - 100000 >= 0 && ItemBattery.getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100000;
dR -= 1000;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
}
while(dR >= 1) {
if(power - 100 >= 0 && ItemBattery.getCharge(slots[index]) < ((ItemBattery)slots[index].getItem()).getMaxCharge())
{
power -= 100;
dR -= 1;
((ItemBattery)slots[index].getItem()).chargeBattery(slots[index], 1);
} else break;
}
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_desh && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_desh_charged);
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_schrabidium && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_schrabidium_charged);
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_euphemium && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_euphemium_charged);
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_dineutronium && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_dineutronium_charged);
}
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_sword && slots[index].getItemDamage() > 0)
@ -556,37 +605,27 @@ public class Library {
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_pickaxe && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_axe && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
for(int i = 0; i < 50; i++)
if(power - 1 >= 0 && slots[index] != null && slots[index].getItem() == ModItems.elec_shovel && slots[index].getItemDamage() > 0)
{
power -= 1;
slots[index].setItemDamage(slots[index].getItemDamage() - 1);
} else break;
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_desh && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_desh_charged);
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_schrabidium && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_schrabidium_charged);
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_euphemium && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_euphemium_charged);
if(slots[index] != null && slots[index].getItem() == ModItems.dynosphere_dineutronium && ItemBattery.getCharge(slots[index]) == ItemBattery.getMaxChargeStatic(slots[index]))
slots[index] = new ItemStack(ModItems.dynosphere_dineutronium_charged);
}
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
ItemBattery.updateDamage(slots[index]);
@ -607,18 +646,48 @@ public class Library {
return maxPower;
}
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery)
for(long i = 0; i < ((ItemBattery)slots[index].getItem()).getDischargeRate(); i++)
if(power + 100 <= maxPower && ItemBattery.getCharge(slots[index]) > 0)
{
power += 100;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
ItemBattery.updateDamage(slots[index]);
}
if(slots[index] != null && slots[index].getItem() instanceof ItemBattery) {
long dR = ((ItemBattery)slots[index].getItem()).getDischargeRate();
while(dR >= 1000000000) {
if(power + 100000000000L <= maxPower && ItemBattery.getCharge(slots[index]) > 0)
{
power += 100000000000L;
dR -= 1000000000L;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
}
while(dR >= 1000000) {
if(power + 100000000L <= maxPower && ItemBattery.getCharge(slots[index]) > 0)
{
power += 100000000L;
dR -= 1000000;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
}
while(dR >= 1000) {
if(power + 100000L <= maxPower && ItemBattery.getCharge(slots[index]) > 0)
{
power += 100000L;
dR -= 1000;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
}
while(dR >= 1) {
if(power + 100L <= maxPower && ItemBattery.getCharge(slots[index]) > 0)
{
power += 100L;
dR -= 1;
((ItemBattery)slots[index].getItem()).dischargeBattery(slots[index], 1);
} else break;
}
}
return power;
}

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 (Arsenic-X07)";
public static final String VERSION = "1.0.27 BETA (Cobalt-X08)";
//HBM's Beta Naming Convention:
//V T (X-Y-Z)
//V -> next release version

View File

@ -1180,6 +1180,14 @@ public class CraftingManager {
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_resonator), new Object[] { ModItems.sat_resonator });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.sat_foeq), new Object[] { ModItems.sat_foeq });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.sat_interface), new Object[] { "ISI", "PCP", "PAP", 'I', "ingotSteel", 'S', ModItems.ingot_starmetal, 'P', ModItems.plate_polymer, 'C', ModItems.sat_chip, 'A', ModItems.circuit_gold }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_spp_bottom), new Object[] { "MDM", "LCL", "LWL", 'M', "ingotMagnetizedTungsten", 'D', "plateDesh", 'L', "plateLead", 'C', ModItems.circuit_gold, 'W', ModItems.coil_magnetized_tungsten }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_spp_top), new Object[] { "LWL", "LCL", "MDM", 'M', "ingotMagnetizedTungsten", 'D', "plateDesh", 'L', "plateLead", 'C', ModItems.circuit_gold, 'W', ModItems.coil_magnetized_tungsten }));
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.machine_spp_bottom), new Object[] { ModBlocks.machine_spp_top });
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.machine_spp_top), new Object[] { ModBlocks.machine_spp_bottom });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_b93), new Object[] { "PCE", "SEB", "PCE", 'P', "plateDineutronium", 'C', ModItems.weaponized_starblaster_cell, 'E', ModItems.component_emitter, 'B', ModItems.gun_b92, 'S', ModItems.singularity_spark }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.machine_transformer), new Object[] { "SDS", "MCM", "MCM", 'S', ModItems.ingot_starmetal, 'D', "ingotDesh", 'M', ModBlocks.fusion_conductor, 'C', ModItems.circuit_targeting_tier6 }));
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.bottle_sparkle), new Object[] { ModItems.bottle_quantum, Items.carrot, Items.gold_nugget });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.grenade_nuke), new Object[] { "CGC", "CGC", "PAP", 'C', ModBlocks.det_charge, 'G', ModItems.grenade_mk2, 'P', "plateAdvanced", 'A', Blocks.anvil }));
GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.assembly_template, 1, OreDictionary.WILDCARD_VALUE) });
GameRegistry.addShapelessRecipe(new ItemStack(Items.paper, 1), new Object[] { new ItemStack(ModItems.chemistry_template, 1, OreDictionary.WILDCARD_VALUE) });

View File

@ -1037,6 +1037,7 @@ public class MainRegistry
OreDictionary.registerOre("plateAdvanced", ModItems.plate_advanced_alloy);
OreDictionary.registerOre("plateSchrabidium", ModItems.plate_schrabidium);
OreDictionary.registerOre("plateCMBSteel", ModItems.plate_combine_steel);
OreDictionary.registerOre("plateDesh", ModItems.plate_desh);
OreDictionary.registerOre("plateEuphemium", ModItems.plate_euphemium);
OreDictionary.registerOre("plateDineutronium", ModItems.plate_dineutronium);
OreDictionary.registerOre("dustIron", ModItems.powder_iron);

View File

@ -1,15 +1,28 @@
package com.hbm.main;
import com.hbm.entity.missile.EntityMissileBaseAdvanced;
import com.hbm.entity.mob.EntityNuclearCreeper;
import com.hbm.entity.projectile.EntityMeteor;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.lib.RefStrings;
import com.hbm.potion.PotionEffectRadiation;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
@ -61,6 +74,81 @@ public class ModEventHandler
MainRegistry.logger.info("Started meteor shower! Duration: " + meteorShower);
}
}
if(event.world != null && !event.world.isRemote) {
if(!event.world.loadedEntityList.isEmpty()) {
for(Object e : event.world.loadedEntityList) {
if(e instanceof EntityLivingBase) {
EntityLivingBase entity = (EntityLivingBase) e;
PotionEffect effect = entity.getActivePotionEffect(PotionEffectRadiation.instance);
if(effect != null) {
if(entity instanceof EntityCreeper) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(event.world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
if(!entity.isDead)
if(!event.world.isRemote)
event.world.spawnEntityInWorld(creep);
entity.setDead();
} else if(entity instanceof EntityCow) {
EntityMooshroom creep = new EntityMooshroom(event.world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
if(!entity.isDead)
if(!event.world.isRemote)
event.world.spawnEntityInWorld(creep);
entity.setDead();
} else if(entity instanceof EntityVillager) {
EntityZombie creep = new EntityZombie(event.world);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
if(!entity.isDead)
if(!event.world.isRemote)
event.world.spawnEntityInWorld(creep);
entity.setDead();
} else if(!(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom) && !(entity instanceof EntityZombie)) {
int level = effect.getAmplifier();
if(level > 15) {
if(event.world.rand.nextInt(100) == 0)
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
if(event.world.rand.nextInt(300) == 0)
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5 * 20, 3));
if(event.world.rand.nextInt(300) == 0)
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5 * 20, 3));
if(event.world.rand.nextInt(300) == 0)
entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 5 * 20, 2));
if(event.world.rand.nextInt(500) == 0)
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 3 * 20, 4));
} else if(level > 10) {
if(event.world.rand.nextInt(150) == 0)
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
if(event.world.rand.nextInt(400) == 0)
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5 * 20, 3));
if(event.world.rand.nextInt(400) == 0)
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5 * 20, 3));
if(event.world.rand.nextInt(400) == 0)
entity.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 5 * 20, 2));
} else if(level > 4) {
if(event.world.rand.nextInt(300) == 0)
entity.addPotionEffect(new PotionEffect(Potion.confusion.id, 5 * 20, 0));
if(event.world.rand.nextInt(500) == 0)
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5 * 20, 1));
if(event.world.rand.nextInt(500) == 0)
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 5 * 20, 1));
}
}
}
}
}
}
}
}
@SubscribeEvent

View File

@ -134,7 +134,7 @@ public class LoopedSoundPacket implements IMessage {
int j = te.xCoord + te.zCoord + te.yCoord;
if(flag && te.getWorldObj().isRemote)
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopBroadcaster(new ResourceLocation("hbm:block.broadcast" + (j % 3 + 1)), te));
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopBroadcaster(new ResourceLocation("hbm:block.broadcast" + (Math.abs(j) % 3 + 1)), te));
}
return null;
}

View File

@ -12,6 +12,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.DamageSource;
@ -41,7 +42,9 @@ public class PotionEffectBang extends Potion {
{
entity.attackEntityFrom(ModDamageSource.bang, 1000);
entity.setHealth(0.0F);
entity.setDead();
if(!(entity instanceof EntityPlayer))
entity.setDead();
entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "hbm:weapon.laserBang", 100.0F, 1.0F);
//entity.worldObj.spawnParticle("hugeexplosion", entity.posX, entity.posY, entity.posZ, 0, 0, 0);

View File

@ -40,7 +40,7 @@ public class PotionEffectTaint extends Potion {
{
entity.attackEntityFrom(ModDamageSource.taint, (level + 1));
if(!entity.worldObj.isRemote) {
/*if(!entity.worldObj.isRemote) {
for(int i = 0; i < 15; i++) {
int a = rand.nextInt(5) + (int)entity.posX - 2;
@ -49,7 +49,7 @@ public class PotionEffectTaint extends Potion {
if(entity.worldObj.getBlock(a, b, c).isReplaceable(entity.worldObj, a, b, c) && BlockTaint.hasPosNeightbour(entity.worldObj, a, b, c))
entity.worldObj.setBlock(a, b, c, ModBlocks.taint, rand.nextInt(3), 2);
}
}
}*/
}
public boolean isReady(int par1, int par2)

View File

@ -428,16 +428,18 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - 10 + 0.5, yCoord - 10 + 0.5 + 6, zCoord - 10 + 0.5, xCoord + 10 + 0.5, yCoord + 10 + 0.5 + 6, zCoord + 10 + 0.5));
for(Entity e : list) {
if(!Library.isObstructed(worldObj, xCoord + 0.5, yCoord + 0.5 + 6, zCoord + 0.5, e.posX, e.posY + e.getEyeHeight(), e.posZ)) {
e.attackEntityFrom(ModDamageSource.ams, 1000);
e.setFire(3);
}
if(!(e instanceof EntityPlayer && Library.checkForHazmat((EntityPlayer)e)))
if(!Library.isObstructed(worldObj, xCoord + 0.5, yCoord + 0.5 + 6, zCoord + 0.5, e.posX, e.posY + e.getEyeHeight(), e.posZ)) {
e.attackEntityFrom(ModDamageSource.ams, 1000);
e.setFire(3);
}
}
List<Entity> list2 = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - scale + 0.5, yCoord - scale + 0.5 + 6, zCoord - scale + 0.5, xCoord + scale + 0.5, yCoord + scale + 0.5 + 6, zCoord + scale + 0.5));
for(Entity e : list2) {
e.attackEntityFrom(ModDamageSource.amsCore, 10000);
if(!(e instanceof EntityPlayer && Library.checkForHaz2((EntityPlayer)e)))
e.attackEntityFrom(ModDamageSource.amsCore, 10000);
}
}
@ -453,9 +455,9 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
this.worldObj.spawnEntityInWorld(cloud);
}
int radius = (int)(100 + (double)(tanks[2].getFill() + tanks[3].getFill()) / 16000D * 150);
int radius = (int)(50 + (double)(tanks[2].getFill() + tanks[3].getFill()) / 16000D * 150);
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFacExperimental(worldObj, 10, xCoord, yCoord, zCoord));
worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFacExperimental(worldObj, radius, xCoord, yCoord, zCoord));
}
}

View File

@ -24,6 +24,7 @@ import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.potion.PotionEffectRadiation;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@ -511,19 +512,8 @@ public class TileEntityReactorMultiblock extends TileEntity implements ISidedInv
Library.damageSuit(((EntityPlayer)entity), 2);
Library.damageSuit(((EntityPlayer)entity), 3);*/
} else if(entity instanceof EntityCreeper) {
EntityNuclearCreeper creep = new EntityNuclearCreeper(this.worldObj);
creep.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
//creep.setRotationYawHead(((EntityCreeper)entity).rotationYawHead);
if(!entity.isDead)
if(!worldObj.isRemote)
worldObj.spawnEntityInWorld(creep);
entity.setDead();
} else if(entity instanceof EntityLivingBase && !(entity instanceof EntityNuclearCreeper) && !(entity instanceof EntityMooshroom))
{
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.poison.getId(), 2 * 60 * 20, 2));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.wither.getId(), 20, 4));
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 1 * 60 * 20, 1));
} else {
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(PotionEffectRadiation.instance.id, 80 * 20, 25));
}
}
}

View File

@ -113,7 +113,7 @@ public class Meteorite {
List<ItemStack> list10 = new ArrayList<ItemStack>();
list10.add(new ItemStack(ModBlocks.block_meteor_broken));
generateSphere5x5(world, rand, x, y, z, list10);
world.setBlock(x, y, z, ModBlocks.taint);
world.setBlock(x, y, z, ModBlocks.taint, 9, 2);
return;
case 11:
//Atomic meteorite