Exemple #1
0
 @Override
 public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
   if (!world.isRemote) {
     TerminalData terminalData = TerminalData.get(player);
     if (!terminalData.isTerminalInstalled()) {
       player.addChatMessage(new ChatComponentTranslation("ac.terminal.notinstalled"));
     } else if (terminalData.isInstalled(app)) {
       player.addChatMessage(
           new ChatComponentTranslation("ac.terminal.app_alrdy_installed", app.getDisplayName()));
     } else {
       if (!player.capabilities.isCreativeMode) stack.stackSize--;
       terminalData.installApp(app);
       player.addChatMessage(
           new ChatComponentTranslation("ac.terminal.app_installed", app.getDisplayName()));
     }
   }
   return stack;
 }
 public void installApp(App app) {
   installApp(app.getID());
 }