finished liquefactor (minus the upgrades)

This commit is contained in:
Bob 2022-01-30 14:53:07 +01:00
parent 474a729a47
commit 49d1528eca
14 changed files with 7601 additions and 23 deletions

View File

@ -2062,7 +2062,7 @@ public class ModBlocks {
machine_deuterium_extractor = new MachineDeuteriumExtractor(Material.iron).setBlockName("machine_deuterium_extractor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_deuterium_extractor_side");
machine_deuterium_tower = new DeuteriumTower(Material.iron).setBlockName("machine_deuterium_tower").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":concrete");
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel_machine");
machine_liquefactor = new MachineLiquefactor().setBlockName("machine_liquefactor").setHardness(10.0F).setResistance(20.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
anvil_iron = new NTMAnvil(Material.iron, 1).setBlockName("anvil_iron").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_iron");
anvil_lead = new NTMAnvil(Material.iron, 1).setBlockName("anvil_lead").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":anvil_lead");

View File

@ -2,6 +2,8 @@ package com.hbm.blocks.machine;
import java.util.List;
import org.lwjgl.input.Keyboard;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.main.MainRegistry;
@ -13,6 +15,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -36,7 +39,7 @@ public class MachineLiquefactor extends BlockDummyable implements ITooltipProvid
@Override
public int[] getDimensions() {
return new int[] {2, 0, 1, 1, 1, 1};
return new int[] {3, 0, 1, 1, 1, 1};
}
@Override
@ -68,7 +71,7 @@ public class MachineLiquefactor extends BlockDummyable implements ITooltipProvid
x = x + dir.offsetX * o;
z = z + dir.offsetZ * o;
this.makeExtra(world, x, y + 2, z);
this.makeExtra(world, x, y + 3, z);
this.makeExtra(world, x + 1, y + 1, z);
this.makeExtra(world, x - 1, y + 1, z);
@ -76,23 +79,17 @@ public class MachineLiquefactor extends BlockDummyable implements ITooltipProvid
this.makeExtra(world, x, y + 1, z - 1);
}
@Override
public int getRenderType() {
return 0;
}
@Override
public boolean isOpaqueCube() {
return true;
}
@Override
public boolean renderAsNormalBlock() {
return true;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
//list.add(EnumChatFormatting.YELLOW + "");
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { //TODO: just slap some fuckin I18n support in there idfk
list.add(EnumChatFormatting.YELLOW + "Powerful universal machine to turn items into fluids.");
list.add(EnumChatFormatting.YELLOW + "Comes with versatile catalytic components, heating elements");
list.add(EnumChatFormatting.YELLOW + "and a built-in hydrator for petrochemical liquefaction.");
} else {
list.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC +"Hold <" +
EnumChatFormatting.YELLOW + "" + EnumChatFormatting.ITALIC + "LSHIFT" +
EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC + "> to display more info");
}
}
}

View File

@ -22,12 +22,10 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.config.GeneralConfig;
import com.hbm.inventory.OreDictManager;
import static com.hbm.inventory.OreDictManager.*;
import com.hbm.inventory.RecipesCommon;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ItemEnums.EnumTarType;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemAssemblyTemplate;
import com.hbm.main.MainRegistry;
@ -921,6 +919,16 @@ public class AssemblerRecipes {
new ComparableStack(ModItems.catalyst_clay, 12),
}, 300);
makeRecipe(new ComparableStack(ModBlocks.machine_liquefactor), new AStack[] {
new OreDictStack(STEEL.ingot(), 8),
new OreDictStack(NB.ingot(), 2),
new OreDictStack(CU.plate(), 12),
new OreDictStack(ANY_TAR.any(), 8),
new ComparableStack(ModItems.catalyst_clay, 4),
new ComparableStack(ModItems.coil_tungsten, 8),
new ComparableStack(ModItems.tank_steel, 2)
}, 200);
if(Loader.isModLoaded("Mekanism")) {
Block mb = (Block) Block.blockRegistry.getObject("Mekanism:MachineBlock");

View File

@ -20,10 +20,17 @@ public class LiquefactionRecipes {
private static HashMap<Object, FluidStack> recipes = new HashMap();
public static void register() {
//TODO: make sure to either remove chemplant liquefication recipes or to adjust the values to match these
//temporary, replace with liquefacted coal (or coal oil? parallel to crude and crack oils perhaps)
//if coal oil isn't parallel, we could do coal -> coal oil -> coal tar -> crude oil (or crack oil)
//if coal oil is parallel, we might fractionate it into crude or crack oil and coal gasoline
recipes.put(COAL.gem(), new FluidStack(100, Fluids.OIL));
recipes.put(COAL.dust(), new FluidStack(100, Fluids.OIL));
//make sure to include bitumen to tar in the solidificator with matching values
recipes.put(ANY_TAR.any(), new FluidStack(100, Fluids.BITUMEN));
//general utility recipes because why not
recipes.put(new ComparableStack(Blocks.netherrack), new FluidStack(250, Fluids.LAVA));
recipes.put(new ComparableStack(Blocks.cobblestone), new FluidStack(250, Fluids.LAVA));
recipes.put(new ComparableStack(Blocks.stone), new FluidStack(250, Fluids.LAVA));
@ -32,6 +39,8 @@ public class LiquefactionRecipes {
recipes.put(new ComparableStack(Blocks.snow), new FluidStack(500, Fluids.WATER));
recipes.put(new ComparableStack(Blocks.ice), new FluidStack(1000, Fluids.WATER));
recipes.put(new ComparableStack(Blocks.packed_ice), new FluidStack(1000, Fluids.WATER));
//TODO: more recipes as the crack oil derivatives are added
}
public static FluidStack getOutput(ItemStack stack) {

View File

@ -203,6 +203,7 @@ public class ClientProxy extends ServerProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTowerSmall.class, new RenderSmallTower());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDeuteriumTower.class, new RenderDeuteriumTower());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineCatalyticCracker.class, new RenderCatalyticCracker());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLiquefactor.class, new RenderLiquefactor());
//AMS
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());

