Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/1.20' into 1.20
Browse files Browse the repository at this point in the history
# Conflicts:
#	changelog.md
  • Loading branch information
MehVahdJukaar committed Dec 13, 2024
2 parents 50bcbd7 + 398f655 commit aa27e93
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 49 deletions.
13 changes: 12 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
fixed server crash
### UPDATED:
- **More Crafting Table (LieOnLion)** (FABRIC): Updated to support v1.2.7

---

### NEW:
- N/A

---

**LEGEND**:
- (COMMON) = FORGE & FABRIC
12 changes: 9 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,22 +567,19 @@ public BL createPaletteFromOak(Consumer<Palette> paletteTransform) {
}

public BL createPaletteFromOak() {
return createPaletteFromOak(p -> {
});
return createPaletteFromOak(p -> {});
}

public BL createPaletteFromChild(Consumer<Palette> paletteTransform, String childKey) {
return createPaletteFromChild(paletteTransform, childKey, null);
}

public BL createPaletteFromChild(String childKey, Predicate<String> 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<Palette> paletteTransform, String childKey, Predicate<String> whichSide) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}
}
Expand Down
14 changes: 10 additions & 4 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 ================================================== \\

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -31,7 +28,7 @@ public class CreateModule extends SimpleModule {

public CreateModule(String modId) {
super(modId, "c");
ResourceKey<CreativeModeTab> tab = CreativeModeTabs.BUILDING_BLOCKS;
ResourceLocation tab = modRes("palettes");

windows = SimpleEntrySet.builder(WoodType.class, "window",
getModBlock("oak_window"), () -> WoodTypeRegistry.OAK_TYPE, //AllPaletteBlocks.OAK_WINDOW
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
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 {

public final SimpleEntrySet<WoodType, Block> craftingTable;

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"))
Expand All @@ -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);
}
}
12 changes: 9 additions & 3 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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) -> {
Expand Down
7 changes: 0 additions & 7 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"



Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa27e93

Please sign in to comment.