Package crazypants.enderio.conduit

Examples of crazypants.enderio.conduit.IConduitBundle


  public static void doFluidLevelUpdate(int x, int y, int z, PacketFluidLevel pkt) {
    TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(x, y, z);
    if(pkt.tc == null || !(tile instanceof IConduitBundle)) {
      return;
    }
    IConduitBundle bundle = (IConduitBundle) tile;
    ILiquidConduit con = bundle.getConduit(ILiquidConduit.class);
    if(con == null) {
      return;
    }
    con.readFromNBT(pkt.tc, TileConduitBundle.NBT_VERSION);
  }
View Full Code Here


  public static void doGasLevelUpdate(int x, int y, int z, PacketGasLevel pkt) {
    TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(x, y, z);
    if(pkt.tc == null || !(tile instanceof IConduitBundle)) {
      return;
    }
    IConduitBundle bundle = (IConduitBundle) tile;
    IGasConduit con = bundle.getConduit(IGasConduit.class);
    if(con == null) {
      return;
    }
    con.readFromNBT(pkt.tc, TileConduitBundle.NBT_VERSION);
  }
View Full Code Here

    TileEntity te = world.getTileEntity(x, y, z);
    if(!(te instanceof IConduitBundle)) {
      return false;
    }
    IConduitBundle cb = (IConduitBundle)te;   
    if(itemStack.getItemDamage() == 0) {     
      if(PacketConduitProbe.canCreatePacket(world, x, y, z)) {
        if(world.isRemote) {
          PacketHandler.INSTANCE.sendToServer(new PacketConduitProbe(x, y, z, side));
        }
View Full Code Here

  }

  @Override
  public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
    if(accessor.getBlock() instanceof BlockConduitBundle && config.getConfig("facades.hidden")) {
      IConduitBundle bundle = (IConduitBundle) accessor.getTileEntity();
      if(bundle.hasFacade()) {
        return new ItemStack(bundle.getFacadeId(), 1, bundle.getFacadeMetadata());
      }
    } else if(accessor.getBlock() instanceof BlockDarkSteelAnvil) {
      return accessor.getBlock().getPickBlock(accessor.getPosition(), accessor.getWorld(), accessor.getPosition().blockX, accessor.getPosition().blockY,
          accessor.getPosition().blockZ);
    }
View Full Code Here

          && mode != IoMode.PULL && mode != IoMode.DISABLED
          && powerInterface.getMinEnergyReceived(receptor.fromDir.getOpposite()) <= canTransmit) {
        double used;
        if(receptor.receptor.getDelegate() instanceof IConduitBundle && !isCreative) {
          //All other power transfer is handled by the conduit network
          IConduitBundle bundle = (IConduitBundle) receptor.receptor.getDelegate();
          IPowerConduit conduit = bundle.getConduit(IPowerConduit.class);
          if(conduit != null && conduit.getConnectionMode(receptor.fromDir.getOpposite()) == ConnectionMode.INPUT) {
            used = powerInterface.recieveEnergy(receptor.fromDir.getOpposite(), canTransmit);
          } else {
            used = 0;
          }
View Full Code Here

    TileEntity te = world.getTileEntity(x, y, z);
    if( ! (te instanceof IConduitBundle)) {
      return null;
    }
   
    IConduitBundle bundle = (IConduitBundle)te;
    return (T) bundle.getConduit(getConType());
  }
View Full Code Here

  public ConduitBundleRenderer(float conduitScale) {
  }

  @Override
  public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick) {
    IConduitBundle bundle = (IConduitBundle) te;
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
    if(bundle.hasFacade() && !ConduitUtil.isFacadeHidden(bundle, player)) {
      return;
    }

    float brightness = -1;
    for (IConduit con : bundle.getConduits()) {
      if(ConduitUtil.renderConduit(player, con)) {
        ConduitRenderer renderer = EnderIO.proxy.getRendererForConduit(con);
        if(renderer.isDynamic()) {
          if(brightness == -1) {
            BlockCoord loc = bundle.getLocation();
            brightness = bundle.getEntity().getWorldObj().getLightBrightnessForSkyBlocks(loc.x, loc.y, loc.z, 0);

            RenderUtil.bindBlockTexture();

            GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
            GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
View Full Code Here

  }

  @Override
  public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rb) {

    IConduitBundle bundle = (IConduitBundle) world.getTileEntity(x, y, z);
    EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;

    boolean renderConduit = renderFacade(x, y, z, rb, bundle, player);   

    if(renderConduit) {
      BlockCoord loc = bundle.getLocation();
      float brightness;
      if(!Config.updateLightingWhenHidingFacades && bundle.hasFacade() && ConduitUtil.isFacadeHidden(bundle, player)) {
        brightness = 15 << 20 | 15 << 4;
      } else {
        brightness = bundle.getEntity().getWorldObj().getLightBrightnessForSkyBlocks(loc.x, loc.y, loc.z, 0);
      }
      renderConduits(bundle, x, y, z, 0, brightness);
    }

    return true;
View Full Code Here

    if(player.canPlayerEdit(placeX, placeY, placeZ, side, itemStack) && world.isAirBlock(placeX, placeY, placeZ)
        && PainterUtil.getSourceBlock(itemStack) != null) {

      world.setBlock(placeX, placeY, placeZ, EnderIO.blockConduitBundle);
      IConduitBundle bundle = (IConduitBundle) world.getTileEntity(placeX, placeY, placeZ);
      bundle.setFacadeId(PainterUtil.getSourceBlock(itemStack));
      bundle.setFacadeMetadata(PainterUtil.getSourceBlockMetadata(itemStack));
      if(!player.capabilities.isCreativeMode) {
        itemStack.stackSize--;
      }
      return true;
    }
View Full Code Here

  public IIcon getIcon(IBlockAccess ba, int x, int y, int z, int side) {
    TileEntity te = ba.getTileEntity(x, y, z);
    if(!(te instanceof IConduitBundle)) {
      return blockIcon;
    }
    IConduitBundle cb = (IConduitBundle) te;
    Block block = cb.getFacadeId();
    if(block != null) {
      int meta = cb.getFacadeMetadata();
      return block.getIcon(side, meta);
    }
    return blockIcon;
  }
View Full Code Here

TOP

Related Classes of crazypants.enderio.conduit.IConduitBundle

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.