rebalanced biofuels and biomass, heat exchanger as a TU source

This commit is contained in:
Boblet 2022-11-28 16:58:27 +01:00
parent 6791cf5095
commit 378ad51018
13 changed files with 302 additions and 53 deletions

View File

@ -654,6 +654,7 @@ public class ModBlocks {
public static Block heater_oven;
public static Block heater_oilburner;
public static Block heater_electric;
public static Block heater_heatex;
public static Block furnace_iron;
public static Block furnace_steel;
@ -1847,6 +1848,7 @@ public class ModBlocks {
heater_oven = new HeaterOven().setBlockName("heater_oven").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
heater_oilburner = new HeaterOilburner().setBlockName("heater_oilburner").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
heater_electric = new HeaterElectric().setBlockName("heater_electric").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
heater_heatex = new HeaterHeatex().setBlockName("heater_heatex").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
furnace_iron = new FurnaceIron().setBlockName("furnace_iron").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
furnace_steel = new FurnaceSteel().setBlockName("furnace_steel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -3040,6 +3042,7 @@ public class ModBlocks {
register(heater_oven);
register(heater_oilburner);
register(heater_electric);
register(heater_heatex);
register(furnace_iron);
register(furnace_steel);
register(machine_stirling);

View File

@ -0,0 +1,33 @@
package com.hbm.blocks.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.tileentity.machine.TileEntityHeaterHeatex;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class HeaterHeatex extends BlockDummyable {
public HeaterHeatex() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12)
return new TileEntityHeaterHeatex();
return null;
}
@Override
public int[] getDimensions() {
return new int[] {0, 0, 1, 1, 1, 1};
}
@Override
public int getOffset() {
return 1;
}
}

View File

@ -0,0 +1,46 @@
package com.hbm.handler.nei;
import java.util.HashMap;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.trait.FT_Heatable;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
import com.hbm.items.machine.ItemFluidIcon;
public class BoilingHandler extends NEIUniversalHandler {
public BoilingHandler() {
super("Boiler", ModBlocks.machine_boiler, generateRecipes());
}
@Override
public String getKey() {
return "ntmBoiling";
}
public static HashMap<Object, Object> cache;
public static HashMap<Object, Object> generateRecipes() {
if(cache != null) return cache;
cache = new HashMap();
for(FluidType type : Fluids.getInNiceOrder()) {
if(type.hasTrait(FT_Heatable.class)) {
FT_Heatable trait = type.getTrait(FT_Heatable.class);
if(trait.getEfficiency(HeatingType.BOILER) > 0) {
HeatingStep step = trait.getFirstStep();
cache.put(ItemFluidIcon.make(type, step.amountReq), ItemFluidIcon.make(step.typeProduced, step.amountProduced));
}
}
}
return cache;
}
}

View File

@ -351,30 +351,6 @@ public class Fluids {
double flammabilityHigh = 2.0D;
/// the allmighty excel spreadsheet has spoken! ///
//OIL.addTraits(new FT_Flammable((long) (baseline / 1D * flammabilityLow * demandLow)));
//CRACKOIL.addTraits(new FT_Flammable((long) (baseline / 1D * flammabilityLow * demandLow * complexityCracking)));
//GAS.addTraits(new FT_Flammable((long) (baseline / 1D * flammabilityNormal * demandVeryLow)));
//HEAVYOIL.addTraits(new FT_Flammable((long) (baseline / 0.5 * flammabilityLow * demandLow * complexityRefinery)));
//SMEAR.addTraits(new FT_Flammable((long) (baseline / 0.35 * flammabilityLow * demandLow * complexityRefinery * complexityFraction)));
//RECLAIMED.addTraits(new FT_Flammable((long) (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant)));
//PETROIL.addTraits(new FT_Flammable((long) (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant * complexityLubed)));
//PETROIL_LEADED.addTraits(new FT_Flammable((long) (baseline / 0.28 * flammabilityLow * demandLow * complexityRefinery * complexityFraction * complexityChemplant * complexityLubed * complexityLeaded)));
//HEATINGOIL.addTraits(new FT_Flammable((long) (baseline / 0.31 * flammabilityNormal * demandLow * complexityRefinery * complexityFraction * complexityFraction)));
//NAPHTHA.addTraits(new FT_Flammable((long) (baseline / 0.25 * flammabilityLow * demandLow * complexityRefinery)));
//NAPHTHA_CRACK.addTraits(new FT_Flammable((long) (baseline / 0.40 * flammabilityLow * demandLow * complexityRefinery * complexityCracking)));
//GASOLINE.addTraits(new FT_Flammable((long) (baseline / 0.20 * flammabilityNormal * demandLow * complexityRefinery * complexityChemplant)));
//GASOLINE_LEADED.addTraits(new FT_Flammable((long) (baseline / 0.20 * flammabilityNormal * demandLow * complexityRefinery * complexityChemplant * complexityLeaded)));
//DIESEL.addTraits(new FT_Flammable((long) (baseline / 0.21 * flammabilityNormal * demandLow * complexityRefinery * complexityFraction)));
//DIESEL_CRACK.addTraits(new FT_Flammable((long) (baseline / 0.28 * flammabilityNormal * demandLow * complexityRefinery * complexityCracking * complexityFraction)));
//LIGHTOIL.addTraits(new FT_Flammable((long) (baseline / 0.15 * flammabilityNormal * demandHigh * complexityRefinery)));
//LIGHTOIL_CRACK.addTraits(new FT_Flammable((long) (baseline / 0.30 * flammabilityNormal * demandHigh * complexityRefinery * complexityCracking)));
//KEROSENE.addTraits(new FT_Flammable((long) (baseline / 0.09 * flammabilityNormal * demandHigh * complexityRefinery * complexityFraction)));
//PETROLEUM.addTraits(new FT_Flammable((long) (baseline / 0.10 * flammabilityNormal * demandMedium * complexityRefinery)));
//AROMATICS.addTraits(new FT_Flammable((long) (baseline / 0.15 * flammabilityHigh * demandHigh * complexityRefinery * complexityCracking)));
//UNSATURATEDS.addTraits(new FT_Flammable((long) (baseline / 0.15 * flammabilityLow * demandHigh * complexityRefinery * complexityCracking)));
//LPG.addTraits(new FT_Flammable((long) (baseline / 0.05 * flammabilityNormal * demandMedium * complexityRefinery * complexityChemplant)));
//BALEFIRE.addTraits(new FT_Flammable(KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 100L));
registerCalculatedFuel(OIL, (baseline / 1D * flammabilityLow * demandLow), 0, null);
registerCalculatedFuel(CRACKOIL, (baseline / 1D * flammabilityLow * demandLow * complexityCracking), 0, null);
registerCalculatedFuel(GAS, (baseline / 1D * flammabilityNormal * demandVeryLow), 0, null);
@ -396,7 +372,19 @@ public class Fluids {
registerCalculatedFuel(PETROLEUM, (baseline / 0.10 * flammabilityNormal * demandMedium * complexityRefinery), 0, null);
registerCalculatedFuel(AROMATICS, (baseline / 0.15 * flammabilityLow * demandHigh * complexityRefinery * complexityCracking), 0, null);
registerCalculatedFuel(LPG, (baseline / 0.05 * flammabilityNormal * demandMedium * complexityRefinery * complexityChemplant), 2.5, FuelGrade.HIGH);
registerCalculatedFuel(NITAN, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 25L, 2.5, FuelGrade.HIGH);
registerCalculatedFuel(BALEFIRE, KEROSENE.getTrait(FT_Flammable.class).getHeatEnergy() * 100L, 2.5, FuelGrade.HIGH);
int coalHeat = 400_000; // 200TU/t for 2000 ticks
registerCalculatedFuel(COALOIL, (coalHeat * (1000 /* bucket */ / 100 /* mB per coal */) * flammabilityLow * demandLow * complexityChemplant), 0, null);
long coaloil = COALOIL.getTrait(FT_Flammable.class).getHeatEnergy();
registerCalculatedFuel(COALGAS, (coaloil / 0.3 * flammabilityNormal * demandMedium * complexityChemplant * complexityFraction), 1.5, FuelGrade.MEDIUM);
registerCalculatedFuel(COALGAS_LEADED, (coaloil / 0.3 * flammabilityNormal * demandMedium * complexityChemplant * complexityFraction * complexityLeaded), 1.5, FuelGrade.MEDIUM);
registerCalculatedFuel(ETHANOL, 275_000D /* diesel / 2 */, 2.5D, FuelGrade.HIGH);
registerCalculatedFuel(BIOGAS, 250_000D * flammabilityLow /* biofuel with half compression, terrible flammability */, 0, null);
registerCalculatedFuel(BIOFUEL, 500_000D /* slightly below diesel */, 2.5D, FuelGrade.HIGH);
}
private static void registerCalculatedFuel(FluidType type, double base, double combustMult, FuelGrade grade) {

View File

@ -319,8 +319,11 @@ public class ChemplantRecipes extends SerializableRecipe {
new ComparableStack(ModItems.nugget_bismuth, 4))
.inputFluids(new FluidStack(Fluids.ACID, 1000))
.outputFluids(new FluidStack(Fluids.DEATH, 1000)));
//one bucket of ethanol equals 275_000 TU using the diesel baseline0
//the coal baseline is 400_000 per piece
//if we assume a burntime of 1.5 ops (300 ticks) for sugar at 100 TU/t that would equal a total of 30_000 TU
recipes.add(new ChemRecipe(75, "ETHANOL", 50)
.inputItems(new ComparableStack(Items.sugar, 6))
.inputItems(new ComparableStack(Items.sugar, 10))
.outputFluids(new FluidStack(Fluids.ETHANOL, 1000)));
recipes.add(new ChemRecipe(76, "METH", 30)
.inputItems(
@ -372,11 +375,11 @@ public class ChemplantRecipes extends SerializableRecipe {
}
public static void registerOtherOil() {
recipes.add(new ChemRecipe(31, "BP_BIOGAS", 200)
.inputItems(new ComparableStack(ModItems.biomass, 16))
.outputFluids(new FluidStack(4000, Fluids.BIOGAS)));
recipes.add(new ChemRecipe(32, "BP_BIOFUEL", 100)
.inputFluids(new FluidStack(2000, Fluids.BIOGAS))
recipes.add(new ChemRecipe(31, "BP_BIOGAS", 60)
.inputItems(new ComparableStack(ModItems.biomass, 16)) //if we assume 1B BF = 500k and translate that to 2B BG = 500k, then each biomass is worth ~31k or roughly 1.5 furnace operations
.outputFluids(new FluidStack(2000, Fluids.BIOGAS)));
recipes.add(new ChemRecipe(32, "BP_BIOFUEL", 60)
.inputFluids(new FluidStack(1500, Fluids.BIOGAS), new FluidStack(250, Fluids.ETHANOL))
.outputFluids(new FluidStack(1000, Fluids.BIOFUEL)));
recipes.add(new ChemRecipe(33, "LPG", 100)
.inputFluids(new FluidStack(2000, Fluids.PETROLEUM))

View File

@ -50,10 +50,10 @@ public class LiquefactionRecipes extends SerializableRecipe {
recipes.put(new ComparableStack(Blocks.packed_ice), new FluidStack(1000, Fluids.WATER));
recipes.put(new ComparableStack(Items.ender_pearl), new FluidStack(100, Fluids.ENDERJUICE));
recipes.put(new ComparableStack(Items.sugar), new FluidStack(150, Fluids.ETHANOL));
recipes.put(new ComparableStack(ModItems.biomass), new FluidStack(250, Fluids.BIOGAS));
recipes.put(new ComparableStack(Items.sugar), new FluidStack(100, Fluids.ETHANOL));
recipes.put(new ComparableStack(ModItems.biomass), new FluidStack(125, Fluids.BIOGAS));
recipes.put(new ComparableStack(ModItems.solid_fuel_bf), new FluidStack(250, Fluids.BALEFIRE));
//recipes.put(new ComparableStack(ModItems.solid_fuel_bf), new FluidStack(250, Fluids.BALEFIRE));
//TODO: more recipes as the crack oil derivatives are added
}

View File

@ -190,11 +190,13 @@ public class ShredderRecipes extends SerializableRecipe {
ShredderRecipes.setRecipe(ModItems.ingot_schrabidate, new ItemStack(ModItems.powder_schrabidate, 1));
ShredderRecipes.setRecipe(ModBlocks.block_schrabidate, new ItemStack(ModItems.powder_schrabidate, 9));
ShredderRecipes.setRecipe(ModItems.coal_infernal, new ItemStack(ModItems.powder_coal, 3));
ShredderRecipes.setRecipe(Items.reeds, new ItemStack(Items.paper, 3));
ShredderRecipes.setRecipe(Items.fermented_spider_eye, new ItemStack(ModItems.powder_poison, 3));
ShredderRecipes.setRecipe(Items.poisonous_potato, new ItemStack(ModItems.powder_poison, 1));
ShredderRecipes.setRecipe(ModBlocks.ore_tektite_osmiridium, new ItemStack(ModItems.powder_tektite, 1));
ShredderRecipes.setRecipe(Blocks.dirt, new ItemStack(ModItems.dust, 1));
ShredderRecipes.setRecipe(Items.reeds, new ItemStack(Items.sugar, 3));
ShredderRecipes.setRecipe(Items.apple, new ItemStack(Items.sugar, 1));
ShredderRecipes.setRecipe(Items.carrot, new ItemStack(Items.sugar, 1));
List<ItemStack> logs = OreDictionary.getOres("logWood");
List<ItemStack> planks = OreDictionary.getOres("plankWood");
@ -209,7 +211,7 @@ public class ShredderRecipes extends SerializableRecipe {
ShredderRecipes.setRecipe(Blocks.sand, new ItemStack(ModItems.dust, 2));
}
for(int i = 0; i < 5; i++) ShredderRecipes.setRecipe(new ItemStack(Items.skull, 1, i), new ItemStack(ModItems.biomass));
for(int i = 0; i < 5; i++) ShredderRecipes.setRecipe(new ItemStack(Items.skull, 1, i), new ItemStack(ModItems.biomass, 4));
/* Crystal processing */
ShredderRecipes.setRecipe(ModItems.ingot_schraranium, new ItemStack(ModItems.nugget_schrabidium, 2));

View File

@ -252,6 +252,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeaterOven.class, new RenderHeatingOven());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeaterOilburner.class, new RenderOilburner());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeaterElectric.class, new RenderElectricHeater());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHeaterHeatex.class, new RenderHeaterHeatex());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStirling.class, new RenderStirling());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySawmill.class, new RenderSawmill());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucible.class, new RenderCrucible());

View File

@ -138,24 +138,17 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.ingot_schrabidium, 1), new Object[] { "###", "###", "###", '#', ModItems.wire_schrabidium });
addRecipeAuto(new ItemStack(ModItems.ingot_magnetized_tungsten, 1), new Object[] { "###", "###", "###", '#', ModItems.wire_magnetized_tungsten });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.melon, Items.melon, Items.melon, Items.melon, Items.melon, Items.melon, Items.melon });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.apple, Items.apple, Items.apple, Items.apple, Items.apple, Items.apple, Items.apple, Items.apple, Items.apple });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.reeds, Items.reeds, Items.reeds, Items.reeds, Items.reeds, Items.reeds, Items.reeds, Items.reeds, Items.reeds });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato, Items.poisonous_potato });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { KEY_LEAVES, KEY_LEAVES, KEY_LEAVES, KEY_LEAVES, KEY_LEAVES });
addShapelessAuto(new ItemStack(ModItems.biomass, 8), new Object[] { Blocks.pumpkin, Blocks.pumpkin, Blocks.pumpkin, Blocks.pumpkin, Blocks.pumpkin, Blocks.pumpkin });
addShapelessAuto(new ItemStack(ModItems.biomass, 6), new Object[] { KEY_LOG, KEY_LOG, KEY_LOG });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { KEY_PLANKS, KEY_PLANKS, KEY_PLANKS, KEY_PLANKS, KEY_PLANKS, KEY_PLANKS, KEY_PLANKS, KEY_PLANKS, KEY_PLANKS });
addShapelessAuto(new ItemStack(ModItems.biomass, 8), new Object[] { Blocks.hay_block, Blocks.hay_block });
addShapelessAuto(new ItemStack(ModItems.biomass, 1), new Object[] { Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds, Items.wheat_seeds });
addShapelessAuto(new ItemStack(ModItems.biomass, 2), new Object[] { Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds, Items.pumpkin_seeds });
addShapelessAuto(new ItemStack(ModItems.biomass, 2), new Object[] { Items.melon_seeds, Items.melon_seeds, Items.melon_seeds, Items.melon_seeds, Items.melon_seeds, Items.melon_seeds, Items.melon_seeds, Items.melon_seeds, Items.melon_seeds });
addShapelessAuto(new ItemStack(ModItems.biomass, 3), new Object[] { Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, ModItems.powder_sawdust, ModItems.powder_sawdust, ModItems.powder_sawdust });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Items.apple, Items.apple, Items.apple });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Items.reeds, Items.reeds, Items.reeds });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Items.rotten_flesh, Items.rotten_flesh, Items.rotten_flesh });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot, Items.carrot });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato, Items.potato });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING, KEY_SAPLING });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, KEY_LEAVES, KEY_LEAVES, KEY_LEAVES, KEY_LEAVES, KEY_LEAVES, KEY_LEAVES });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Blocks.pumpkin });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Blocks.melon_block });
addShapelessAuto(new ItemStack(ModItems.biomass, 4), new Object[] { Items.sugar, ModItems.powder_sawdust, ModItems.powder_sawdust, Items.wheat, Items.wheat, Items.wheat, Items.wheat, Items.wheat, Items.wheat });
//addRecipeAuto(new ItemStack(ModItems.part_lithium), new Object[] { "P", "D", "P", 'P', STEEL.plate(), 'D', LI.dust() });
//addRecipeAuto(new ItemStack(ModItems.part_beryllium), new Object[] { "P", "D", "P", 'P', STEEL.plate(), 'D', BE.dust() });

