1.15.2 Dungeon Instances (Like MineZ)

Discussion in 'Spigot Plugin Development' started by ArKeid0s, Feb 7, 2020.

  1. Hello guys does anyone here knows how the instances are made ?
     
  2. You mean a dungeon crawler? MineZ doesn't have anything to do with dungeons. At least how my understanding of MineZ is.
     
    • Agree Agree x 1
  3. in minez there are dungeons and when you enter one it says a local instance has been created i wanted to know how it works
     
  4. Instances are created using constructors, for example
    Code (Text):

    private final String NAME;
    private final Location DUNGEON_LOCATION;
    //this is the constructor
    public Dungeon(String name, Location loc) {
        this.NAME = name;
        this.DUNGEON_LOCATION = loc
        //any other code you would want to run when you  
        // create a “local instance” would go here
    }
     
    This is an example of a constructor you would use for a dungeon, simplified severely ofc

    you call a constructor using
    Code (Text):
     public Dungeon dungeon = new Dungeon(Name, location);
    Once you call a constructor, a new “local instance” is created. Using a local instance you can use different methods from the class the constructor is in.

    Example of a “local instance” class: https://github.com/notjacob-dev/Not...src/github/notjacobdev/objects/DuelArena.java

    Also side note, don’t use static methods on classes you use a constructor on.
    (Apologies for typos, made on mobile)
     
    • Winner Winner x 1
  5. I will look into that thanks and what does the final stands for at the beginning of your variables ?
     
  6. That means it can’t be changed, like const if you’ve used other languages. It’s not necessary for creating instances
     
  7. Wouldn't a dungeon instance require making a small temporary world, like a mini game but its a dungeon?
     
  8. Depending on how you set it up, no it doesn't necessarily mean that.
     
  9. If you're talking about randomized dungeon layouts, most systems I know just use a grid with preset 'blocks'. Not super hard to implement
     
  10. this is not the topic buoobuoo the topic is about instance like in an mmorpg where a group of player can accomplish a dungeon without being disturbe by others
     
  11. Instance in this case can mean anything it can mean a just randomly created world from template or a seperate server on bungee it all depends on the implementation of the developer
     
    • Like Like x 1
    • Agree Agree x 1