MapGeneration.sk

Created by Maxgamer9473

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

# MAXGAMER9473'S MAP GENERATION [SKRIPT]


# SETTING ID's

command mapgen:setid <number> <number>:
  usage: &a&lMAP GENERATION &8» &fUse &e/mapgen:help &ffor more info.
  permission message: %nl%&a&lMAP GENERATION &8» &fLacking permissions.
  permission: op
  trigger:
    arg 2 is between 1 and 2:
      set {map.%arg-1%.%arg-2%} to player's location
      send "%nl%&a&lMAP GENERATION &8» &fSet position ID &e%arg 2% &fof map-gen ID &e%arg 1%&f to &e%player's location%&f."
    else:
      send "%nl%&a&lMAP GENERATION &8» &fError! Arguement &e2&f or the &eposition ID &fis not between &e1 and 2&f!"

# GENERATION & COMMAND

command mapgen:generate <item> <item> <item> <item> <item> <number> <number> <number>:
  usage: &a&lMAP GENERATION &8» &fUse &e/mapgen:help &ffor more info.
  permission message: %nl%&a&lMAP GENERATION &8» &fLacking permissions.
  permission: op
  trigger:
  # CHECKING IF MAP ID IS EVEN SET:
    {map.%arg-6%.1} is set:
      arg 8 is between 1 and 2:
        set {_number-of-blocks} to 0
        loop all blocks between {map.%arg-6%.1} and {map.%arg-6%.2}:
          add 1 to {_number-of-blocks}
          if {_number-of-blocks} is greater than 300:
            send "%nl%&a&lMAP GENERATION &8» &fTo stop your server from crashing, Map-Generation has &ecancelled &fthis. Try making &esmaller&f maps."
            stop
          if arg 7 is greater than 49:
            send "%nl%&a&lMAP GENERATION &8» &fTo stop your server from crashing, Map-Generation has &ecancelled &fthis. Try changing arguement 7 to a &esmaller &fvalue, like &e10&f."
            stop
        loop arg 7 times:
          wait 3 ticks
          mapgen(arg-1, arg-2, arg-3, arg-4, arg-5, {map.%arg-6%.1}, {map.%arg-6%.2}, arg-8)
        send "%nl%&a&lMAP GENERATION &8» &fStarted Map generation of the following &econfig&f options.%nl%&fBase material &e%arg 1%%nl%&fBase-to-second material &e%arg 2%%nl%&fSecond-to-third material &e%arg 3%%nl%&fThird-to-Forth material &e%arg 4%%nl%&fForth-to-Last material &e%arg 5%%nl%&fMap-gen ID &e%arg 6%%nl%&fAttempted &e%arg 7% &ftimes%nl%&fConfig option &e%arg 8%"
      else:
        send "%nl%&a&lMAP GENERATION &8» &fAttempted Map generation. Error! Arguement &e8&f is not between &e1 &fand &e2&f."
    else if {map.%arg-6%.1} is set:
      arg 8 is between 1 and 2:
        set {_number-of-blocks} to 0
        loop all blocks between {map.%arg-6%.1} and {map.%arg-6%.2}:
          add 1 to {_number-of-blocks}
          if {_number-of-blocks} is greater than 300:
            send "%nl%&a&lMAP GENERATION &8» &fTo stop your server from crashing, Map-Generation has &ecancelled &fthis. Try making &esmaller&f maps."
            stop
          if arg 7 is greater than 49:
            send "%nl%&a&lMAP GENERATION &8» &fTo stop your server from crashing, Map-Generation has &ecancelled &fthis. Try changing arguement 7 to a &esmaller &fvalue, like &e10&f."
            stop
        loop arg 7 times:
          wait 3 ticks
          mapgen(arg-1, arg-2, arg-3, arg-4, arg-5, {map.%arg-6%.1}, {map.%arg-6%.2}, arg-8)
        send "%nl%&a&lMAP GENERATION &8» &fStarted Map generation of the following &econfig&f options.%nl%&fBase material &e%arg 1%%nl%&fBase-to-second material &e%arg 2%%nl%&fSecond-to-third material &e%arg 3%%nl%&fThird-to-Forth material &e%arg 4%%nl%&fForth-to-Last material &e%arg 5%%nl%&fMap-gen ID &e%arg 6%%nl%&fAttempted &e%arg 7% &ftimes%nl%&fConfig option &e%arg 8%"
      else:
        send "%nl%&a&lMAP GENERATION &8» &fAttempted Map generation. Error! Arguement &e8&f is not between &e1 &fand &e2&f."
    else:
      send "%nl%&a&lMAP GENERATION &8» &fAttempted Map generation. Error! Region ID &e%arg 6% &fis not set."

# CREDITS | DONT CHANGE THIS!!!

command mapgen:credits:
  cooldown: 3 seconds
  cooldown message: %nl%&a&lMAP GENERATION &8» &fPlease wait &e3 seconds&f every time you use this command.
  usage: &a&lMAP GENERATION &8» &fUse &e/mapgen:help &ffor more info.
  trigger:
    send "%nl%%nl%&a&lMAP GENERATION &8» &fCredits.%nl%&fThank all these people for helping make Map Generation.%nl%%nl%&7&l| &eMaxGamer9473 &8» &fLead developer and owner%nl%%nl%&7&l| &eCompX_ &8» &fTester%nl%%nl%  &8»   <link:https://discord.gg/btx6fsUue2>&fJoin our discord&f &ehere&f.%nl%%nl%"

