Skip to content

Commit

Permalink
tag fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leclowndu93150 committed Oct 6, 2024
1 parent 7457bb5 commit f043fb0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ configurations {

dependencies {
runtimeOnly "curse.maven:mekanism-268560:5680395"
runtimeOnly "curse.maven:cloth-config-348521:5729127"
runtimeOnly "curse.maven:modern-industrialization-405388:5729622"
runtimeOnly "curse.maven:mystical-agriculture-246640:5774649"
runtimeOnly "curse.maven:cucumber-272335:5774468"
runtimeOnly "curse.maven:jei-238222:5781938"
implementation "curse.maven:selene-499980:5787975"
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=More Plates
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=1.0.0
mod_version=1.0.1
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.mojang.serialization.Decoder;
import com.portingdeadmods.moreplates.MorePlatesMod;
import com.portingdeadmods.moreplates.config.MPConfig;
import com.portingdeadmods.moreplates.registries.MPItems;
Expand All @@ -21,6 +22,7 @@
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe;
import net.neoforged.neoforge.common.conditions.ICondition;
import org.apache.logging.log4j.Logger;
Expand All @@ -34,6 +36,7 @@ public class DynamicDataPack extends DynServerResourcesGenerator {
public DynamicDataPack() {
super(new net.mehvahdjukaar.moonlight.api.resources.pack.DynamicDataPack(ResourceLocation.fromNamespaceAndPath(MorePlatesMod.MODID,"generated_pack"), Pack.Position.TOP, false, false));
this.dynamicPack.setGenerateDebugResources(PlatHelper.isDev());
this.dynamicPack.addNamespaces("c");
}

@Override
Expand Down Expand Up @@ -156,6 +159,25 @@ public void accept(@NotNull ResourceLocation resourceLocation, @NotNull Recipe<?
}
});
}

if(MorePlatesMod.MODID.equals(itemId.getNamespace())){
if(itemId.getPath().contains("plate")){
ResourceLocation originalItem = MPConfig.getIngotFromPlate(itemId);
SimpleTagBuilder tagBuilder = SimpleTagBuilder.of(ResourceLocation.fromNamespaceAndPath(MorePlatesMod.MODID,"mods/"+originalItem.getNamespace()));
tagBuilder.addEntry(item);
dynamicPack.addTag(tagBuilder, Registries.ITEM);
}else if(itemId.getPath().contains("gear")){
ResourceLocation originalItem = MPConfig.getIngotFromGear(itemId);
SimpleTagBuilder tagBuilder = SimpleTagBuilder.of(ResourceLocation.fromNamespaceAndPath(MorePlatesMod.MODID,"mods/"+originalItem.getNamespace()));
tagBuilder.addEntry(item);
dynamicPack.addTag(tagBuilder, Registries.ITEM);
}else if(itemId.getPath().contains("rod")){
ResourceLocation originalItem = MPConfig.getIngotFromRod(itemId);
SimpleTagBuilder tagBuilder = SimpleTagBuilder.of(ResourceLocation.fromNamespaceAndPath(MorePlatesMod.MODID,"mods/"+originalItem.getNamespace()));
tagBuilder.addEntry(item);
dynamicPack.addTag(tagBuilder, Registries.ITEM);
}
}
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class IngotUtil {
public static boolean isValidIngot(ResourceLocation location, boolean onlyVanilla) {
String path = location.getPath();
return path.contains("ingot") && !path.contains("block") && (!onlyVanilla || "minecraft".equals(location.getNamespace()));
return (path.startsWith("ingot_") || path.endsWith("_ingot")) && !path.contains("block") && (!onlyVanilla || "minecraft".equals(location.getNamespace()));
}

public static String getIngotType(ResourceLocation itemId) {
Expand Down

0 comments on commit f043fb0

Please sign in to comment.