Package net.minecraft.util

Examples of net.minecraft.util.ChatComponentTranslation


    }
    if(MainProxy.isServer(getWorld())) {
      if(settings == null || settings.openGui) {
        openGui(entityplayer);
      } else {
        entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
      }
    }
    return true;
  }
View Full Code Here


    CraftOnly;
  }
 
  public static void request(final EntityPlayer player, final ItemIdentifierStack stack, final CoreRoutedPipe pipe) {
    if(!pipe.useEnergy(5)) {
      player.addChatMessage(new ChatComponentTranslation("lp.misc.noenergy"));
      return;
    }
    RequestTree.request(stack.clone(), pipe, new RequestLog() {
      @Override
      public void handleMissingItems(Map<ItemIdentifier,Integer> items) {
View Full Code Here

  }
 

  public static void requestList(final EntityPlayer player, final List<ItemIdentifierStack> list, CoreRoutedPipe pipe) {
    if(!pipe.useEnergy(5)) {
      player.addChatMessage(new ChatComponentTranslation("lp.misc.noenergy"));
      return;
    }
    RequestTree.request(list, pipe, new RequestLog() {
      @Override
      public void handleMissingItems(Map<ItemIdentifier,Integer> items) {
View Full Code Here

    },RequestTree.defaultRequestFlags, null);
  }

  public static void requestMacrolist(NBTTagCompound itemlist, final CoreRoutedPipe requester, final EntityPlayer player) {
    if(!requester.useEnergy(5)) {
      player.addChatMessage(new ChatComponentTranslation("lp.misc.noenergy"));
      return;
    }
    NBTTagList list = itemlist.getTagList("inventar", 10);
    final List<ItemIdentifierStack> transaction = new ArrayList<ItemIdentifierStack>(list.tagCount());
    for(int i = 0;i < list.tagCount();i++) {
View Full Code Here

    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(OrdererContent.class).setIdentSet(_allItems), player);
  }

  public static void requestFluid(final EntityPlayer player, final ItemIdentifierStack stack, CoreRoutedPipe pipe, IRequestFluid requester) {
    if(!pipe.useEnergy(10)) {
      player.addChatMessage(new ChatComponentTranslation("lp.misc.noenergy"));
      return;
    }
   
    RequestTree.requestFluid(FluidIdentifier.get(stack.getItem()) , stack.getStackSize(), requester, new RequestLog() {
      @Override
View Full Code Here

    if(entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().getItem() == LogisticsPipes.LogisticsRemoteOrderer) {
      if(MainProxy.isServer(getWorld())) {
        if (settings == null || settings.openRequest) {
          ItemStack orderer = entityplayer.getCurrentEquippedItem();
          RemoteOrderer.connectToPipe(orderer, this);
          entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.connectedtopipe"));
        } else {
          entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
        }
      }
      return true;
    }
    return false;
View Full Code Here

    case 1: //-
      inv.decrStackSize(0, 1);
      break;
    case 2: //+
      if(!useEnergy(10)) {
        player.addChatComponentMessage(new ChatComponentTranslation("lp.misc.noenergy"));
        return;
      }
      if(inv.getStackInSlot(0) == null) {
        ItemStack stack = new ItemStack(LogisticsPipes.LogisticsItemCard, 1, LogisticsItemCard.SEC_CARD);
        stack.setTagCompound(new NBTTagCompound());
        stack.getTagCompound().setString("UUID", getSecId().toString());
        inv.setInventorySlotContents(0, stack);
      } else {
        ItemStack slot=inv.getStackInSlot(0);
        if(slot.stackSize < 64) {
          slot.stackSize++;
          slot.setTagCompound(new NBTTagCompound());
          slot.getTagCompound().setString("UUID", getSecId().toString());
          inv.setInventorySlotContents(0, slot);
        }
      }
      break;
    case 3: //++
      if(!useEnergy(640)) {
        player.addChatComponentMessage(new ChatComponentTranslation("lp.misc.noenergy"));
        return;
      }
      ItemStack stack = new ItemStack(LogisticsPipes.LogisticsItemCard, 64, LogisticsItemCard.SEC_CARD);
      stack.setTagCompound(new NBTTagCompound());
      stack.getTagCompound().setString("UUID", getSecId().toString());
View Full Code Here

  }

  public SecuritySettings getSecuritySettingsForPlayer(EntityPlayer entityplayer, boolean usePower) {
    if(byPassed.contains(entityplayer)) return allowAll;
    if(usePower && !useEnergy(10)) {
      entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.misc.noenergy"));
      return new SecuritySettings("No Energy");
    }
    SecuritySettings setting = settingsList.get(entityplayer.getDisplayName());
    //TODO Change to GameProfile based Authentication
    if(setting == null) {
View Full Code Here

    if (MainProxy.isPipeControllerEquipped(entityplayer)) {
      if(MainProxy.isServer(entityplayer.worldObj)) {
        if(settings == null || settings.openNetworkMonitor) {
          NewGuiHandler.getGui(PipeController.class).setTilePos(container).open(entityplayer);
        } else {
          entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
        }
      }
      return true;
    }

    if(handleClick(entityplayer, settings)) {
      return true;
    }

    if (entityplayer.getCurrentEquippedItem() == null) {
      if (!entityplayer.isSneaking()) return false;
      if(MainProxy.isClient(entityplayer.worldObj)) {
        if(!LogisticsHUDRenderer.instance().hasLasers()) {
          MainProxy.sendPacketToServer(PacketHandler.getPacket(RequestRoutingLasersPacket.class).setPosX(getX()).setPosY(getY()).setPosZ(getZ()));
        } else {
          LogisticsHUDRenderer.instance().resetLasers();
        }
      }
      if (LPConstants.DEBUG) {
        doDebugStuff(entityplayer);
      }
      return true;
    }

    if (entityplayer.getCurrentEquippedItem().getItem() == LogisticsPipes.LogisticsRemoteOrderer) {
      if(MainProxy.isServer(entityplayer.worldObj)) {
        if(settings == null || settings.openRequest) {
          entityplayer.openGui(LogisticsPipes.instance, GuiIDs.GUI_Normal_Orderer_ID, getWorld(), getX(), getY(), getZ());
        } else {
          entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
        }
      }
      return true;
    }

    if (SimpleServiceLocator.toolWrenchHandler.isWrenchEquipped(entityplayer) && SimpleServiceLocator.toolWrenchHandler.canWrench(entityplayer, this.getX(), this.getY(), this.getZ())) {
      if(MainProxy.isServer(entityplayer.worldObj)) {
        if (settings == null || settings.openGui) {
          if (getLogisticsModule() != null && getLogisticsModule() instanceof LogisticsGuiModule) {
            ((LogisticsGuiModule)getLogisticsModule()).getPipeGuiProviderForModule().setTilePos(this.container).open(entityplayer);
          } else {
            onWrenchClicked(entityplayer);
          }
        } else {
          entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
        }
      }
      SimpleServiceLocator.toolWrenchHandler.wrenchUsed(entityplayer, this.getX(), this.getY(), this.getZ());
      return true;
    }
View Full Code Here

          break;
        }
      }
    }
    if(result == null) {
      player.addChatComponentMessage(new ChatComponentTranslation("lp.chat.slotnotfound"));
    }
    int resultIndex = -1;
    if(resultIndex == -1) {
      ItemStack content = result.getStack();
      if(content != null) {
        for(int i=0;i<util.getSizeInventory();i++) {
          if(content == util.getStackInSlot(i)) {
            resultIndex = i;
            break;
          }
        }
      } else {
        ItemStack dummyStack = new ItemStack(Blocks.stone, 0, 0);
        NBTTagCompound nbt = new NBTTagCompound();
        nbt.setBoolean("LPStackFinderBoolean", true); //Make it unique
        dummyStack.setTagCompound(nbt);
        result.putStack(dummyStack);
        for(int i=0;i < util.getSizeInventory();i++) {
          if(dummyStack == util.getStackInSlot(i)) {
            resultIndex = i;
            break;
          }
        }
        if(resultIndex == -1) {
          for(int i=0;i < util.getSizeInventory();i++) {
            ItemStack stack = util.getStackInSlot(i);
            if(stack == null) continue;
            if(ItemIdentifier.get(stack).equals(ItemIdentifier.get(dummyStack)) && stack.stackSize == dummyStack.stackSize) {
              resultIndex = i;
              break;
            }
          }
        }
        result.putStack(null);
      }
    }
    if(resultIndex == -1) {
      player.addChatComponentMessage(new ChatComponentTranslation("lp.chat.slotnotfound"));
    } else {
      //Copy pipe to coordinates to use the getPipe method
      setPosX(getPipePosX());
      setPosY(getPipePosY());
      setPosZ(getPipePosZ());
View Full Code Here

TOP

Related Classes of net.minecraft.util.ChatComponentTranslation

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.