Package tconstruct.smeltery.logic

Examples of tconstruct.smeltery.logic.CastingChannelLogic


    @Override
    public List<String> getWailaBody (ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
    {
        if (accessor.getTileEntity() instanceof CastingChannelLogic)
        {
            CastingChannelLogic te = (CastingChannelLogic) accessor.getTileEntity();
            FluidTankInfo internalTank = te.getTankInfo(null)[0];
            FluidTankInfo northTank = te.getTankInfo(ForgeDirection.NORTH)[0];
            FluidTankInfo southTank = te.getTankInfo(ForgeDirection.SOUTH)[0];
            FluidTankInfo westTank = te.getTankInfo(ForgeDirection.WEST)[0];
            FluidTankInfo eastTank = te.getTankInfo(ForgeDirection.EAST)[0];

            if (internalTank.fluid != null && internalTank.fluid.amount > 0)
            {
                FluidStack fs = internalTank.fluid;
                currenttip.add(StatCollector.translateToLocal("tconstruct.waila.liquidtag") + WailaRegistrar.fluidNameHelper(fs));
View Full Code Here


    @Override
    public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
    {
        ItemStack stack = player.getCurrentEquippedItem();
        CastingChannelLogic tile = (CastingChannelLogic) world.getTileEntity(x, y, z);

        if (stack != null && stack.getItem() == Item.getItemFromBlock(TinkerSmeltery.castingChannel))
            return false;
        else
        {
            tile.changeOutputs(player, side, hitX, hitY, hitZ);
            return true;
        }
    }
View Full Code Here

    }

    @Override
    public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
    {
        CastingChannelLogic tile = (CastingChannelLogic) world.getTileEntity(x, y, z);
        float minX = 0.3125F;
        float maxX = 0.6875F;
        float minZ = 0.3125F;
        float maxZ = 0.6875F;
        minZ = 0F;
View Full Code Here

    }

    @Override
    public TileEntity createNewTileEntity (World var1, int var2)
    {
        return new CastingChannelLogic();
    }
View Full Code Here

    @Override
    public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer)
    {
        if (modelID == renderID)
        {
            CastingChannelLogic tile = (CastingChannelLogic) world.getTileEntity(x, y, z);

            Set<ForgeDirection> outputs = tile.getOutputs().keySet();

            if (!outputs.contains(ForgeDirection.DOWN))//CentrePiece, floor is removed if tank below is found
            {
                renderer.setRenderBounds(0.3125D, 0.375D, 0.3125D, 0.6875D, 0.5D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            else
            //"Guiding Borders" when tank below is found
            {
                renderer.setRenderBounds(0.375D, 0.125D, 0.3125D, 0.625D, 0.5D, 0.375D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.375D, 0.125D, 0.625D, 0.625D, 0.5D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.3125D, 0.125D, 0.3125D, 0.375D, 0.5D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.625D, 0.125D, 0.3125D, 0.6875D, 0.5D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            if (outputs.contains(ForgeDirection.NORTH))//Channel to Z-
            {
                renderer.setRenderBounds(0.3125D, 0.375D, 0D, 0.6875D, 0.5D, 0.3125D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.3125D, 0.5D, 0D, 0.375D, 0.625D, 0.3125D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.625D, 0.5D, 0D, 0.6875D, 0.625D, 0.3125D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            else
            //Wall to Z-
            {
                renderer.setRenderBounds(0.375D, 0.5D, 0.3125D, 0.625D, 0.625D, 0.375D);
                renderer.renderStandardBlock(block, x, y, z);
            }

            if (outputs.contains(ForgeDirection.SOUTH))//Channel to Z+
            {
                renderer.setRenderBounds(0.3125D, 0.375D, 0.6875D, 0.6875D, 0.5D, 1D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.3125D, 0.5D, 0.6875D, 0.375D, 0.625D, 1D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.625D, 0.5D, 0.6875D, 0.6875D, 0.625D, 1D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            else
            //Wall to Z+
            {
                renderer.setRenderBounds(0.375D, 0.5D, 0.625D, 0.625D, 0.625D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }

            if (outputs.contains(ForgeDirection.WEST))//Channel to X-
            {
                renderer.setRenderBounds(0D, 0.375D, 0.3125D, 0.3125D, 0.5D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0D, 0.5D, 0.3125D, 0.375D, 0.625D, 0.375D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0D, 0.5D, 0.625D, 0.375D, 0.625D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            else
            //Wall to X-
            {
                renderer.setRenderBounds(0.3125D, 0.5D, 0.3125D, 0.375D, 0.625D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }

            if (outputs.contains(ForgeDirection.EAST))//Channel to X+
            {
                renderer.setRenderBounds(0.6875D, 0.375D, 0.3125D, 1D, 0.5D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.625D, 0.5D, 0.3125D, 1D, 0.625D, 0.375D);
                renderer.renderStandardBlock(block, x, y, z);
                renderer.setRenderBounds(0.625D, 0.5D, 0.625D, 1D, 0.625D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            else
            //Wall to X+
            {
                renderer.setRenderBounds(0.625D, 0.5D, 0.3125D, 0.6875D, 0.625D, 0.6875D);
                renderer.renderStandardBlock(block, x, y, z);
            }
            FluidTankInfo tankMain = tile.getTankInfo(null)[0];
            if (tankMain.fluid != null)
            {
                float liquidAmount = (float) tankMain.fluid.amount / (float) tankMain.capacity * 0.125f;
                double startY = tile.tankBelow();
                renderer.setRenderBounds(0.375D, startY, 0.375D, 0.625D, 0.51 + liquidAmount, 0.625D); //Center
                renderLiquidPart(world, x, y, z, block, renderer, tankMain.fluid, false);
            }
            for (ForgeDirection dir : outputs)
            {
                double[] bounds = getRenderboundsForLiquid(dir);
                if (bounds == null)
                    break;
                FluidTankInfo tankSub = tile.getTankInfo(dir)[0];
                if (tankSub == null || tankSub.fluid == null)
                    break;
                float liquidAmount = (float) tankSub.fluid.amount / (float) tankSub.capacity * 0.125f / 2;
                renderer.setRenderBounds(bounds[0], 0.51, bounds[1], bounds[2], 0.5 + liquidAmount, bounds[3]);
                renderLiquidPart(world, x, y, z, block, renderer, tankSub.fluid, false);
View Full Code Here

TOP

Related Classes of tconstruct.smeltery.logic.CastingChannelLogic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.