From fe2d0c00f956ab8aeb1ee7ab7ed403784e26264c Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Sat, 23 Dec 2023 17:36:59 -0500 Subject: [PATCH 01/19] Update CITATION.cff --- CITATION.cff | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index c87d93c7..b6cae29e 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,11 +8,35 @@ message: >- metadata from this file. type: software authors: - - given-names: R74n - email: contact@r74n.com - affiliation: R74n + - name: R74n + email: contact@R74n.com + date-start: '2017-05-02' + website: 'https://r74n.com/' +identifiers: + - type: doi + value: 10.17605/OSF.IO/H7TDY + - type: swh + value: 'swh:1:rev:5a5813a8f4f418540f1bdb765d293735541bf7fd' + - type: url + value: 'https://sandboxels.r74n.com/' + - type: doi + value: 10.5281/zenodo.10044909 + - type: other + value: /g/11spmybz10 + description: KGMID + - type: url + value: 'https://purl.org/r74n/sandboxels' + description: PURL + - type: url + value: 'https://w3id.org/r74n/sandboxels' + description: W3ID repository-code: 'https://github.com/R74nCom/sandboxels' url: 'https://sandboxels.r74n.com' +abstract: >- + Sandboxels is a free falling-sand simulator that can be + played in your browser. It features heat simulation, + electricity, density, chemical reactions, cooking, and + fire spread. keywords: - R74n - Sandboxels From bde5032475ee7a4e4f3d2957277c3290aded8dc3 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:07:28 -0500 Subject: [PATCH 02/19] fix whenAvailable statement? --- mods/rays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/rays.js b/mods/rays.js index f862df47..d43f5483 100644 --- a/mods/rays.js +++ b/mods/rays.js @@ -22,7 +22,7 @@ var runAfterAutogenMod = "mods/runAfterAutogen2.js"; var libraryMod = "mods/code_library.js"; if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod)) { -whenAvailable(["runAfterAutogen","libraryLoaded"], function() { +whenAvailable(["runAfterAutogen","code_library"], function() { runAfterAutogen(function() { snowAndIceCache = Object.keys(elements).filter(function(name) { return name.endsWith("snow") || name.endsWith("ice") || name == "rime" From d0006899ece7c93a522d8fcb60932b553c338aac Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:10:51 -0500 Subject: [PATCH 03/19] add loading indicator value at end --- mods/code_library.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/code_library.js b/mods/code_library.js index 6035ca3a..08f3226f 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1748,3 +1748,5 @@ } }*/ } + +libraryLoaded = true; From 749171805e27b2a1826e300134fddc63008c52f2 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:11:24 -0500 Subject: [PATCH 04/19] add similar indicator --- mods/runAfterAutogen2.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/runAfterAutogen2.js b/mods/runAfterAutogen2.js index 8ea63f87..8d3ea839 100644 --- a/mods/runAfterAutogen2.js +++ b/mods/runAfterAutogen2.js @@ -51,4 +51,6 @@ function createButtonsAndCountElements() { }, 10); }; -runAfterAutogen(createButtonsAndCountElements); \ No newline at end of file +runAfterAutogen(createButtonsAndCountElements); + +raaLoaded = true; From 409c3a38d96f61461ca671180df7a1c6c66070f2 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:12:04 -0500 Subject: [PATCH 05/19] fix whenAvail statement (for real?) --- mods/rays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/rays.js b/mods/rays.js index d43f5483..0b039664 100644 --- a/mods/rays.js +++ b/mods/rays.js @@ -22,7 +22,7 @@ var runAfterAutogenMod = "mods/runAfterAutogen2.js"; var libraryMod = "mods/code_library.js"; if(enabledMods.includes(runAfterAutogenMod) && enabledMods.includes(libraryMod)) { -whenAvailable(["runAfterAutogen","code_library"], function() { +whenAvailable(["raaLoaded","libraryLoaded"], function() { runAfterAutogen(function() { snowAndIceCache = Object.keys(elements).filter(function(name) { return name.endsWith("snow") || name.endsWith("ice") || name == "rime" From 9170c7df53760c406fefa6c1ac224518ebe4dba3 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:16:17 -0500 Subject: [PATCH 06/19] syntax? --- mods/code_library.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/code_library.js b/mods/code_library.js index 08f3226f..fabe81eb 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1747,6 +1747,6 @@ } } }*/ - } + }; -libraryLoaded = true; +libraryLoaded = true From 1042a9592510d80d42f909388042a046dfeec720 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:17:09 -0500 Subject: [PATCH 07/19] test --- mods/code_library.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mods/code_library.js b/mods/code_library.js index fabe81eb..0a0b33f4 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1,3 +1,5 @@ +libraryLoaded = true; + //URL urlParams = new URLSearchParams(window.location.search); From 71a28201da00030512f6327dfc7b3a4decd9d734 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:18:43 -0500 Subject: [PATCH 08/19] smth is unsetting the value --- mods/code_library.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/code_library.js b/mods/code_library.js index 0a0b33f4..cfbe9964 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1,5 +1,3 @@ -libraryLoaded = true; - //URL urlParams = new URLSearchParams(window.location.search); @@ -1751,4 +1749,4 @@ libraryLoaded = true; }*/ }; -libraryLoaded = true +const libraryLoaded = true From ae3f42b05e35bb36114876d7cd8a7368453bc7da Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:21:03 -0500 Subject: [PATCH 09/19] sdfghkjhgtfde --- mods/code_library.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/code_library.js b/mods/code_library.js index cfbe9964..823d95ed 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1749,4 +1749,9 @@ }*/ }; -const libraryLoaded = true +libraryLoaded = true; + +runAfterLoad(function() { + libraryLoaded = true; + const libraryLoaded = true; +}; From 347be60f56aed8a500b3c6251aab6e0e2ae2e9f9 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:21:35 -0500 Subject: [PATCH 10/19] bals --- mods/code_library.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/code_library.js b/mods/code_library.js index 823d95ed..50412627 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1754,4 +1754,4 @@ libraryLoaded = true; runAfterLoad(function() { libraryLoaded = true; const libraryLoaded = true; -}; +}); From 435a6b007504b3627171d4d05eedd58f23b9f205 Mon Sep 17 00:00:00 2001 From: An Orbit <68935009+orbit-loona@users.noreply.github.com> Date: Mon, 25 Dec 2023 08:25:14 -0500 Subject: [PATCH 11/19] nayeon jeongyeon momo sana jihyo mina dahyun chaeyoung tzuyu --- mods/code_library.js | 65 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/mods/code_library.js b/mods/code_library.js index 50412627..0afacccf 100644 --- a/mods/code_library.js +++ b/mods/code_library.js @@ -1,7 +1,15 @@ +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //URL urlParams = new URLSearchParams(window.location.search); +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Objects //getKeyByValue code by SO UncleLaz: https://stackoverflow.com/questions/9907419/how-to-get-a-key-in-a-javascript-object-by-its-value @@ -10,6 +18,10 @@ return Object.keys(object).find(key => object[key] === value); }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //RNG //Random integer from 0 to n @@ -77,6 +89,10 @@ return Math.floor(randomFunction() * (max - min + 1)) + min }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Arrays //Shallow array comparer by SO Tim Down: https://stackoverflow.com/a/10260204 @@ -158,6 +174,10 @@ }; }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Checks //Element exists in the elements object @@ -260,6 +280,10 @@ return false; }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Math(s) //Base n logarithm from https://stackoverflow.com/a/3019290 @@ -305,6 +329,10 @@ return (number - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; } +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Color function rgbStringToUnvalidatedObject(string) { //turns rgb() to {r,g,b} with no bounds checking @@ -1182,7 +1210,11 @@ //console.log(`Hexed to #${f(0)}${f(8)}${f(4)}`) return `#${f(0)}${f(8)}${f(4)}`; }; - + +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Pixels function exposedToAir(pixel) { @@ -1540,6 +1572,10 @@ return true; }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //World function breakCircle(x,y,radius,respectHardness=false,changeTemp=false,defaultBreakIntoDust=false) { @@ -1639,6 +1675,10 @@ return true; }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Logic function xor(c1,c2) { @@ -1651,6 +1691,10 @@ }; }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //currentPixels operations function findInCurrentPixels(x,y) { @@ -1710,6 +1754,10 @@ }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Sugar functions function newElement(name="element_name",color="#FF00FF",otherProps={}) { @@ -1722,6 +1770,10 @@ return elements[name]; }; +libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; + //Fixes //fix -1-caused ghost pixels @@ -1750,8 +1802,13 @@ }; libraryLoaded = true; +this.libraryLoaded = true; +window.libraryLoaded = true; runAfterLoad(function() { - libraryLoaded = true; - const libraryLoaded = true; -}); + if(!libraryLoaded) { + libraryLoaded = true; + this.libraryLoaded = true; + window.libraryLoaded = true + } +}) From c618cb9b6162cf533e98e74c5a774b52a918ca17 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:41:37 -0500 Subject: [PATCH 12/19] Update heatglow.js --- mods/heatglow.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mods/heatglow.js b/mods/heatglow.js index d9b6e269..2fb1a58b 100644 --- a/mods/heatglow.js +++ b/mods/heatglow.js @@ -1,8 +1,9 @@ const heatfunc = function(pixel){ - if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null){ + if (pixel.ogR == null || pixel.ogG == null || pixel.ogB == null || !(pixel.element == pixel.ogElement)){ pixel.ogR = parseInt(pixel.color.slice(4, pixel.color.indexOf(',')), 10) pixel.ogG = parseInt(pixel.color.slice(pixel.color.indexOf(',') + 1, pixel.color.lastIndexOf(',')), 10) pixel.ogB = parseInt(pixel.color.slice(pixel.color.lastIndexOf(',') + 1, -1), 10) + pixel.ogElement = pixel.element }else{ pixel.gethigh = (elements[pixel.element].tempHigh) pixel.halftemp = ((20+pixel.gethigh)/2) @@ -24,7 +25,7 @@ const heatfunc = function(pixel){ } }; if (!eLists.metals) { eLists.metals = [] } - eLists.metals = eLists.metals.concat(["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead"]) + eLists.metals = eLists.metals.concat(["iron", "glass", "copper", "gold", "brass","steel","nickel","zinc","silver","aluminum","bronze","metal_scrap","oxidized_copper","tin","lead", "rose_gold"]) eLists.metals.forEach(metal => { const prefunc = elements[metal].tick; if (!prefunc){ From aaea63d540a59ebf4ce34d0e0f55495d1c85829e Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:51:40 -0500 Subject: [PATCH 13/19] Update nousersthings.js --- mods/nousersthings.js | 56 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 883ebdb1..b1e69f0f 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1390,4 +1390,60 @@ elements.blackhole_storage = { }, movable: false, conduct: 1, +}, +elements.plutonium = { + color: ["#616161", "#4b4949", "#353232", "#211c1c"], + behavior: behaviors.STURDYPOWDER, + category: "powders", + tempHigh: 640, + stateHigh: "molten_plutonium", + state: "solid", + tick: function(pixel){ + if (Math.random() < 0.0007) { + changePixel(pixel, "neutron", false); + } else if (Math.random() < 0.0007) { + changePixel(pixel, "uranium", false); + } + }, + reactions: { + "neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 }, + "neutron": { temp1: 100, temp2: 100 }, + }, + density: 19186, +} +elements.molten_plutonium = { + color: ["#6b5133", "#743f26", "#7c2727"], + behavior: behaviors.LIQUID, + category: "states", + state: "liquid", + tempLow: 620, + stateLow: "plutonium", + tick: function(pixel){ + if (Math.random() < 0.0007) { + changePixel(pixel, "neutron", false); + } else if (Math.random() < 0.0007) { + changePixel(pixel, "uranium", false); + } + }, + reactions: { + "neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 }, + "neutron": { temp1: 100, temp2: 100 }, + }, + density: 16629, +} +elements.pn_explosion = { + color: ["#ffb48f","#ffd991","#ffad91"], + behavior: [ + "XX|XX|XX", + "XX|EX:80>plasma,plasma,plasma,plasma,radiation,rad_steam,neutron|XX", + "XX|XX|XX", + ], + temp: 100000000, + category: "energy", + state: "gas", + density: 1000, + excludeRandom: true, + hidden: true, + alias: "plutonium nuclear explosion", + noMix: true } From 01a8789a07ce61a7747c4c04a94c10c0274a1bb5 Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Tue, 26 Dec 2023 14:45:35 -0500 Subject: [PATCH 14/19] Update nousersthings.js --- mods/nousersthings.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index b1e69f0f..2cc2bf7b 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1427,10 +1427,13 @@ elements.molten_plutonium = { }, reactions: { "neutron": { elem1:"pn_explosion", tempMin:400, chance:0.1 }, - "neutron": { temp1: 100, temp2: 100 }, }, density: 16629, -} +}, +elements.neutron.reactions = { + "uranium": { temp2:100 }, + "plutonium": { temp2: 100 } +}, elements.pn_explosion = { color: ["#ffb48f","#ffd991","#ffad91"], behavior: [ From dc976529ff5e0a701169ec1e061fa78bef8a7f0c Mon Sep 17 00:00:00 2001 From: JustAGenericUsername <92590792+JustAGenericUsername@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:40:47 -0500 Subject: [PATCH 15/19] Update nousersthings.js --- mods/nousersthings.js | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/mods/nousersthings.js b/mods/nousersthings.js index 2cc2bf7b..a94f0b3f 100644 --- a/mods/nousersthings.js +++ b/mods/nousersthings.js @@ -1449,4 +1449,51 @@ elements.pn_explosion = { hidden: true, alias: "plutonium nuclear explosion", noMix: true +}, +elements.smasher = { + color: "#606060", + behavior: behaviors.WALL, + category: "machines", + tick: function(pixel){ + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y)) { + var otherPixel = pixelMap[x][y]; + breakPixel(otherPixel); + } + } + }, +}, +elements.mixer = { + color: "#F0F0F0", + behavior: behaviors.WALL, + category: "machines", + tick: function(pixel){ + pixel.mixList = []; + for (var i = 0; i < squareCoords.length; i++) { + var coord = squareCoords[i]; + var x = pixel.x+coord[0]; + var y = pixel.y+coord[1]; + if (!isEmpty(x,y)) { + var otherPixel = pixelMap[x][y]; + pixel.mixList.push(otherPixel); + } + } + for (var i = 0; i < pixel.mixList.length; i++) { + var pixel1 = pixel.mixList[Math.floor(Math.random()*pixel.mixList.length)]; + var pixel2 = pixel.mixList[Math.floor(Math.random()*pixel.mixList.length)]; + swapPixels(pixel1,pixel2); + pixel.mixList.splice(pixel.mixList.indexOf(pixel1),1); + pixel.mixList.splice(pixel.mixList.indexOf(pixel2),1); + if (elements[pixel1.element].onMix) { + elements[pixel1.element].onMix(pixel1,pixel2); + } + if (elements[pixel2.element].onMix) { + elements[pixel2.element].onMix(pixel2,pixel1); + } + } + } } + From 53d168da33e305a832e28275bc8d3b74b88d0e36 Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:14:05 -0600 Subject: [PATCH 16/19] Create betaworldgen.js --- mods/betaworldgen.js | 128 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 mods/betaworldgen.js diff --git a/mods/betaworldgen.js b/mods/betaworldgen.js new file mode 100644 index 00000000..9c25dd1f --- /dev/null +++ b/mods/betaworldgen.js @@ -0,0 +1,128 @@ +//This mod was made by Alex the transfem, https://discord.com/users/778753696804765696 on discord and https://www.tiktok.com/@alextheagenenby?_t=8hoCVI3NRhu&_r=1 on tiktok. +function randomAlter(num, list){ + let r = Math.floor(Math.random() * list.length); + return (num + list[r]); +} +let avgheight = 0; +let seed = ""; +function getSeed(type = "plains", thickness = 15){ + seed = ""; + console.log(thickness) + if(thickness == 15){ + avgheight = Math.floor(Math.random() * (18 - 12 + 1)) + 12; + } else{ + avgheight = thickness; + } + console.log(avgheight) + + if(type == "plains"){ + let location = Math.floor(Math.random(0, pixelMap.length) * 100); + let i = 0; + while (i < pixelMap.length){ + if (i !== location){ + seed += `${randomAlter(avgheight, [0, 1, 1, 2, 0, 0])}|`; + i += 1; + } else if (i == location){ + let height = `${Math.floor(Math.random(40, pixelMap[i].length) * 10)}`; + let prevH = randomAlter(avgheight, [1, 1, 1, 2, 0, 0]); + while (height > prevH){ + prevH = randomAlter(prevH, [0, 1, 1, 2, 0, 0, 0, 1]); + seed += `${prevH}|`; + } + + i += 1; + + } + } + return seed; + } + if(type == "desert"){ + let i = 0; + while (i < pixelMap.length){ + seed += `${randomAlter(avgheight, [0, 1, 1, 2, 0, 0])}|`; + i += 1; + + } + } + return seed; + } +function spawnElements(seed, list, height2 = 1, condition = [1, 1, 0]){ + console.log(list); + let width = pixelMap.length - 1; + let element; + let height = pixelMap[1].length - 1; + console.log(seed); + let seedArray = seed.split("|"); + console.log(seedArray); + seedArray.splice(seedArray.indexOf(""), 1); + seedArray.splice(pixelMap.length); + console.log(seedArray); + let i = 0; + while (i < seedArray.length - 1){ + + let ii = 0; + while (ii < seedArray[i]){ + if((Math.floor(Math.random() * (condition[0] - condition[1] + 1))) == condition[2]){ + if (height2 != 1){ + element = list[Math.floor(Math.random() * list.length)]; + createPixel(element, (width - 1) - i, (height - (height2 + 1)) - ii); + } else{ + element = list[Math.floor(Math.random() * list.length)]; + createPixel(element, (width - 1) - i, (height - 1) - ii); + } + } + ii += 1; + } + + i += 1; + } +} + +function flat(){ + let iii = 0; + let flat = ""; + while (iii < pixelMap.length){ + flat += "1|"; + iii += 1; + } + return flat; +} +function processSeed(seed, type = "plains"){ + + console.log(flat()); + let seedsArray = seed.split(":"); + console.log(seedsArray); + if(type == "plains"){ + spawnElements(seedsArray[0],["rock","rock","rock","rock","rock","rock","metal_scrap","metal_scrap","metal_scrap","gold_coin","uranium","uranium","diamond","rock","iron","iron","iron","aluminum","aluminum","aluminum","aluminum","copper","copper","copper","zinc","zinc","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock","rock"].sort(() => Math.random() - 0.5)); + setTimeout(function(){ spawnElements(seedsArray[1], ["dirt"], 24); }, 200); + setTimeout(function(){ spawnElements(flat(),["grass","grass","grass","sapling","flower_seed","grass","grass","pinecone","grass","grass","grass","grass","grass","grass","grass","grass","grass","grass"], 40); }, 300); + } else if(type == "desert"){ + spawnElements(seed, ["sand"]); + setTimeout(function(){ spawnElements(flat(), ["cactus"], 40, [6, 0, 3]); }, 100); + } +} +elements.worldGen = { + color: "#FFFFFF", + behavior: elements.erase.behavior, + temp: 2, + category: "tools", + insulate:true, + canPlace: false, + desc: "Generate worlds with random seeds or your own seeds.", + onSelect: function() { + let Seed = prompt("Enter desert or plains random generation! automatically set to plains."); + let regex = /[a-z]/; + if (regex.test(Seed)){ + if(Seed.toLowerCase() == "desert"){ + processSeed(getSeed("desert", 30), "desert"); + } + } else { + if (Seed == ""){ + seed = `${getSeed("plains", 20)}:${getSeed("plains", 8)}` + processSeed(seed); + } else{ + processSeed(Seed); + } + } + } +} From 4bc1dca86ce91095972eec1678342218c7865a7e Mon Sep 17 00:00:00 2001 From: Alexthetransfem <124483815+theenchantedsword@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:20:57 -0600 Subject: [PATCH 17/19] Update mod-list.html --- mod-list.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod-list.html b/mod-list.html index 4242543b..1312c8fc 100644 --- a/mod-list.html +++ b/mod-list.html @@ -115,13 +115,13 @@