some ammo related items

This commit is contained in:
Bob 2020-09-10 19:31:35 +02:00
parent a6e047467c
commit 651a8506cf
7 changed files with 29 additions and 20 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

View File

@ -871,6 +871,11 @@ public class ModItems {
public static Item magnetron;
public static Item pellet_buckshot;
public static Item pellet_flechette;
public static Item pellet_chlorophyte;
public static Item pellet_mercury;
public static Item pellet_meteorite;
public static Item pellet_canister;
public static Item pellet_charged;
public static Item designator;
public static Item designator_range;
@ -2729,6 +2734,11 @@ public class ModItems {
magnetron = new ItemCustomLore().setUnlocalizedName("magnetron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":magnetron_alt");
pellet_buckshot = new Item().setUnlocalizedName("pellet_buckshot").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_lead");
pellet_flechette = new Item().setUnlocalizedName("pellet_flechette").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_flechette");
pellet_chlorophyte = new Item().setUnlocalizedName("pellet_chlorophyte").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_chlorophyte");
pellet_mercury = new Item().setUnlocalizedName("pellet_mercury").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_mercury");
pellet_meteorite = new Item().setUnlocalizedName("pellet_meteorite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_meteorite");
pellet_canister = new Item().setUnlocalizedName("pellet_canister").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_canister");
pellet_charged = new Item().setUnlocalizedName("pellet_charged").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_charged");
pellet_schrabidium = new WatzFuel(25F, true, 50000, 140000, 0.975F, 200, 1.05F, 1.05F).setUnlocalizedName("pellet_schrabidium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_schrabidium").setMaxStackSize(1);
pellet_hes = new WatzFuel(20F, true, 108000, 65000, 1F, 85, 1, 1.025F).setUnlocalizedName("pellet_hes").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pellet_hes").setMaxStackSize(1);
@ -4440,6 +4450,11 @@ public class ModItems {
GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName());
GameRegistry.registerItem(pellet_buckshot, pellet_buckshot.getUnlocalizedName());
GameRegistry.registerItem(pellet_flechette, pellet_flechette.getUnlocalizedName());
GameRegistry.registerItem(pellet_chlorophyte, pellet_chlorophyte.getUnlocalizedName());
GameRegistry.registerItem(pellet_mercury, pellet_mercury.getUnlocalizedName());
GameRegistry.registerItem(pellet_meteorite, pellet_meteorite.getUnlocalizedName());
GameRegistry.registerItem(pellet_canister, pellet_canister.getUnlocalizedName());
GameRegistry.registerItem(pellet_charged, pellet_charged.getUnlocalizedName());
GameRegistry.registerItem(pellet_gas, pellet_gas.getUnlocalizedName());
GameRegistry.registerItem(magnetron, magnetron.getUnlocalizedName());

View File

@ -10,6 +10,7 @@ import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidContainer;
import com.hbm.interfaces.IFluidSource;
import com.hbm.interfaces.ISource;
import com.hbm.interfaces.Untested;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.MachineRecipes;
import com.hbm.lib.Library;
@ -17,8 +18,6 @@ import com.hbm.tileentity.TileEntityMachineBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
@ -50,6 +49,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
return "container.machineLargeTurbine";
}
@Untested
@Override
public void updateEntity() {
@ -77,25 +77,19 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
} else {
tanks[1].setTankType((FluidType) outs[0]);
int processMax = (int) Math.ceil(tanks[0].getFill() / 10F);
int processMax = (int) Math.ceil(tanks[0].getFill() / 10F) / (Integer)outs[2]; //the maximum amount of cycles based on the 10% cap
int processSteam = tanks[0].getFill() / (Integer)outs[2]; //the maximum amount of cycles depending on steam
int processWater = (tanks[1].getMaxFill() - tanks[1].getFill()) / (Integer)outs[1]; //the maximum amount of cycles depending on water
//TODO: handle this dynamically instead of a 16k iteration for loop
for(int i = 0; i < processMax; i++) {
if(tanks[0].getFill() >= (Integer)outs[2] && tanks[1].getFill() + (Integer)outs[1] <= tanks[1].getMaxFill()) {
operational = true;
tanks[0].setFill(tanks[0].getFill() - (Integer)outs[2]);
tanks[1].setFill(tanks[1].getFill() + (Integer)outs[1]);
power += (Integer)outs[3];
if(power > maxPower)
power = maxPower;
} else {
break;
}
}
int cycles = Math.min(processMax, Math.min(processSteam, processWater));
tanks[0].setFill(tanks[0].getFill() - (Integer)outs[2] * cycles);
tanks[1].setFill(tanks[1].getFill() + (Integer)outs[1] * cycles);
power += (Integer)outs[3] * cycles;
if(power > maxPower)
power = maxPower;
}
tanks[1].unloadTank(5, 6, slots);