Package crazypants.enderio.machine.transceiver

Examples of crazypants.enderio.machine.transceiver.TileTransceiver


  }

  @Override
  public void renderTileEntityAt(TileEntity te, double x, double y, double z, float tick) {

    TileTransceiver trans = (TileTransceiver) te;

    GL11.glEnable(GL12.GL_RESCALE_NORMAL);

    float f = trans.getWorldObj().getBlockLightValue(te.xCoord, te.yCoord, te.zCoord);
    int l = trans.getWorldObj().getLightBrightnessForSkyBlocks(te.xCoord, te.yCoord, te.zCoord, 0);
    int l1 = l % 65536;
    int l2 = l / 65536;
    Tessellator.instance.setColorOpaque_F(f, f, f);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) l1, (float) l2);

    model.render(trans, x, y, z);
    if(trans.isActive()) {
      renderPower(te.getWorldObj(), x, y, z, true);
    }
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x, (float) y, (float) z);
    GL11.glColor3f(1, 1, 1);
    GL11.glDisable(GL11.GL_LIGHTING);
    Tessellator.instance.startDrawingQuads();
    Tessellator.instance.setColorOpaque_F(f, f, f);
   

    RenderUtil.bindBlockTexture();
    CustomRenderBlocks rb = new CustomRenderBlocks(te.getWorldObj());
    double scale = 0.88;
    BoundingBox pushPullBounds = BoundingBox.UNIT_CUBE.scale(scale, scale, scale);
    BoundingBox disabledBounds = BoundingBox.UNIT_CUBE.scale(1.01, 1.01, 1.01);
   
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      IoMode mode = trans.getIoMode(dir);
      if(mode != null) {
        if(mode == IoMode.DISABLED) {
          rb.setRenderBounds(disabledBounds.minX, disabledBounds.minY, disabledBounds.minZ,
              disabledBounds.maxX, disabledBounds.maxY, disabledBounds.maxZ);
        } else {
View Full Code Here


    }
    TileEntity te = world.getTileEntity(x, y - 1, z);
    if(!(te instanceof TileTransceiver)) {
      return;
    }
    TileTransceiver ter = (TileTransceiver) te;
    if(ter.getRailController().isRecievedCart(cart)) {
      return;
    }
    tryTeleport(world, cart, x, y, z);
  }
View Full Code Here

    TileEntity te = world.getTileEntity(x, y - 1, z);
    if(!(te instanceof TileTransceiver)) {
      return;
    }
    TileTransceiver sender = (TileTransceiver) te;
    if(!sender.isRedstoneChecksPassed()) {
      return;
    }
    if(!sender.hasPower()) {
      return;
    }
    List<Channel> sendChannels = sender.getSendChannels(ChannelType.RAIL);
    for (Channel channel : sendChannels) {
      RoundRobinIterator<TileTransceiver> iter = ServerChannelRegister.instance.getIterator(channel);
      for (TileTransceiver reciever : iter) {
        if(isValidDestination(sender, channel, reciever)) {
          int requiredPower = getPowerRequired(cart, sender, reciever);
          if(sender.getEnergyStored() >= requiredPower) {
            if(teleportCart(world, cart, sender, reciever)) {
              sender.usePower(requiredPower);
              return;
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of crazypants.enderio.machine.transceiver.TileTransceiver

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.