Rotating maps

Discussion in 'Plugin Development' started by sgavster, Dec 4, 2013.

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

    xTrollxDudex

    sgavster
    PHP:
    enum Map {
        
    /* worlds, x's, y's, z's */
       
        
    MAPA(new Location(worldxyz), new Location(wxayaza)), /* more */;

        
    Location spawnA;
        
    Location spawnB;
        public 
    Map(Location locLocation l) {
            
    spawnA loc;
            
    spawnB l;
        }
      
        public 
    Location getSpawnA() {
            return 
    spawnA;
        }

        public 
    Location getSpawnB() {
            return 
    spawnB;
        }
    }
    Truthfully though, I think you should serialize the location and get the entire location from a deserialization method.
     
  2. Offline

    sgavster

    How would I go about doing that? :eek:
     
  3. Offline

    sgavster

    xTrollxDudex okay.. Now I get
    PHP:
    Cannot make a static reference to the non-static field plugin
    on
    PHP:
            String w plugin.getConfig().getString("TEST.red.world"); int x plugin.getConfig().getInt("TEST.red.x"), plugin.getConfig().getInt("TEST.red.y"), plugin.getConfig().getInt("TEST.red.z");;
    and
    PHP:
    Syntax error on token "TEST", @ expected before this token
    on
    PHP:
    TEST(new Location(Bukkit.getWorld(w), xyz));
    and
    PHP:
    Illegal modifier for the enum constructoronly private is permitted.
    on
    PHP:
    public Map(Location locLocation l)
    This is all my code:

    PHP:
     
    public class Maps
    {
        private final 
    Main plugin;
        public 
    Maps(Main plugin)
        {
            
    this.plugin plugin;
        }
       
        private 
    Map map;
        public 
    enum Map
        
    {
            
    String w plugin.getConfig().getString("TEST.red.world"); int x plugin.getConfig().getInt("TEST.red.x"), plugin.getConfig().getInt("TEST.red.y"), plugin.getConfig().getInt("TEST.red.z");;
     
            
    TEST(new Location(Bukkit.getWorld(w), xyz));
        }
     
        public 
    Map getMap()
        {
            return 
    map;
        }
     
        public 
    void setMap(Map map)
        {
            
    this.map map;
        }
     
        
    Location spawnA;
        
    Location spawnB;
        public 
    Map(Location locLocation l)
        {
            
    spawnA loc;
            
    spawnB l;
        }
     
        public 
    Location getSpawnA()
        {
            return 
    spawnA;
        }
     
        public 
    Location getSpawnB()
        {
            return 
    spawnB;
        }
    }
    I can't figure out how to fix :/ thanks for any help :(

    I don't mean to bump, but I just thought:
    xTrollxDudex , your code doesn't really help because I need to know how I should load/unload/delete maps.

    Thanks!

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

    xTrollxDudex

    sgavster
    That's... Not what I meant. And as for you questions, if you mean like chunks, you can just loop through all the chunks in a world and unload or delete them. You can also use the world creator to delete a world too.
     
Thread Status:
Not open for further replies.

Share This Page