From be0ee23d8b3daab3368b95edde17cddac5596440 Mon Sep 17 00:00:00 2001 From: marston Date: Fri, 12 Jan 2024 16:13:42 -0500 Subject: [PATCH] added auto-smelt and fixed crash --- MODIFIERS.md | 78 +++++++++---------- .../java/dev/marston/randomloot/GenWiki.java | 31 ++++---- 2 files changed, 55 insertions(+), 54 deletions(-) diff --git a/MODIFIERS.md b/MODIFIERS.md index 3e84685..6e0e2de 100644 --- a/MODIFIERS.md +++ b/MODIFIERS.md @@ -6,28 +6,32 @@ These effects are applied when breaking blocks. **id:** `attracting` | **crafting:** `minecraft:iron_block` **Decription:** Upon breaking a block (allowed by tool type), all items at that block's position will teleport to you. -### Melting -**id:** `melting` | **crafting:** `minecraft:magma_cream` +### Explosive +**id:** `explode` | **crafting:** `minecraft:tnt` -**Decription:** Items dropped by blocks broken with this tool will be smelted. +**Decription:** Upon breaking a block (allowed by tool type), the current block position will explode causing damage to surrounding blocks. ### Learning **id:** `learning` | **crafting:** `minecraft:book` **Decription:** After breaking 10 blocks as allowed by this tool, gain 3 experience points. +### Melting +**id:** `melting` | **crafting:** `minecraft:magma_cream` + +**Decription:** Items dropped by blocks broken with this tool will be smelted. ### Veiny **id:** `veiny` | **crafting:** `minecraft:diamond_pickaxe` **Decription:** Breaking any block while crouching will cause all blocks of the same type adjacent to it to break up to 5 in each direction. -### Explosive -**id:** `explode` | **crafting:** `minecraft:tnt` - -**Decription:** Upon breaking a block (allowed by tool type), the current block position will explode causing damage to surrounding blocks. ## Holders These effects are applied when holding the tool. -### Rainy -**id:** `rainy` | **crafting:** `minecraft:cauldron` +### Appley +**id:** `absorption` | **crafting:** `minecraft:golden_apple` -**Decription:** While holding the tool in the rain, mine faster! +**Decription:** While holding the tool, get the absorption effect. +### Detecting +**id:** `detecting` | **crafting:** `minecraft:spyglass` + +**Decription:** While holding the tool, ores around you will glow. ### Tomb Raider **id:** `spawner` | **crafting:** `minecraft:mossy_cobblestone` @@ -36,18 +40,14 @@ These effects are applied when holding the tool. **id:** `filling` | **crafting:** `minecraft:cake` **Decription:** While holding the tool, get the saturation effect. +### Rainy +**id:** `rainy` | **crafting:** `minecraft:cauldron` + +**Decription:** While holding the tool in the rain, mine faster! ### Hasty **id:** `hasty` | **crafting:** `minecraft:sugar` **Decription:** While holding the tool, get the Haste effect. -### Detecting -**id:** `detecting` | **crafting:** `minecraft:spyglass` - -**Decription:** While holding the tool, ores around you will glow. -### Appley -**id:** `absorption` | **crafting:** `minecraft:golden_apple` - -**Decription:** While holding the tool, get the absorption effect. ## Users These effects are applied when right clicking. ### Fire Starter @@ -58,16 +58,24 @@ These effects are applied when right clicking. **id:** `flame_thrower` | **crafting:** `minecraft:fire_charge` **Decription:** Right clicking throws a fire ball. -### Heartha's Grace -**id:** `dirt_place` | **crafting:** `minecraft:dirt` - -**Decription:** Right clicking on the top of a block with the tool in hand will place a dirt block and use 1 durability points. ### Spelunking **id:** `torch_place` | **crafting:** `minecraft:glowstone` **Decription:** Right clicking on the top of a block with the tool in hand will place a torch and use 10 durability points. +### Heartha's Grace +**id:** `dirt_place` | **crafting:** `minecraft:dirt` + +**Decription:** Right clicking on the top of a block with the tool in hand will place a dirt block and use 1 durability points. ## Hurters These effects are applied when hurting enemies. +### Poisonous +**id:** `poison` | **crafting:** `minecraft:poisonous_potato` + +**Decription:** When attacking with tool, apply the poison effect to the target. +### Flaming +**id:** `flaming` | **crafting:** `minecraft:blaze_rod` + +**Decription:** Sets enemy on fire for 2 seconds. ### Dexterous **id:** `combo` | **crafting:** `minecraft:chorus_fruit` @@ -76,27 +84,19 @@ These effects are applied when hurting enemies. **id:** `necrotic` | **crafting:** `minecraft:wither_skeleton_skull` **Decription:** Heals 10% of damage dealt to target. -### Withering -**id:** `wither` | **crafting:** `minecraft:wither_rose` - -**Decription:** When attacking with tool, apply the wither effect to the target. -### Critical -**id:** `critical` | **crafting:** `minecraft:ghast_tear` +### Charged +**id:** `charged` | **crafting:** `minecraft:lightning_rod` -**Decription:** Always critically strikes enemy. +**Decription:** After 7 seconds, hitting and enemy will summon a lightning bolt and empty the charge meter. ### Blinding **id:** `blinding` | **crafting:** `minecraft:carrot` **Decription:** When attacking with tool, apply the blindness effect to the target. -### Poisonous -**id:** `poison` | **crafting:** `minecraft:poisonous_potato` - -**Decription:** When attacking with tool, apply the poison effect to the target. -### Flaming -**id:** `flaming` | **crafting:** `minecraft:blaze_rod` +### Critical +**id:** `critical` | **crafting:** `minecraft:ghast_tear` -**Decription:** Sets enemy on fire for 2 seconds. -### Charged -**id:** `charged` | **crafting:** `minecraft:lightning_rod` +**Decription:** Always critically strikes enemy. +### Withering +**id:** `wither` | **crafting:** `minecraft:wither_rose` -**Decription:** After 7 seconds, hitting and enemy will summon a lightning bolt and empty the charge meter. +**Decription:** When attacking with tool, apply the wither effect to the target. diff --git a/src/main/java/dev/marston/randomloot/GenWiki.java b/src/main/java/dev/marston/randomloot/GenWiki.java index 74ae036..7b35089 100644 --- a/src/main/java/dev/marston/randomloot/GenWiki.java +++ b/src/main/java/dev/marston/randomloot/GenWiki.java @@ -74,24 +74,25 @@ private static void writeModifiers(FileWriter f) throws IOException { public static void genWiki() { - try { - String isProd = System.getenv("RL_PROD").strip(); - - if (isProd.contains("false")) { - RandomLootMod.LOGGER.info("Creating wiki..."); - - try { - FileWriter wikiWriter = new FileWriter("../MODIFIERS.md"); - writeModifiers(wikiWriter); - wikiWriter.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } catch (Exception e) { + String isProdEnv = System.getenv("RL_PROD"); + if (isProdEnv == null) { return; } + String isProd = isProdEnv.strip(); + + if (isProd.contains("false")) { + RandomLootMod.LOGGER.info("Creating wiki..."); + + try { + FileWriter wikiWriter = new FileWriter("../MODIFIERS.md"); + writeModifiers(wikiWriter); + wikiWriter.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } public static String readRecipe(String trait) throws FileNotFoundException {