mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Watz pellet fix, AMS improvement
This commit is contained in:
parent
0b7c14cb79
commit
1def78fa59
@ -155,7 +155,7 @@ public class NukeFleija extends BlockContainer implements IBomb {
|
|||||||
|
|
||||||
world.spawnEntityInWorld(entity);
|
world.spawnEntityInWorld(entity);
|
||||||
|
|
||||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(world, r);
|
EntityCloudFleija cloud = new EntityCloudFleija(world, r);
|
||||||
cloud.posX = x;
|
cloud.posX = x;
|
||||||
cloud.posY = y;
|
cloud.posY = y;
|
||||||
cloud.posZ = z;
|
cloud.posZ = z;
|
||||||
|
|||||||
@ -2364,11 +2364,14 @@ public class MachineRecipes {
|
|||||||
list.add(new ItemStack(ModItems.coil_magnetized_tungsten, 4));
|
list.add(new ItemStack(ModItems.coil_magnetized_tungsten, 4));
|
||||||
break;
|
break;
|
||||||
case SCHRABTRANS:
|
case SCHRABTRANS:
|
||||||
|
list.add(new ItemStack(ModItems.ingot_magnetized_tungsten, 1));
|
||||||
list.add(new ItemStack(ModItems.ingot_titanium, 24));
|
list.add(new ItemStack(ModItems.ingot_titanium, 24));
|
||||||
list.add(new ItemStack(ModItems.plate_advanced_alloy, 18));
|
list.add(new ItemStack(ModItems.plate_advanced_alloy, 18));
|
||||||
list.add(new ItemStack(ModItems.plate_steel, 12));
|
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(ModBlocks.machine_battery, 5));
|
||||||
list.add(new ItemStack(ModItems.ingot_magnetized_tungsten, 1));
|
list.add(new ItemStack(ModItems.circuit_gold, 5));
|
||||||
break;
|
break;
|
||||||
case CMB_FURNACE:
|
case CMB_FURNACE:
|
||||||
list.add(new ItemStack(ModItems.ingot_steel, 8));
|
list.add(new ItemStack(ModItems.ingot_steel, 8));
|
||||||
|
|||||||
@ -13,8 +13,22 @@ public class ContainerWatzCore extends Container {
|
|||||||
|
|
||||||
private TileEntityWatzCore diFurnace;
|
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) {
|
public ContainerWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) {
|
||||||
|
|
||||||
|
powerList = 0;
|
||||||
|
heatList = 0;
|
||||||
|
decayMultiplier = 0;
|
||||||
|
powerMultiplier = 0;
|
||||||
|
heatMultiplier = 0;
|
||||||
|
heat = 0;
|
||||||
|
|
||||||
diFurnace = tedf;
|
diFurnace = tedf;
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 18));
|
this.addSlotToContainer(new Slot(tedf, 0, 8, 18));
|
||||||
@ -56,7 +70,7 @@ public class ContainerWatzCore extends Container {
|
|||||||
//Mud Input
|
//Mud Input
|
||||||
this.addSlotToContainer(new Slot(tedf, 36, 134, 108 - 18));
|
this.addSlotToContainer(new Slot(tedf, 36, 134, 108 - 18));
|
||||||
//Battery
|
//Battery
|
||||||
this.addSlotToContainer(new Slot(tedf, 37, 152, 108));
|
this.addSlotToContainer(new Slot(tedf, 37, 152, 108 - 18));
|
||||||
//Filter
|
//Filter
|
||||||
this.addSlotToContainer(new Slot(tedf, 38, 116, 63));
|
this.addSlotToContainer(new Slot(tedf, 38, 116, 63));
|
||||||
//Mud Output
|
//Mud Output
|
||||||
@ -118,4 +132,79 @@ public class ContainerWatzCore extends Container {
|
|||||||
public boolean canInteractWith(EntityPlayer player) {
|
public boolean canInteractWith(EntityPlayer player) {
|
||||||
return diFurnace.isUseableByPlayer(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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ public class GUIWatzCore extends GuiInfoContainer {
|
|||||||
super.drawScreen(mouseX, mouseY, f);
|
super.drawScreen(mouseX, mouseY, f);
|
||||||
|
|
||||||
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 106 - 18 - 70, 16, 70);
|
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
|
@Override
|
||||||
|
|||||||
@ -4,9 +4,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
public class WatzFuel extends ItemRadioactive {
|
public class WatzFuel extends ItemRadioactive {
|
||||||
|
|
||||||
|
public int lifeTime;
|
||||||
public int power;
|
public int power;
|
||||||
public float powerMultiplier;
|
public float powerMultiplier;
|
||||||
public int heat;
|
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) {
|
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.power = power/10;
|
||||||
this.powerMultiplier = powerMultiplier;
|
this.powerMultiplier = powerMultiplier;
|
||||||
this.heat = heat;
|
this.heat = heat;
|
||||||
this.heatMultiplier = heatMultiplier;
|
this.heatMultiplier = heatMultiplier;
|
||||||
this.decayMultiplier = decayMultiplier;
|
this.decayMultiplier = decayMultiplier;
|
||||||
|
this.setMaxDamage(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
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 per tick: " + (power) + "HE");
|
||||||
list.add("Power multiplier: " + (powerMultiplier >= 1 ? "+" : "") + (Math.round(powerMultiplier * 1000) * .10 - 100) + "%");
|
list.add("Power multiplier: " + (powerMultiplier >= 1 ? "+" : "") + (Math.round(powerMultiplier * 1000) * .10 - 100) + "%");
|
||||||
list.add("Heat provided: " + heat + " heat");
|
list.add("Heat provided: " + heat + " heat");
|
||||||
list.add("Heat multiplier: " + (heatMultiplier >= 1 ? "+" : "") + (Math.round(heatMultiplier * 1000) * .10 - 100) + "%");
|
list.add("Heat multiplier: " + (heatMultiplier >= 1 ? "+" : "") + (Math.round(heatMultiplier * 1000) * .10 - 100) + "%");
|
||||||
list.add("Decay multiplier: " + (decayMultiplier >= 1 ? "+" : "") + (Math.round(decayMultiplier * 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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ public class WeaponizedCell extends Item {
|
|||||||
{
|
{
|
||||||
World world = item.worldObj;
|
World world = item.worldObj;
|
||||||
|
|
||||||
if(item.ticksExisted > 60 * 20 || item.isBurning()) {
|
if(item.ticksExisted > 50 * 20 || item.isBurning()) {
|
||||||
|
|
||||||
if(!world.isRemote) {
|
if(!world.isRemote) {
|
||||||
world.playSoundEffect(item.posX, item.posY, item.posZ,
|
world.playSoundEffect(item.posX, item.posY, item.posZ,
|
||||||
@ -40,14 +40,16 @@ public class WeaponizedCell extends Item {
|
|||||||
cloud.posZ = item.posZ;
|
cloud.posZ = item.posZ;
|
||||||
world.spawnEntityInWorld(cloud);
|
world.spawnEntityInWorld(cloud);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item.setDead();
|
||||||
}
|
}
|
||||||
|
|
||||||
int randy = (60 * 20) - item.ticksExisted;
|
int randy = (50 * 20) - item.ticksExisted;
|
||||||
|
|
||||||
if(randy < 1)
|
if(randy < 1)
|
||||||
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);
|
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
|
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);
|
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);
|
||||||
|
|||||||
@ -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(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_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_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_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_power, 'P', "ingotDineutronium", 'B', ModItems.dynosphere_euphemium_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
|
//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, 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" }));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_revolver_pip_ammo, 1), new Object[] { "S", "G", "C", 'S', "plateSteel", 'G', Items.gunpowder, 'C', "plateCopper" }));
|
||||||
|
|||||||
@ -348,7 +348,8 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IS
|
|||||||
heatBase *= Math.pow(1.25F, booster);
|
heatBase *= Math.pow(1.25F, booster);
|
||||||
heatBase *= (100 - field);
|
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));
|
power += (powerBase * powerMod * gauss(1, (heat - (maxHeat / 2)) / maxHeat));
|
||||||
heat += (heatBase * heatMod) / (float)(this.field / 100F);
|
heat += (heatBase * heatMod) / (float)(this.field / 100F);
|
||||||
|
|||||||
@ -620,11 +620,12 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
|
|||||||
if(slots[i] != null && slots[i].getItem() instanceof WatzFuel)
|
if(slots[i] != null && slots[i].getItem() instanceof WatzFuel)
|
||||||
{
|
{
|
||||||
WatzFuel fuel = (WatzFuel)slots[i].getItem();
|
WatzFuel fuel = (WatzFuel)slots[i].getItem();
|
||||||
slots[i].setItemDamage(slots[i].getItemDamage() + this.decayMultiplier);
|
WatzFuel.setLifeTime(slots[i], WatzFuel.getLifeTime(slots[i]) + this.decayMultiplier);
|
||||||
if(slots[i].getItemDamage() >= slots[i].getMaxDamage())
|
WatzFuel.updateDamage(slots[i]);
|
||||||
|
if(WatzFuel.getLifeTime(slots[i]) >= fuel.lifeTime)
|
||||||
{
|
{
|
||||||
if(slots[i].getItem() == ModItems.pellet_lead)
|
if(slots[i].getItem() == ModItems.pellet_lead)
|
||||||
slots[i] = null;
|
slots[i] = new ItemStack(ModItems.powder_lead);
|
||||||
else
|
else
|
||||||
slots[i] = new ItemStack(ModItems.pellet_lead);
|
slots[i] = new ItemStack(ModItems.pellet_lead);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user