fractioning tower

This commit is contained in:
Boblet 2021-08-26 16:49:38 +02:00
parent 4671ecbe4a
commit 0e5db1d675
16 changed files with 528 additions and 122 deletions

View File

@ -829,6 +829,8 @@ public class ModBlocks {
public static Block machine_refinery;
public static final int guiID_machine_refinery = 43;
public static Block machine_fraction_tower;
public static Block machine_boiler_off;
public static Block machine_boiler_on;
@ -1912,6 +1914,7 @@ public class ModBlocks {
oil_pipe = new BlockNoDrop(Material.iron).setBlockName("oil_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":oil_pipe");
machine_flare = new MachineGasFlare(Material.iron).setBlockName("machine_flare").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_flare");
machine_refinery = new MachineRefinery(Material.iron).setBlockName("machine_refinery").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_refinery");
machine_fraction_tower = new MachineFractionTower(Material.iron).setBlockName("machine_fraction_tower").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fraction_tower");
machine_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_drill");
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");

View File

@ -107,7 +107,6 @@ public class YellowBarrel extends Block {
@Override
public int tickRate(World world) {
return 20;
}

View File

@ -0,0 +1,85 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineFractionTower;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class MachineFractionTower extends BlockDummyable {
public MachineFractionTower(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityMachineFractionTower();
return null;
}
@Override
public int[] getDimensions() {
return new int[] {2, 0, 1, 1, 1, 1};
}
@Override
public int getOffset() {
return 1;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(!player.isSneaking()) {
if(player.getHeldItem() == null || player.getHeldItem().getItem() == ModItems.fluid_identifier) {
int[] pos = this.findCore(world, x, y, z);
if(pos == null)
return false;
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
if(!(te instanceof TileEntityMachineFractionTower))
return false;
TileEntityMachineFractionTower frac = (TileEntityMachineFractionTower) te;
if(player.getHeldItem() == null) {
for(int i = 0; i < frac.tanks.length; i++)
player.addChatComponentMessage(new ChatComponentText(frac.tanks[i].getTankType() + ": " + frac.tanks[i].getFill() + "/" + frac.tanks[i].getMaxFill() + "mB"));
} else {
if(world.getTileEntity(pos[0], pos[1] - 3, pos[2]) instanceof TileEntityMachineFractionTower) {
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You can only change the type in the bottom segment!"));
} else {
FluidType type = FluidType.values()[player.getHeldItem().getItemDamage()];
frac.tanks[0].setTankType(type);
frac.markDirty();
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Changed type to " + type + "!"));
}
}
return true;
}
return false;
} else {
return true;
}
}
}

View File

@ -8,6 +8,7 @@ import java.util.List;
import java.util.Map;
import com.hbm.inventory.MachineRecipes;
import com.hbm.inventory.RefineryRecipes;
import com.hbm.inventory.gui.GUIMachineRefinery;
import com.hbm.lib.RefStrings;
@ -85,7 +86,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if ((outputId.equals("refinery")) && getClass() == RefineryRecipeHandler.class) {
Map<Object, Object[]> recipes = MachineRecipes.instance().getRefineryRecipe();
Map<Object, Object[]> recipes = RefineryRecipes.getRefineryRecipe();
for (Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),
(ItemStack)recipe.getValue()[0], (ItemStack)recipe.getValue()[1],
@ -99,7 +100,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(ItemStack result) {
Map<Object, Object[]> recipes = MachineRecipes.instance().getRefineryRecipe();
Map<Object, Object[]> recipes = RefineryRecipes.getRefineryRecipe();
for (Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
if (compareFluidStacks((ItemStack)recipe.getValue()[0], result) ||
compareFluidStacks((ItemStack)recipe.getValue()[1], result) ||
@ -124,7 +125,7 @@ public class RefineryRecipeHandler extends TemplateRecipeHandler {
@Override
public void loadUsageRecipes(ItemStack ingredient) {
Map<Object, Object[]> recipes = MachineRecipes.instance().getRefineryRecipe();
Map<Object, Object[]> recipes = RefineryRecipes.getRefineryRecipe();
for (Map.Entry<Object, Object[]> recipe : recipes.entrySet()) {
if (compareFluidStacks(ingredient, (ItemStack)recipe.getKey()))
this.arecipes.add(new SmeltingSet((ItemStack)recipe.getKey(),

View File

@ -169,20 +169,20 @@ public class AnvilRecipes {
new AnvilOutput(new ItemStack(ModItems.wings_limp))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("ingotDesh", 2), new OreDictStack("dustPolymer", 2), new ComparableStack(ModItems.ingot_dura_steel, 1)},
new AStack[] {new OreDictStack("ingotDesh", 4), new OreDictStack("dustPolymer", 2), new ComparableStack(ModItems.ingot_dura_steel, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_desh, 4))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("ingotEuphemium", 2), new ComparableStack(ModItems.powder_astatine, 2), new ComparableStack(Items.nether_star, 1)},
new AStack[] {new OreDictStack("ingotEuphemium", 4), new ComparableStack(ModItems.powder_astatine, 2), new ComparableStack(ModItems.gem_volcanic, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_euphemium, 4))).setTier(6));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("ingotDineutronium", 2), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack("ingotDesh", 1)},
new AStack[] {new OreDictStack("ingotDineutronium", 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack("ingotDesh", 1)},
new AnvilOutput(new ItemStack(ModItems.plate_dineutronium, 4))).setTier(7));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("plateTitanium", 4), new OreDictStack("ingotSteel", 1), new ComparableStack(ModItems.bolt_tungsten, 2)},
new AStack[] {new OreDictStack("plateTitanium", 2), new OreDictStack("ingotSteel", 1), new ComparableStack(ModItems.bolt_tungsten, 2)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_titanium))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("plateIron", 4), new ComparableStack(ModItems.plate_saturnite, 4), new ComparableStack(ModItems.plate_armor_titanium, 1)},
new AStack[] {new OreDictStack("plateIron", 4), new ComparableStack(ModItems.plate_saturnite, 2), new ComparableStack(ModItems.plate_armor_titanium, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_ajr))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new ComparableStack(ModItems.plate_advanced_alloy, 4), new ComparableStack(ModItems.plate_armor_titanium, 1), new ComparableStack(ModItems.wire_tungsten, 6)},
@ -194,7 +194,7 @@ public class AnvilRecipes {
new AStack[] {new ComparableStack(ModItems.ingot_meteorite_forged, 4), new OreDictStack("ingotDesh", 1), new ComparableStack(ModItems.billet_yharonite, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_fau))).setTier(6));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new ComparableStack(ModItems.plate_dineutronium, 4), new ComparableStack(ModItems.particle_sparkticle, 1), new ComparableStack(ModItems.plate_armor_fau, 1)},
new AStack[] {new ComparableStack(ModItems.plate_dineutronium, 4), new ComparableStack(ModItems.particle_sparkticle, 1), new ComparableStack(ModItems.plate_armor_fau, 6)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_dnt))).setTier(7));
}
@ -202,74 +202,74 @@ public class AnvilRecipes {
public static void registerConstructionAmmo() {
Object[][] recs = new Object[][] {
new Object[] {ModItems.ammo_12gauge, ModItems.powder_fire, ModItems.ammo_12gauge_incendiary, 20, 2},
new Object[] {ModItems.ammo_12gauge, Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_12gauge_shrapnel, 20, 2},
new Object[] {ModItems.ammo_12gauge, ModItems.ingot_u238, ModItems.ammo_12gauge_du, 20, 3},
new Object[] {ModItems.ammo_12gauge, ModItems.coin_maskman, ModItems.ammo_12gauge_sleek, 100, 4},
{ModItems.ammo_12gauge, ModItems.powder_fire, ModItems.ammo_12gauge_incendiary, 20, 2},
{ModItems.ammo_12gauge, Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_12gauge_shrapnel, 20, 2},
{ModItems.ammo_12gauge, ModItems.ingot_u238, ModItems.ammo_12gauge_du, 20, 3},
{ModItems.ammo_12gauge, ModItems.coin_maskman, ModItems.ammo_12gauge_sleek, 100, 4},
new Object[] {ModItems.ammo_20gauge, ModItems.powder_fire, ModItems.ammo_20gauge_incendiary, 20, 2},
new Object[] {ModItems.ammo_20gauge, Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_20gauge_shrapnel, 20, 2},
new Object[] {ModItems.ammo_20gauge, ModItems.powder_poison, ModItems.ammo_20gauge_caustic, 20, 2},
new Object[] {ModItems.ammo_20gauge, "dustDiamond", ModItems.ammo_20gauge_shock, 20, 2},
new Object[] {ModItems.ammo_20gauge, Item.getItemFromBlock(Blocks.soul_sand), ModItems.ammo_20gauge_wither, 10, 3},
new Object[] {ModItems.ammo_20gauge, ModItems.coin_maskman, ModItems.ammo_20gauge_sleek, 100, 4},
{ModItems.ammo_20gauge, ModItems.powder_fire, ModItems.ammo_20gauge_incendiary, 20, 2},
{ModItems.ammo_20gauge, Item.getItemFromBlock(ModBlocks.gravel_obsidian), ModItems.ammo_20gauge_shrapnel, 20, 2},
{ModItems.ammo_20gauge, ModItems.powder_poison, ModItems.ammo_20gauge_caustic, 20, 2},
{ModItems.ammo_20gauge, "dustDiamond", ModItems.ammo_20gauge_shock, 20, 2},
{ModItems.ammo_20gauge, Item.getItemFromBlock(Blocks.soul_sand), ModItems.ammo_20gauge_wither, 10, 3},
{ModItems.ammo_20gauge, ModItems.coin_maskman, ModItems.ammo_20gauge_sleek, 100, 4},
new Object[] {ModItems.ammo_4gauge_flechette, ModItems.ingot_phosphorus, ModItems.ammo_4gauge_flechette_phosphorus, 20, 2},
new Object[] {ModItems.ammo_4gauge_explosive, ModItems.egg_balefire_shard, ModItems.ammo_4gauge_balefire, 10, 4},
new Object[] {ModItems.ammo_4gauge_explosive, ModItems.ammo_rocket, ModItems.ammo_4gauge_kampf, 4, 2},
new Object[] {ModItems.ammo_4gauge_kampf, ModItems.pellet_canister, ModItems.ammo_4gauge_canister, 10, 3},
new Object[] {ModItems.ammo_4gauge, ModItems.pellet_claws, ModItems.ammo_4gauge_claw, 4, 5},
new Object[] {ModItems.ammo_4gauge, ModItems.toothpicks, ModItems.ammo_4gauge_vampire, 4, 5},
new Object[] {ModItems.ammo_4gauge, ModItems.pellet_charged, ModItems.ammo_4gauge_void, 1, 5},
new Object[] {ModItems.ammo_4gauge, ModItems.coin_maskman, ModItems.ammo_4gauge_sleek, 100, 4},
{ModItems.ammo_4gauge_flechette, ModItems.ingot_phosphorus, ModItems.ammo_4gauge_flechette_phosphorus, 20, 2},
{ModItems.ammo_4gauge_explosive, ModItems.egg_balefire_shard, ModItems.ammo_4gauge_balefire, 10, 4},
{ModItems.ammo_4gauge_explosive, ModItems.ammo_rocket, ModItems.ammo_4gauge_kampf, 4, 2},
{ModItems.ammo_4gauge_kampf, ModItems.pellet_canister, ModItems.ammo_4gauge_canister, 10, 3},
{ModItems.ammo_4gauge, ModItems.pellet_claws, ModItems.ammo_4gauge_claw, 4, 5},
{ModItems.ammo_4gauge, ModItems.toothpicks, ModItems.ammo_4gauge_vampire, 4, 5},
{ModItems.ammo_4gauge, ModItems.pellet_charged, ModItems.ammo_4gauge_void, 1, 5},
{ModItems.ammo_4gauge, ModItems.coin_maskman, ModItems.ammo_4gauge_sleek, 100, 4},
new Object[] {ModItems.ammo_44, ModItems.ingot_dura_steel, ModItems.ammo_44_ap, 20, 2},
new Object[] {ModItems.ammo_44, ModItems.ingot_u238, ModItems.ammo_44_du, 20, 2},
new Object[] {ModItems.ammo_44, ModItems.ingot_phosphorus, ModItems.ammo_44_phosphorus, 20, 2},
new Object[] {ModItems.ammo_44_du, ModItems.ingot_starmetal, ModItems.ammo_44_star, 10, 3},
new Object[] {ModItems.ammo_44, ModItems.pellet_chlorophyte, ModItems.ammo_44_chlorophyte, 10, 3},
{ModItems.ammo_44, ModItems.ingot_dura_steel, ModItems.ammo_44_ap, 20, 2},
{ModItems.ammo_44, ModItems.ingot_u238, ModItems.ammo_44_du, 20, 2},
{ModItems.ammo_44, ModItems.ingot_phosphorus, ModItems.ammo_44_phosphorus, 20, 2},
{ModItems.ammo_44_du, ModItems.ingot_starmetal, ModItems.ammo_44_star, 10, 3},
{ModItems.ammo_44, ModItems.pellet_chlorophyte, ModItems.ammo_44_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_5mm, ModItems.ingot_semtex, ModItems.ammo_5mm_explosive, 20, 2},
new Object[] {ModItems.ammo_5mm, ModItems.ingot_u238, ModItems.ammo_5mm_du, 20, 2},
new Object[] {ModItems.ammo_5mm, ModItems.ingot_starmetal, ModItems.ammo_5mm_star, 10, 3},
new Object[] {ModItems.ammo_5mm, ModItems.pellet_chlorophyte, ModItems.ammo_5mm_chlorophyte, 10, 3},
{ModItems.ammo_5mm, ModItems.ingot_semtex, ModItems.ammo_5mm_explosive, 20, 2},
{ModItems.ammo_5mm, ModItems.ingot_u238, ModItems.ammo_5mm_du, 20, 2},
{ModItems.ammo_5mm, ModItems.ingot_starmetal, ModItems.ammo_5mm_star, 10, 3},
{ModItems.ammo_5mm, ModItems.pellet_chlorophyte, ModItems.ammo_5mm_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_9mm, ModItems.ingot_dura_steel, ModItems.ammo_9mm_ap, 20, 2},
new Object[] {ModItems.ammo_9mm, ModItems.ingot_u238, ModItems.ammo_9mm_du, 20, 2},
new Object[] {ModItems.ammo_9mm, ModItems.pellet_chlorophyte, ModItems.ammo_9mm_chlorophyte, 10, 3},
{ModItems.ammo_9mm, ModItems.ingot_dura_steel, ModItems.ammo_9mm_ap, 20, 2},
{ModItems.ammo_9mm, ModItems.ingot_u238, ModItems.ammo_9mm_du, 20, 2},
{ModItems.ammo_9mm, ModItems.pellet_chlorophyte, ModItems.ammo_9mm_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_22lr, ModItems.ingot_dura_steel, ModItems.ammo_22lr_ap, 20, 2},
new Object[] {ModItems.ammo_22lr, ModItems.pellet_chlorophyte, ModItems.ammo_22lr_chlorophyte, 10, 3},
{ModItems.ammo_22lr, ModItems.ingot_dura_steel, ModItems.ammo_22lr_ap, 20, 2},
{ModItems.ammo_22lr, ModItems.pellet_chlorophyte, ModItems.ammo_22lr_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_50bmg, ModItems.powder_fire, ModItems.ammo_50bmg_incendiary, 20, 2},
new Object[] {ModItems.ammo_50bmg, ModItems.ingot_phosphorus, ModItems.ammo_50bmg_phosphorus, 20, 2},
new Object[] {ModItems.ammo_50bmg, ModItems.ingot_semtex, ModItems.ammo_50bmg_explosive, 20, 2},
new Object[] {ModItems.ammo_50bmg, ModItems.ingot_dura_steel, ModItems.ammo_50bmg_ap, 20, 2},
new Object[] {ModItems.ammo_50bmg, ModItems.ingot_u238, ModItems.ammo_50bmg_du, 20, 2},
new Object[] {ModItems.ammo_50bmg_du, ModItems.ingot_starmetal, ModItems.ammo_50bmg_star, 10, 3},
new Object[] {ModItems.ammo_50bmg, ModItems.pellet_chlorophyte, ModItems.ammo_50bmg_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_50bmg, ModItems.coin_maskman, ModItems.ammo_50bmg_sleek, 100, 4},
new Object[] {ModItems.ammo_50bmg_flechette, ModItems.nugget_am_mix, ModItems.ammo_50bmg_flechette_am, 10, 3},
new Object[] {ModItems.ammo_50bmg_flechette, ModItems.powder_polonium, ModItems.ammo_50bmg_flechette_po, 20, 3},
{ModItems.ammo_50bmg, ModItems.powder_fire, ModItems.ammo_50bmg_incendiary, 20, 2},
{ModItems.ammo_50bmg, ModItems.ingot_phosphorus, ModItems.ammo_50bmg_phosphorus, 20, 2},
{ModItems.ammo_50bmg, ModItems.ingot_semtex, ModItems.ammo_50bmg_explosive, 20, 2},
{ModItems.ammo_50bmg, ModItems.ingot_dura_steel, ModItems.ammo_50bmg_ap, 20, 2},
{ModItems.ammo_50bmg, ModItems.ingot_u238, ModItems.ammo_50bmg_du, 20, 2},
{ModItems.ammo_50bmg_du, ModItems.ingot_starmetal, ModItems.ammo_50bmg_star, 10, 3},
{ModItems.ammo_50bmg, ModItems.pellet_chlorophyte, ModItems.ammo_50bmg_chlorophyte, 10, 3},
{ModItems.ammo_50bmg, ModItems.coin_maskman, ModItems.ammo_50bmg_sleek, 100, 4},
{ModItems.ammo_50bmg_flechette, ModItems.nugget_am_mix, ModItems.ammo_50bmg_flechette_am, 10, 3},
{ModItems.ammo_50bmg_flechette, ModItems.powder_polonium, ModItems.ammo_50bmg_flechette_po, 20, 3},
new Object[] {ModItems.ammo_50ae, ModItems.ingot_dura_steel, ModItems.ammo_50ae_ap, 20, 2},
new Object[] {ModItems.ammo_50ae, ModItems.ingot_u238, ModItems.ammo_50ae_du, 20, 2},
new Object[] {ModItems.ammo_50ae_du, ModItems.ingot_starmetal, ModItems.ammo_50ae_star, 10, 3},
new Object[] {ModItems.ammo_50ae, ModItems.pellet_chlorophyte, ModItems.ammo_50ae_chlorophyte, 10, 3},
{ModItems.ammo_50ae, ModItems.ingot_dura_steel, ModItems.ammo_50ae_ap, 20, 2},
{ModItems.ammo_50ae, ModItems.ingot_u238, ModItems.ammo_50ae_du, 20, 2},
{ModItems.ammo_50ae_du, ModItems.ingot_starmetal, ModItems.ammo_50ae_star, 10, 3},
{ModItems.ammo_50ae, ModItems.pellet_chlorophyte, ModItems.ammo_50ae_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_556, ModItems.ingot_phosphorus, ModItems.ammo_556_phosphorus, 20, 2},
new Object[] {ModItems.ammo_556, ModItems.ingot_dura_steel, ModItems.ammo_556_ap, 20, 2},
new Object[] {ModItems.ammo_556, ModItems.ingot_u238, ModItems.ammo_556_du, 20, 2},
new Object[] {ModItems.ammo_556_du, ModItems.ingot_starmetal, ModItems.ammo_556_star, 10, 3},
new Object[] {ModItems.ammo_556, ModItems.pellet_chlorophyte, ModItems.ammo_556_chlorophyte, 10, 3},
new Object[] {ModItems.ammo_556, ModItems.coin_maskman, ModItems.ammo_556_sleek, 100, 4},
new Object[] {ModItems.ammo_556, Items.redstone, ModItems.ammo_556_tracer, 20, 2},
new Object[] {ModItems.ammo_556, ModItems.pellet_flechette, ModItems.ammo_556_flechette, 20, 2},
new Object[] {ModItems.ammo_556_flechette, ModItems.powder_fire, ModItems.ammo_556_flechette_incendiary, 20, 2},
new Object[] {ModItems.ammo_556_flechette, ModItems.ingot_phosphorus, ModItems.ammo_556_flechette_phosphorus, 20, 2},
new Object[] {ModItems.ammo_556_flechette, ModItems.ingot_u238, ModItems.ammo_556_flechette_du, 20, 2},
new Object[] {ModItems.ammo_556_flechette, ModItems.coin_maskman, ModItems.ammo_556_flechette_sleek, 100, 4},
new Object[] {ModItems.ammo_556_flechette, ModItems.pellet_chlorophyte, ModItems.ammo_556_flechette_chlorophyte, 10, 3},
{ModItems.ammo_556, ModItems.ingot_phosphorus, ModItems.ammo_556_phosphorus, 20, 2},
{ModItems.ammo_556, ModItems.ingot_dura_steel, ModItems.ammo_556_ap, 20, 2},
{ModItems.ammo_556, ModItems.ingot_u238, ModItems.ammo_556_du, 20, 2},
{ModItems.ammo_556_du, ModItems.ingot_starmetal, ModItems.ammo_556_star, 10, 3},
{ModItems.ammo_556, ModItems.pellet_chlorophyte, ModItems.ammo_556_chlorophyte, 10, 3},
{ModItems.ammo_556, ModItems.coin_maskman, ModItems.ammo_556_sleek, 100, 4},
{ModItems.ammo_556, Items.redstone, ModItems.ammo_556_tracer, 20, 2},
{ModItems.ammo_556, ModItems.pellet_flechette, ModItems.ammo_556_flechette, 20, 2},
{ModItems.ammo_556_flechette, ModItems.powder_fire, ModItems.ammo_556_flechette_incendiary, 20, 2},
{ModItems.ammo_556_flechette, ModItems.ingot_phosphorus, ModItems.ammo_556_flechette_phosphorus, 20, 2},
{ModItems.ammo_556_flechette, ModItems.ingot_u238, ModItems.ammo_556_flechette_du, 20, 2},
{ModItems.ammo_556_flechette, ModItems.coin_maskman, ModItems.ammo_556_flechette_sleek, 100, 4},
{ModItems.ammo_556_flechette, ModItems.pellet_chlorophyte, ModItems.ammo_556_flechette_chlorophyte, 10, 3},
};
for(Object[] objs : recs) {

View File

@ -1564,40 +1564,6 @@ public class MachineRecipes {
return recipes;
}
public Map<Object, Object[]> getRefineryRecipe() {
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
ItemStack oil = new ItemStack(ModItems.fluid_icon, 1, Arrays.asList(FluidType.values()).indexOf(FluidType.HOTOIL));
oil.stackTagCompound = new NBTTagCompound();
oil.stackTagCompound.setInteger("fill", 1000);
ItemStack heavy = new ItemStack(ModItems.fluid_icon, 1, Arrays.asList(FluidType.values()).indexOf(FluidType.HEAVYOIL));
heavy.stackTagCompound = new NBTTagCompound();
heavy.stackTagCompound.setInteger("fill", 500);
ItemStack naphtha = new ItemStack(ModItems.fluid_icon, 1, Arrays.asList(FluidType.values()).indexOf(FluidType.NAPHTHA));
naphtha.stackTagCompound = new NBTTagCompound();
naphtha.stackTagCompound.setInteger("fill", 250);
ItemStack light = new ItemStack(ModItems.fluid_icon, 1, Arrays.asList(FluidType.values()).indexOf(FluidType.LIGHTOIL));
light.stackTagCompound = new NBTTagCompound();
light.stackTagCompound.setInteger("fill", 150);
ItemStack petroleum = new ItemStack(ModItems.fluid_icon, 1, Arrays.asList(FluidType.values()).indexOf(FluidType.PETROLEUM));
petroleum.stackTagCompound = new NBTTagCompound();
petroleum.stackTagCompound.setInteger("fill", 100);
recipes.put(oil , new ItemStack[] {
heavy,
naphtha,
light,
petroleum,
new ItemStack(ModItems.sulfur, 1) });
return recipes;
}
public Map<Object, Object> getBoilerRecipes() {
Map<Object, Object> recipes = new HashMap<Object, Object>();
@ -2174,20 +2140,20 @@ public class MachineRecipes {
switch(ItemChemistryTemplate.EnumChemistryTemplate.getEnum(stack.getItemDamage())) {
case FP_HEAVYOIL:
output[0] = new FluidStack(300, FluidType.BITUMEN);
output[1] = new FluidStack(700, FluidType.SMEAR);
output[0] = new FluidStack(RefineryRecipes.heavy_frac_bitu * 10, FluidType.BITUMEN);
output[1] = new FluidStack(RefineryRecipes.heavy_frac_smear * 10, FluidType.SMEAR);
break;
case FP_SMEAR:
output[0] = new FluidStack(600, FluidType.HEATINGOIL);
output[1] = new FluidStack(400, FluidType.LUBRICANT);
output[0] = new FluidStack(RefineryRecipes.smear_frac_heat * 10, FluidType.HEATINGOIL);
output[1] = new FluidStack(RefineryRecipes.smear_frac_lube * 10, FluidType.LUBRICANT);
break;
case FP_NAPHTHA:
output[0] = new FluidStack(400, FluidType.HEATINGOIL);
output[1] = new FluidStack(600, FluidType.DIESEL);
output[0] = new FluidStack(RefineryRecipes.napth_frac_heat * 10, FluidType.HEATINGOIL);
output[1] = new FluidStack(RefineryRecipes.napth_frac_diesel * 10, FluidType.DIESEL);
break;
case FP_LIGHTOIL:
output[0] = new FluidStack(400, FluidType.DIESEL);
output[1] = new FluidStack(600, FluidType.KEROSENE);
output[0] = new FluidStack(RefineryRecipes.light_frac_diesel * 10, FluidType.DIESEL);
output[1] = new FluidStack(RefineryRecipes.light_frac_kero * 10, FluidType.KEROSENE);
break;
case FR_REOIL:
output[0] = new FluidStack(800, FluidType.RECLAIMED);

View File

@ -0,0 +1,59 @@
package com.hbm.inventory;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.Tuple.Quartet;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class RefineryRecipes {
/// fractions in percent ///
public static final int oil_frac_heavy = 50;
public static final int oil_frac_naph = 25;
public static final int oil_frac_light = 15;
public static final int oil_frac_petro = 10;
public static final int heavy_frac_bitu = 30;
public static final int heavy_frac_smear = 70;
public static final int smear_frac_heat = 60;
public static final int smear_frac_lube = 40;
public static final int napth_frac_heat = 40;
public static final int napth_frac_diesel = 60;
public static final int light_frac_diesel = 40;
public static final int light_frac_kero = 60;
private static Map<FluidType, Quartet<FluidType, FluidType, Integer, Integer>> fractions = new HashMap();
public static Map<Object, Object[]> getRefineryRecipe() {
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
recipes.put(ItemFluidIcon.make(FluidType.HOTOIL, 1000),
new ItemStack[] {
ItemFluidIcon.make(FluidType.HEAVYOIL, oil_frac_heavy * 10),
ItemFluidIcon.make(FluidType.NAPHTHA, oil_frac_naph * 10),
ItemFluidIcon.make(FluidType.LIGHTOIL, oil_frac_light * 10),
ItemFluidIcon.make(FluidType.PETROLEUM, oil_frac_petro * 10),
new ItemStack(ModItems.sulfur, 1) });
return recipes;
}
public static void registerFractions() {
fractions.put(FluidType.HEAVYOIL, new Quartet(FluidType.BITUMEN, FluidType.SMEAR, heavy_frac_bitu, heavy_frac_smear));
fractions.put(FluidType.SMEAR, new Quartet(FluidType.HEATINGOIL, FluidType.LUBRICANT, smear_frac_heat, smear_frac_lube));
fractions.put(FluidType.NAPHTHA, new Quartet(FluidType.HEATINGOIL, FluidType.DIESEL, napth_frac_heat, napth_frac_diesel));
fractions.put(FluidType.LIGHTOIL, new Quartet(FluidType.DIESEL, FluidType.KEROSENE, light_frac_diesel, light_frac_kero));
}
public static Quartet<FluidType, FluidType, Integer, Integer> getFractions(FluidType oil) {
return fractions.get(oil);
}
}

View File

@ -2508,7 +2508,7 @@ public class ModItems {
plate_paa = new ItemCustomLore().setUnlocalizedName("plate_paa").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_paa");
board_copper = new Item().setUnlocalizedName("board_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":board_copper");
bolt_dura_steel = new Item().setUnlocalizedName("bolt_dura_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":bolt_dura_steel");
pipes_steel = new ItemCustomLore().setUnlocalizedName("pipes_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pipes_steel");
pipes_steel = new Item().setUnlocalizedName("pipes_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pipes_steel");
drill_titanium = new Item().setUnlocalizedName("drill_titanium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":drill_titanium");
plate_dalekanium = new Item().setUnlocalizedName("plate_dalekanium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_dalekanium");
plate_euphemium = new ItemCustomLore().setUnlocalizedName("plate_euphemium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_euphemium");

View File

@ -2,6 +2,8 @@ package com.hbm.items.machine;
import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.items.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.resources.I18n;
@ -47,7 +49,11 @@ public class ItemFluidIcon extends Item {
stack.getTagCompound().setInteger("fill", i);
return stack.copy();
return stack;
}
public static ItemStack make(FluidType fluid, int i) {
return addQuantity(new ItemStack(ModItems.fluid_icon, 1, fluid.ordinal()), i);
}
public static int getQuantity(ItemStack stack) {

View File

@ -690,7 +690,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barrel_plastic, 1), new Object[] { "IPI", "I I", "IPI", 'I', ModItems.plate_polymer, 'P', "plateAluminum" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { "IPI", "I I", "IPI", 'I', "plateIron", 'P', "ingotIron" }));
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.barrel_iron, 1), new Object[] { ModBlocks.barrel_corroded, ModItems.oil_tar });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barrel_steel, 1), new Object[] { "IPI", "I I", "IPI", 'I', "plateSteel", 'P', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barrel_steel, 1), new Object[] { "IPI", "ITI", "IPI", 'I', "plateSteel", 'P', "ingotSteel", 'T', ModItems.oil_tar }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.barrel_tcalloy, 1), new Object[] { "IPI", "I I", "IPI", 'I', "ingotTcAlloy", 'P', "plateTitanium" }));
GameRegistry.addRecipe(new ItemStack(ModBlocks.barrel_antimatter, 1), new Object[] { "IPI", "IPI", "IPI", 'I', ModItems.plate_saturnite, 'P', ModItems.coil_advanced_torus });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.tesla, 1), new Object[] { "CCC", "PIP", "WTW", 'C', ModItems.coil_copper, 'I', "ingotIron", 'P', "ingotPolymer", 'T', ModBlocks.machine_transformer, 'W', "plankWood" }));

