-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/1.20' into 1.20
# Conflicts: # changelog.md
- Loading branch information
Showing
14 changed files
with
114 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
common/src/main/java/net/mehvahdjukaar/every_compat/common_classes/RecipeUtility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters