Package codechicken.lib.vec

Examples of codechicken.lib.vec.BlockCoord


    {
        MovingObjectPosition hit = RayTracer.reTrace(world, player);
        if(hit == null)
            return false;
       
        BlockCoord pos = new BlockCoord(hit.blockX, hit.blockY, hit.blockZ).offset(hit.sideHit);
        ItemStack held = player.getHeldItem();
        McBlockPart part = null;
        if(held == null)
            return false;
View Full Code Here


            dropIfCantStay();
    }
   
    public boolean canStay()
    {
        BlockCoord pos = new BlockCoord(tile()).offset(sideForMeta(meta));
        return world().isSideSolid(pos.x, pos.y, pos.z, ForgeDirection.getOrientation(sideForMeta(meta)^1));
    }
View Full Code Here

    }
   
    @Override
    public BlockCoord getPos()
    {
        return new BlockCoord(tile());
    }
View Full Code Here

  public TMultiPart newPart(ItemStack item, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 vHit)
  {
    EnumColor col = EnumColor.DYES[item.getItemDamage()];
    ForgeDirection orientation = getSideFromVector3(vHit.subtract(Vector3.center));
   
    BlockCoord pos1 = pos.copy().inset(orientation.getOpposite().ordinal());
   
    if(world.isSideSolid(pos1.x, pos1.y, pos1.z, orientation.getOpposite()))
    {
      return new PartGlowPanel(col, orientation);
    }
View Full Code Here

    public int readVarInt() {
        return ByteBufUtils.readVarInt(byteBuf, 5);
    }

    public BlockCoord readCoord() {
        return new BlockCoord(readInt(), readInt(), readInt());
    }
View Full Code Here

        int type = in.readUByte();
        int color = in.readUByte();
        int count = in.readUByte();
        int dir = type != 1 ? in.readUByte() : -1;

        BlockCoord bc = in.readCoord();
        if (type == 1)
            spawnType1(color, count, bc, world);
        else if (type == 2)
            spawnType2(color, count, dir, bc, world);
        else if (type == 3)
View Full Code Here

        }

        @Override
        public void onDestinationReached()
        {
            BlockCoord bc = particle.blockPosition();
            TMultiPart part = PRLib.getMultiPart(particle.worldObj, bc, 6);
            if (part instanceof PayloadPipePart && !(part instanceof TNetworkPipe))
            {
                PayloadPipePart pipe = (PayloadPipePart) part;
View Full Code Here

        }

        public int calcInputA()
        {
            int absDir = Rotation.rotateSide(gate.side(), gate.toAbsolute(2));
            BlockCoord pos = new BlockCoord(gate.tile()).offset(absDir);
            Block block = gate.world().getBlock(pos.x, pos.y, pos.z);
            if (block != null)
            {
                if (block.hasComparatorInputOverride())
                    return block.getComparatorInputOverride(gate.world(), pos.x, pos.y, pos.z, absDir^1);

                if (block.isNormalCube(gate.world(), pos.x, pos.y, pos.z))
                {
                    pos.offset(absDir);
                    block = gate.world().getBlock(pos.x, pos.y, pos.z);
                    if (block != null && block.hasComparatorInputOverride())
                        return block.getComparatorInputOverride(gate.world(), pos.x, pos.y, pos.z, absDir^1);
                }
            }
View Full Code Here

    public void notifyNeighbors(int mask)
    {
        int smask = 0;

        Block block = MultipartProxy.block();
        BlockCoord pos = new BlockCoord();
        BlockCoord pos2 = new BlockCoord();

        for (int r = 0; r < 4; r++)
            if ((mask&1<<r) != 0)
            {
                int absSide = Rotation.rotateSide(side(), r);
                pos.set(x(), y(), z()).offset(absSide);

                world().notifyBlockOfNeighborChange(pos.x, pos.y, pos.z, block);
                for (int s = 0; s < 6; s++)
                    if (s != (absSide^1) && (smask&1<<s) == 0)
                    {
                        pos2.set(pos).offset(s);
                        world().notifyBlockOfNeighborChange(pos2.x, pos2.y, pos2.z, block);
                    }

                smask |= 1<<absSide;
            }
View Full Code Here

        int i = RedstoneInteractions.getPowerTo(this, absDir)*17;
        if (i > 0 || getLogic().requireStrongInput(r))
            return i;

        BlockCoord pos = new BlockCoord(tile()).offset(absDir);
        if (world().isBlockNormalCubeDefault(pos.x, pos.y, pos.z, false))
            return world().getBlockPowerInput(pos.x, pos.y, pos.z)*17;

        return 0;
    }
View Full Code Here

TOP

Related Classes of codechicken.lib.vec.BlockCoord

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.