View File

@ -62,6 +62,7 @@ public class NEIConfig implements IConfigureNEI {
registerHandler(new SolidificationHandler());
registerHandler(new CrackingHandler());
registerHandler(new FractioningHandler());
registerHandler(new BoilingHandler());
//Some things are even beyond my control...or are they?
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));

View File

@ -0,0 +1,50 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.render.item.ItemRenderBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderHeaterHeatex extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
switch(tile.getBlockMetadata() - BlockDummyable.offset) {
case 3: GL11.glRotatef(0, 0F, 1F, 0F); break;
case 5: GL11.glRotatef(90, 0F, 1F, 0F); break;
case 2: GL11.glRotatef(180, 0F, 1F, 0F); break;
case 4: GL11.glRotatef(270, 0F, 1F, 0F); break;
}
//TODO
GL11.glPopMatrix();
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.heater_heatex);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase() {
public void renderInventory() {
GL11.glTranslated(0, -1, 0);
GL11.glScaled(3.25, 3.25, 3.25);
}
public void renderCommon() {
//TODO
}};
}
}

View File

@ -238,6 +238,7 @@ public class TileMappings {
put(TileEntityHeaterOven.class, "tileentity_heating_oven");
put(TileEntityHeaterOilburner.class, "tileentity_oilburner");
put(TileEntityHeaterElectric.class, "tileentity_electric_heater");
put(TileEntityHeaterHeatex.class, "tileentity_heater_heatex");
put(TileEntityFurnaceIron.class, "tileentity_furnace_iron");
put(TileEntityFurnaceSteel.class, "tileentity_furnace_steel");
put(TileEntityStirling.class, "tileentity_stirling");

View File

@ -0,0 +1,128 @@
package com.hbm.tileentity.machine;
import com.hbm.blocks.BlockDummyable;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Coolable;
import com.hbm.inventory.fluid.trait.FT_Coolable.CoolingType;
import com.hbm.tileentity.INBTPacketReceiver;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.fluid.IFluidStandardTransceiver;
import api.hbm.tile.IHeatSource;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHeatSource, INBTPacketReceiver, IFluidStandardTransceiver {
public FluidTank[] tanks;
public int amountToCool = 1;
public int tickDelay = 1;
public int heatEnergy;
public TileEntityHeaterHeatex() {
super(1);
this.tanks = new FluidTank[2];
this.tanks[0] = new FluidTank(Fluids.COOLANT_HOT, 24_000, 0);
this.tanks[1] = new FluidTank(Fluids.COOLANT, 24_000, 1);
}
@Override
public String getName() {
return "container.heaterHeatex";
}
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
this.setupTanks();
this.updateConnections();
NBTTagCompound data = new NBTTagCompound();
tanks[0].writeToNBT(data, "0");
this.tryConvert();
tanks[1].writeToNBT(data, "1");
data.setInteger("heat", heatEnergy);
INBTPacketReceiver.networkPack(this, data, 25);
}
}
protected void setupTanks() {
if(tanks[0].getTankType().hasTrait(FT_Coolable.class)) {
FT_Coolable trait = tanks[0].getTankType().getTrait(FT_Coolable.class);
if(trait.getEfficiency(CoolingType.HEATEXCHANGER) > 0) {
tanks[1].setTankType(trait.coolsTo);
return;
}
}
tanks[0].setTankType(Fluids.NONE);
tanks[1].setTankType(Fluids.NONE);
}
protected void updateConnections() {
for(DirPos pos : getConPos()) {
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
}
protected void tryConvert() {
if(!tanks[0].getTankType().hasTrait(FT_Coolable.class)) return;
if(tickDelay < 1) tickDelay = 1;
if(worldObj.getTotalWorldTime() % tickDelay != 0) return;
FT_Coolable trait = tanks[0].getTankType().getTrait(FT_Coolable.class);
int inputOps = tanks[0].getFill() / trait.amountReq;
int outputOps = (tanks[1].getMaxFill() - tanks[1].getFill()) / trait.amountProduced;
int opCap = this.amountToCool;
int ops = Math.min(inputOps, Math.min(outputOps, opCap));
tanks[0].setFill(tanks[0].getFill() - trait.amountReq * ops);
tanks[1].setFill(tanks[1].getFill() + trait.amountProduced * ops);
this.heatEnergy += trait.heatEnergy * ops;
this.markChanged();
}
private DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
return new DirPos[] {
new DirPos(xCoord + dir.offsetX * 2 + rot.offsetX, yCoord, zCoord + dir.offsetZ * 2 + rot.offsetZ, dir),
new DirPos(xCoord + dir.offsetX * 2 - rot.offsetX, yCoord, zCoord + dir.offsetZ * 2 - rot.offsetZ, dir),
new DirPos(xCoord - dir.offsetX * 2 + rot.offsetX, yCoord, zCoord - dir.offsetZ * 2 + rot.offsetZ, dir.getOpposite()),
new DirPos(xCoord - dir.offsetX * 2 - rot.offsetX, yCoord, zCoord - dir.offsetZ * 2 - rot.offsetZ, dir.getOpposite())
};
}
@Override
public int getHeatStored() {
return heatEnergy;
}
@Override
public void useUpHeat(int heat) {
this.heatEnergy = Math.max(0, this.heatEnergy - heat);
}
@Override
public FluidTank[] getAllTanks() {
return tanks;
}
@Override
public FluidTank[] getSendingTanks() {
return new FluidTank[] {tanks[1]};
}
@Override
public FluidTank[] getReceivingTanks() {
return new FluidTank[] {tanks[0]};
}
}