Package codechicken.lib.vec

Examples of codechicken.lib.vec.BlockCoord


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

        BlockCoord pos = new BlockCoord(tile()).offset(absDir);
        return world().getIndirectPowerLevelTo(pos.x, pos.y, pos.z, absDir)*17;
    }
View Full Code Here


    }

    public void propogateCorner(int r, TMultiPart prev, int mode)
    {
        int absDir = Rotation.rotateSide(side(), r);
        BlockCoord pos = new BlockCoord(tile()).offset(absDir).offset(side());

        TileMultipart t = PRLib.getMultipartTile(world(), pos);
        if (t != null)
        {
            TMultiPart tp = t.partMap(absDir^1);
View Full Code Here

    }

    public void propogateStraight(int r, TMultiPart prev, int mode)
    {
        int absDir = Rotation.rotateSide(side(), r);
        BlockCoord pos = new BlockCoord(tile()).offset(absDir);

        TileMultipart t = PRLib.getMultipartTile(world(), pos);
        if (t != null)
        {
            TMultiPart tp = t.partMap(side());
View Full Code Here

    }

    @Override
    public boolean connectStraightOverride(int absDir)
    {
        BlockCoord pos = new BlockCoord(tile()).offset(absDir);
        TileEntity t = world().getTileEntity(pos.x, pos.y, pos.z);
        if (t instanceof IBundledTile) return ((IBundledTile)t).canConnectBundled(absDir^1);
        if (APIImpl_Transmission.canConnectBundled(world(), pos, absDir^1)) return true;
        return false;
    }
View Full Code Here

    public byte[] calculateBundledCornerSignal(int r)
    {
        int absDir = Rotation.rotateSide(side(), r);

        BlockCoord pos = new BlockCoord(tile()).offset(absDir).offset(side());
        TileMultipart t = PRLib.getMultipartTile(world(), pos);
        if (t != null)
            return getBundledPartSignal(t.partMap(absDir^1), Rotation.rotationTo(absDir^1, side()^1));

        return null;
View Full Code Here

    public byte[] calculateBundledStraightSignal(int r)
    {
        int absDir = Rotation.rotateSide(side(), r);

        BlockCoord pos = new BlockCoord(tile()).offset(absDir);
        TileEntity t = world().getTileEntity(pos.x, pos.y, pos.z);
        if (t instanceof IBundledEmitter)
            return getBundledPartSignal(t, absDir^1);
        else if (t instanceof TileMultipart)
            return getBundledPartSignal(((TileMultipart)t).partMap(side()), (r+2)%4);
View Full Code Here

  {
    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();
    TMultiPart part = null;

    Block blk = null;
View Full Code Here

    }

    if ( myPart == null )
      myPart = (CableBusPart) PartRegistry.CableBusPart.construct( 0 );

    BlockCoord loc = new BlockCoord( myMP.xCoord, myMP.yCoord, myMP.zCoord );

    if ( myMP.canAddPart( myPart ) && Platform.isServer() )
    {
      myMP = TileMultipart.addPart( myMP.getWorldObj(), loc, myPart );
      hasPart = true;
View Full Code Here

  @Override
  public IPartHost getOrCreateHost(TileEntity tile)
  {
    try
    {
      BlockCoord loc = new BlockCoord( tile.xCoord, tile.yCoord, tile.zCoord );

      TileMultipart mp = TileMultipart.getOrConvertTile( tile.getWorldObj(), loc );
      if ( mp != null )
      {
        scala.collection.Iterator<TMultiPart> i = mp.partList().iterator();
View Full Code Here

    }

    @Override
    public boolean onItemUse(ItemStack stack, EntityPlayer player, World w, int x, int y, int z, int side, float hitX, float hitY, float hitZ){
        if(FMP.getMultiPart(w, new ChunkPosition(x, y, z), PartPressureTube.class) != null || w.getBlock(x, y, z) == Blockss.pressureTube) {
            BlockCoord pos = new BlockCoord(x, y, z);
            Vector3 vhit = new Vector3(hitX, hitY, hitZ);
            double d = getHitDepth(vhit, side);
            if(d < 1 && place(stack, player, pos, w, side, vhit)) {
                w.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, Block.soundTypeGlass.getStepResourcePath(), Block.soundTypeGlass.getVolume() * 5.0F, Block.soundTypeGlass.getPitch() * .9F);
                return true;
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.