Package net.minecraft.command

Examples of net.minecraft.command.WrongUsageException


                    return;
                }

            }

            throw new WrongUsageException(GCCoreUtil.translateWithFormat("commands.gcenergyunits.invalidUnits", this.getCommandUsage(icommandsender)), new Object[0]);
        }

        throw new WrongUsageException(GCCoreUtil.translateWithFormat("commands.gcenergyunits.noUnits", this.getCommandUsage(icommandsender)), new Object[0]);
    }
View Full Code Here


                {
                    GCPlayerStats stats = GCPlayerStats.get(playerBase);

                    if (stats.spaceStationDimensionID <= 0)
                    {
                        throw new WrongUsageException(GCCoreUtil.translate("commands.ssinvite.notFound"), new Object[0]);
                    }
                    else
                    {
                        final SpaceStationWorldData data = SpaceStationWorldData.getStationData(playerBase.worldObj, stats.spaceStationDimensionID, playerBase);

                        String str = null;
                        for (String player : data.getAllowedPlayers())
                        {
                            if (player.equalsIgnoreCase(var3))
                            {
                                str = player;
                                break;
                            }
                        }

                        if (str != null)
                        {
                            data.getAllowedPlayers().remove(str);
                            data.markDirty();
                        }
                        else
                        {
                            throw new CommandException(GCCoreUtil.translateWithFormat("commands.ssuninvite.noPlayer", "\"" + var3 + "\""), new Object[0]);
                        }
                    }
                }
            }
            catch (final Exception var6)
            {
                throw new CommandException(var6.getMessage(), new Object[0]);
            }

        }
        else
        {
            throw new WrongUsageException(GCCoreUtil.translateWithFormat("commands.ssinvite.wrongUsage", this.getCommandUsage(icommandsender)), new Object[0]);
        }

        if (playerBase != null)
        {
            playerBase.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.spacestation.removesuccess", var3)));
View Full Code Here

                {
                    GCPlayerStats stats = GCPlayerStats.get(playerBase);

                    if (stats.spaceStationDimensionID <= 0)
                    {
                        throw new WrongUsageException(GCCoreUtil.translate("commands.ssinvite.notFound"), new Object[0]);
                    }
                    else
                    {
                        final SpaceStationWorldData data = SpaceStationWorldData.getStationData(playerBase.worldObj, stats.spaceStationDimensionID, playerBase);

                        if (!data.getAllowedPlayers().contains(var3))
                        {
                            data.getAllowedPlayers().add(var3);
                            data.markDirty();
                        }
                    }

                    final EntityPlayerMP playerToAdd = PlayerUtil.getPlayerBaseServerFromPlayerUsername(var3, true);

                    if (playerToAdd != null)
                    {
                        playerToAdd.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.spacestation.added", playerBase.getGameProfile().getName())));
                    }
                }
            }
            catch (final Exception var6)
            {
                throw new CommandException(var6.getMessage(), new Object[0]);
            }

        }
        else
        {
            throw new WrongUsageException(GCCoreUtil.translateWithFormat("commands.ssinvite.wrongUsage", this.getCommandUsage(icommandsender)), new Object[0]);
        }

        if (playerBase != null)
        {
            playerBase.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.spacestation.addsuccess", var3)));
View Full Code Here

                            gcInventory.setInventorySlotContents(i, null);
                        }
                    }
                    else
                    {
                        throw new WrongUsageException("Invalid GCInv command. Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
                    }
                }
                else
                {
                    // Special rule for 'restore' command if player not found -
                    // look to see if the player is offline (i.e. had a saved
                    // inventory already)
                    if (astring[0].equalsIgnoreCase("restore"))
                    {
                        ItemStack[] saveinv = CommandGCInv.savedata.get(astring[1].toLowerCase());
                        if (saveinv != null)
                        {
                            System.out.println("[GCInv] Restore command for offline player " + astring[1] + ", setting to restore GCInv on next login.");
                            CommandGCInv.dontload.remove(astring[1].toLowerCase()); // Now
                            // it
                            // can
                            // autoload
                            // on
                            // next
                            // player
                            // logon
                            return;
                        }
                    }

                    // No player found, and not a 'restore' command
                    if (astring[0].equalsIgnoreCase("clear") || astring[0].equalsIgnoreCase("save") || astring[0].equalsIgnoreCase("drop"))
                    {
                        System.out.println("GCInv command: player " + astring[1] + " not found.");
                    }
                    else
                    {
                        throw new WrongUsageException("Invalid GCInv command. Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
                    }
                }
            }
            catch (final Exception e)
            {
                System.out.println(e.toString());
                e.printStackTrace();
            }
        }
        else
        {
            throw new WrongUsageException("Not enough command arguments! Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
        }
    }
View Full Code Here

                throw new CommandException(var6.getMessage(), new Object[0]);
            }
        }
        else
        {
            throw new WrongUsageException(GCCoreUtil.translateWithFormat("commands.joinrace.noTeam", this.getCommandUsage(icommandsender)), new Object[0]);
        }
    }
View Full Code Here

    {
        EntityPlayerMP playerBase;

        if (astring.length > 1)
        {
            throw new WrongUsageException("Not enough command arguments! Usage: " + this.getCommandUsage(icommandsender), new Object[0]);
        }
        else
        {
            try
            {
View Full Code Here

                throw new CommandException(var6.getMessage(), new Object[0]);
            }
        }
        else
        {
            throw new WrongUsageException(GCCoreUtil.translateWithFormat("commands.dimensiontp.tooMany", this.getCommandUsage(icommandsender)), new Object[0]);
        }
    }
View Full Code Here

                }
            }
        }
        else
        {
            throw new WrongUsageException(getCommandUsage(icommandsender));
        }
    }
View Full Code Here

  @Override
  public void processCommand(ICommandSender sender, String[] arguments) {

    if (arguments.length <= 0) {
      throw new WrongUsageException("Type '" + getCommandUsage(sender) + "' for help.");
    }
    if (commands.containsKey(arguments[0])) {
      commands.get(arguments[0]).handleCommand(sender, arguments);
      return;
    }
    throw new WrongUsageException("Type '" + getCommandUsage(sender) + "' for help.");
  }
View Full Code Here

    @Override
  public void processCommand(ICommandSender var1, String[] var2)
    {
        if (var2.length != 6)
        {
            throw new WrongUsageException("/drop <X> <Y> <Z> <ItemID> <Meta> <Qty>", new Object[0]);
        }
        Object var3 = null;
        int var4 = (int) this.func_82368_a(var1, 0.0D, var2[0]);
        int var5 = (int) this.func_82367_a(var1, 0.0D, var2[1], 0, 0);
        int var6 = (int) this.func_82368_a(var1, 0.0D, var2[2]);
View Full Code Here

TOP

Related Classes of net.minecraft.command.WrongUsageException

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.