Package logisticspipes.pipes

Examples of logisticspipes.pipes.PipeItemsRemoteOrdererLogistics


 
  @Override
  public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
    if(par1ItemStack == null) { return null; }
    if(!par1ItemStack.hasTagCompound()) { return par1ItemStack; }
    PipeItemsRemoteOrdererLogistics pipe = getPipe(par1ItemStack);
    if(pipe != null) {
      if(MainProxy.isServer(par3EntityPlayer.worldObj)) {
        int energyUse = 0;
        if(pipe.getWorld() != par3EntityPlayer.worldObj) energyUse += 2500;
        energyUse += Math.sqrt(Math.pow(pipe.getX() - par3EntityPlayer.posX, 2) + Math.pow(pipe.getY() - par3EntityPlayer.posY, 2) + Math.pow(pipe.getZ() - par3EntityPlayer.posZ, 2));
        if(pipe.useEnergy(energyUse)) {
          MainProxy.sendPacketToPlayer(PacketHandler.getPacket(RequestPipeDimension.class).setInteger(MainProxy.getDimensionForWorld(pipe.getWorld())), par3EntityPlayer);
          par3EntityPlayer.openGui(LogisticsPipes.instance, GuiIDs.GUI_Normal_Orderer_ID, pipe.getWorld(), pipe.getX(), pipe.getY(), pipe.getZ());
         
        }
      }
    }
    return par1ItemStack;
View Full Code Here

TOP

Related Classes of logisticspipes.pipes.PipeItemsRemoteOrdererLogistics

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.