Solved Generator problems

Discussion in 'Plugin Development' started by pkt, Jun 23, 2013.

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

    pkt

    I've been working on a custom generator, I know how to initialize the generators/block populators, but when using more than 1 block populator class, they don't work...
    To initialize more than 1 block populator, I am using a list, and returning it like this:
    Code:
        public List<BlockPopulator> buildPopulators() {
            List<BlockPopulator> pops = new ArrayList<>();
            pops.add(new Populator_Tree());
            pops.add(new Populator_Ores());
            return pops;
        }
    I have never had a problem making lists like that ^^
     
  2. Offline

    TomFromCollege

    What happens? You've given absolutely no details as to what the problem is with that code my man ;)
     
  3. Offline

    Alex5657

    Could you post the code that doesn't work? I am not quite understanding what you are trying to say
     
  4. Offline

    pkt

    The populators don't work if I return that list, but if I return Arrays.asList((BlockPopulator) new Populator_Ores); it will work...
     
  5. Offline

    Alex5657

    Idk how this is possible, but use that then ;)
     
  6. Offline

    pkt

    but then I can't use more then 1 populator class...
     
  7. Offline

    Alex5657

    Yes you can:
    Code:java
    1. Arrays.asList(new BlockPopulator[]{<pop1>,<pop2>,<etc>});
     
    pkt likes this.
  8. Offline

    pkt

    :D thanks, I got it to work!
     
Thread Status:
Not open for further replies.

Share This Page