CraftWorld Not Working

Discussion in 'Plugin Development' started by Jamesthatguy, Jun 2, 2013.

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

    Jamesthatguy

    So I am try to implement this line of code.
    Code:
    super(((CraftWorld)world).getHandle());
    The problem is that it can't be resolved as a type. I assume it is outdated or something along those lines. Does anyone have a different method that can replace this?
     
  2. Offline

    LucasEmanuel

    You need to build against CraftBukkit and not Bukkit.
     
  3. Offline

    Jamesthatguy

    I am. I am using CraftBukkit as my build path.
     
  4. Offline

    LucasEmanuel

    Which part of that line cannot be resolved?
     
  5. Offline

    Jamesthatguy

    The
    Code:
     ((CraftWorld)world)
     
  6. Offline

    LucasEmanuel

    When it says it cannot be resolved as a type, it's generally problems with the importation.

    Can i see your entire code?
     
  7. Offline

    Jamesthatguy

    Code:
    import java.util.ArrayList;
    import java.util.List;
     
    import org.bukkit.Location;
    import org.bukkit.event.Listener;
     
    import net.minecraft.server.v1_5_R3.EntitySkeleton;
    import net.minecraft.server.v1_5_R3.World;
     
    public class Test extends EntitySkeleton implements Listener{
     
        public Test(org.bukkit.World world) {
            super(((CraftWorld)world).getHandle()); 
            this.maxHealth = 500; 
            this.health = 500;
        }
        public void spawn(Location loc) {
            this.setPosition(loc.getX(), loc.getY(), loc.getZ());
            this.world.addEntity(this);
        }
     
    private List<Test> zList = new ArrayList<Test>();
     
    public void spawnBoss(Location loc) {
       Test zombie = new Test(loc.getWorld()); 
       skeleton.spawnBoss(loc);
       zList.add(skeleton);
    }
     
    }
    
     
  8. Offline

    LucasEmanuel

    You need to import CraftWorld.
     
  9. Offline

    Jamesthatguy

    Whats the import?
     
  10. Offline

    LucasEmanuel

    Hoover over it with your mouse and press import.
     
  11. Offline

    Jamesthatguy

    There is no suggestion to any imports. Just the error.
     
  12. Offline

    LucasEmanuel

    Are you sure you are using CraftBukkit (the server jar) and not Bukkit?
     
  13. Offline

    Jamesthatguy

    I am using both.
     
  14. Offline

    LucasEmanuel

    Don't, just use one of them, and in this case it should be CraftBukkit.
     
  15. Offline

    Jamesthatguy

    Alright, still get the same error.
     
Thread Status:
Not open for further replies.

Share This Page