From c779f3d5bd5020d61ba6d89628af4413e6bfc3a9 Mon Sep 17 00:00:00 2001 From: oitsjustjose Date: Fri, 4 Jun 2021 21:39:54 -0500 Subject: [PATCH] Clean up and modularize JSON things --- .../DatapackTemplates/OreDeposit.js | 24 ++++++ .../DatapackTemplates/OreDepositMulti.js | 19 +++++ .../DatapackTemplates/StoneDeposit.js | 17 +++++ .../mods/GeolosysComponents/Datapacks.jsx | 73 ++----------------- 4 files changed, 66 insertions(+), 67 deletions(-) create mode 100644 src/components/mods/GeolosysComponents/DatapackTemplates/OreDeposit.js create mode 100644 src/components/mods/GeolosysComponents/DatapackTemplates/OreDepositMulti.js create mode 100644 src/components/mods/GeolosysComponents/DatapackTemplates/StoneDeposit.js diff --git a/src/components/mods/GeolosysComponents/DatapackTemplates/OreDeposit.js b/src/components/mods/GeolosysComponents/DatapackTemplates/OreDeposit.js new file mode 100644 index 0000000..d9ff2c7 --- /dev/null +++ b/src/components/mods/GeolosysComponents/DatapackTemplates/OreDeposit.js @@ -0,0 +1,24 @@ +export default `{ /* Notes / Comments ↓ */ + "type": "geolosys:ore_deposit", /* This is always the same for ore plutons */ + "config": { + "block": "minecraft:ice", /* The ore block to generate */ + "sample": "minecraft:ice", /* The surface sample to generate with the pluton */ + "type": "sparse", /* Can be SPARSE, DENSE, DIKE, LAYER or TOP_LAYER */ + "yMin": 1, /* The Minimum Y-level the deposit can gen */ + "yMax": 255, /* The Maximum Y-level the deposit can gen */ + "chance": 1, /* Out of all chances, cumulatively that the deposits gens */ + "size": 24, /* The size of pluton - # blocks dependent on type of dep */ + "dimensions": { /* Control over which dimensions the pluton can gen */ + "isBlacklist": true, /* Is the filter a blacklist or whitelist? */ + "filter": [ /* The dimensions you wish to filter */ + "the_nether", + "the_end" + ] + }, + "biomes" :[ /* OPTIONAL: which biomes this can/can't gen in */ + "minecraft:plains" + ], + "isWhitelist": true, /* OPTIONAL (Req'd if biomes key is present) */ + "density": 0.75 /* Float w/ Range 0.0 - 1.0. Density of ores in pluton */ + } +}`; diff --git a/src/components/mods/GeolosysComponents/DatapackTemplates/OreDepositMulti.js b/src/components/mods/GeolosysComponents/DatapackTemplates/OreDepositMulti.js new file mode 100644 index 0000000..219b464 --- /dev/null +++ b/src/components/mods/GeolosysComponents/DatapackTemplates/OreDepositMulti.js @@ -0,0 +1,19 @@ +export default `{ + . + . + . + "blocks": [{ /* The block(s) that will generate in the pluton */ + "block": "minecraft:dirt", /* NOTE: only 1 minimum block is required. Chances MUST */ + "chance": 90 /* Add up to equal 100 */ + }, { + "block": "minecraft:diamond_ore", + "chance": 10 + }], + "samples": [{ + "block": "minecraft:grass", + "chance": 100 + }], + . + . + . +}`; diff --git a/src/components/mods/GeolosysComponents/DatapackTemplates/StoneDeposit.js b/src/components/mods/GeolosysComponents/DatapackTemplates/StoneDeposit.js new file mode 100644 index 0000000..c655ac8 --- /dev/null +++ b/src/components/mods/GeolosysComponents/DatapackTemplates/StoneDeposit.js @@ -0,0 +1,17 @@ +export default `{ /* Notes / Comments ↓ */ + "type": "geolosys:stone_deposit", /* This is always the same for all stone plutons */ + "config": { + "block": "minecraft:ice", /* The stone block to generate */ + "size": 24, /* The size of pluton, in this case max-radius */ + "chance": 1, /* Out of all chances, cumulatively that the deposits gens */ + "yMin": 1, /* The Minimum Y-level the deposit can gen */ + "yMax": 255, /* The Maximum Y-level the deposit can gen */ + "dimensions": { /* Control over which dimensions the pluton can gen */ + "isBlacklist": true, /* Is the filter a blacklist or whitelist? */ + "filter": [ /* The dimensions you wish to filter */ + "the_nether", + "the_end" + ] + } + } +}`; diff --git a/src/components/mods/GeolosysComponents/Datapacks.jsx b/src/components/mods/GeolosysComponents/Datapacks.jsx index 4f1728f..195de6d 100644 --- a/src/components/mods/GeolosysComponents/Datapacks.jsx +++ b/src/components/mods/GeolosysComponents/Datapacks.jsx @@ -1,6 +1,9 @@ import React from 'react'; import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { nord } from 'react-syntax-highlighter/dist/esm/styles/prism'; +import OreDeposit from './DatapackTemplates/OreDeposit'; +import OreDepositMulti from './DatapackTemplates/OreDepositMulti'; +import StoneDeposit from './DatapackTemplates/StoneDeposit'; export default () => (
@@ -176,32 +179,7 @@ export default () => (

- {` - { /* Notes / Comments ↓ */ - "type": "geolosys:ore_deposit", /* This is always the same for ore plutons */ - "config": { - "block": "minecraft:ice", /* The ore block to generate */ - "sample": "minecraft:ice", /* The surface sample to generate with the pluton */ - "type": "sparse", /* Can be SPARSE, DENSE, DIKE, LAYER or TOP_LAYER */ - "yMin": 1, /* The Minimum Y-level the deposit can gen */ - "yMax": 255, /* The Maximum Y-level the deposit can gen */ - "chance": 1, /* Out of all chances, cumulatively that the deposits gens */ - "size": 24, /* The size of pluton - # blocks dependent on type of dep */ - "dimensions": { /* Control over which dimensions the pluton can gen */ - "isBlacklist": true, /* Is the filter a blacklist or whitelist? */ - "filter": [ /* The dimensions you wish to filter */ - "the_nether", - "the_end" - ] - }, - "biomes" :[ /* OPTIONAL: which biomes this can/can't gen in */ - "minecraft:plains" - ], - "isWhitelist": true, /* OPTIONAL (Req'd if biomes key is present) */ - "density": 0.75 /* Float w/ Range 0.0 - 1.0. Density of ores in pluton */ - } - } - `} + {OreDeposit}

@@ -215,27 +193,7 @@ export default () => ( the JSON sample below) alone in the array with a chance of 100.

- {` - { - . - . - . - "blocks": [{ /* The block(s) that will generate in the pluton */ - "block": "minecraft:dirt", /* NOTE: only 1 minimum block is required. Chances MUST */ - "chance": 90 /* Add up to equal 100 */ - }, { - "block": "minecraft:diamond_ore", - "chance": 10 - }], - "samples": [{ - "block": "minecraft:grass", - "chance": 100 - }], - . - . - . - } - `} + {OreDepositMulti}

geolosys:stone_deposit

@@ -246,26 +204,7 @@ export default () => (

- {` - { /* Notes / Comments ↓ */ - "type": "geolosys:stone_deposit", /* This is always the same for all stone plutons */ - "config": { - "block": "minecraft:ice", /* The stone block to generate */ - "size": 24, /* The size of pluton, in this case max-radius */ - "chance": 1, /* Out of all chances, cumulatively that the deposits gens */ - "yMin": 1, /* The Minimum Y-level the deposit can gen */ - "yMax": 255, /* The Maximum Y-level the deposit can gen */ - "dimensions": { /* Control over which dimensions the pluton can gen */ - "isBlacklist": true, /* Is the filter a blacklist or whitelist? */ - "filter": [ /* The dimensions you wish to filter */ - "the_nether", - "the_end" - ] - } - } - } - `} - + {StoneDeposit}