the mcdonalds among us meal
@ -638,8 +638,10 @@ public class ModBlocks {
|
||||
public static Block machine_stirling_steel;
|
||||
public static Block machine_sawmill;
|
||||
public static Block machine_crucible;
|
||||
|
||||
|
||||
public static Block foundry_mold;
|
||||
public static Block foundry_basin;
|
||||
public static Block foundry_channel;
|
||||
|
||||
public static Block machine_difurnace_off;
|
||||
public static Block machine_difurnace_on;
|
||||
@ -1822,7 +1824,9 @@ public class ModBlocks {
|
||||
machine_sawmill = new MachineSawmill().setBlockName("machine_sawmill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_crucible = new MachineCrucible().setBlockName("machine_crucible").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_crucible");
|
||||
|
||||
foundry_mold = new FoundryMold().setBlockName("foundry_mold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":foundry_mold");
|
||||
foundry_basin = new FoundryBasin().setBlockName("foundry_basin").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":foundry_basin");
|
||||
foundry_channel = new FoundryChannel().setBlockName("foundry_channel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":foundry_channel");
|
||||
|
||||
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
@ -3015,6 +3019,9 @@ public class ModBlocks {
|
||||
register(machine_stirling_steel);
|
||||
register(machine_sawmill);
|
||||
register(machine_crucible);
|
||||
register(foundry_mold);
|
||||
register(foundry_basin);
|
||||
register(foundry_channel);
|
||||
GameRegistry.registerBlock(machine_difurnace_off, machine_difurnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_difurnace_on, machine_difurnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_difurnace_rtg_off, machine_difurnace_rtg_off.getUnlocalizedName());
|
||||
|
||||
@ -1,21 +1,47 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryBasin;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class FoundryBasin extends BlockContainer implements ICrucibleAcceptor {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInner;
|
||||
|
||||
public FoundryBasin() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":foundry_basin_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":foundry_basin_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":foundry_basin_bottom");
|
||||
this.iconInner = iconRegister.registerIcon(RefStrings.MODID + ":foundry_basin_inner");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
|
||||
101
src/main/java/com/hbm/blocks/machine/FoundryChannel.java
Normal file
@ -0,0 +1,101 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryChannel;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class FoundryChannel extends BlockContainer implements ICrucibleAcceptor {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInner;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconLava;
|
||||
|
||||
public FoundryChannel() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":foundry_channel_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":foundry_channel_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":foundry_channel_bottom");
|
||||
this.iconInner = iconRegister.registerIcon(RefStrings.MODID + ":foundry_channel_inner");
|
||||
this.iconLava = iconRegister.registerIcon(RefStrings.MODID + ":lava_gray");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityFoundryChannel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryChannel) world.getTileEntity(x, y, z)).canAcceptPartialPour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryChannel) world.getTileEntity(x, y, z)).pour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryChannel) world.getTileEntity(x, y, z)).canAcceptPartialFlow(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryChannel) world.getTileEntity(x, y, z)).flow(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
public boolean canConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
if(dir == ForgeDirection.UP || dir == ForgeDirection.DOWN || dir == ForgeDirection.UNKNOWN)
|
||||
return false;
|
||||
|
||||
Block b = world.getBlock(x + dir.offsetX, y, z + dir.offsetZ);
|
||||
|
||||
return b == ModBlocks.foundry_channel || b == ModBlocks.foundry_mold;
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
87
src/main/java/com/hbm/blocks/machine/FoundryMold.java
Normal file
@ -0,0 +1,87 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryMold;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class FoundryMold extends BlockContainer implements ICrucibleAcceptor {
|
||||
|
||||
@SideOnly(Side.CLIENT) public IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconSide;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) public IIcon iconInner;
|
||||
|
||||
public FoundryMold() {
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":foundry_mold_top");
|
||||
this.iconSide = iconRegister.registerIcon(RefStrings.MODID + ":foundry_mold_side");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":foundry_mold_bottom");
|
||||
this.iconInner = iconRegister.registerIcon(RefStrings.MODID + ":foundry_mold_inner");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityFoundryMold();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryMold) world.getTileEntity(x, y, z)).canAcceptPartialPour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryMold) world.getTileEntity(x, y, z)).pour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryMold) world.getTileEntity(x, y, z)).canAcceptPartialFlow(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
return ((TileEntityFoundryMold) world.getTileEntity(x, y, z)).flow(world, x, y, z, side, stack);
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,6 @@ import net.minecraft.world.World;
|
||||
public class MachineDiFurnace extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private Random rand;
|
||||
private final boolean isActive;
|
||||
private static boolean keepInventory;
|
||||
|
||||
@ -39,7 +38,6 @@ public class MachineDiFurnace extends BlockContainer {
|
||||
|
||||
public MachineDiFurnace(boolean blockState) {
|
||||
super(Material.iron);
|
||||
rand = new Random();
|
||||
isActive = blockState;
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,8 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial;
|
||||
import com.hbm.items.special.ItemWasteLong;
|
||||
import com.hbm.items.special.ItemWasteShort;
|
||||
import com.hbm.main.CraftingManager;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
@ -432,6 +434,8 @@ public class MineralRecipes {
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ingot_pu_mix, 1), new Object[] { "tinyPu239", "tinyPu239", "tinyPu239", "tinyPu239", "tinyPu239", "tinyPu239", "tinyPu240", "tinyPu240", "tinyPu240" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ingot_am_mix, 1), new Object[] { "nuggetAmericium241", "nuggetAmericium241", "nuggetAmericium241", "nuggetAmericium242", "nuggetAmericium242", "nuggetAmericium242", "nuggetAmericium242", "nuggetAmericium242", "nuggetAmericium242" }));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(ModItems.ingot_am_mix, 1), new Object[] { "tinyAm241", "tinyAm241", "tinyAm241", "tinyAm242", "tinyAm242", "tinyAm242", "tinyAm242", "tinyAm242", "tinyAm242" }));
|
||||
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ball_fireclay, 4), new Object[] { Items.clay_ball, Items.clay_ball, Items.clay_ball, AL.dust() });
|
||||
}
|
||||
|
||||
//Bundled 1/9 recipes
|
||||
|
||||
@ -110,6 +110,7 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(ModItems.rag_damp, new ItemStack(ModItems.rag), 0.1F);
|
||||
GameRegistry.addSmelting(ModItems.rag_piss, new ItemStack(ModItems.rag), 0.1F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.plant_flower, EnumFlowerType.TOBACCO), DictFrame.fromOne(ModItems.plant_item, EnumPlantType.TOBACCO), 0.1F);
|
||||
GameRegistry.addSmelting(ModItems.ball_fireclay, new ItemStack(ModItems.ingot_firebrick), 0.1F);
|
||||
|
||||
//GameRegistry.addSmelting(Items.bone, new ItemStack(Items.slime_ball, 3), 0.0F);
|
||||
//GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 15), new ItemStack(Items.slime_ball, 1), 0.0F);
|
||||
|
||||
@ -147,6 +147,7 @@ public class ModItems {
|
||||
public static Item ingot_c4;
|
||||
public static Item ingot_boron;
|
||||
public static Item ingot_graphite;
|
||||
public static Item ingot_firebrick;
|
||||
public static Item ingot_smore;
|
||||
|
||||
public static Item ingot_gh336;
|
||||
@ -1207,6 +1208,7 @@ public class ModItems {
|
||||
public static Item ballistite;
|
||||
public static Item ball_dynamite;
|
||||
public static Item ball_tnt;
|
||||
public static Item ball_fireclay;
|
||||
|
||||
public static Item pellet_cluster;
|
||||
public static Item powder_fire;
|
||||
@ -2641,6 +2643,7 @@ public class ModItems {
|
||||
ingot_cobalt = new Item().setUnlocalizedName("ingot_cobalt").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_cobalt");
|
||||
ingot_boron = new Item().setUnlocalizedName("ingot_boron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_boron");
|
||||
ingot_graphite = new Item().setUnlocalizedName("ingot_graphite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_graphite");
|
||||
ingot_firebrick = new Item().setUnlocalizedName("ingot_firebrick").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_firebrick");
|
||||
ingot_smore = new ItemFood(10, 20F, false).setUnlocalizedName("ingot_smore").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_smore");
|
||||
sulfur = new Item().setUnlocalizedName("sulfur").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":sulfur");
|
||||
|
||||
@ -3992,6 +3995,7 @@ public class ModItems {
|
||||
ballistite = new Item().setUnlocalizedName("ballistite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ballistite");
|
||||
ball_dynamite = new Item().setUnlocalizedName("ball_dynamite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ball_dynamite");
|
||||
ball_tnt = new Item().setUnlocalizedName("ball_tnt").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ball_tnt");
|
||||
ball_fireclay = new Item().setUnlocalizedName("ball_fireclay").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ball_fireclay");
|
||||
pellet_gas = new ItemCustomLore().setUnlocalizedName("pellet_gas").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellet_gas");
|
||||
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");
|
||||
@ -5807,6 +5811,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ingot_cobalt, ingot_cobalt.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_boron, ingot_boron.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_graphite, ingot_graphite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_firebrick, ingot_firebrick.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_dura_steel, ingot_dura_steel.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_polymer, ingot_polymer.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_bakelite, ingot_bakelite.getUnlocalizedName());
|
||||
@ -6048,6 +6053,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ballistite, ballistite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ball_dynamite, ball_dynamite.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ball_tnt, ball_tnt.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ball_fireclay, ball_fireclay.getUnlocalizedName());
|
||||
|
||||
//Crystals
|
||||
GameRegistry.registerItem(crystal_coal, crystal_coal.getUnlocalizedName());
|
||||
|
||||
@ -265,6 +265,9 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStirling.class, new RenderStirling());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySawmill.class, new RenderSawmill());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucible.class, new RenderCrucible());
|
||||
//Foundry
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryBasin.class, new RenderFoundry());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryMold.class, new RenderFoundry());
|
||||
//AMS
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());
|
||||
@ -740,6 +743,10 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderDiode());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBoxDuct());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockDecoModel(ModBlocks.deco_computer.getRenderType(), ResourceManager.deco_computer));
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderBasin());
|
||||
RenderingRegistry.registerBlockHandler(new RenderMold());
|
||||
RenderingRegistry.registerBlockHandler(new RenderChannel());
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_dynamite.getRenderType(), ResourceManager.charge_dynamite));
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_c4.getRenderType(), ResourceManager.charge_c4));
|
||||
|
||||
101
src/main/java/com/hbm/render/block/RenderBasin.java
Normal file
@ -0,0 +1,101 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.machine.FoundryBasin;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderBasin implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
FoundryBasin basin = (FoundryBasin) block;
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
double z = 0;
|
||||
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, basin.iconTop);
|
||||
renderer.renderFaceYPos(block, x, y - 0.875D, z, basin.iconBottom);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, basin.iconBottom);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceXPos(block, x - 0.875D, y, z, basin.iconInner);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceXNeg(block, x + 0.875D, y, z, basin.iconInner);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z - 0.875D, basin.iconInner);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceZNeg(block, x, y, z + 0.875D, basin.iconInner);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int colorMult = block.colorMultiplier(world, x, y, z);
|
||||
float r = (float) (colorMult >> 16 & 255) / 255.0F;
|
||||
float g = (float) (colorMult >> 8 & 255) / 255.0F;
|
||||
float b = (float) (colorMult & 255) / 255.0F;
|
||||
|
||||
float mulBottom = 0.5F;
|
||||
float mulTop = 1.0F;
|
||||
float mulZ = 0.8F;
|
||||
float mulX = 0.6F;
|
||||
|
||||
if(EntityRenderer.anaglyphEnable) {
|
||||
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
||||
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
||||
float aB = (r * 30.0F + b * 70.0F) / 100.0F;
|
||||
r = aR;
|
||||
g = aG;
|
||||
b = aB;
|
||||
}
|
||||
|
||||
FoundryBasin basin = (FoundryBasin) block;
|
||||
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, basin.iconTop);
|
||||
renderer.renderFaceYPos(block, x, y - 0.875D, z, basin.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, basin.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXPos(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceXNeg(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceXPos(block, x - 0.875D, y, z, basin.iconInner);
|
||||
renderer.renderFaceXNeg(block, x + 0.875D, y, z, basin.iconInner);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZPos(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceZNeg(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z - 0.875D, basin.iconInner);
|
||||
renderer.renderFaceZNeg(block, x, y, z + 0.875D, basin.iconInner);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return FoundryBasin.renderID;
|
||||
}
|
||||
}
|
||||
382
src/main/java/com/hbm/render/block/RenderChannel.java
Normal file
@ -0,0 +1,382 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.machine.FoundryChannel;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryChannel;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderChannel implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
double height = 0.5D;
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
double z = 0;
|
||||
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
FoundryChannel channel = (FoundryChannel) block;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
//center
|
||||
renderer.setRenderBounds(0.375D, 0D, 0.375D, 0.625D, 0.125D, 0.625D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.3125D, 0.6875D, 0.125D, 0.6875D);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
|
||||
//pos X bottom
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.3125D, 1D, 0.125D, 0.6875D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
//pos X
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.3125D, 1D, height, 0.375D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.625D, 1D, height, 0.6875D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
//neg x bottom
|
||||
renderer.setRenderBounds(0D, 0D, 0.3125D, 0.375D, 0.125D, 0.6875D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
|
||||
//neg x
|
||||
renderer.setRenderBounds(0D, 0D, 0.3125D, 0.375D, height, 0.375D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
|
||||
renderer.setRenderBounds(0D, 0D, 0.625D, 0.375D, height, 0.6875D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
|
||||
//pos Z bottom
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.625D, 0.6875D, 0.125D, 1D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
//pos z
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.625D, 0.375D, height, 1D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.625D, 0.6875D, height, 1D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
//neg z bottom
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0D, 0.6875D, 0.125D, 0.375D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
|
||||
//neg z
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0D, 0.375D, height, 0.375D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0D, 0.6875D, height, 0.375D);
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconInner);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int colorMult = block.colorMultiplier(world, x, y, z);
|
||||
float r = (float) (colorMult >> 16 & 255) / 255.0F;
|
||||
float g = (float) (colorMult >> 8 & 255) / 255.0F;
|
||||
float b = (float) (colorMult & 255) / 255.0F;
|
||||
|
||||
float mulBottom = 0.5F;
|
||||
float mulTop = 1.0F;
|
||||
float mulZ = 0.8F;
|
||||
float mulX = 0.6F;
|
||||
|
||||
if(EntityRenderer.anaglyphEnable) {
|
||||
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
||||
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
||||
float aB = (r * 30.0F + b * 70.0F) / 100.0F;
|
||||
r = aR;
|
||||
g = aG;
|
||||
b = aB;
|
||||
}
|
||||
|
||||
FoundryChannel channel = (FoundryChannel) block;
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
TileEntityFoundryChannel tile = null;
|
||||
|
||||
if(te instanceof TileEntityFoundryChannel) {
|
||||
tile = (TileEntityFoundryChannel) te;
|
||||
}
|
||||
|
||||
boolean doRender = tile != null ? (tile.amount > 0 && tile.type != null) : false;
|
||||
double level = doRender ? tile.amount * 0.25D / tile.getCapacity() : 0;
|
||||
Color color = doRender ? new Color(tile.type.moltenColor).brighter() : null;
|
||||
|
||||
boolean posX = channel.canConnectTo(world, x, y, z, Library.POS_X);
|
||||
boolean negX = channel.canConnectTo(world, x, y, z, Library.NEG_X);
|
||||
boolean posZ = channel.canConnectTo(world, x, y, z, Library.POS_Z);
|
||||
boolean negZ = channel.canConnectTo(world, x, y, z, Library.NEG_Z);
|
||||
|
||||
double height = 0.5D;
|
||||
|
||||
renderer.setRenderBounds(0.375D, 0D, 0.375D, 0.625D, 0.125D, 0.625D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.3125D, 0.6875D, 0.125D, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
|
||||
if(doRender) {
|
||||
renderer.setRenderBounds(0.375D, 0.125D, 0.375D, 0.625D, 0.125D + level, 0.625D);
|
||||
tessellator.setColorOpaque_F(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconLava);
|
||||
}
|
||||
|
||||
if(posX) {
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.3125D, 1D, 0.125D, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.3125D, 1D, height, 0.375D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconInner);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.625D, 1D, height, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconInner);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
if(doRender) {
|
||||
renderer.setRenderBounds(0.625D, 0.125D, 0.3125D, 1D, 0.125D + level, 0.6875D);
|
||||
tessellator.setColorOpaque_F(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconLava);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconLava);
|
||||
}
|
||||
|
||||
} else {
|
||||
renderer.setRenderBounds(0.625, 0D, 0.3125D, 0.6875D, height, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconInner);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
}
|
||||
|
||||
if(negX) {
|
||||
renderer.setRenderBounds(0D, 0D, 0.3125D, 0.375D, 0.125D, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
|
||||
renderer.setRenderBounds(0D, 0D, 0.3125D, 0.375D, height, 0.375D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconInner);
|
||||
|
||||
renderer.setRenderBounds(0D, 0D, 0.625D, 0.375D, height, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconInner);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
if(doRender) {
|
||||
renderer.setRenderBounds(0D, 0.125D, 0.3125D, 0.375D, 0.125D + level, 0.6875D);
|
||||
tessellator.setColorOpaque_F(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconLava);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconLava);
|
||||
}
|
||||
|
||||
} else {
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.3125D, 0.375D, height, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconInner);
|
||||
}
|
||||
|
||||
if(posZ) {
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.625D, 0.6875D, 0.125D, 1D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.625D, 0.375D, height, 1D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconInner);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0.625D, 0.6875D, height, 1D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconInner);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
if(doRender) {
|
||||
renderer.setRenderBounds(0.3125D, 0.125D, 0.625D, 0.6875D, 0.125D + level, 1D);
|
||||
tessellator.setColorOpaque_F(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconLava);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconLava);
|
||||
}
|
||||
|
||||
} else {
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.625D, 0.6875D, height, 0.6875D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconInner);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconSide);
|
||||
}
|
||||
|
||||
if(negZ) {
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0D, 0.6875D, 0.125D, 0.375D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, channel.iconBottom);
|
||||
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0D, 0.375D, height, 0.375D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconSide);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconInner);
|
||||
|
||||
renderer.setRenderBounds(0.625D, 0D, 0D, 0.6875D, height, 0.375D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXNeg(block, x, y, z, channel.iconInner);
|
||||
renderer.renderFaceXPos(block, x, y, z, channel.iconSide);
|
||||
|
||||
if(doRender) {
|
||||
renderer.setRenderBounds(0.3125D, 0.125D, 0D, 0.6875D, 0.125D + level, 0.375D);
|
||||
tessellator.setColorOpaque_F(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconLava);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconLava);
|
||||
}
|
||||
|
||||
} else {
|
||||
renderer.setRenderBounds(0.3125D, 0D, 0.3125D, 0.6875D, height, 0.375D);
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y, z, channel.iconTop);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZNeg(block, x, y, z, channel.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z, channel.iconInner);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return FoundryChannel.renderID;
|
||||
}
|
||||
}
|
||||
101
src/main/java/com/hbm/render/block/RenderMold.java
Normal file
@ -0,0 +1,101 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.machine.FoundryMold;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderMold implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
FoundryMold basin = (FoundryMold) block;
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
double z = 0;
|
||||
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0F, 1F, 0F);
|
||||
renderer.renderFaceYPos(block, x, y - 0.5D, z, basin.iconTop);
|
||||
renderer.renderFaceYPos(block, x, y - 0.875D, z, basin.iconBottom);
|
||||
tessellator.setNormal(0F, -1F, 0F);
|
||||
renderer.renderFaceYNeg(block, x, y, z, basin.iconBottom);
|
||||
tessellator.setNormal(1F, 0F, 0F);
|
||||
renderer.renderFaceXPos(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceXPos(block, x - 0.875D, y, z, basin.iconInner);
|
||||
tessellator.setNormal(-1F, 0F, 0F);
|
||||
renderer.renderFaceXNeg(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceXNeg(block, x + 0.875D, y, z, basin.iconInner);
|
||||
tessellator.setNormal(0F, 0F, 1F);
|
||||
renderer.renderFaceZPos(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z - 0.875D, basin.iconInner);
|
||||
tessellator.setNormal(0F, 0F, -1F);
|
||||
renderer.renderFaceZNeg(block, x, y, z, basin.iconSide);
|
||||
renderer.renderFaceZNeg(block, x, y, z + 0.875D, basin.iconInner);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int colorMult = block.colorMultiplier(world, x, y, z);
|
||||
float r = (float) (colorMult >> 16 & 255) / 255.0F;
|
||||
float g = (float) (colorMult >> 8 & 255) / 255.0F;
|
||||
float b = (float) (colorMult & 255) / 255.0F;
|
||||
|
||||
float mulBottom = 0.5F;
|
||||
float mulTop = 1.0F;
|
||||
float mulZ = 0.8F;
|
||||
float mulX = 0.6F;
|
||||
|
||||
if(EntityRenderer.anaglyphEnable) {
|
||||
float aR = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
|
||||
float aG = (r * 30.0F + g * 70.0F) / 100.0F;
|
||||
float aB = (r * 30.0F + b * 70.0F) / 100.0F;
|
||||
r = aR;
|
||||
g = aG;
|
||||
b = aB;
|
||||
}
|
||||
|
||||
FoundryMold mold = (FoundryMold) block;
|
||||
|
||||
tessellator.setColorOpaque_F(r * mulTop, g * mulTop, b * mulTop);
|
||||
renderer.renderFaceYPos(block, x, y - 0.5D, z, mold.iconTop);
|
||||
renderer.renderFaceYPos(block, x, y - 0.875D, z, mold.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulBottom, g * mulBottom, b * mulBottom);
|
||||
renderer.renderFaceYNeg(block, x, y, z, mold.iconBottom);
|
||||
tessellator.setColorOpaque_F(r * mulX, g * mulX, b * mulX);
|
||||
renderer.renderFaceXPos(block, x, y, z, mold.iconSide);
|
||||
renderer.renderFaceXNeg(block, x, y, z, mold.iconSide);
|
||||
renderer.renderFaceXPos(block, x - 0.875D, y, z, mold.iconInner);
|
||||
renderer.renderFaceXNeg(block, x + 0.875D, y, z, mold.iconInner);
|
||||
tessellator.setColorOpaque_F(r * mulZ, g * mulZ, b * mulZ);
|
||||
renderer.renderFaceZPos(block, x, y, z, mold.iconSide);
|
||||
renderer.renderFaceZNeg(block, x, y, z, mold.iconSide);
|
||||
renderer.renderFaceZPos(block, x, y, z - 0.875D, mold.iconInner);
|
||||
renderer.renderFaceZNeg(block, x, y, z + 0.875D, mold.iconInner);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return FoundryMold.renderID;
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
@ -19,6 +20,13 @@ public class RenderCrucible extends TileEntitySpecialRenderer implements IItemRe
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
switch(tile.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.crucible_tex);
|
||||
ResourceManager.crucible_heat.renderAll();
|
||||
|
||||
72
src/main/java/com/hbm/render/tileentity/RenderFoundry.java
Normal file
@ -0,0 +1,72 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.IRenderFoundry;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderFoundry extends TileEntitySpecialRenderer {
|
||||
|
||||
public static final ResourceLocation lava = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lava_gray.png");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
IRenderFoundry foundry = (IRenderFoundry) tile;
|
||||
|
||||
if(!foundry.shouldRender()) return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
this.bindTexture(lava);
|
||||
|
||||
int hex = foundry.getMat().moltenColor;
|
||||
Color color = new Color(hex);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorRGBA_F(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
|
||||
tess.addVertexWithUV(foundry.minX(), foundry.getLevel(), foundry.minZ(), foundry.minZ(), foundry.maxX());
|
||||
tess.addVertexWithUV(foundry.minX(), foundry.getLevel(), foundry.maxZ(), foundry.maxZ(), foundry.maxX());
|
||||
tess.addVertexWithUV(foundry.maxX(), foundry.getLevel(), foundry.maxZ(), foundry.maxZ(), foundry.minX());
|
||||
tess.addVertexWithUV(foundry.maxX(), foundry.getLevel(), foundry.minZ(), foundry.minZ(), foundry.minX());
|
||||
tess.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
tess.startDrawingQuads();
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 0.3F);
|
||||
tess.addVertexWithUV(foundry.minX(), foundry.getLevel(), foundry.minZ(), foundry.minZ(), foundry.maxX());
|
||||
tess.addVertexWithUV(foundry.minX(), foundry.getLevel(), foundry.maxZ(), foundry.maxZ(), foundry.maxX());
|
||||
tess.addVertexWithUV(foundry.maxX(), foundry.getLevel(), foundry.maxZ(), foundry.maxZ(), foundry.minX());
|
||||
tess.addVertexWithUV(foundry.maxX(), foundry.getLevel(), foundry.minZ(), foundry.minZ(), foundry.minX());
|
||||
tess.draw();
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -251,6 +251,10 @@ public class TileMappings {
|
||||
put(TileEntityStirling.class, "tileentity_stirling");
|
||||
put(TileEntitySawmill.class, "tileentity_sawmill");
|
||||
put(TileEntityCrucible.class, "tileentity_crucible");
|
||||
|
||||
put(TileEntityFoundryMold.class, "tileentity_foundry_mold");
|
||||
put(TileEntityFoundryBasin.class, "tileentity_foundry_basin");
|
||||
put(TileEntityFoundryChannel.class, "tileentity_foundry_channel");
|
||||
|
||||
put(TileEntityMachineAutocrafter.class, "tileentity_autocrafter");
|
||||
put(TileEntityDiFurnaceRTG.class, "tileentity_rtg_difurnace");
|
||||
|
||||
14
src/main/java/com/hbm/tileentity/machine/IRenderFoundry.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
|
||||
public interface IRenderFoundry {
|
||||
|
||||
public boolean shouldRender();
|
||||
public double getLevel();
|
||||
public NTMMaterial getMat();
|
||||
public double minX();
|
||||
public double maxX();
|
||||
public double minZ();
|
||||
public double maxZ();
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.inventory.container.ContainerCrucible;
|
||||
import com.hbm.inventory.gui.GUICrucible;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
@ -15,18 +16,22 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCrucible extends TileEntityMachineBase implements IGUIProvider {
|
||||
|
||||
@ -90,6 +95,45 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
/* TEMP */
|
||||
if(!this.wasteStack.isEmpty()) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset).getOpposite();
|
||||
|
||||
outer:
|
||||
for(MaterialStack stack : this.wasteStack) {
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
int x = xCoord + dir.offsetX * 2;
|
||||
int z = zCoord + dir.offsetZ * 2;
|
||||
int y = yCoord - i - 1;
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
if(b.isAir(worldObj, x, y, z)) continue;
|
||||
|
||||
if(b instanceof ICrucibleAcceptor) {
|
||||
|
||||
ICrucibleAcceptor acc = (ICrucibleAcceptor) b;
|
||||
int pourAmount = Math.min(MaterialShapes.NUGGET.q(1), stack.amount);
|
||||
MaterialStack toPour = new MaterialStack(stack.material, pourAmount);
|
||||
|
||||
if(acc.canAcceptPartialPour(worldObj, x, y, z, 0.5, 1, 0.5, ForgeDirection.UP, toPour)) {
|
||||
int prev = pourAmount;
|
||||
MaterialStack left = acc.pour(worldObj, x, y, z, 0.5, 1, 0.5, ForgeDirection.UP, toPour);
|
||||
|
||||
int diff = prev - (left != null ? left.amount : 0);
|
||||
stack.amount -= diff;
|
||||
|
||||
break outer;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.wasteStack.removeIf(x -> x.amount <= 0);
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
int[] rec = new int[recipeStack.size() * 2];
|
||||
int[] was = new int[wasteStack.size() * 2];
|
||||
|
||||
@ -2,12 +2,13 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TileEntityFoundryBasin extends TileEntityFoundryBase {
|
||||
public class TileEntityFoundryBasin extends TileEntityFoundryBase implements IRenderFoundry {
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
@ -18,15 +19,24 @@ public class TileEntityFoundryBasin extends TileEntityFoundryBase {
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.lastType != this.type || this.lastAmount != this.amount) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.lastType = this.type;
|
||||
this.lastAmount = this.amount;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: cool off
|
||||
}
|
||||
|
||||
//TODO: move to block
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(side != ForgeDirection.UP) return false; //reject from any direction other than the top
|
||||
if(this.type != null && this.type != stack.material) return false; //reject if there's already a different material
|
||||
if(this.amount >= this.getCapacity()) return false; //reject if the buffer is already full
|
||||
|
||||
for(String name : stack.material.names) {
|
||||
String od = "block" + name;
|
||||
@ -42,6 +52,10 @@ public class TileEntityFoundryBasin extends TileEntityFoundryBase {
|
||||
@Override
|
||||
public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type == null) {
|
||||
this.type = stack.material;
|
||||
}
|
||||
|
||||
if(stack.amount + this.amount <= this.getCapacity()) {
|
||||
this.amount += stack.amount;
|
||||
return null;
|
||||
@ -57,4 +71,24 @@ public class TileEntityFoundryBasin extends TileEntityFoundryBase {
|
||||
|
||||
@Override public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) { return false; }
|
||||
@Override public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) { return stack; }
|
||||
|
||||
@Override
|
||||
public boolean shouldRender() {
|
||||
return this.type != null && this.amount > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLevel() {
|
||||
return 0.125 + this.amount * 0.75D / this.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NTMMaterial getMat() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@Override public double minX() { return 0.125D; }
|
||||
@Override public double maxX() { return 0.875D; }
|
||||
@Override public double minZ() { return 0.125D; }
|
||||
@Override public double maxZ() { return 0.875D; }
|
||||
}
|
||||
|
||||
@ -0,0 +1,158 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFoundryChannel extends TileEntityFoundryBase {
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.type == null && this.amount != 0) {
|
||||
this.amount = 0;
|
||||
}
|
||||
|
||||
if(this.lastType != this.type || this.lastAmount != this.amount) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.lastType = this.type;
|
||||
this.lastAmount = this.amount;
|
||||
}
|
||||
|
||||
if(worldObj.rand.nextInt(10) == 0 && this.amount > 0 && this.type != null) {
|
||||
|
||||
List<Integer> ints = new ArrayList() {{ add(2); add(3); add(4); add(5); }};
|
||||
Collections.shuffle(ints);
|
||||
|
||||
for(Integer i : ints) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
Block b = worldObj.getBlock(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
|
||||
if(b instanceof ICrucibleAcceptor && b != ModBlocks.foundry_channel) {
|
||||
ICrucibleAcceptor acc = (ICrucibleAcceptor) b;
|
||||
|
||||
if(acc.canAcceptPartialFlow(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, dir.getOpposite(), new MaterialStack(this.type, this.amount))) {
|
||||
MaterialStack left = acc.flow(worldObj, xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ, dir.getOpposite(), new MaterialStack(this.type, this.amount));
|
||||
if(left == null) {
|
||||
this.type = null;
|
||||
this.amount = 0;
|
||||
} else {
|
||||
this.amount = left.amount;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(Integer i : ints) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
TileEntity b = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
|
||||
|
||||
if(b instanceof TileEntityFoundryChannel) {
|
||||
TileEntityFoundryChannel acc = (TileEntityFoundryChannel) b;
|
||||
|
||||
if(acc.type == null || acc.type == this.type) {
|
||||
acc.type = this.type;
|
||||
|
||||
if(worldObj.rand.nextInt(5) == 0) {
|
||||
//1:4 chance that the fill states are simply swapped
|
||||
//this promotes faster spreading and prevents spread limits
|
||||
int buf = this.amount;
|
||||
this.amount = acc.amount;
|
||||
acc.amount = buf;
|
||||
|
||||
} else {
|
||||
//otherwise, equalize the neighbors
|
||||
int diff = this.amount - acc.amount;
|
||||
|
||||
if(diff > 0) {
|
||||
diff /= 2;
|
||||
this.amount -= diff;
|
||||
acc.amount += diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(side != ForgeDirection.UP) return false; //reject from any direction other than the top
|
||||
if(this.type != null && this.type != stack.material) return false; //reject if there's already a different material
|
||||
if(this.amount >= this.getCapacity()) return false; //reject if the buffer is already full
|
||||
|
||||
return true; //pour
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type == null) {
|
||||
this.type = stack.material;
|
||||
}
|
||||
|
||||
if(stack.amount + this.amount <= this.getCapacity()) {
|
||||
this.amount += stack.amount;
|
||||
return null;
|
||||
}
|
||||
|
||||
int required = this.getCapacity() - this.amount;
|
||||
this.amount = this.getCapacity();
|
||||
|
||||
stack.amount -= required;
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(side == ForgeDirection.UP || side == ForgeDirection.DOWN) return false;
|
||||
if(this.type != null && this.type != stack.material) return false;
|
||||
if(this.amount >= this.getCapacity()) return false;
|
||||
|
||||
return true; //pour
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type == null) {
|
||||
this.type = stack.material;
|
||||
}
|
||||
|
||||
if(stack.amount + this.amount <= this.getCapacity()) {
|
||||
this.amount += stack.amount;
|
||||
return null;
|
||||
}
|
||||
|
||||
int required = this.getCapacity() - this.amount;
|
||||
this.amount = this.getCapacity();
|
||||
|
||||
stack.amount -= required;
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return MaterialShapes.INGOT.q(1);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class TileEntityFoundryMold extends TileEntityFoundryBase implements IRenderFoundry {
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return MaterialShapes.INGOT.q(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.lastType != this.type || this.lastAmount != this.amount) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.lastType = this.type;
|
||||
this.lastAmount = this.amount;
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: cool off
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(side != ForgeDirection.UP) return false; //reject from any direction other than the top
|
||||
if(this.type != null && this.type != stack.material) return false; //reject if there's already a different material
|
||||
if(this.amount >= this.getCapacity()) return false; //reject if the buffer is already full
|
||||
|
||||
for(String name : stack.material.names) {
|
||||
String od = "ingot" + name;
|
||||
|
||||
if(!OreDictionary.getOres(od).isEmpty()) {
|
||||
return true; //at least one block for this material? return TRUE
|
||||
}
|
||||
}
|
||||
|
||||
return false; //no OD match -> no pouring
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type == null) {
|
||||
this.type = stack.material;
|
||||
}
|
||||
|
||||
if(stack.amount + this.amount <= this.getCapacity()) {
|
||||
this.amount += stack.amount;
|
||||
return null;
|
||||
}
|
||||
|
||||
int required = this.getCapacity() - this.amount;
|
||||
this.amount = this.getCapacity();
|
||||
|
||||
stack.amount -= required;
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type != null && this.type != stack.material) return false; //reject if there's already a different material
|
||||
if(this.amount >= this.getCapacity()) return false; //reject if the buffer is already full
|
||||
|
||||
for(String name : stack.material.names) {
|
||||
String od = "ingot" + name;
|
||||
|
||||
if(!OreDictionary.getOres(od).isEmpty()) {
|
||||
return true; //at least one block for this material? return TRUE
|
||||
}
|
||||
}
|
||||
|
||||
return false; //no OD match -> no pouring
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type == null) {
|
||||
this.type = stack.material;
|
||||
}
|
||||
|
||||
if(stack.amount + this.amount <= this.getCapacity()) {
|
||||
this.amount += stack.amount;
|
||||
return null;
|
||||
}
|
||||
|
||||
int required = this.getCapacity() - this.amount;
|
||||
this.amount = this.getCapacity();
|
||||
|
||||
stack.amount -= required;
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender() {
|
||||
return this.type != null && this.amount > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLevel() {
|
||||
return 0.125 + this.amount * 0.25D / this.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NTMMaterial getMat() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@Override public double minX() { return 0.125D; }
|
||||
@Override public double maxX() { return 0.875D; }
|
||||
@Override public double minZ() { return 0.125D; }
|
||||
@Override public double maxZ() { return 0.875D; }
|
||||
}
|
||||
BIN
src/main/resources/assets/hbm/textures/blocks/foundry_basin.png
Normal file
|
After Width: | Height: | Size: 651 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 533 B |
|
After Width: | Height: | Size: 599 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 329 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 523 B |
|
After Width: | Height: | Size: 515 B |
|
After Width: | Height: | Size: 329 B |
|
After Width: | Height: | Size: 319 B |
|
After Width: | Height: | Size: 466 B |
BIN
src/main/resources/assets/hbm/textures/blocks/lava_gray.png
Normal file
|
After Width: | Height: | Size: 751 B |
BIN
src/main/resources/assets/hbm/textures/items/ball_fireclay.png
Normal file
|
After Width: | Height: | Size: 425 B |
BIN
src/main/resources/assets/hbm/textures/items/ingot_firebrick.png
Normal file
|
After Width: | Height: | Size: 403 B |
|
After Width: | Height: | Size: 751 B |