Update ResourceLocation usage and replace deprecated AllTags with relevant CommonMetal and TFMGItemTags across the codebase

This commit is contained in:
Joao Rocha
2025-11-07 01:32:33 +00:00
parent e26e4485f1
commit 1df1f1a0fb
16 changed files with 96 additions and 104 deletions

View File

@@ -223,7 +223,7 @@ public class TFMGPaletteBlockPattern {
ResourceLocation resLoc = texture.srcFactory.apply(variant);
ResourceLocation resLocTarget = texture.targetFactory.apply(variant);
return CTSpriteShifter.getCT(texture.type, resLoc,
new ResourceLocation(resLocTarget.getNamespace(), resLocTarget.getPath() + "_connected"));
ResourceLocation.fromNamespaceAndPath(resLocTarget.getNamespace(), resLocTarget.getPath() + "_connected"));
}
@FunctionalInterface

View File

@@ -17,7 +17,7 @@ import org.joml.Matrix4f;
@OnlyIn(Dist.CLIENT)
public class DryIceFlakeRenderer extends EntityRenderer<DryIceFlake> {
private static final ResourceLocation TEXTURE_LOCATION = new ResourceLocation("tfmg:textures/entity/dry_ice_flake.png");
private static final ResourceLocation TEXTURE_LOCATION = ResourceLocation.parse("tfmg:textures/entity/dry_ice_flake.png");
private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION);
public DryIceFlakeRenderer(EntityRendererProvider.Context context) {
super(context);

View File

@@ -17,7 +17,7 @@ import org.joml.Matrix4f;
@OnlyIn(Dist.CLIENT)
public class SparkRenderer extends EntityRenderer<Spark> {
private static final ResourceLocation TEXTURE_LOCATION = new ResourceLocation("textures/particle/lava.png");
private static final ResourceLocation TEXTURE_LOCATION = ResourceLocation.parse("textures/particle/lava.png");
private static final RenderType RENDER_TYPE = RenderType.entityCutoutNoCull(TEXTURE_LOCATION);
public SparkRenderer(EntityRendererProvider.Context p_173962_) {
super(p_173962_);

View File

@@ -20,7 +20,7 @@ public class CableTypeBuilder<T extends CableType, P> extends AbstractBuilder<Ca
private final NonNullFunction<CableType.Properties, T> factory;
private NonNullSupplier<CableType.Properties> initialProperties = () -> new CableType.Properties(new ResourceLocation(getOwner().getModid(), getName()));
private NonNullSupplier<CableType.Properties> initialProperties = () -> new CableType.Properties(ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName()));
private NonNullFunction<CableType.Properties, CableType.Properties> propertiesCallback = NonNullUnaryOperator.identity();
public CableTypeBuilder(AbstractRegistrate<?> owner, P parent, String name, BuilderCallback callback, NonNullFunction<CableType.Properties, T> factory) {
@@ -60,7 +60,7 @@ public class CableTypeBuilder<T extends CableType, P> extends AbstractBuilder<Ca
@Override
public CableTypeEntry<T> register() {
TFMGRegistries.registeredCableTypes.put(new ResourceLocation(getOwner().getModid(), getName()), createEntry());
TFMGRegistries.registeredCableTypes.put(ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName()), createEntry());
return (CableTypeEntry<T>) super.register();
}
}

View File

@@ -60,7 +60,7 @@ public class CableConnection {
BlockPos blockPos1 = BlockPos.of(compoundTag.getLong("Pos"));
boolean visible = compoundTag.getBoolean("Visible");
CableType type = TFMGUtils.getCableType(new ResourceLocation(compoundTag.getString("CableType")));
CableType type = TFMGUtils.getCableType(ResourceLocation.parse(compoundTag.getString("CableType")));
return new CableConnection(pos1,pos2,blockPos1,type,visible);
}
public float getLength(){

View File

@@ -47,7 +47,7 @@ public class FuelType {
public static FuelType fromJson(JsonObject object) {
FuelType type = new FuelType();
try {
parseJsonPrimitive(object, "fluid", JsonPrimitive::isString, primitive -> type.fluid = optionalTag(ForgeRegistries.FLUIDS,new ResourceLocation(primitive.getAsString())));
parseJsonPrimitive(object, "fluid", JsonPrimitive::isString, primitive -> type.fluid = optionalTag(ForgeRegistries.FLUIDS, ResourceLocation.fromNamespaceAndPath("", primitive.getAsString())));
parseJsonPrimitive(object, "speed", JsonPrimitive::isNumber, primitive -> type.speed = primitive.getAsFloat());
parseJsonPrimitive(object, "efficiency", JsonPrimitive::isNumber, primitive -> type.efficiency = primitive.getAsFloat());

View File

@@ -16,6 +16,7 @@ import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.FluidTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
@@ -26,7 +27,6 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.ArrayList;
import java.util.List;
@@ -39,7 +39,6 @@ import static com.drmangotea.tfmg.content.engines.base.EngineProperties.pistonsU
import static com.drmangotea.tfmg.content.engines.base.EngineProperties.pistonsV;
import static com.drmangotea.tfmg.content.engines.base.EngineProperties.pistonsW;
import static com.drmangotea.tfmg.content.engines.types.regular_engine.RegularEngineBlock.EXTENDED;
import static com.drmangotea.tfmg.registry.TFMGTags.optionalTag;
import static com.simibubi.create.content.kinetics.base.HorizontalKineticBlock.HORIZONTAL_FACING;
public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
@@ -93,7 +92,7 @@ public class RegularEngineBlockEntity extends AbstractSmallEngineBlockEntity {
String id = fuelsToAllow.getString(key);
TagKey<Fluid> tag = optionalTag(ForgeRegistries.FLUIDS, new ResourceLocation(id));
TagKey<Fluid> tag = FluidTags.create(ResourceLocation.fromNamespaceAndPath("forge", id.replace("forge:", "")));
fuelsFound.add(tag);
}

View File

@@ -116,7 +116,7 @@ public class ElectrodeHolderBlockEntity extends ElectricBlockEntity implements I
@Override
protected void read(CompoundTag compound, boolean clientPacket) {
super.read(compound, clientPacket);
setElectrode(TFMGUtils.getElectrode(new ResourceLocation(compound.getString("Electrode"))), false);
setElectrode(TFMGUtils.getElectrode(ResourceLocation.parse(compound.getString("Electrode"))), false);
}
public void destroy() {

View File

@@ -20,7 +20,7 @@ public class ElectrodeBuilder<T extends Electrode, P> extends AbstractBuilder<El
private final NonNullFunction<Electrode.Properties, T> factory;
private NonNullSupplier<Electrode.Properties> initialProperties = () -> new Electrode.Properties(new ResourceLocation(getOwner().getModid(), getName()));
private NonNullSupplier<Electrode.Properties> initialProperties = () -> new Electrode.Properties(ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName()));
private NonNullFunction<Electrode.Properties, Electrode.Properties> propertiesCallback = NonNullUnaryOperator.identity();
public ElectrodeBuilder(AbstractRegistrate<?> owner, P parent, String name, BuilderCallback callback, NonNullFunction<Electrode.Properties, T> factory) {
@@ -60,7 +60,7 @@ public class ElectrodeBuilder<T extends Electrode, P> extends AbstractBuilder<El
@Override
public ElectrodeEntry<T> register() {
TFMGRegistries.registeredElectrodes.put(new ResourceLocation(getOwner().getModid(), getName()), createEntry());
TFMGRegistries.registeredElectrodes.put(ResourceLocation.fromNamespaceAndPath(getOwner().getModid(), getName()), createEntry());
return (ElectrodeEntry<T>) super.register();
}
}

View File

@@ -82,7 +82,7 @@ public abstract class TFMGProcessingRecipeGen extends TFMGRecipeProvider {
ItemLike itemLike = singleIngredient.get();
transform
.apply(new ProcessingRecipeBuilder<>(serializer.getFactory(),
new ResourceLocation(namespace, CatnipServices.REGISTRIES.getKeyOrThrow(itemLike.asItem())
ResourceLocation.fromNamespaceAndPath(namespace, CatnipServices.REGISTRIES.getKeyOrThrow(itemLike.asItem())
.getPath())).withItemIngredients(Ingredient.of(itemLike)))
.build(c);
};

View File

@@ -15,11 +15,11 @@ import com.drmangotea.tfmg.registry.TFMGTags;
import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllFluids;
import com.simibubi.create.AllItems;
import com.simibubi.create.AllTags;
import com.simibubi.create.content.decoration.palettes.AllPaletteBlocks;
import com.simibubi.create.content.decoration.palettes.AllPaletteStoneTypes;
import com.simibubi.create.content.processing.recipe.ProcessingRecipe;
import com.simibubi.create.content.processing.recipe.ProcessingRecipeSerializer;
import com.simibubi.create.foundation.data.recipe.CommonMetal;
import net.createmod.catnip.platform.CatnipServices;
import net.minecraft.data.PackOutput;
import net.minecraft.data.recipes.FinishedRecipe;
@@ -382,10 +382,10 @@ public class TFMGRecipeProvider extends RecipeProvider {
return ItemTags.LOGS_THAT_BURN;
}
public static TagKey<Item> gold() {
return AllTags.forgeItemTag("ingots/gold");
return CommonMetal.GOLD.ingots;
}
public static TagKey<Item> string() {
return AllTags.forgeItemTag("string");
return Tags.Items.STRING;
}
public static ItemLike propeller() {
@@ -463,7 +463,7 @@ public class TFMGRecipeProvider extends RecipeProvider {
public static TagKey<Item> goldSheet() {
return AllTags.forgeItemTag("plates/gold");
return CommonMetal.GOLD.plates;
}
public static TagKey<Item> stone() {
@@ -500,11 +500,11 @@ public class TFMGRecipeProvider extends RecipeProvider {
}
public static TagKey<Item> brassIngot() {
return AllTags.forgeItemTag("ingots/brass");
return CommonMetal.BRASS.ingots;
}
public static TagKey<Item> brassSheet() {
return AllTags.forgeItemTag("plates/brass");
return CommonMetal.BRASS.plates;
}
public static TagKey<Item> iron() {
@@ -512,23 +512,19 @@ public class TFMGRecipeProvider extends RecipeProvider {
}
public static TagKey<Item> ironNugget() {
return AllTags.forgeItemTag("nuggets/iron");
return CommonMetal.IRON.nuggets;
}
public static TagKey<Item> ironDust() {
return AllTags.forgeItemTag("dusts/iron");
return TFMGTags.TFMGItemTags.DUSTS_IRON.tag;
}
public static TagKey<Item> zincIngot() {
return AllTags.forgeItemTag("ingots/zinc");
return CommonMetal.ZINC.ingots;
}
public static TagKey<Item> ironSheet() {
return AllTags.forgeItemTag("plates/iron");
}
public static TagKey<Item> sturdySheet() {
return AllTags.forgeItemTag("plates/obsidian");
return CommonMetal.IRON.plates;
}
public static ItemLike brassCasing() {
@@ -552,15 +548,11 @@ public class TFMGRecipeProvider extends RecipeProvider {
}
public static TagKey<Item> brassBlock() {
return AllTags.forgeItemTag("storage_blocks/brass");
return CommonMetal.BRASS.storageBlocks.items();
}
public static TagKey<Item> zincBlock() {
return AllTags.forgeItemTag("storage_blocks/zinc");
}
public static TagKey<Item> wheatFlour() {
return AllTags.forgeItemTag("flour/wheat");
return CommonMetal.ZINC.storageBlocks.items();
}
public static ItemLike copperIngot() {
@@ -568,19 +560,19 @@ public class TFMGRecipeProvider extends RecipeProvider {
}
public static TagKey<Item> copperSheet() {
return AllTags.forgeItemTag("plates/copper");
return CommonMetal.COPPER.plates;
}
public static TagKey<Item> copperNugget() {
return AllTags.forgeItemTag("nuggets/copper");
return CommonMetal.COPPER.nuggets;
}
public static TagKey<Item> brassNugget() {
return AllTags.forgeItemTag("nuggets/brass");
return CommonMetal.BRASS.nuggets;
}
public static TagKey<Item> zincNugget() {
return AllTags.forgeItemTag("nuggets/zinc");
return CommonMetal.ZINC.nuggets;
}
public static ItemLike copperCasing() {
@@ -595,10 +587,6 @@ public class TFMGRecipeProvider extends RecipeProvider {
return AllItems.SHADOW_STEEL.get();
}
public static Ingredient netherite() {
return Ingredient.of(AllTags.forgeItemTag("ingots/netherite"));
}
public static ItemStack resistor10Ohms(){
ItemStack stack = TFMGBlocks.RESISTOR.asStack();
@@ -818,7 +806,7 @@ public class TFMGRecipeProvider extends RecipeProvider {
ItemLike itemLike = singleIngredient.get();
transform
.apply((IndustrialBlastingRecipeBuilder) new IndustrialBlastingRecipeBuilder(serializer.getFactory(),hotAirUsage,
new ResourceLocation(namespace, CatnipServices.REGISTRIES.getKeyOrThrow(itemLike.asItem())
ResourceLocation.fromNamespaceAndPath(namespace, CatnipServices.REGISTRIES.getKeyOrThrow(itemLike.asItem())
.getPath())).withItemIngredients(Ingredient.of(itemLike)))
.build(c);
};
@@ -863,7 +851,7 @@ public class TFMGRecipeProvider extends RecipeProvider {
ItemLike itemLike = singleIngredient.get();
transform
.apply((VatMachineRecipeBuilder) new VatMachineRecipeBuilder(serializer.getFactory(),params,
new ResourceLocation(namespace, CatnipServices.REGISTRIES.getKeyOrThrow(itemLike.asItem())
ResourceLocation.fromNamespaceAndPath(namespace, CatnipServices.REGISTRIES.getKeyOrThrow(itemLike.asItem())
.getPath())).withItemIngredients(Ingredient.of(itemLike)))
.build(c);
};

View File

@@ -7,7 +7,6 @@ import com.drmangotea.tfmg.base.fluid.AsphaltFluid;
import com.drmangotea.tfmg.base.fluid.ConcreteFluid;
import com.drmangotea.tfmg.base.fluid.HotFluidType;
import com.simibubi.create.AllFluids;
import com.simibubi.create.AllTags;
import com.simibubi.create.content.fluids.VirtualFluid;
import com.tterrag.registrate.builders.FluidBuilder;
import com.tterrag.registrate.util.entry.FluidEntry;
@@ -15,6 +14,7 @@ import com.tterrag.registrate.util.nullness.NonNullFunction;
import net.createmod.catnip.theme.Color;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.material.Fluid;
@@ -79,7 +79,7 @@ public class TFMGFluids {
.tag(tags)
.source(ForgeFlowingFluid.Source::new)
.bucket()
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}
@@ -97,7 +97,7 @@ public class TFMGFluids {
.tag(tags)
.source(ForgeFlowingFluid.Source::new)
.bucket()
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}
@@ -117,7 +117,7 @@ public class TFMGFluids {
.tag(TFMGTags.TFMGFluidTags.FUEL.tag, TFMGTags.TFMGFluidTags.FLAMMABLE.tag)
.source(ForgeFlowingFluid.Source::new)
.bucket()
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}
@@ -136,7 +136,7 @@ public class TFMGFluids {
.tag(tags)
.source(ForgeFlowingFluid.Source::new)
.bucket()
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}
@@ -155,7 +155,7 @@ public class TFMGFluids {
.tag(tags)
.source(factory)
.bucket()
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}
@@ -169,7 +169,7 @@ public class TFMGFluids {
.tag(TFMGTags.TFMGFluidTags.GAS.tag)
.bucket()
.lang(TFMGUtils.fromId(name) + " Tank")
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}
@@ -184,7 +184,7 @@ public class TFMGFluids {
.tag(TFMGTags.TFMGFluidTags.FLAMMABLE.tag)
.bucket()
.lang(TFMGUtils.fromId(name) + " Tank")
.tag(AllTags.forgeItemTag("buckets/" + name))
.tag(ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "buckets/" + name)))
.build()
.register();
}

View File

@@ -57,7 +57,7 @@ public enum TFMGGuiTextures implements ScreenElement {
}
private TFMGGuiTextures(String namespace, String location, int startX, int startY, int width, int height) {
this.location = new ResourceLocation(namespace, "textures/gui/" + location + ".png");
this.location = ResourceLocation.fromNamespaceAndPath(namespace, "textures/gui/" + location + ".png");
this.width = width;
this.height = height;
this.startX = startX;

View File

@@ -29,10 +29,11 @@ import com.drmangotea.tfmg.content.items.weapons.quad_potato_cannon.QuadPotatoCa
import com.drmangotea.tfmg.content.machinery.misc.winding_machine.SpoolItem;
import com.drmangotea.tfmg.content.machinery.oil_processing.OilHammerItem;
import com.drmangotea.tfmg.content.machinery.oil_processing.pumpjack.pumpjack.base.DepositItem;
import com.simibubi.create.AllTags;
import com.simibubi.create.content.processing.sequenced.SequencedAssemblyItem;
import com.simibubi.create.foundation.data.AssetLookup;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.drmangotea.tfmg.registry.TFMGTags.TFMGItemTags;
import com.simibubi.create.foundation.data.recipe.CommonMetal;
import com.tterrag.registrate.builders.ItemBuilder;
import com.tterrag.registrate.util.DataIngredient;
import com.tterrag.registrate.util.entry.ItemEntry;
@@ -64,7 +65,8 @@ import static com.drmangotea.tfmg.content.items.weapons.explosives.thermite_gren
import static com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.ThermiteGrenade.ChemicalColor.BLUE;
import static com.drmangotea.tfmg.content.items.weapons.explosives.thermite_grenades.ThermiteGrenade.ChemicalColor.GREEN;
import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS;
import static com.simibubi.create.AllTags.forgeItemTag;
import static com.simibubi.create.AllTags.AllItemTags.PLATES;
import static com.simibubi.create.AllTags.AllItemTags;
public class TFMGItems {
@@ -73,54 +75,55 @@ public class TFMGItems {
public static final ItemEntry<Item>
STEEL_INGOT = taggedIngredient("steel_ingot", forgeItemTag("ingots/steel"), CREATE_INGOTS.tag),
CAST_IRON_INGOT = taggedIngredient("cast_iron_ingot", forgeItemTag("ingots/cast_iron"), CREATE_INGOTS.tag),
ALUMINUM_INGOT = taggedIngredient("aluminum_ingot", forgeItemTag("ingots/aluminum"), CREATE_INGOTS.tag),
PLASTIC_SHEET = taggedIngredient("plastic_sheet", forgeItemTag("ingots/plastic"), CREATE_INGOTS.tag),
HEAVY_PLATE = taggedIngredient("heavy_plate", forgeItemTag("plates/steel"), forgeItemTag("plates")),
ALUMINUM_SHEET = taggedIngredient("aluminum_sheet", forgeItemTag("plates/aluminum"), forgeItemTag("plates")),
NICKEL_SHEET = taggedIngredient("nickel_sheet", forgeItemTag("plates/nickel"), forgeItemTag("plates")),
CAST_IRON_SHEET = taggedIngredient("cast_iron_sheet", forgeItemTag("plates/cast_iron"), forgeItemTag("plates")),
LEAD_SHEET = taggedIngredient("lead_sheet", forgeItemTag("plates/lead"), forgeItemTag("plates")),
LEAD_INGOT = taggedIngredient("lead_ingot", forgeItemTag("ingots/lead"), CREATE_INGOTS.tag),
NICKEL_INGOT = taggedIngredient("nickel_ingot", forgeItemTag("ingots/nickel"), CREATE_INGOTS.tag),
CONSTANTAN_INGOT = taggedIngredient("constantan_ingot", forgeItemTag("ingots/constantan"), CREATE_INGOTS.tag),
LITHIUM_INGOT = taggedIngredient("lithium_ingot", forgeItemTag("ingots/lithium"), CREATE_INGOTS.tag),
ALUMINUM_NUGGET = taggedIngredient("aluminum_nugget", forgeItemTag("nuggets/aluminum"), forgeItemTag("nuggets")),
STEEL_NUGGET = taggedIngredient("steel_nugget", forgeItemTag("nuggets/steel"), forgeItemTag("nuggets")),
CAST_IRON_NUGGET = taggedIngredient("cast_iron_nugget", forgeItemTag("nuggets/cast_iron"), forgeItemTag("nuggets")),
CONSTANTAN_NUGGET = taggedIngredient("constantan_nugget", forgeItemTag("nuggets/constantan"), forgeItemTag("nuggets")),
LEAD_NUGGET = taggedIngredient("lead_nugget", forgeItemTag("nuggets/lead"), forgeItemTag("nuggets")),
NICKEL_NUGGET = taggedIngredient("nickel_nugget", forgeItemTag("nuggets/nickel"), forgeItemTag("nuggets")),
LITHIUM_NUGGET = taggedIngredient("lithium_nugget", forgeItemTag("nuggets/lithium"), forgeItemTag("nuggets")),
RAW_LEAD = taggedIngredient("raw_lead", forgeItemTag("raw_materials/lead"), forgeItemTag("raw_materials")),
RAW_NICKEL = taggedIngredient("raw_nickel", forgeItemTag("raw_materials/nickel"), forgeItemTag("raw_materials")),
RAW_LITHIUM = taggedIngredient("raw_lithium", forgeItemTag("raw_materials/lithium"), forgeItemTag("raw_materials")),
SYNTHETIC_LEATHER = taggedIngredient("synthetic_leather", Tags.Items.LEATHER, AllTags.forgeItemTag("leather")),
LIMESAND = taggedIngredient("limesand", TFMGTags.TFMGItemTags.FLUX.tag),
SULFUR_DUST = taggedIngredient("sulfur_dust", forgeItemTag("dusts/sulfur"), forgeItemTag("dusts")),
RUBBER_SHEET = taggedIngredient("rubber_sheet", forgeItemTag("ingots/rubber"), forgeItemTag("ingots")),
SILICON_INGOT = taggedIngredient("silicon_ingot", forgeItemTag("ingots/silicon"), forgeItemTag("ingots")),
CRUSHED_LITHIUM = taggedIngredient("crushed_raw_lithium", AllTags.AllItemTags.CRUSHED_RAW_MATERIALS.tag)
STEEL_INGOT = taggedIngredient("steel_ingot", CommonMetal.STEEL.ingots, Tags.Items.INGOTS, CREATE_INGOTS.tag),
CAST_IRON_INGOT = taggedIngredient("cast_iron_ingot", TFMGItemTags.INGOTS_CAST_IRON.tag, Tags.Items.INGOTS, CREATE_INGOTS.tag),
ALUMINUM_INGOT = taggedIngredient("aluminum_ingot", CommonMetal.ALUMINUM.ingots, Tags.Items.INGOTS, CREATE_INGOTS.tag),
PLASTIC_SHEET = taggedIngredient("plastic_sheet", TFMGItemTags.INGOTS_PLASTIC.tag, Tags.Items.INGOTS, CREATE_INGOTS.tag),
HEAVY_PLATE = taggedIngredient("heavy_plate", CommonMetal.STEEL.plates, PLATES.tag),
ALUMINUM_SHEET = taggedIngredient("aluminum_sheet", CommonMetal.ALUMINUM.plates, PLATES.tag),
NICKEL_SHEET = taggedIngredient("nickel_sheet", CommonMetal.NICKEL.plates, PLATES.tag),
CAST_IRON_SHEET = taggedIngredient("cast_iron_sheet", TFMGItemTags.PLATES_CAST_IRON.tag, PLATES.tag),
LEAD_SHEET = taggedIngredient("lead_sheet", CommonMetal.LEAD.plates, PLATES.tag),
LEAD_INGOT = taggedIngredient("lead_ingot", CommonMetal.LEAD.ingots, Tags.Items.INGOTS, CREATE_INGOTS.tag),
NICKEL_INGOT = taggedIngredient("nickel_ingot", CommonMetal.NICKEL.ingots, Tags.Items.INGOTS, CREATE_INGOTS.tag),
CONSTANTAN_INGOT = taggedIngredient("constantan_ingot", CommonMetal.CONSTANTAN.ingots, Tags.Items.INGOTS, CREATE_INGOTS.tag),
LITHIUM_INGOT = taggedIngredient("lithium_ingot", TFMGItemTags.INGOTS_LITHIUM.tag, Tags.Items.INGOTS, CREATE_INGOTS.tag),
ALUMINUM_NUGGET = taggedIngredient("aluminum_nugget", CommonMetal.ALUMINUM.nuggets, Tags.Items.NUGGETS),
STEEL_NUGGET = taggedIngredient("steel_nugget", CommonMetal.STEEL.nuggets, Tags.Items.NUGGETS),
CAST_IRON_NUGGET = taggedIngredient("cast_iron_nugget", TFMGItemTags.NUGGETS_CAST_IRON.tag, Tags.Items.NUGGETS),
CONSTANTAN_NUGGET = taggedIngredient("constantan_nugget", CommonMetal.CONSTANTAN.nuggets, Tags.Items.NUGGETS),
LEAD_NUGGET = taggedIngredient("lead_nugget", CommonMetal.LEAD.nuggets, Tags.Items.NUGGETS),
NICKEL_NUGGET = taggedIngredient("nickel_nugget", CommonMetal.NICKEL.nuggets, Tags.Items.NUGGETS),
LITHIUM_NUGGET = taggedIngredient("lithium_nugget", TFMGItemTags.NUGGETS_LITHIUM.tag, Tags.Items.NUGGETS),
RAW_LEAD = taggedIngredient("raw_lead", CommonMetal.LEAD.rawOres, Tags.Items.RAW_MATERIALS),
RAW_NICKEL = taggedIngredient("raw_nickel", CommonMetal.NICKEL.rawOres, Tags.Items.RAW_MATERIALS),
RAW_LITHIUM = taggedIngredient("raw_lithium", TFMGItemTags.RAW_LITHIUM.tag, Tags.Items.RAW_MATERIALS),
SYNTHETIC_LEATHER = taggedIngredient("synthetic_leather", Tags.Items.LEATHER),
LIMESAND = taggedIngredient("limesand", TFMGItemTags.FLUX.tag),
SULFUR_DUST = taggedIngredient("sulfur_dust", TFMGItemTags.DUSTS_SULFUR.tag, Tags.Items.DUSTS),
RUBBER_SHEET = taggedIngredient("rubber_sheet", TFMGItemTags.INGOTS_RUBBER.tag, PLATES.tag),
SILICON_INGOT = taggedIngredient("silicon_ingot", TFMGItemTags.INGOTS_SILICON.tag, CREATE_INGOTS.tag),
CRUSHED_LITHIUM = taggedIngredient("crushed_raw_lithium", AllItemTags.CRUSHED_RAW_MATERIALS.tag)
;
public static final ItemEntry<Item>
REBAR = REGISTRATE.item("rebar", Item::new)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/steel")), RecipeCategory.BUILDING_BLOCKS, c::get, 4))
.tag(TFMGItemTags.RODS_STEEL.tag, Tags.Items.RODS)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.STEEL.ingots), RecipeCategory.BUILDING_BLOCKS, c, 4))
.register(),
SYNTHETIC_STRING = REGISTRATE.item("synthetic_string", Item::new)
.tag(Tags.Items.STRING, AllTags.forgeItemTag("string"))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/rubber")), RecipeCategory.MISC, c::get, 4))
.tag(Tags.Items.STRING)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(TFMGItemTags.INGOTS_RUBBER.tag), RecipeCategory.MISC, c, 4))
.register();
public static final ItemEntry<Item>
COPPER_WIRE = REGISTRATE.item("copper_wire", Item::new).tag(AllTags.forgeItemTag("wires/copper"), forgeItemTag("wires"))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/copper")), RecipeCategory.BUILDING_BLOCKS, c::get, 2)).register(),
ALUMINUM_WIRE = REGISTRATE.item("aluminum_wire", Item::new).tag(AllTags.forgeItemTag("wires/aluminum"), forgeItemTag("wires"))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/aluminum")), RecipeCategory.BUILDING_BLOCKS, c::get, 2)).register(),
CONSTANTAN_WIRE = REGISTRATE.item("constantan_wire", Item::new).tag(AllTags.forgeItemTag("wires/constantan"), forgeItemTag("wires"))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/constantan")), RecipeCategory.BUILDING_BLOCKS, c::get, 2)).register();
COPPER_WIRE = REGISTRATE.item("copper_wire", Item::new).tag(TFMGItemTags.WIRES_COPPER.tag, TFMGItemTags.WIRES.tag)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.COPPER.ingots), RecipeCategory.BUILDING_BLOCKS, c, 2)).register(),
ALUMINUM_WIRE = REGISTRATE.item("aluminum_wire", Item::new).tag(TFMGItemTags.WIRES_ALUMINUM.tag, TFMGItemTags.WIRES.tag)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.ALUMINUM.ingots), RecipeCategory.BUILDING_BLOCKS, c, 2)).register(),
CONSTANTAN_WIRE = REGISTRATE.item("constantan_wire", Item::new).tag(TFMGItemTags.WIRES_CONSTANTAN.tag, TFMGItemTags.WIRES.tag)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.CONSTANTAN.ingots), RecipeCategory.BUILDING_BLOCKS, c, 2)).register();
public static final ItemEntry<Item>
SPARK_PLUG = REGISTRATE.item("spark_plug", Item::new).register(),
@@ -129,7 +132,7 @@ public class TFMGItems {
FIREPROOF_BRICK = REGISTRATE.item("fireproof_brick", Item::new).register(),
FIRECLAY_BALL = REGISTRATE.item("fireclay_ball", Item::new).register(),
SCREW = REGISTRATE.item("screw", Item::new)
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("ingots/steel")), RecipeCategory.BUILDING_BLOCKS, c::get, 4))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.STEEL.ingots), RecipeCategory.BUILDING_BLOCKS, c, 4))
.lang("Screws")
.register(),
THERMITE_POWDER = REGISTRATE.item("thermite_powder", Item::new).register(),
@@ -151,7 +154,7 @@ public class TFMGItems {
TURBO = REGISTRATE.item("turbo", Item::new).register(),
GOLDEN_TURBO = REGISTRATE.item("golden_turbo", Item::new).register(),
CINDERBLOCK = REGISTRATE.item("cinderblock", Item::new)
.recipe((c, p) -> p.stonecutting(DataIngredient.items(TFMGBlocks.CONCRETE.block.asItem()), RecipeCategory.BUILDING_BLOCKS, c::get, 8))
.recipe((c, p) -> p.stonecutting(DataIngredient.items(TFMGBlocks.CONCRETE.block.asItem()), RecipeCategory.BUILDING_BLOCKS, c, 8))
.register(),
CINDERFLOURBLOCK = REGISTRATE.item("cinderflourblock", Item::new).register(),
NAPALM_POTATO = REGISTRATE.item("napalm_potato", Item::new).register(),
@@ -171,19 +174,19 @@ public class TFMGItems {
UNFINISHED_ELECTROMAGNETIC_COIL = REGISTRATE.item("unfinished_electromagnetic_coil", Item::new).register(),
COPPER_ELECTRODE = REGISTRATE.item("copper_electrode", Item::new)
.properties(p -> p.stacksTo(1))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("storage_blocks/copper")), RecipeCategory.BUILDING_BLOCKS, c::get, 1))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.COPPER.storageBlocks.items()), RecipeCategory.BUILDING_BLOCKS, c, 1))
.model((c, p) -> p.withExistingParent(c.getName(), TFMG.asResource("item/copper_electrode_model"))).register(),
ZINC_ELECTRODE = REGISTRATE.item("zinc_electrode", Item::new)
.properties(p -> p.stacksTo(1))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("storage_blocks/zinc")), RecipeCategory.BUILDING_BLOCKS, c::get, 1))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(CommonMetal.ZINC.storageBlocks.items()), RecipeCategory.BUILDING_BLOCKS, c, 1))
.model((c, p) -> p.withExistingParent(c.getName(), TFMG.asResource("item/zinc_electrode_model"))).register(),
GRAPHITE_ELECTRODE = REGISTRATE.item("graphite_electrode", Item::new)
.properties(p -> p.stacksTo(1))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(AllTags.forgeItemTag("storage_blocks/coal_coke")), RecipeCategory.BUILDING_BLOCKS, c::get, 1))
.recipe((c, p) -> p.stonecutting(DataIngredient.tag(TFMGItemTags.STORAGE_BLOCKS_COAL_COKE.tag), RecipeCategory.BUILDING_BLOCKS, c, 1))
.model((c, p) -> p.withExistingParent(c.getName(), TFMG.asResource("item/graphite_electrode_model"))).register(),
UNFIRED_INSULATOR = REGISTRATE.item("unfired_insulator", Item::new)
.model((c, p) -> p.withExistingParent(c.getName(), TFMG.asResource("item/unfired_insulator_model")))
.recipe((c, p) -> p.stonecutting(DataIngredient.items(Blocks.CLAY.asItem()), RecipeCategory.BUILDING_BLOCKS, c::get, 1))
.recipe((c, p) -> p.stonecutting(DataIngredient.items(Blocks.CLAY.asItem()), RecipeCategory.BUILDING_BLOCKS, c, 1))
.register(),
UNFINISHED_INSULATOR = REGISTRATE.item("unfinished_insulator", Item::new)
.model((c, p) -> p.withExistingParent(c.getName(), TFMG.asResource("item/unfinished_insulator_model"))).register(),
@@ -222,7 +225,7 @@ public class TFMGItems {
// .properties(p -> p.stacksTo(1))
// .register();
public static final ItemEntry<CoalCokeItem> COAL_COKE_DUST = REGISTRATE.item("coal_coke_dust", CoalCokeItem::new)
.tag(forgeItemTag("dusts/coal_coke"), TFMGTags.TFMGItemTags.BLAST_FURNACE_FUEL.tag, forgeItemTag("dusts"))
.tag(TFMGItemTags.DUSTS_COAL_COKE.tag, TFMGTags.TFMGItemTags.BLAST_FURNACE_FUEL.tag, Tags.Items.DUSTS)
.register();
public static final ItemEntry<OilHammerItem> OIL_HAMMER = REGISTRATE.item("oil_hammer", OilHammerItem::new)
@@ -456,7 +459,7 @@ public class TFMGItems {
public static ItemBuilder<SpoolItem, CreateRegistrate> spoolItem(String name, int barColor, ResourceLocation type) {
return REGISTRATE.item(name + "_spool", p -> new SpoolItem(p, barColor, type))
.tag(TFMGTags.TFMGItemTags.SPOOLS.tag)
.tag(TFMGItemTags.SPOOLS.tag)
.properties(p -> p.stacksTo(1));
}

View File

@@ -8,6 +8,8 @@ import com.simibubi.create.AllTags;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.utility.CreateLang;
import com.tterrag.registrate.util.nullness.NonNullSupplier;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
@@ -58,8 +60,8 @@ public enum TFMGPaletteStoneTypes {
NonNullSupplier<Block> baseBlock = paletteStoneVariants.factory.apply(registrate);
paletteStoneVariants.baseBlock = baseBlock;
String id = CreateLang.asId(paletteStoneVariants.name());
paletteStoneVariants.materialTag =
AllTags.optionalTag(ForgeRegistries.ITEMS, TFMG.asResource("stone_types/" + id));
paletteStoneVariants.materialTag =
ItemTags.create(ResourceLocation.fromNamespaceAndPath("forge", "stone_types/" + id.replace("forge:", "")));
paletteStoneVariants.variants = new TFMGPalettesVariantEntry(id, paletteStoneVariants);
}
}

View File

@@ -338,7 +338,7 @@ public class TFMGSoundEvents {
}
protected ResourceLocation getIdOf(int i) {
return new ResourceLocation(id.getNamespace(), i == 0 ? id.getPath() : id.getPath() + "_compounded_" + i);
return ResourceLocation.fromNamespaceAndPath(id.getNamespace(), i == 0 ? id.getPath() : id.getPath() + "_compounded_" + i);
}
@Override