View File

@ -486,6 +486,7 @@ public class MainRegistry {
GameRegistry.registerTileEntity(TileEntityWatz.class, "tileentity_watz");
GameRegistry.registerTileEntity(TileEntityMachineBAT9000.class, "tileentity_bat9000");
GameRegistry.registerTileEntity(TileEntityMachineOrbus.class, "tileentity_orbus");
GameRegistry.registerTileEntity(TileEntityMachineFractionTower.class, "tileentity_fraction_tower");
GameRegistry.registerTileEntity(TileEntityRBMKRod.class, "tileentity_rbmk_rod");
GameRegistry.registerTileEntity(TileEntityRBMKRodReaSim.class, "tileentity_rbmk_rod_reasim");
@ -1084,6 +1085,7 @@ public class MainRegistry {
MagicRecipes.register();
SILEXRecipes.register();
AnvilRecipes.register();
RefineryRecipes.registerFractions();
TileEntityNukeCustom.registerBombItems();
HazmatRegistry.registerHazmats();

View File

@ -170,7 +170,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
short mode = (short) this.getRelevantMode();
//////////////////////////////////////////////////////////////////////
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
/*for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
@ -199,7 +199,7 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
if(con.getPowerNet() != null && !con.getPowerNet().isSubscribed(this))
con.getPowerNet().subscribe(this);
}
}
}*/
//////////////////////////////////////////////////////////////////////
this.maxPower = ((MachineBattery)worldObj.getBlock(xCoord, yCoord, zCoord)).maxPower;

View File

@ -0,0 +1,203 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.FluidTypeHandler.FluidType;
import com.hbm.interfaces.IFluidAcceptor;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.RefineryRecipes;
import com.hbm.lib.Library;
import com.hbm.util.Tuple.Quartet;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import scala.actors.threadpool.Arrays;
public class TileEntityMachineFractionTower extends TileEntity implements IFluidSource, IFluidAcceptor {
public FluidTank[] tanks;
public List<IFluidAcceptor> list1 = new ArrayList();
public List<IFluidAcceptor> list2 = new ArrayList();
public TileEntityMachineFractionTower() {
super();
tanks = new FluidTank[3];
tanks[0] = new FluidTank(FluidType.HEAVYOIL, 4000, 0);
tanks[1] = new FluidTank(FluidType.BITUMEN, 4000, 0);
tanks[2] = new FluidTank(FluidType.SMEAR, 4000, 0);
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
TileEntity stack = worldObj.getTileEntity(xCoord, yCoord + 3, zCoord);
if(stack instanceof TileEntityMachineFractionTower) {
TileEntityMachineFractionTower frac = (TileEntityMachineFractionTower) stack;
//make types equal
for(int i = 0; i < 3; i++) {
frac.tanks[i].setTankType(tanks[i].getTankType());
}
//calculate transfer
int oil = Math.min(tanks[0].getFill(), frac.tanks[0].getMaxFill() - frac.tanks[0].getFill());
int left = Math.min(frac.tanks[1].getFill(), tanks[1].getMaxFill() - tanks[1].getFill());
int right = Math.min(frac.tanks[2].getFill(), tanks[2].getMaxFill() - tanks[2].getFill());
//move oil up, pull fractions down
tanks[0].setFill(tanks[0].getFill() - oil);
tanks[1].setFill(tanks[1].getFill() + left);
tanks[2].setFill(tanks[2].getFill() + right);
frac.tanks[0].setFill(frac.tanks[0].getFill() + oil);
frac.tanks[1].setFill(frac.tanks[1].getFill() - left);
frac.tanks[2].setFill(frac.tanks[2].getFill() - right);
}
setupTanks();
if(worldObj.getTotalWorldTime() % 20 == 0)
fractionate();
}
}
private void setupTanks() {
Quartet<FluidType, FluidType, Integer, Integer> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
if(quart != null) {
tanks[1].setTankType(quart.getW());
tanks[2].setTankType(quart.getX());
}
}
private void fractionate() {
Quartet<FluidType, FluidType, Integer, Integer> quart = RefineryRecipes.getFractions(tanks[0].getTankType());
if(quart != null) {
int left = quart.getY();
int right = quart.getZ();
if(tanks[0].getFill() >= 100 && hasSpace(left, right)) {
tanks[0].setFill(tanks[0].getFill() - 100);
tanks[1].setFill(tanks[1].getFill() + left);
tanks[2].setFill(tanks[2].getFill() + right);
}
}
}
private boolean hasSpace(int left, int right) {
return tanks[1].getFill() + left <= tanks[1].getMaxFill() && tanks[2].getFill() + right <= tanks[2].getMaxFill();
}
@Override
public void setFillstate(int fill, int index) {
if(index < 3 && tanks[index] != null)
tanks[index].setFill(fill);
}
@Override
public void setFluidFill(int fill, FluidType type) {
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
tank.setFill(fill);
}
}
}
@Override
public void setType(FluidType type, int index) {
this.tanks[index].setTankType(type);
}
@Override
public List<FluidTank> getTanks() {
return Arrays.asList(this.tanks);
}
@Override
public int getFluidFill(FluidType type) {
for(FluidTank tank : tanks) {
if(tank.getTankType() == type) {
return tank.getFill();
}
}
return 0;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type.name().equals(tanks[0].getTankType().name()))
return tanks[0].getMaxFill();
else
return 0;
}
@Override
public void fillFluidInit(FluidType type) {
// TODO Auto-generated method stub
}
@Override
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
}
@Override
public boolean getTact() {
return worldObj.getTotalWorldTime() % 20 < 10;
}
@Override
public List<IFluidAcceptor> getFluidList(FluidType type) {
if(type.name().equals(tanks[1].getTankType().name()))
return list1;
if(type.name().equals(tanks[2].getTankType().name()))
return list2;
return new ArrayList<IFluidAcceptor>();
}
@Override
public void clearFluidList(FluidType type) {
if(type.name().equals(tanks[1].getTankType().name()))
list1.clear();
if(type.name().equals(tanks[2].getTankType().name()))
list2.clear();
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 1,
yCoord,
zCoord - 1,
xCoord + 2,
yCoord + 3,
zCoord + 2
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -10,6 +10,7 @@ import com.hbm.interfaces.IFluidContainer;
import com.hbm.interfaces.IFluidSource;
import com.hbm.inventory.FluidContainerRegistry;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.RefineryRecipes;
import com.hbm.items.ModItems;
import com.hbm.lib.Library;
import com.hbm.packet.AuxElectricityPacket;
@ -270,10 +271,10 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
tanks[0].loadTank(1, 2, slots);
int ho = 50;
int nt = 25;
int lo = 15;
int pe = 10;
int ho = RefineryRecipes.oil_frac_heavy;
int nt = RefineryRecipes.oil_frac_naph;
int lo = RefineryRecipes.oil_frac_light;
int pe = RefineryRecipes.oil_frac_petro;
if(power >= 5 && tanks[0].getFill() >= 100 &&
tanks[1].getFill() + ho <= tanks[1].getMaxFill() &&
@ -454,8 +455,7 @@ public class TileEntityMachineRefinery extends TileEntity implements ISidedInven
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

View File

@ -1,6 +1,14 @@
package com.hbm.util;
import com.hbm.interfaces.Spaghetti;
@Spaghetti("alreay??") //i made this like a week ago and it's already eye-bleeding, what the fuck happened?!
public class Tuple {
/*
* We endure this horribleness in order to provide a way to create classes that hold values of definite types (no more nasty casting)
* that may also be used in hashmaps, should the need arrive. I'm kinda tired of making new classes just to hold values for one single list.
*/
public static class Pair<X,Y> {
@ -113,4 +121,78 @@ public class Tuple {
return true;
}
}
public static class Quartet<W,X,Y,Z> {
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((w == null) ? 0 : w.hashCode());
result = prime * result + ((x == null) ? 0 : x.hashCode());
result = prime * result + ((y == null) ? 0 : y.hashCode());
result = prime * result + ((z == null) ? 0 : z.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if(this == obj)
return true;
if(obj == null)
return false;
if(getClass() != obj.getClass())
return false;
Quartet other = (Quartet) obj;
if(w == null) {
if(other.w != null)
return false;
} else if(!w.equals(other.w))
return false;
if(x == null) {
if(other.x != null)
return false;
} else if(!x.equals(other.x))
return false;
if(y == null) {
if(other.y != null)
return false;
} else if(!y.equals(other.y))
return false;
if(z == null) {
if(other.z != null)
return false;
} else if(!z.equals(other.z))
return false;
return true;
}
W w;
X x;
Y y;
Z z;
public Quartet(W w, X x, Y y, Z z) {
this.w = w;
this.x = x;
this.y = y;
this.z = z;
}
public W getW() {
return this.w;
}
public X getX() {
return this.x;
}
public Y getY() {
return this.y;
}
public Z getZ() {
return this.z;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B