# PRESETS

command mapgen:presets:
  cooldown: 3 seconds
  cooldown message: %nl%&a&lMAP GENERATION &8» &fPlease wait &e3 seconds&f every time you use this command.
  usage: &a&lMAP GENERATION &8» &fUse &e/mapgen:help &ffor more info.
  permission message: %nl%&a&lMAP GENERATION &8» &fLacking permissions.
  permission: op
  trigger:
    send "%nl%%nl%&a&lMAP GENERATION &8» &fPresets.%nl%&fMap generation is the ultimate Map creation skript! Here are its preset commands!%nl%%nl%&e<suggest command:/mapgen:generate dark oak planks brown terracotta brown wool brown concrete powder green concrete powder (MAPID) 10 1>&e&lCLICK ME&f Generates a grassy area with a nice &egradient&f.%nl%%nl%&e<suggest command:/mapgen:generate deepslate cobbled deepslate andesite stone grass block (MAPID) 5 1>&e&lCLICK ME&f Generates an &eamplified&f type of chunk&f.%nl%%nl%&e<suggest command:/mapgen:generate white concrete light gray concrete gray concrete black concrete black concrete (MAPID) 3 1>&e&lCLICK ME&f Generates an &eamplified&f, &eblack-to-white&f type of chunk&f.%nl%%nl%&e<suggest command:/mapgen:generate smooth sandstone stripped birch wood stripped oak wood sandstone sand (MAPID) 5 1>&e&lCLICK ME&f Generates an &eamplified&f, &edesert&f type of chunk&f.%nl%%nl%"

#/mapgen:generate smooth sandstone stripped birch wood stripped oak wood sandstone sand 1 5 1

# HELP

command mapgen:help:
  cooldown: 3 seconds
  cooldown message: &a&lMAP GENERATION &8» &fPlease wait &e3 seconds&f every time you use this command.
  usage: &a&lMAP GENERATION &8» &fThe help command &e/mapgen:help&f.
  permission message: %nl%&a&lMAP GENERATION &8» &fLacking permissions.
  permission: op
  trigger:
    send "%nl%%nl%&a&lMAP GENERATION &8» &fHelp page.%nl%&fMap generation is the ultimate Map creation skript! Here are its commands:%nl%%nl%&f&e/mapgen:setid &r&fCreates the map-gen ID of a Map-Generation circut <tooltip:&eExample: &e/mapgen:setid (ID) (Selection digit)>&e&eHover for example&f.%nl%%nl%&f&e/mapgen:help &r&fShows you this help page. <tooltip:&eExample: &e/mapgen:help>&e&eHover for example%nl%%nl%&f&e/mapgen:presets &r&fShows you this presets you can use for your maps. <tooltip:&eExample: &e/mapgen:presets>&e&eHover for example%nl%%nl%&f&e/mapgen:generate &r&fCreates a map based off of your config options. <tooltip:&eExample: &e/mapgen:generate (BASE BLOCK) (SECONDARY BLOCK) (THIRD BLOCK OF GRADIENT) (FORTH BLOCK OF GRADIENT) (LAST GRADIENT BLOCK) (MAP-GEN ID) (ATTEMPTED AMOUNT) (TYPE OF CONFIG)>&e&eHover for example%nl%%nl%&f&e/mapgen:credits &r&fShows you the credits. <tooltip:&eExample: &e/mapgen:credits>&e&eHover for example%nl%"

# GENERATION FUNCTION

function mapgen(I: item, I2: item, I3: item, I4: item, I5: item, L1: location, L2: location, L3: number):
# SETTING VARIABLES & ADDING TO MAKE A 'VOLUME' EFFECT FOR THE BLOCK HEIGHT
  if {_L3} is 1:
    set {y} to y location of {_L1}
  if {_L3} is 2:
    set {y} to y location of {_L2}
  loop all blocks within {_L1} and {_L2}:
    set {_random1} to a random integer between 1 and 3
    if {_random1} is 1:
      set {_random2} to a random integer between 1 and 40
      set {loc} to location of loop-block
      set y location of {loc} to {y}
      if {_random2} is 1:
        add 1 to {y}
      if {_random2} is between 2 and 39:
        set {y} to {y}
      if {_random2} is 40:
        subtract 1 from {y}
# SETTING THE BLOCKS
      set loop-block to air
      set y location of {loc} to {y}
      set block at {loc} to {_I}
# CREATING GRADIENT
      block above {loc} is air:
        set block above {loc} to {_I2}
        set block 2 blocks above {loc} to {_I3}
        set block 3 blocks above {loc} to {_I4}
        set block 4 blocks above {loc} to {_I5}
# MAKING THERE NOT BE HOLES BELOW
      loop all blocks between {loc} and block 30 blocks below {loc}:
        set loop-block-2 to {_I}
    else:
# SETTING BLOCKS
      set {y} to {y}
      set {loc} to location of loop-block
      set y location of {loc} to {y}
      set block at {loc} to {_I}
# CREATING GRADIENT
      block above {loc} is air:
        set block above {loc} to {_I2}
        set block 2 blocks above {loc} to {_I3}
        set block 3 blocks above {loc} to {_I4}
        set block 4 blocks above {loc} to {_I5}
# MAKING THERE NOT BE HOLES BELOW
      loop all blocks between {loc} and block 30 blocks below {loc}:
        set loop-block-2 to {_I}