Skip to content

Commit

Permalink
Updated to work with new loader
Browse files Browse the repository at this point in the history
Shnupbups committed Aug 28, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 95a25db commit 85c2b52
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
import com.shnupbups.extrapieces.core.PieceSet;
import com.shnupbups.extrapieces.core.PieceSets;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.metadata.CustomValue;
import net.minecraft.util.Identifier;

import java.io.File;
@@ -50,12 +51,12 @@ public static void init() {

public static void findAndCopyPiecePacks() {
FabricLoader.getInstance().getAllMods().stream().map(modContainer -> {
com.google.gson.JsonElement je = modContainer.getMetadata().getCustomElement(ExtraPieces.mod_id + ":piecepack");
Path path = null;

if (je != null) {
if (modContainer.getMetadata().containsCustomValue(ExtraPieces.mod_id + ":piecepack")) {
ExtraPieces.log("Found Piece Pack in " + modContainer.getMetadata().getName() + " (" + modContainer.getMetadata().getId() + ")");
path = modContainer.getPath(je.getAsString());
CustomValue pp = modContainer.getMetadata().getCustomValue(ExtraPieces.mod_id + ":piecepack");
path = modContainer.getPath(pp.getAsString());
}

return path;
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "extrapieces",
"version": "2.6.0",
"version": "2.6.1",

"name": "Extra Pieces",
"description": "Adds more block shapes to Minecraft!",
@@ -33,7 +33,7 @@
],

"depends": {
"fabricloader": ">=0.4.0",
"fabricloader": ">=0.6.1",
"fabric": "*"
},
"suggests": {

0 comments on commit 85c2b52

Please sign in to comment.