diff --git a/com/hbm/blocks/bomb/NukeFleija.java b/com/hbm/blocks/bomb/NukeFleija.java index cc5d87ffb..e9c7e207c 100644 --- a/com/hbm/blocks/bomb/NukeFleija.java +++ b/com/hbm/blocks/bomb/NukeFleija.java @@ -155,7 +155,7 @@ public class NukeFleija extends BlockContainer implements IBomb { world.spawnEntityInWorld(entity); - EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, r); + EntityCloudFleija cloud = new EntityCloudFleija(world, r); cloud.posX = x; cloud.posY = y; cloud.posZ = z; diff --git a/com/hbm/inventory/MachineRecipes.java b/com/hbm/inventory/MachineRecipes.java index 14a061492..ea78113a8 100644 --- a/com/hbm/inventory/MachineRecipes.java +++ b/com/hbm/inventory/MachineRecipes.java @@ -2364,11 +2364,14 @@ public class MachineRecipes { list.add(new ItemStack(ModItems.coil_magnetized_tungsten, 4)); break; case SCHRABTRANS: + list.add(new ItemStack(ModItems.ingot_magnetized_tungsten, 1)); list.add(new ItemStack(ModItems.ingot_titanium, 24)); list.add(new ItemStack(ModItems.plate_advanced_alloy, 18)); list.add(new ItemStack(ModItems.plate_steel, 12)); + list.add(new ItemStack(ModItems.plate_desh, 6)); + list.add(new ItemStack(ModItems.plate_polymer, 8)); list.add(new ItemStack(ModBlocks.machine_battery, 5)); - list.add(new ItemStack(ModItems.ingot_magnetized_tungsten, 1)); + list.add(new ItemStack(ModItems.circuit_gold, 5)); break; case CMB_FURNACE: list.add(new ItemStack(ModItems.ingot_steel, 8)); diff --git a/com/hbm/inventory/container/ContainerWatzCore.java b/com/hbm/inventory/container/ContainerWatzCore.java index e75906f24..dae933643 100644 --- a/com/hbm/inventory/container/ContainerWatzCore.java +++ b/com/hbm/inventory/container/ContainerWatzCore.java @@ -12,8 +12,22 @@ import net.minecraft.item.ItemStack; public class ContainerWatzCore extends Container { private TileEntityWatzCore diFurnace; + + private int powerList; + private int heatList; + private int decayMultiplier; + private int powerMultiplier; + private int heatMultiplier; + private int heat; public ContainerWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) { + + powerList = 0; + heatList = 0; + decayMultiplier = 0; + powerMultiplier = 0; + heatMultiplier = 0; + heat = 0; diFurnace = tedf; @@ -56,7 +70,7 @@ public class ContainerWatzCore extends Container { //Mud Input this.addSlotToContainer(new Slot(tedf, 36, 134, 108 - 18)); //Battery - this.addSlotToContainer(new Slot(tedf, 37, 152, 108)); + this.addSlotToContainer(new Slot(tedf, 37, 152, 108 - 18)); //Filter this.addSlotToContainer(new Slot(tedf, 38, 116, 63)); //Mud Output @@ -118,4 +132,79 @@ public class ContainerWatzCore extends Container { public boolean canInteractWith(EntityPlayer player) { return diFurnace.isUseableByPlayer(player); } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + for(int i = 0; i < this.crafters.size(); i++) + { + ICrafting par1 = (ICrafting)this.crafters.get(i); + + if(this.powerList != this.diFurnace.powerList) + { + par1.sendProgressBarUpdate(this, 0, this.diFurnace.powerList); + } + + if(this.heatList != this.diFurnace.heatList) + { + par1.sendProgressBarUpdate(this, 1, this.diFurnace.heatList); + } + + if(this.decayMultiplier != this.diFurnace.decayMultiplier) + { + par1.sendProgressBarUpdate(this, 2, this.diFurnace.decayMultiplier); + } + + if(this.powerMultiplier != this.diFurnace.powerMultiplier) + { + par1.sendProgressBarUpdate(this, 3, this.diFurnace.powerMultiplier); + } + + if(this.heatMultiplier != this.diFurnace.heatMultiplier) + { + par1.sendProgressBarUpdate(this, 4, this.diFurnace.heatMultiplier); + } + + if(this.heat != this.diFurnace.heat) + { + par1.sendProgressBarUpdate(this, 5, this.diFurnace.heat); + } + } + + this.powerList = this.diFurnace.powerList; + this.heatList = this.diFurnace.heatList; + this.decayMultiplier = this.diFurnace.decayMultiplier; + this.powerMultiplier = this.diFurnace.powerMultiplier; + this.heatMultiplier = this.diFurnace.heatMultiplier; + this.heat = this.diFurnace.heat; + } + + @Override + public void updateProgressBar(int i, int j) { + if(i == 0) + { + diFurnace.powerList = j; + } + if(i == 1) + { + diFurnace.heatList = j; + } + if(i == 2) + { + diFurnace.decayMultiplier = j; + } + if(i == 3) + { + diFurnace.powerMultiplier = j; + } + if(i == 4) + { + diFurnace.heatMultiplier = j; + } + if(i == 5) + { + diFurnace.heat = j; + } + } } diff --git a/com/hbm/inventory/gui/GUIWatzCore.java b/com/hbm/inventory/gui/GUIWatzCore.java index 85f01dd1f..234034716 100644 --- a/com/hbm/inventory/gui/GUIWatzCore.java +++ b/com/hbm/inventory/gui/GUIWatzCore.java @@ -32,7 +32,7 @@ public class GUIWatzCore extends GuiInfoContainer { super.drawScreen(mouseX, mouseY, f); diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 106 - 18 - 70, 16, 70); - this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 106 - 70, 16, 70, diFurnace.power, diFurnace.maxPower); + this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 106 - 70, 16, 70 - 18, diFurnace.power, diFurnace.maxPower); } @Override diff --git a/com/hbm/items/special/WatzFuel.java b/com/hbm/items/special/WatzFuel.java index d15912795..10f598d68 100644 --- a/com/hbm/items/special/WatzFuel.java +++ b/com/hbm/items/special/WatzFuel.java @@ -4,9 +4,11 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; public class WatzFuel extends ItemRadioactive { - + + public int lifeTime; public int power; public float powerMultiplier; public int heat; @@ -24,22 +26,47 @@ public class WatzFuel extends ItemRadioactive { */ public WatzFuel(int lifeTime, int power, float powerMultiplier, int heat, float heatMultiplier, float decayMultiplier) { - this.setMaxDamage(lifeTime * 100); + this.lifeTime = lifeTime * 100; this.power = power/10; this.powerMultiplier = powerMultiplier; this.heat = heat; this.heatMultiplier = heatMultiplier; this.decayMultiplier = decayMultiplier; + this.setMaxDamage(100); } @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { - list.add("Max age: " + (this.getMaxDamage()/100) + " ticks"); + list.add("Max age: " + this.lifeTime/100 + " ticks"); list.add("Power per tick: " + (power) + "HE"); list.add("Power multiplier: " + (powerMultiplier >= 1 ? "+" : "") + (Math.round(powerMultiplier * 1000) * .10 - 100) + "%"); list.add("Heat provided: " + heat + " heat"); list.add("Heat multiplier: " + (heatMultiplier >= 1 ? "+" : "") + (Math.round(heatMultiplier * 1000) * .10 - 100) + "%"); list.add("Decay multiplier: " + (decayMultiplier >= 1 ? "+" : "") + (Math.round(decayMultiplier * 1000) * .10 - 100) + "%"); } + + public static void setLifeTime(ItemStack stack, int time) { + if(!stack.hasTagCompound()) + stack.stackTagCompound = new NBTTagCompound(); + + stack.stackTagCompound.setInteger("life", time); + } + + public static void updateDamage(ItemStack stack) { + + if(!stack.hasTagCompound()) + stack.stackTagCompound = new NBTTagCompound(); + + stack.setItemDamage((int)((double)getLifeTime(stack) / (double)((WatzFuel)stack.getItem()).lifeTime * 100D)); + } + + public static int getLifeTime(ItemStack stack) { + if(!stack.hasTagCompound()) { + stack.stackTagCompound = new NBTTagCompound(); + return 0; + } + + return stack.stackTagCompound.getInteger("life"); + } } diff --git a/com/hbm/items/weapon/WeaponizedCell.java b/com/hbm/items/weapon/WeaponizedCell.java index 21c566021..eb3178d21 100644 --- a/com/hbm/items/weapon/WeaponizedCell.java +++ b/com/hbm/items/weapon/WeaponizedCell.java @@ -17,7 +17,7 @@ public class WeaponizedCell extends Item { { World world = item.worldObj; - if(item.ticksExisted > 60 * 20 || item.isBurning()) { + if(item.ticksExisted > 50 * 20 || item.isBurning()) { if(!world.isRemote) { world.playSoundEffect(item.posX, item.posY, item.posZ, @@ -40,14 +40,16 @@ public class WeaponizedCell extends Item { cloud.posZ = item.posZ; world.spawnEntityInWorld(cloud); } + + item.setDead(); } - int randy = (60 * 20) - item.ticksExisted; + int randy = (50 * 20) - item.ticksExisted; if(randy < 1) randy = 1; - if(item.worldObj.rand.nextInt(60 * 20) >= randy) + if(item.worldObj.rand.nextInt(50 * 20) >= randy) world.spawnParticle("reddust", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0); else world.spawnParticle("smoke", item.posX + item.worldObj.rand.nextGaussian() * item.width / 2, item.posY + item.worldObj.rand.nextGaussian() * item.height, item.posZ + item.worldObj.rand.nextGaussian() * item.width / 2, 0.0, 0.0, 0.0); diff --git a/com/hbm/main/CraftingManager.java b/com/hbm/main/CraftingManager.java index ef1fff364..685585a98 100644 --- a/com/hbm/main/CraftingManager.java +++ b/com/hbm/main/CraftingManager.java @@ -1094,8 +1094,8 @@ public class CraftingManager { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.dynosphere_base), new Object[] { "RPR", "PBP", "RPR", 'R', "dustRedAlloy", 'P', "plateSteel", 'B', "blockRedstone" })); GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_desh), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_desh_mix, 'P', "ingotDesh", 'B', ModItems.dynosphere_base })); GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_schrabidium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_power, 'P', "ingotSchrabidium", 'B', ModItems.dynosphere_desh_charged })); - GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_euphemium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_power, 'P', "ingotEuphemium", 'B', ModItems.dynosphere_schrabidium_charged })); - GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_dineutronium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_power, 'P', "ingotDineutronium", 'B', ModItems.dynosphere_euphemium_charged })); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_euphemium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_nitan_mix, 'P', "ingotEuphemium", 'B', ModItems.dynosphere_schrabidium_charged })); + GameRegistry.addRecipe(new ShapedOreRecipe(ItemBattery.getEmptyBattery(ModItems.dynosphere_dineutronium), new Object[] { "RPR", "PBP", "RPR", 'R', ModItems.powder_spark_mix, 'P', "ingotDineutronium", 'B', ModItems.dynosphere_euphemium_charged })); //Temporary Crappy Recipes GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_pip, 1), new Object[] { " G ", "SSP", " TI", 'G', Blocks.glass_pane, 'S', "plateSteel", 'P', ModItems.powder_power, 'T', ModItems.wire_tungsten, 'I', "ingotPolymer" })); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_pip_ammo, 1), new Object[] { "S", "G", "C", 'S', "plateSteel", 'G', Items.gunpowder, 'C', "plateCopper" })); diff --git a/com/hbm/tileentity/machine/TileEntityAMSBase.java b/com/hbm/tileentity/machine/TileEntityAMSBase.java index 3ea1ed041..00d1563e2 100644 --- a/com/hbm/tileentity/machine/TileEntityAMSBase.java +++ b/com/hbm/tileentity/machine/TileEntityAMSBase.java @@ -348,7 +348,8 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS heatBase *= Math.pow(1.25F, booster); heatBase *= (100 - field); - if(this.getFuelPower(tanks[2].getTankType()) > 0 && this.getFuelPower(tanks[3].getTankType()) > 0) { + if(this.getFuelPower(tanks[2].getTankType()) > 0 && this.getFuelPower(tanks[3].getTankType()) > 0 && + tanks[2].getFill() > 0 && tanks[3].getFill() > 0) { power += (powerBase * powerMod * gauss(1, (heat - (maxHeat / 2)) / maxHeat)); heat += (heatBase * heatMod) / (float)(this.field / 100F); diff --git a/com/hbm/tileentity/machine/TileEntityWatzCore.java b/com/hbm/tileentity/machine/TileEntityWatzCore.java index d4d2f662b..7e2e5bd12 100644 --- a/com/hbm/tileentity/machine/TileEntityWatzCore.java +++ b/com/hbm/tileentity/machine/TileEntityWatzCore.java @@ -620,11 +620,12 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I if(slots[i] != null && slots[i].getItem() instanceof WatzFuel) { WatzFuel fuel = (WatzFuel)slots[i].getItem(); - slots[i].setItemDamage(slots[i].getItemDamage() + this.decayMultiplier); - if(slots[i].getItemDamage() >= slots[i].getMaxDamage()) + WatzFuel.setLifeTime(slots[i], WatzFuel.getLifeTime(slots[i]) + this.decayMultiplier); + WatzFuel.updateDamage(slots[i]); + if(WatzFuel.getLifeTime(slots[i]) >= fuel.lifeTime) { if(slots[i].getItem() == ModItems.pellet_lead) - slots[i] = null; + slots[i] = new ItemStack(ModItems.powder_lead); else slots[i] = new ItemStack(ModItems.pellet_lead); }