Results 1 to 3 of 3
  1. #1
    DrkMatr1984 is offline Member
    Join Date
    Sep 2013
    Location
    Lancaster, PA
    Posts
    2
    Rep Power
    0

    Default Trying to Compile this Craftbukkit Mod

    Hi guys! I am new to the forum and have a question about a craftbukkit mod I recently acquired the source code to and am having trouble compiling. I'm not entirely new to java and programming, but this eludes me. Here is a link to the source code :
    https://github.com/DrkMatr1984/Boatmania

    *************** This is what seems to be the problem : **********************

    /* */ public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
    /* */ {
    /* 78 */ if ((label.equalsIgnoreCase("boatmania")) || (label.equalsIgnoreCase("bm"))) {
    /* 79 */ if ((args.length >= 1) && (
    /* 80 */ (args[0].equalsIgnoreCase("destroy")) ||
    /* 81 */ (args[0].equalsIgnoreCase("d")) ||
    /* 82 */ (args[0].equalsIgnoreCase("remove")) ||
    /* 83 */ (args[0].equalsIgnoreCase("r"))))
    /* */ {
    /* */ Object object2;
    /* 84 */ if (args.length == 2) {
    /* 85 */ if (!sender.hasPermission("boatmania.destroy." + args[1])) {
    /* 86 */ sender.sendMessage(PRE_MESSAGE_RED + "No Permissions!");
    /* 87 */ return false;
    /* */ }
    /* */
    /* 90 */ World world = getServer().getWorld(args[1]);
    /* */
    /* 92 */ Collection boatList = world.getEntitiesByClass(Boat.class);
    /* 93 */ boatList2 = boatList.toArray();
    /* 94 */ i = 0;
    /* 95 */ for (object2 : boatList2) {
    /* 96 */ ((Boat)object2).remove();
    /* 97 */ i++;
    /* */ }
    /* 99 */ sender.sendMessage(PRE_MESSAGE_GREEN + i + " Boats on " + ChatColor.YELLOW + args[1] + ChatColor.GREEN + " destoyed!");
    /* */
    /* 101 */ return true;
    /* */ }
    /* 103 */ if (!sender.hasPermission("boatmania.destroy.all")) {
    /* 104 */ sender.sendMessage(PRE_MESSAGE_RED + "No Permissions!");
    /* 105 */ return false;
    /* */ }
    /* */
    /* 108 */ Object[] worlds = getServer().getWorlds().toArray();
    /* 109 */ int i = (object2 = worlds).length; for (Object[] boatList2 = 0; boatList2 < i; boatList2++) { Object object = object2[boatList2];
    /* */
    /* 111 */ Collection boatList = ((World)object).getEntitiesByClass(Boat.class);
    /* 112 */ Object[] boatList2 = boatList.toArray();
    /* 113 */ int i = 0;
    /* 114 */ for (Object object2 : boatList2) {
    /* 115 */ ((Boat)object2).remove();
    /* 116 */ i++;
    /* */ }
    /* 118 */ sender.sendMessage(PRE_MESSAGE_GREEN + i + " Boats on " + ChatColor.YELLOW + ((World)object).getName() + ChatColor.GREEN + " destoyed!");
    /* */ }
    /* */
    /* 122 */ return true;
    /* */ }

    **********************

    And this is the error message I am getting :

    C:\Users\DrkMatr\workspace\BoatMania>gradle build
    :compileJava
    C:\Users\DrkMatr\workspace\BoatMania\src\me\irobin 591\boatmania\BoatMania.java:8
    7: error: not a statement
    /* 95 */ for (object2 : boatList2) {
    ^
    C:\Users\DrkMatr\workspace\BoatMania\src\me\irobin 591\boatmania\BoatMania.java:8
    7: error: ';' expected
    /* 95 */ for (object2 : boatList2) {
    ^
    C:\Users\DrkMatr\workspace\BoatMania\src\me\irobin 591\boatmania\BoatMania.java:8
    7: error: illegal start of expression
    /* 95 */ for (object2 : boatList2) {
    ^
    C:\Users\DrkMatr\workspace\BoatMania\src\me\irobin 591\boatmania\BoatMania.java:8
    7: error: ';' expected
    /* 95 */ for (object2 : boatList2) {
    ^
    4 errors
    :compileJava FAILED

    FAILURE: Build failed with an exception.


    Any help is appreciated!

  2. #2
    pj6444 is offline Senior Member
    Join Date
    Jan 2013
    Posts
    165
    Rep Power
    2

    Default Re: Trying to Compile this Craftbukkit Mod

    I think you should probably go to the bukkit forums, because most of us here do not know the bukkit api.

  3. #3
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,148
    Rep Power
    6

    Default Re: Trying to Compile this Craftbukkit Mod

    Quote Originally Posted by pj6444 View Post
    I think you should probably go to the bukkit forums, because most of us here do not know the bukkit api.
    That is good advice in general; generic Java forums are good for generic Java questions, but as soon as you have a question about something really specific and third party (like Minecraft related stuff), better find a specialist forum.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Can't compile
    By trath in forum New To Java
    Replies: 18
    Last Post: 08-29-2012, 10:39 AM
  2. What to do here(cant compile)?
    By Pojahn_M in forum New To Java
    Replies: 8
    Last Post: 08-06-2011, 02:55 AM
  3. Can't Compile
    By sidk47 in forum JavaServer Pages (JSP) and JSTL
    Replies: 7
    Last Post: 06-15-2010, 05:43 PM
  4. Help with compile
    By mr_anderson in forum NetBeans
    Replies: 7
    Last Post: 06-10-2010, 05:03 AM
  5. Not able to compile
    By bugger in forum New To Java
    Replies: 2
    Last Post: 01-09-2008, 11:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •