[Plan]SkyBlockGeneratorExt

Discussion in 'Forum Games' started by Auditor_Black, Apr 27, 2014.

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

    Auditor_Black Member

    Joined:
    Apr 27, 2014
    Messages:
    1
    I heard that newly generated island will cut excess part of adjacent older island. Don't we have any protection algorithm? Noobcrew
     
  2. Auditor_Black
    Offline

    Auditor_Black Member

    Joined:
    Apr 27, 2014
    Messages:
    1
    The original version is:
    Code:
        @Override
        public byte[] generate(World world, Random random, int x, int y) {
            byte[] result = new byte[32768];
           
            if (x == 0 && y == 0) {
                for (int i = 0; i < 3; i++) {
                    for (int j = 0; j < 2; j++) {
                        for (int k = 0; k < 3; k++) {
                            result[getIndex(i, j + 64, k + 1)] = DIRT;
                        }
                    }
                }
               
                for (int i = 0; i < 3; i++) {
                    for (int k = 0; k < 3; k++) {
                        result[getIndex(i, 66, k + 1)] = GRASS;
                    }
                }
               
                result[getIndex(1, 64, 2)] = BEDROCK;
                result[getIndex(1, 65, 2)] = SAND;
               
                for (int i = 0; i < 5; i++) {
                    for (int j = 6; j < 8; j++) {
                        for (int k = 0; k < 5; k++) {
                            if ((i != 0 || (k != 0 && k != 4)) && (i != 4 || (k != 0 && k != 4))) {
                                result[getIndex(i, j + 64, k)] = LEAVES;
                            }
                        }
                    }
                }
                for (int i = 1; i < 4; i++) {
                    for (int k = 1; k < 4; k++) {
                        result[getIndex(i, 72, k)] = LEAVES;
                    }
                }
                result[getIndex(2, 73, 2)] = LEAVES;
                result[getIndex(1, 73, 2)] = LEAVES;
                result[getIndex(3, 73, 2)] = LEAVES;
                result[getIndex(2, 73, 1)] = LEAVES;
                result[getIndex(2, 73, 3)] = LEAVES;
               
                for (int j = 3; j < 9; j++) {
                    result[getIndex(2, j + 64, 2)] = WOOD;
                }
            }
           
            return result;
        }
    I think we can extend the class and override the method :p
     
Thread Status:
Not open for further replies.

Share This Page