Convert from World to CraftWorld

Discussion in 'Plugin Development' started by Techy4198, Jun 21, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Techy4198

    hi i have no idea how to do this. can someone tell me? i don't care if i need to cast it in some special way or use *something*.getCraftWorld(); just please help me i need this for a huge part of a new plugin i'm developing
     
  2. Offline

    Tirelessly

    ((CraftWorld)world)
     
  3. Offline

    chasechocolate

    Code:java
    1. ((CraftWorld) world).something();


    EDIT: Ninja'd by Tirelessly
     
  4. Offline

    Techy4198

    tried that. server throws a sh## ton of errors.
     
  5. Offline

    chasechocolate

    You have to add CraftBukkit to your build path.
     
  6. Offline

    Techy4198

    something about ticking the world.
    maybe it's the way i change the world's environment once it's been created. take a look at this:
    Code:
    WorldCreator c = new WorldCreator(args[0]);
                        c.environment(Environment.THE_END);
                        World w = c.createWorld();
                        Location wl = new Location(w, 0, w.getHighestBlockYAt(0, 0), 0);
                        Player p = ((Player) sender).getPlayer();
                        ((Player) sender).getPlayer().teleport(wl);
                        CraftPlayer cp = (CraftPlayer)p;
                        CraftWorld cw = (CraftWorld)cp.getWorld();
                        cw.setEnvironment(Environment.NORMAL);
    not eclipse, the server itself throws the errors. check out the post above for info

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  7. Offline

    Tirelessly

  8. Offline

    Techy4198

    i know that code is messy, i feel like a total noob, but I JUST WANT IT TO WORK lol
     
Thread Status:
Not open for further replies.

Share This Page