From 182fe8991823366f2c322ab989964e122f4a6179 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:35:47 -0700 Subject: [PATCH 01/11] CHANGELOG - v2.7.3 --- changelog.md | 2 +- .../every_compat/api/AbstractSimpleEntrySet.java | 9 +++------ gradle.properties | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/changelog.md b/changelog.md index 623f81f5..bb1fdb5a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,5 @@ ### UPDATED: -- **EveryComp** (COMMON): Fixed the SERVER crash related to [#710](https://github.com/MehVahdJukaar/WoodGood/issues/710#issuecomment-2525282502) +- **EveryComp** (COMMON): Fixed the crash server (AGAIN) related to [#710](https://github.com/MehVahdJukaar/WoodGood/issues/711) --- diff --git a/common/src/main/java/net/mehvahdjukaar/every_compat/api/AbstractSimpleEntrySet.java b/common/src/main/java/net/mehvahdjukaar/every_compat/api/AbstractSimpleEntrySet.java index 434f346e..a450e472 100644 --- a/common/src/main/java/net/mehvahdjukaar/every_compat/api/AbstractSimpleEntrySet.java +++ b/common/src/main/java/net/mehvahdjukaar/every_compat/api/AbstractSimpleEntrySet.java @@ -567,8 +567,7 @@ public BL createPaletteFromOak(Consumer paletteTransform) { } public BL createPaletteFromOak() { - return createPaletteFromOak(p -> { - }); + return createPaletteFromOak(p -> {}); } public BL createPaletteFromChild(Consumer paletteTransform, String childKey) { @@ -576,13 +575,11 @@ public BL createPaletteFromChild(Consumer paletteTransform, String chil } public BL createPaletteFromChild(String childKey, Predicate whichSide) { - return createPaletteFromChild(p -> { - }, childKey, whichSide); + return createPaletteFromChild(p -> {}, childKey, whichSide); } public BL createPaletteFromChild(String childKey) { - return createPaletteFromChild(p -> { - }, childKey, null); + return createPaletteFromChild(p -> {}, childKey, null); } public BL createPaletteFromChild(Consumer paletteTransform, String childKey, Predicate whichSide) { diff --git a/gradle.properties b/gradle.properties index 8e3c3bdb..c4f04818 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ org.gradle.warning.mode = none # Publication Info mod_id = everycomp -mod_version = 1.20-2.7.2 +mod_version = 1.20-2.7.3 maven_group = net.mehvahdjukaar project_id = 628539 version = 1.20.1 From b2c5c634f1ea23f4271d030b4df86e9119a7a89a Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:45:41 -0700 Subject: [PATCH 02/11] build.gradle(ALL): Improved codes to make updating Moonlight easier --- common/build.gradle | 12 +++++++++--- fabric/build.gradle | 12 +++++++++--- forge/build.gradle | 12 +++++++++--- gradle.properties | 3 ++- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index daecabad..4e9b9d17 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -17,10 +17,16 @@ dependencies { modCompileOnly("curse.maven:resourceful-lib-570073:5659872") // v2.1.29 modCompileOnly("curse.maven:architectury-api-419699:5137936") // v9.2.14 -//!! MOONLIGHT LIB -------------------------------------------------------------------------------------------------- \\ +//!! MOONLIGHT LIB (REQUIRED) --------------------------------------------------------------------------------------- \\ + //!! Repository LOCAL + String path = System.getenv('REPOS20_1') +// modImplementation(files(path + "\\Moonlight\\fabric\\build\\libs\\moonlight-${moonlight_testVersion}-fabric.jar")) -// modImplementation("net.mehvahdjukaar:moonlight:${moonlight_version}") - modImplementation("curse.maven:selene-499980:5975796") // v2.13.37 + //!! ~/fabric/mods LOCAL +// modImplementation("net.mehvahdjukaar:moonlight:${moonlight_testVersion}") + + //!! MAVEN + modImplementation("maven.modrinth:moonlight:fabric_${moonlight_version}") // v2.13.37 //!! ============================================ DEPENDENCIES ====================================================== \\ modCompileOnly("curse.maven:framework-549225:5680025") // Furniture Refurbished diff --git a/fabric/build.gradle b/fabric/build.gradle index bf93fb65..98920c1a 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -40,10 +40,16 @@ dependencies { modImplementation("io.github.fabricators_of_create.Porting-Lib:$module:$port_lib_version") } -//!! MOONLIGHT LIB -------------------------------------------------------------------------------------------------- \\ +//!! MOONLIGHT LIB (REQUIRED) --------------------------------------------------------------------------------------- \\ + //!! Repository LOCAL + String path = System.getenv('REPOS20_1') +// modImplementation(files(path + "\\Moonlight\\fabric\\build\\libs\\moonlight-${moonlight_testVersion}-fabric.jar")) -// modImplementation("net.mehvahdjukaar:moonlight-fabric:${moonlight_version}") // LOCAL - modImplementation("curse.maven:selene-499980:5975796") // v2.13.37 + //!! ~/fabric/mods LOCAL +// modImplementation("net.mehvahdjukaar:moonlight-fabric:${moonlight_testVersion}") + + //!! MAVEN + modImplementation("maven.modrinth:moonlight:fabric_${moonlight_version}") // v2.13.37 //!! ================================================ DEPENDENCIES ================================================== \\ diff --git a/forge/build.gradle b/forge/build.gradle index 464f99cd..331cd0bd 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -109,10 +109,16 @@ dependencies { implementation(include("io.github.llamalad7:mixinextras-forge:${mixin_extras_version}")) annotationProcessor 'net.fabricmc:sponge-mixin:0.12.5+mixin.0.8.5' -//!! MOONLIGHT LIB -------------------------------------------------------------------------------------------------- \\ +//!! MOONLIGHT LIB (REQUIRED) --------------------------------------------------------------------------------------- \\ + //!! Repository LOCAL + String path = System.getenv('REPOS20_1') +// modImplementation(files(path + "\\Moonlight\\forge\\build\\libs\\moonlight-${moonlight_testVersion}-forge.jar")) -// modImplementation("net.mehvahdjukaar:moonlight:${project.moonlight_version}-forge") // LOCAL - modImplementation("curse.maven:selene-499980:5975794") // v2.13.37 + //!! ~/fabric/mods LOCAL +// modImplementation("net.mehvahdjukaar:moonlight:${moonlight_testVersion}-forge") + + //!! MAVEN + modImplementation("maven.modrinth:moonlight:forge_${moonlight_version}") // v2.13.37 //!! ================================================ DEPENDENCIES ================================================== \\ modImplementation("com.tterrag.registrate:Registrate:${registrate_version}") diff --git a/gradle.properties b/gradle.properties index c4f04818..bc9001ed 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,8 @@ fabric_api_version = 0.92.2+1.20.1 # LIBRARY | DEPENDENCIES # COMMON -moonlight_version = 1.20-2.13.36a +moonlight_version = 1.20-2.13.37 +moonlight_testVersion = 1.20-2.13.37 mixin_extras_version = 0.4.0 architectury_version = 5.7.28 parchment_version = 1.20.1:2023.09.03 From e130a5411a1dbcf007057fac967a3010d576f5a2 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:48:58 -0700 Subject: [PATCH 03/11] gradle.properties: renamed moonlight_version to moonlight_mavenVersion --- common/build.gradle | 2 +- fabric/build.gradle | 2 +- forge/build.gradle | 2 +- gradle.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 4e9b9d17..71c3b07d 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -26,7 +26,7 @@ dependencies { // modImplementation("net.mehvahdjukaar:moonlight:${moonlight_testVersion}") //!! MAVEN - modImplementation("maven.modrinth:moonlight:fabric_${moonlight_version}") // v2.13.37 + modImplementation("maven.modrinth:moonlight:fabric_${moonlight_mavenVersion}") // v2.13.37 //!! ============================================ DEPENDENCIES ====================================================== \\ modCompileOnly("curse.maven:framework-549225:5680025") // Furniture Refurbished diff --git a/fabric/build.gradle b/fabric/build.gradle index 98920c1a..c050af99 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -49,7 +49,7 @@ dependencies { // modImplementation("net.mehvahdjukaar:moonlight-fabric:${moonlight_testVersion}") //!! MAVEN - modImplementation("maven.modrinth:moonlight:fabric_${moonlight_version}") // v2.13.37 + modImplementation("maven.modrinth:moonlight:fabric_${moonlight_mavenVersion}") // v2.13.37 //!! ================================================ DEPENDENCIES ================================================== \\ diff --git a/forge/build.gradle b/forge/build.gradle index 331cd0bd..8ac8d283 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -118,7 +118,7 @@ dependencies { // modImplementation("net.mehvahdjukaar:moonlight:${moonlight_testVersion}-forge") //!! MAVEN - modImplementation("maven.modrinth:moonlight:forge_${moonlight_version}") // v2.13.37 + modImplementation("maven.modrinth:moonlight:forge_${moonlight_mavenVersion}") // v2.13.37 //!! ================================================ DEPENDENCIES ================================================== \\ modImplementation("com.tterrag.registrate:Registrate:${registrate_version}") diff --git a/gradle.properties b/gradle.properties index bc9001ed..bd9cb1dd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ fabric_api_version = 0.92.2+1.20.1 # LIBRARY | DEPENDENCIES # COMMON -moonlight_version = 1.20-2.13.37 +moonlight_mavenVersion = 1.20-2.13.37 moonlight_testVersion = 1.20-2.13.37 mixin_extras_version = 0.4.0 architectury_version = 5.7.28 From 488eb40ad2e80235e6011aabe60e3710be9dce47 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:10:29 -0700 Subject: [PATCH 04/11] build.gradle(FABRIC): Updated MoreCraftingTable to v1.2.7 --- fabric/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index c050af99..d9fe0db2 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -117,7 +117,7 @@ dependencies { modCompileOnly("curse.maven:lightmans-currency-fabric-724119:5544643") modCompileOnly("curse.maven:mighty-mail-fabric-904097:4750271") modCompileOnly("curse.maven:missing-wilds-622590:5053651") - modCompileOnly("curse.maven:more-crafting-tables-lieonlion-913586:5104629") + modCompileOnly("curse.maven:more-crafting-tables-lieonlion-913586:5330969") modCompileOnly("curse.maven:storage-drawers-223852:5915606") modCompileOnly("maven.modrinth:stylish-stiles:zLlRqz68") modCompileOnly("curse.maven:table-top-craft-fabric-729535:5319819") //RLM: exp4j From 64eb22f593d4fec6a97c3cecd6136cedbb337b89 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:11:03 -0700 Subject: [PATCH 05/11] MoreCraftingTablesModule(FABRIC): Updated & Fixed #714 --- .../fabric/lieonlion/MoreCraftingTablesModule.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/lieonlion/MoreCraftingTablesModule.java b/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/lieonlion/MoreCraftingTablesModule.java index 8c08295d..621ab120 100644 --- a/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/lieonlion/MoreCraftingTablesModule.java +++ b/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/lieonlion/MoreCraftingTablesModule.java @@ -1,18 +1,17 @@ package net.mehvahdjukaar.every_compat.modules.fabric.lieonlion; -import io.github.lieonlion.lolmct.bock.MoreCraftingTableBlock; -import io.github.lieonlion.lolmct.bock.MoreTableEnum; +import io.github.lieonlion.lolmct.block.MoreCraftingTableBlock; import net.mehvahdjukaar.every_compat.EveryCompat; import net.mehvahdjukaar.every_compat.api.SimpleEntrySet; import net.mehvahdjukaar.every_compat.api.SimpleModule; import net.mehvahdjukaar.moonlight.api.set.wood.WoodType; import net.mehvahdjukaar.moonlight.api.set.wood.WoodTypeRegistry; -import net.mehvahdjukaar.moonlight.api.util.Utils; import net.minecraft.core.registries.Registries; import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.level.block.Block; -// SUPPORT: v1.2.1+ +// SUPPORT: v1.2.7+ // NOTE: More Crafting Table is developed by LieOnLion and has both FORGE & FABRIC public class MoreCraftingTablesModule extends SimpleModule { @@ -20,12 +19,12 @@ public class MoreCraftingTablesModule extends SimpleModule { public MoreCraftingTablesModule(String modId) { super(modId, "lolmct"); -// var tab = CreativeModeTabs.FUNCTIONAL_BLOCKS; + var tab = CreativeModeTabs.FUNCTIONAL_BLOCKS; craftingTable = SimpleEntrySet.builder(WoodType.class, "crafting_table", getModBlock("spruce_crafting_table"), () -> WoodTypeRegistry.getValue(new ResourceLocation("spruce")), - w -> new MoreCraftingTableBlock(MoreTableEnum.valueOf(w.planks.toString()), Utils.copyPropertySafe(w.planks))) + w -> new MoreCraftingTableBlock(w.planks.defaultMapColor())) .addTextureM(EveryCompat.res("block/spruce_crafting_table_front"), EveryCompat.res("block/lolmct/spruce_crafting_table_front_m")) .addTextureM(EveryCompat.res("block/spruce_crafting_table_side"), EveryCompat.res("block/lolmct/spruce_crafting_table_side_m")) .addTextureM(EveryCompat.res("block/spruce_crafting_table_top"), EveryCompat.res("block/lolmct/spruce_crafting_table_top_m")) @@ -34,10 +33,9 @@ public MoreCraftingTablesModule(String modId) { .addTag(new ResourceLocation("lieonstudio:crafting_tables"), Registries.ITEM) .addTag(new ResourceLocation("c:workbench"), Registries.ITEM) .addTag(new ResourceLocation("quad:fuel/wood"), Registries.ITEM) -// .setTabKey(tab) + .setTabKey(tab) .defaultRecipe() .build(); - this.addEntry(craftingTable); } } From 9aea0edb0ab7a629eb44bd24dfecd4ae26019a63 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:12:50 -0700 Subject: [PATCH 06/11] changelog.md - v2.7.4 UPDATED#0 --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index bb1fdb5a..44edc7ea 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,5 @@ ### UPDATED: -- **EveryComp** (COMMON): Fixed the crash server (AGAIN) related to [#710](https://github.com/MehVahdJukaar/WoodGood/issues/711) +- **More Crafting Table (LieOnLion)** (FABRIC): Updated to support v1.2.7 --- From c92269d54a2edd637a0e1bc865e4bc774b78eeb8 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:39:28 -0700 Subject: [PATCH 07/11] BuildingButBetterModule: Updated to support either v1.1.1 or v1.0.1 --- .../building_but_better/BuildingButBetterModule.java | 11 +++++++++-- forge/src/main/resources/META-INF/mods.toml | 7 ------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/building_but_better/BuildingButBetterModule.java b/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/building_but_better/BuildingButBetterModule.java index 3ffffbba..fbfce5d0 100644 --- a/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/building_but_better/BuildingButBetterModule.java +++ b/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/building_but_better/BuildingButBetterModule.java @@ -152,13 +152,20 @@ public BuildingButBetterModule(String modId) { .build(); this.addEntry(supports); + ResourceLocation frameTexture = (Objects.equals(PlatHelper.getModVersion("bbb"), "1.1.1")) + ? modRes("block/frame/oak") + : modRes("block/frame/oak_frame"); + ResourceLocation stickTexture = (Objects.equals(PlatHelper.getModVersion("bbb"), "1.1.1")) + ? modRes("block/frame/oak_sticks") + : modRes("block/frame/oak_frame_sticks"); + frames = SimpleEntrySet.builder(WoodType.class, "frame", getModBlock("oak_frame"), () -> WoodTypeRegistry.OAK_TYPE, w -> new FrameBlock(Utils.copyPropertySafe(w.planks).noOcclusion().noCollission().pushReaction(PushReaction.DESTROY)) ) .requiresChildren("slab") //REASON: recipes - .addTexture(modRes("block/frame/oak")) - .addTexture(modRes("block/frame/oak_sticks")) + .addTexture(frameTexture) + .addTexture(stickTexture) .addTag(BlockTags.MINEABLE_WITH_AXE, Registries.BLOCK) .addTag(new ResourceLocation("create", "movable_empty_collider"), Registries.BLOCK) .addTag(modRes("wooden_blocks"), Registries.BLOCK) diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 49e0150c..e8431b61 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -88,13 +88,6 @@ versionRange="[1.5.7,)" #mandatory ordering="AFTER" side="BOTH" -[[dependencies.everycomp]] #optional - -modId="bbb" -mandatory=false -versionRange="[1.1.1,)" #mandatory -ordering="AFTER" -side="BOTH" From c62269558a8eb6a6c75793f47d02d26a9d4cd074 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:08:49 -0700 Subject: [PATCH 08/11] SpriteHelper: Quick reorganized --- .../net/mehvahdjukaar/every_compat/misc/SpriteHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/net/mehvahdjukaar/every_compat/misc/SpriteHelper.java b/common/src/main/java/net/mehvahdjukaar/every_compat/misc/SpriteHelper.java index c7cbf09d..3cd2dc04 100644 --- a/common/src/main/java/net/mehvahdjukaar/every_compat/misc/SpriteHelper.java +++ b/common/src/main/java/net/mehvahdjukaar/every_compat/misc/SpriteHelper.java @@ -42,13 +42,13 @@ public static void addHardcodedSprites() { // TextureCache.registerSpecialTextureForBlock(Blocks.CACTUS, "stripped_cactus_log", res("block/stripped_cactus_side")); // TextureCache.registerSpecialTextureForBlock(Blocks.CACTUS, "stripped_cactus_log_top", res("block/stripped_cactus_top")); + addOptional("minecraft:mushroom_stem", "_side", "minecraft:block/mushroom_stem"); + addOptional("minecraft:mushroom_stem", "_top", "minecraft:block/mushroom_stem"); + // Advent Of Ascension addOptional("aoa3:stranglewood_log", "_side", "aoa3:block/stranglewood_log"); addOptional("aoa3:stranglewood_log", "_top", "aoa3:block/stranglewood_log_top"); - addOptional("minecraft:mushroom_stem", "_side", "minecraft:block/mushroom_stem"); - addOptional("minecraft:mushroom_stem", "_top", "minecraft:block/mushroom_stem"); - // Better End addOptional("betterend:lucernia_leaves", "_leaves", "betterend:block/lucernia_leaves_1"); From 9bd98564b61a666ae4f6da88a2cd0630bd2b205e Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:00:46 -0700 Subject: [PATCH 09/11] CreateModule(FORGE|FABRIC): Cleanup imports --- .../every_compat/modules/fabric/create/CreateModule.java | 5 +---- .../every_compat/modules/forge/create/CreateModule.java | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/create/CreateModule.java b/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/create/CreateModule.java index c122d00e..71a5d2be 100644 --- a/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/create/CreateModule.java +++ b/fabric/src/main/java/net/mehvahdjukaar/every_compat/modules/fabric/create/CreateModule.java @@ -14,11 +14,8 @@ import net.mehvahdjukaar.moonlight.api.set.wood.WoodTypeRegistry; import net.mehvahdjukaar.moonlight.api.util.Utils; import net.minecraft.core.registries.Registries; -import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.BlockTags; -import net.minecraft.world.item.CreativeModeTab; -import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -31,7 +28,7 @@ public class CreateModule extends SimpleModule { public CreateModule(String modId) { super(modId, "c"); - ResourceKey tab = CreativeModeTabs.BUILDING_BLOCKS; + ResourceLocation tab = modRes("palettes"); windows = SimpleEntrySet.builder(WoodType.class, "window", getModBlock("oak_window"), () -> WoodTypeRegistry.OAK_TYPE, //AllPaletteBlocks.OAK_WINDOW diff --git a/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/create/CreateModule.java b/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/create/CreateModule.java index 4d675119..c007c87c 100644 --- a/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/create/CreateModule.java +++ b/forge/src/main/java/net/mehvahdjukaar/every_compat/modules/forge/create/CreateModule.java @@ -18,7 +18,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.tags.BlockTags; -import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; @@ -35,7 +34,7 @@ public class CreateModule extends SimpleModule { public CreateModule(String modId) { super(modId, "c"); - var tab = CreativeModeTabs.BUILDING_BLOCKS; + var tab = modRes("palettes"); windows = SimpleEntrySet.builder(WoodType.class, "window", getModBlock("oak_window"), () -> WoodTypeRegistry.OAK_TYPE, //AllPaletteBlocks.OAK_WINDOW @@ -69,8 +68,8 @@ private WindowBlock makeWindow(WoodType w) { .isSuffocating((s, l, ps) -> false).isViewBlocking((s, l, ps) -> false), false); } - @OnlyIn(Dist.CLIENT) @Override + @OnlyIn(Dist.CLIENT) public void onClientSetup() { super.onClientSetup(); windows.blocks.forEach((w, b) -> { From 9f45ee3758591ea30a7218e1075b22d11212b756 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:25:25 -0700 Subject: [PATCH 10/11] NEW CLASS: RecipeUtility --- .../common_classes/RecipeUtility.java | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 common/src/main/java/net/mehvahdjukaar/every_compat/common_classes/RecipeUtility.java diff --git a/common/src/main/java/net/mehvahdjukaar/every_compat/common_classes/RecipeUtility.java b/common/src/main/java/net/mehvahdjukaar/every_compat/common_classes/RecipeUtility.java new file mode 100644 index 00000000..9a235f2c --- /dev/null +++ b/common/src/main/java/net/mehvahdjukaar/every_compat/common_classes/RecipeUtility.java @@ -0,0 +1,42 @@ +package net.mehvahdjukaar.every_compat.common_classes; + +import com.google.gson.JsonObject; +import net.mehvahdjukaar.every_compat.dynamicpack.ServerDynamicResourcesHandler; +import net.mehvahdjukaar.moonlight.api.resources.RPUtils; +import net.mehvahdjukaar.moonlight.api.resources.ResType; +import net.mehvahdjukaar.moonlight.api.util.Utils; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.world.level.block.Block; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Objects; + +@SuppressWarnings("unused") +public class RecipeUtility { + + /** + * Create Stonecutting Recipe that use tag as an ingredient + */ + public static void stonecuttingWithTagRecipe(Block output, ResourceLocation recipeLoc, ResourceLocation tagResLoc, + ResourceLocation newRecipeLoc, ServerDynamicResourcesHandler handler, ResourceManager manager) { + if (Objects.nonNull(output)) { + try (InputStream recipeStream = manager.getResource(recipeLoc) + .orElseThrow(() -> new FileNotFoundException("Failed to get " + recipeLoc)).open()) { + JsonObject recipe = RPUtils.deserializeJson(recipeStream); + + // Editing the recipe + recipe.getAsJsonObject("ingredient").addProperty("tag", tagResLoc.toString()); + recipe.addProperty("result", Utils.getID(output).toString()); + + // Adding to the resources + handler.dynamicPack.addJson(newRecipeLoc, recipe, ResType.RECIPES); + + } catch (IOException e) { + handler.getLogger().error("Failed to generate the recipe @ {} : {}", recipeLoc, e); + } + } + } +} From 398f655eaf42a211420a5853c450484da5c989b2 Mon Sep 17 00:00:00 2001 From: Xel'Bayria <12866666+Xelbayria@users.noreply.github.com> Date: Fri, 13 Dec 2024 00:25:59 -0700 Subject: [PATCH 11/11] FarmersDelightModule: Improved the error logging --- .../modules/farmersdelight/FarmersDelightModule.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/net/mehvahdjukaar/every_compat/modules/farmersdelight/FarmersDelightModule.java b/common/src/main/java/net/mehvahdjukaar/every_compat/modules/farmersdelight/FarmersDelightModule.java index 0e296d4d..8e6ec330 100644 --- a/common/src/main/java/net/mehvahdjukaar/every_compat/modules/farmersdelight/FarmersDelightModule.java +++ b/common/src/main/java/net/mehvahdjukaar/every_compat/modules/farmersdelight/FarmersDelightModule.java @@ -8,7 +8,6 @@ import net.mehvahdjukaar.every_compat.dynamicpack.ServerDynamicResourcesHandler; import net.mehvahdjukaar.moonlight.api.resources.RPUtils; import net.mehvahdjukaar.moonlight.api.resources.ResType; -import net.mehvahdjukaar.moonlight.api.resources.textures.Palette; import net.mehvahdjukaar.moonlight.api.set.wood.WoodType; import net.mehvahdjukaar.moonlight.api.set.wood.WoodTypeRegistry; import net.mehvahdjukaar.moonlight.api.util.Utils; @@ -19,6 +18,7 @@ import net.minecraft.world.level.block.Block; import vectorwing.farmersdelight.common.block.CabinetBlock; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Objects; @@ -80,10 +80,12 @@ public void addDynamicServerResources(ServerDynamicResourcesHandler handler, Res public void createCuttingRecipe(String recipeType, Block input, Block output, WoodType woodType, ServerDynamicResourcesHandler handler, ResourceManager manager) { - ResourceLocation recipeLocation = modRes("recipes/cutting/oak_"+recipeType+".json"); if (Objects.nonNull(input) && Objects.nonNull(output)) { - try (InputStream recipeStream = manager.getResource(recipeLocation).orElseThrow().open()) { + ResourceLocation recipeLocation = modRes("recipes/cutting/oak_"+recipeType+".json"); + + try (InputStream recipeStream = manager.getResource(recipeLocation) + .orElseThrow(() -> new FileNotFoundException(recipeLocation.toString())).open()) { JsonObject recipe = RPUtils.deserializeJson(recipeStream); // EDITING RECIPE @@ -98,7 +100,7 @@ public void createCuttingRecipe(String recipeType, Block input, Block output, handler.dynamicPack.addJson(EveryCompat.res(path), recipe, ResType.RECIPES); } catch (IOException e) { - handler.getLogger().error("Failed to generate the cutting recipe for {} : {}", Utils.getID(output), e); + handler.getLogger().error("Failed to generate the cutting recipe for {} - {}", Utils.getID(output), e); } } }