View File

@ -66,6 +66,7 @@ public class ResourceManager {
public static final IModelCustom fraction_tower = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_tower.obj"));
public static final IModelCustom fraction_spacer = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/fraction_spacer.obj"));
public static final IModelCustom cracking_tower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/cracking_tower.obj"));
public static final IModelCustom liquefactor = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/liquefactor.obj"));
//Flare Stack
public static final IModelCustom oilflare = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/oilFlare.obj"));
@ -343,6 +344,7 @@ public class ResourceManager {
public static final ResourceLocation fraction_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fraction_tower.png");
public static final ResourceLocation fraction_spacer_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fraction_spacer.png");
public static final ResourceLocation cracking_tower_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/cracking_tower.png");
public static final ResourceLocation liquefactor_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/liquefactor.png");
//Flare Stack
public static final ResourceLocation oilflare_tex = new ResourceLocation(RefStrings.MODID, "textures/models/oilFlareTexture.png");

View File

@ -1183,6 +1183,17 @@ public class ItemRenderLibrary {
bindTexture(ResourceManager.cracking_tower_tex); ResourceManager.cracking_tower.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_liquefactor), new ItemRenderBase( ) {
public void renderInventory() {
GL11.glTranslated(0, -2.5, 0);
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.liquefactor_tex); ResourceManager.liquefactor.renderPart("Main");
GL11.glShadeModel(GL11.GL_FLAT);
}});
}
private static void bindTexture(ResourceLocation res) {

View File

@ -0,0 +1,62 @@
package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntityMachineLiquefactor;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderLiquefactor extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
TileEntityMachineLiquefactor liq = (TileEntityMachineLiquefactor) tileEntity;
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.liquefactor_tex);
ResourceManager.liquefactor.renderPart("Main");
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
if(liq.tank.getFill() > 0) {
int color = liq.tank.getTankType().getColor();
GL11.glColor3ub((byte) ((color & 0xFF0000) >> 16), (byte) ((color & 0x00FF00) >> 8), (byte) ((color & 0x0000FF) >> 0));
double height = (double)liq.tank.getFill() / (double)liq.tank.getMaxFill();
GL11.glPushMatrix();
GL11.glTranslated(0, 1, 0);
GL11.glScaled(1, height, 1);
GL11.glTranslated(0, -1, 0);
ResourceManager.liquefactor.renderPart("Fluid");
GL11.glPopMatrix();
}
GL11.glEnable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(0.75F, 1.0F, 1.0F, 0.15F);
GL11.glDepthMask(false);
ResourceManager.liquefactor.renderPart("Glass");
GL11.glDepthMask(true);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
}

View File

@ -14,7 +14,10 @@ import com.hbm.lib.Library;
import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyUser;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyUser, IFluidSource {
@ -165,7 +168,11 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
@Override
public void fillFluidInit(FluidType type) {
fillFluid(xCoord, yCoord - 1, zCoord, getTact(), type);
fillFluid(xCoord, yCoord + 3, zCoord, getTact(), type);
fillFluid(xCoord, yCoord + 4, zCoord, getTact(), type);
fillFluid(xCoord + 2, yCoord + 1, zCoord, getTact(), type);
fillFluid(xCoord - 2, yCoord + 1, zCoord, getTact(), type);
fillFluid(xCoord, yCoord + 1, zCoord + 2, getTact(), type);
fillFluid(xCoord, yCoord + 1, zCoord - 2, getTact(), type);
}
@Override
@ -189,4 +196,29 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
public void clearFluidList(FluidType type) {
consumers.clear();
}
AxisAlignedBB bb = null;
@Override
public AxisAlignedBB getRenderBoundingBox() {
if(bb == null) {
bb = AxisAlignedBB.getBoundingBox(
xCoord - 1,
yCoord,
zCoord - 1,
xCoord + 2,
yCoord + 4,
zCoord + 2
);
}
return bb;
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB