Package mekanism.api

Examples of mekanism.api.Coord4D


    }
 
    @Override
    public void fromBytes(ByteBuf dataStream)
    {
      coord4D = new Coord4D(dataStream.readInt(), dataStream.readInt(), dataStream.readInt(), dataStream.readInt());
 
      type = dataStream.readByte();
      delete = dataStream.readBoolean();
 
      if(type == 0)
View Full Code Here


      GL11.glColor4f(EnumColor.PURPLE.getColor(0), EnumColor.PURPLE.getColor(1), EnumColor.PURPLE.getColor(2), 0.75F);

      bindTexture(MekanismRenderer.getBlocksTexture());
      GL11.glTranslatef((float)x, (float)y, (float)z);

      Coord4D obj = Coord4D.get(tileEntity).getFromSide(ForgeDirection.WEST);
      int type = 0;

      if(obj.getBlock(tileEntity.getWorldObj()) == Mekanism.BasicBlock && obj.getMetadata(tileEntity.getWorldObj()) == 7)
      {
        type = 1;
      }

      int display = getOverlayDisplay(type).display;
View Full Code Here

 
  protected void clearAround(IGridTransmitter<N> transmitter)
  {
    for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
    {
      Coord4D coord = Coord4D.get(transmitter.getTile()).getFromSide(side);
     
      if(possibleAcceptors.containsKey(coord))
      {
        clearIfNecessary(coord, transmitter, side.getOpposite());
      }
View Full Code Here

    {
      deregister();
      return null;
    }
   
    Coord4D initCoord = Coord4D.get(transmitters.iterator().next().getTile());
   
    int minX = initCoord.xCoord;
    int minY = initCoord.yCoord;
    int minZ = initCoord.zCoord;
    int maxX = initCoord.xCoord;
    int maxY = initCoord.yCoord;
    int maxZ = initCoord.zCoord;
   
    for(IGridTransmitter transmitter : transmitters)
    {
      Coord4D coord = Coord4D.get(transmitter.getTile());
     
      if(coord.xCoord < minX) minX = coord.xCoord;
      if(coord.yCoord < minY) minY = coord.yCoord;
      if(coord.zCoord < minZ) minZ = coord.zCoord;
      if(coord.xCoord > maxX) maxX = coord.xCoord;
View Full Code Here

      if(itemStack != null)
      {
        amount = Integer.toString(tileEntity.clientAmount);
      }

      Coord4D obj = Coord4D.get(tileEntity).getFromSide(ForgeDirection.getOrientation(tileEntity.facing));

      if(tileEntity.getWorldObj().getBlock(obj.xCoord, obj.yCoord, obj.zCoord).isSideSolid(tileEntity.getWorldObj(), obj.xCoord, obj.yCoord, obj.zCoord, ForgeDirection.getOrientation(tileEntity.facing).getOpposite()))
      {
        return;
      }
View Full Code Here

        toIgnore.add(location);
      }

      for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
      {
        Coord4D obj = location.getFromSide(direction);

        if(!iterated.contains(obj) && !toIgnore.contains(obj))
        {
          TileEntity tileEntity = obj.getTileEntity(worldObj);

          if(!(tileEntity instanceof IBlockableConnection) || ((IBlockableConnection)tileEntity).canConnectMutual(direction.getOpposite()))
          {
            if(TransmissionType.checkTransmissionType(tileEntity, transmissionType, location.getTileEntity(worldObj)))
            {
View Full Code Here

              return itemstack;
          }
          else {
              if(pos.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
              {
                Coord4D coord = new Coord4D(pos.blockX, pos.blockY, pos.blockZ, world.provider.dimensionId);
 
                  if(!world.canMineBlock(entityplayer, coord.xCoord, coord.yCoord, coord.zCoord))
                  {
                      return itemstack;
                  }
 
                  if(!entityplayer.isSneaking())
                  {
                      if(!entityplayer.canPlayerEdit(coord.xCoord, coord.yCoord, coord.zCoord, pos.sideHit, itemstack))
                      {
                          return itemstack;
                      }
                     
                      FluidStack fluid = MekanismUtils.getFluid(world, coord.xCoord, coord.yCoord, coord.zCoord);
                     
                      if(fluid != null && (getFluidStack(itemstack) == null || getFluidStack(itemstack).isFluidEqual(fluid)))
                      {
                      int needed = TileEntityPortableTank.MAX_FLUID-(getFluidStack(itemstack) != null ? getFluidStack(itemstack).amount : 0);
                     
                      if(fluid.amount > needed)
                      {
                        return itemstack;
                      }
                     
                      if(getFluidStack(itemstack) == null)
                      {
                        setFluidStack(fluid, itemstack);
                      }
                      else {
                        FluidStack newStack = getFluidStack(itemstack);
                        newStack.amount += fluid.amount;
                        setFluidStack(newStack, itemstack);
                      }
                     
                      world.setBlockToAir(coord.xCoord, coord.yCoord, coord.zCoord);
                      }
                  }
                  else {
                  FluidStack stored = getFluidStack(itemstack);
               
                if(stored == null || stored.amount < FluidContainerRegistry.BUCKET_VOLUME)
                {
                  return itemstack;
                }
               
                Coord4D trans = coord.getFromSide(ForgeDirection.getOrientation(pos.sideHit));

                      if(!entityplayer.canPlayerEdit(trans.xCoord, trans.yCoord, trans.zCoord, pos.sideHit, itemstack))
                      {
                          return itemstack;
                      }
View Full Code Here

    return false;
  }

  public boolean canStay()
  {
    Coord4D adj = Coord4D.get(tile()).getFromSide(side);
    return world().isSideSolid(adj.xCoord, adj.yCoord, adj.zCoord, side.getOpposite()) || tile().partMap(side.ordinal()) instanceof HollowMicroblock;
  }
View Full Code Here

      {
        int xPos = MathHelper.floor_double(pos.blockX);
        int yPos = MathHelper.floor_double(pos.blockY);
        int zPos = MathHelper.floor_double(pos.blockZ);

        Coord4D obj = new Coord4D(xPos, yPos, zPos, transporter.world().provider.dimensionId);

        if(obj.equals(Coord4D.get(transporter.tile())))
        {
          int mode = ((PartDiversionTransporter)transporter).modes[pos.sideHit];
          ForgeDirection side = ForgeDirection.getOrientation(pos.sideHit);

          pushTransporter();
View Full Code Here

        {
          int x = MathHelper.floor_double(pos.blockX);
          int y = MathHelper.floor_double(pos.blockY);
          int z = MathHelper.floor_double(pos.blockZ);
 
          Coord4D obj = new Coord4D(x, y, z, world.provider.dimensionId);
 
          if(Mekanism.debug && mc.currentScreen == null && !mc.gameSettings.showDebugInfo)
          {
            String tileDisplay = "";
 
            if(obj.getTileEntity(world) != null)
            {
              if(obj.getTileEntity(world).getClass() != null)
              {
                tileDisplay = obj.getTileEntity(world).getClass().getSimpleName();
              }
            }
 
            font.drawStringWithShadow("Block: " + obj.getBlock(world).getUnlocalizedName(), 1, 1, 0x404040);
            font.drawStringWithShadow("Metadata: " + obj.getMetadata(world), 1, 10, 0x404040);
            font.drawStringWithShadow("Location: " + MekanismUtils.getCoordDisplay(obj), 1, 19, 0x404040);
            font.drawStringWithShadow("TileEntity: " + tileDisplay, 1, 28, 0x404040);
            font.drawStringWithShadow("Side: " + pos.sideHit, 1, 37, 0x404040);
          }
        }
View Full Code Here

TOP

Related Classes of mekanism.api.Coord4D

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.