diff --git a/changelog.md b/changelog.md index be1b5bde..44edc7ea 100644 --- a/changelog.md +++ b/changelog.md @@ -1 +1,12 @@ -fixed server crash \ No newline at end of file +### UPDATED: +- **More Crafting Table (LieOnLion)** (FABRIC): Updated to support v1.2.7 + +--- + +### NEW: +- N/A + +--- + +**LEGEND**: +- (COMMON) = FORGE & FABRIC \ No newline at end of file diff --git a/common/build.gradle b/common/build.gradle index daecabad..71c3b07d 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_mavenVersion}") // v2.13.37 //!! ============================================ DEPENDENCIES ====================================================== \\ modCompileOnly("curse.maven:framework-549225:5680025") // Furniture Refurbished 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 cb676423..eb2af20d 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/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); + } + } + } +} 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"); 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); } } } diff --git a/fabric/build.gradle b/fabric/build.gradle index bf93fb65..d9fe0db2 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_mavenVersion}") // v2.13.37 //!! ================================================ DEPENDENCIES ================================================== \\ @@ -111,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 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/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); } } diff --git a/forge/build.gradle b/forge/build.gradle index 464f99cd..8ac8d283 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_mavenVersion}") // v2.13.37 //!! ================================================ DEPENDENCIES ================================================== \\ modImplementation("com.tterrag.registrate:Registrate:${registrate_version}") 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/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) -> { 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" diff --git a/gradle.properties b/gradle.properties index c4f04818..bd9cb1dd 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_mavenVersion = 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