From 4c417953cf3c6dd6cc28f7bf6ab1501bba67086c Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Mon, 22 Feb 2021 15:48:47 +0100 Subject: [PATCH] honey recipes, bugfixes and recipe cleanups --- src/kubejs/server/remove_by_output.txt | 23 ++++++ src/kubejs/server/src/Main.hx | 2 +- src/kubejs/server/src/Recipes.hx | 99 ++++++++++++++++++-------- src/kubejs/server/src/Util.hx | 20 ++++++ 4 files changed, 115 insertions(+), 29 deletions(-) create mode 100644 src/kubejs/server/remove_by_output.txt create mode 100644 src/kubejs/server/src/Util.hx diff --git a/src/kubejs/server/remove_by_output.txt b/src/kubejs/server/remove_by_output.txt new file mode 100644 index 0000000..217fc07 --- /dev/null +++ b/src/kubejs/server/remove_by_output.txt @@ -0,0 +1,23 @@ +angelring:itemring +angelring:itemdiamondring +alchemistry:chemical_combiner +alchemistry:chemical_dissolver +compactmachines:wall +compactmachines:machine_tiny +compactmachines:machine_small +compactmachines:machine_normal +compactmachines:machine_large +compactmachines:machine_giant +compactmachines:machine_large +compactmachines:machine_maximum +compactmachines:personal_shrinking_device +ring_of_teleport:ring_of_teleport +ring_of_enderchest:ring_of_enderchest +ring_of_repair:ring_of_repair +ring_of_blink:ring_of_blink +crossroads:gear_facade_glass +assemblylinemachines:simple_grinder +assemblylinemachines:steel_blade_piece +assemblylinemachines:steel_fluid_tank +enderrift:rift +enderrift:rift_or diff --git a/src/kubejs/server/src/Main.hx b/src/kubejs/server/src/Main.hx index 8868f16..10faab5 100644 --- a/src/kubejs/server/src/Main.hx +++ b/src/kubejs/server/src/Main.hx @@ -12,8 +12,8 @@ class Main { Settings.logSkippedRecipes = false; Settings.logErroringRecipes = true; - Events.onEvent(EventType.RecipesEventType, Recipes.onEvent); Events.onEvent(EventType.ItemTagsEventType, Tags.onItemTagsEvent); Events.onEvent(EventType.BlockTagsEventType, Tags.onBlockTagsEvent); + Events.onEvent(EventType.RecipesEventType, Recipes.onEvent); } } diff --git a/src/kubejs/server/src/Recipes.hx b/src/kubejs/server/src/Recipes.hx index 0df23f1..d625e4b 100644 --- a/src/kubejs/server/src/Recipes.hx +++ b/src/kubejs/server/src/Recipes.hx @@ -4,44 +4,29 @@ import kubejs.events.server.RecipesEvent; import kubejs.Item; class Recipes { + static final removeByOutput = Util.getFile("remove_by_output.txt"); + // @formatter:off - static final removeByOutput = [ - "angelring:itemring", - "angelring:itemdiamondring", - "alchemistry:chemical_combiner", - "alchemistry:chemical_dissolver", - "compactmachines:wall", - "compactmachines:machine_tiny", - "compactmachines:machine_small", - "compactmachines:machine_normal", - "compactmachines:machine_large", - "compactmachines:machine_giant", - "compactmachines:machine_large", - "compactmachines:machine_maximum", - "compactmachines:personal_shrinking_device", - "ring_of_teleport:ring_of_teleport", - "ring_of_enderchest:ring_of_enderchest", - "ring_of_repair:ring_of_repair", - "ring_of_blink:ring_of_blink", - "crossroads:gear_facade_glass", - "assemblylinemachines:simple_grinder", - "assemblylinemachines:steel_blade_piece", - "assemblylinemachines:steel_fluid_tank", - "enderrift:rift", - "enderrift:rift_orb" + static final honeyLiquids = [ + "resourcefulbees:honey", + "productivebees:honey", + "create:honey" ]; // @formatter:on public static function onEvent(event:RecipesEvent) { - for (i in removeByOutput) { - event.remove({output: i}); - } - + removeRecipes(event); shapedRecipes(event); shapelessRecipes(event); customRecipes(event); replaceInputs(event); } + static function removeRecipes(event:RecipesEvent) { + for (i in removeByOutput) { + event.remove({output: i}); + } + } + static function shapedRecipes(event:RecipesEvent) { event.shaped("alchemistry:chemical_combiner", ["SSS", "ACA", "SSS"], { S: "#forge:ingots/steel", @@ -194,6 +179,64 @@ class Recipes { ] }); + // Resourceful bees honey to bottle in fluid encapsulator + event.custom(untyped { + type: "thermal:bottler", + ingredient: [ + { + item: "minecraft:glass_bottle" + }, + { + fluid: "resourcefulbees:honey", + amount: 250 + } + ], + result: [ + { + item: "minecraft:honey_bottle" + } + ] + }); + + // Honey to sugar + for (honey in honeyLiquids) { + event.custom({ + type: "silents_mechanisms:solidifying", + ingredient: { + fluid: honey, + amount: 250 + }, + process_time: 100, + result: { + item: "minecraft:sugar", + count: 3 + } + }); + } + + // Overwrite glitchy ice and obsidian recipies in solidifier + // @formatter:off + for ( + inOutId in [ + ["minecraft:water", "minecraft:ice", "silents_mechanisms:solidifying/obsidian"], + ["minecraft:lava", "minecraft:obsidian", "silents_mechanisms:solidifying/ice"] + ] + ) + // @formatter:on + { + event.custom({ + type: "silents_mechanisms:solidifying", + process_time: 800, + ingredient: { + fluid: inOutId[0] + }, + result: { + item: inOutId[1], + count: 1 + } + }).id(inOutId[2]); + } + // Ore processing fixes var enrichmentChamberOreRecipes = [ ["forge:ores/nickel", "thermal:nickel_dust"], diff --git a/src/kubejs/server/src/Util.hx b/src/kubejs/server/src/Util.hx new file mode 100644 index 0000000..be5d857 --- /dev/null +++ b/src/kubejs/server/src/Util.hx @@ -0,0 +1,20 @@ +package; + +import haxe.macro.Expr.ExprOf; + +class Util { + /** + * Reads a file into an array of lines at compile time + * Removes empty lines + **/ + public static macro function getFile(path:String):ExprOf> { + // @formatter:off + return macro $a{ + sys.io.File.getContent(path) + .split("\n") + .filter(line -> line.length >= 1) + .map(line -> macro $v{line}) + }; + // @formatter:on + } +}