From 5437de74a487608cc176ac33fac1f2e8dcd5c08f Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Aug 2026 11:36:28 +1000 Subject: [PATCH 1/8] switch to use correct resource location methods --- .../Recipe-Logic/Custom-Ingredient.md | 2 +- .../Other-Topics/Ambiguous-Methods.md | 2 +- .../Modpacks/Other-Topics/Dimension-Icons.md | 6 +- .../java/com/gregtechceu/gtceu/GTCEu.java | 4 +- .../gtceu/api/capability/ICoverable.java | 2 +- .../gtceu/api/cosmetics/CapeRegistry.java | 4 +- .../gtceu/api/data/tag/TagPrefix.java | 26 +- .../gtceu/api/data/tag/TagUtil.java | 8 +- .../bedrockfluid/FluidVeinWorldEntry.java | 2 +- .../bedrockore/OreVeinWorldEntry.java | 2 +- .../gtceu/api/fluids/FluidBuilder.java | 6 +- .../gregtechceu/gtceu/api/item/IGTTool.java | 6 +- .../gtceu/api/item/armor/DummyArmorLogic.java | 2 +- .../component/prospector/ProspectorMode.java | 4 +- .../recipe/ingredient/FluidIngredient.java | 8 +- .../gtceu/api/registry/GTRegistry.java | 4 +- .../api/registry/registrate/GTRegistrate.java | 2 +- .../registry/registrate/MachineBuilder.java | 32 +- .../gtceu/api/sound/WrappedSoundEntry.java | 2 +- .../gtceu/GTRecipeTransformer.java | 6 +- .../client/model/ctm/GTTextureMetadata.java | 2 +- .../model/machine/MachineModelLoader.java | 6 +- .../gtceu/client/model/pipe/PipeModel.java | 2 +- .../renderer/entity/GTBoatRenderer.java | 6 +- .../gtceu/client/util/RenderUtil.java | 2 +- .../arguments/GTRegistryArgument.java | 2 +- .../gtceu/common/cover/data/BucketMode.java | 2 +- .../gtceu/common/data/GTBlocks.java | 6 +- .../gregtechceu/gtceu/common/data/GTOres.java | 6 +- .../gtceu/common/data/GTToolTiers.java | 2 +- .../common/data/machines/GTMachineUtils.java | 2 +- .../gtceu/common/data/models/GTModels.java | 2 +- .../item/behavior/ColorSprayBehaviour.java | 2 +- .../electric/monitor/MonitorGroup.java | 2 +- .../research/ResearchStationMachine.java | 5 +- .../electric/research/package-info.java | 4 + .../multiblock/generator/package-info.java | 4 + .../CleaningMaintenanceHatchPartMachine.java | 6 - .../multiblock/part/hpca/package-info.java | 4 + .../primitive/CharcoalPileIgniterMachine.java | 2 +- .../gtceu/common/machine/package-info.java | 4 + .../condition/AdjacentBlockCondition.java | 4 +- .../condition/AdjacentFluidCondition.java | 4 +- .../recipe/condition/BiomeCondition.java | 2 +- .../recipe/condition/BiomeTagCondition.java | 2 +- .../gregtechceu/gtceu/core/MixinHelpers.java | 12 +- .../gtceu/data/pack/GTDynamicDataPack.java | 6 +- .../data/pack/GTDynamicPackContents.java | 2 +- .../gtceu/data/recipe/CustomTags.java | 2 +- .../gtceu/data/recipe/MaterialInfoLoader.java | 4 +- .../gtceu/data/recipe/WoodTypeEntry.java | 2 +- .../data/recipe/builder/GTRecipeBuilder.java | 2 +- .../ShapedEnergyTransferRecipeBuilder.java | 4 +- .../ShapedFluidContainerRecipeBuilder.java | 2 +- .../recipe/builder/ShapedRecipeBuilder.java | 4 +- .../builder/ShapelessRecipeBuilder.java | 2 +- .../recipe/configurable/RecipeAddition.java | 12 +- .../recipe/configurable/RecipeRemoval.java | 754 +++++++++--------- .../recipe/misc/VanillaStandardRecipes.java | 32 +- .../data/recipe/misc/WoodMachineRecipes.java | 30 +- .../chemistry/ChemistryRecipes.java | 7 +- .../gtceu/data/tags/BlockTagLoader.java | 20 +- .../integration/ae2/GTAEPlaceholders.java | 4 +- .../provider/AutoOutputBlockProvider.java | 2 +- .../provider/ExhaustVentBlockProvider.java | 2 +- .../jade/provider/GTFluidStorageProvider.java | 2 +- .../jade/provider/MachineModeProvider.java | 4 +- .../kjs/builders/FluidVeinBuilderJS.java | 8 +- .../kjs/builders/block/CoilBlockBuilder.java | 2 +- .../kjs/recipe/GTRecipeSchema.java | 2 +- .../recipe/components/GTRecipeComponents.java | 2 +- .../map/cache/fluid/FluidCache.java | 2 +- .../map/journeymap/JourneymapRenderer.java | 2 +- .../worldmap/ore/OreVeinElementRenderer.java | 2 +- .../com/gregtechceu/gtceu/utils/GTUtil.java | 8 +- 75 files changed, 583 insertions(+), 571 deletions(-) create mode 100644 src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java create mode 100644 src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java create mode 100644 src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java create mode 100644 src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java diff --git a/docs/content/Development/Recipe-Logic/Custom-Ingredient.md b/docs/content/Development/Recipe-Logic/Custom-Ingredient.md index 3d26e7c07e1..67f10c52464 100644 --- a/docs/content/Development/Recipe-Logic/Custom-Ingredient.md +++ b/docs/content/Development/Recipe-Logic/Custom-Ingredient.md @@ -132,7 +132,7 @@ public class BonkRecipeCapability extends RecipeCapability { public final static BonkRecipeCapability CAP = new BonkRecipeCapability(); protected BonkRecipeCapability() { - super(new ResourceLocation("MOD_ID", "bonk"), 0x777777, false, 5, BonkIngredient.Serializer.INSTANCE); + super(ResourceLocation.fromNamespaceAndPath("MOD_ID", "bonk"), 0x777777, false, 5, BonkIngredient.Serializer.INSTANCE); } @Override diff --git a/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md b/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md index 53dceeb592b..cabf53b62fb 100644 --- a/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md +++ b/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md @@ -90,7 +90,7 @@ or GTCEuStartupEvents.registry("gtceu:recipe_type", event => { event.create("unboxinator") .setProgressBar( - ResourceTexture["(net.minecraft.resources.ResourceLocation)"](new ResourceLocation("kubejs:textures/gui/progress_bar/progress_bar_stone_oreifier.png")), + ResourceTexture["(net.minecraft.resources.ResourceLocation)"](ResourceLocation.tryParse("kubejs:textures/gui/progress_bar/progress_bar_stone_oreifier.png")), FillDirection.LEFT_TO_RIGHT ) // Rest of the recipe type diff --git a/docs/content/Modpacks/Other-Topics/Dimension-Icons.md b/docs/content/Modpacks/Other-Topics/Dimension-Icons.md index 439f59f2041..8de80dbad7e 100644 --- a/docs/content/Modpacks/Other-Topics/Dimension-Icons.md +++ b/docs/content/Modpacks/Other-Topics/Dimension-Icons.md @@ -15,7 +15,7 @@ Below is an example of making new and modifying existing dimension icons in a Ja ```java private void registerDimensionMarkers(GTCEuAPI.RegisterEvent event) { // Making a new icon. - ResourceLocation sceneDimKey = new ResourceLocation(Phantasia.MOD_ID, "scene"); + ResourceLocation sceneDimKey = ResourceLocation.fromNamespaceAndPath(Phantasia.MOD_ID, "scene"); DimensionMarker sceneMarker = new DimensionMarker( 3, // Tier () -> Items.DIAMOND_BLOCK, // Supplier for the actual Icon ItemStack. @@ -24,7 +24,7 @@ private void registerDimensionMarkers(GTCEuAPI.RegisterEvent Items.NETHERITE_BLOCK, @@ -41,7 +41,7 @@ GTCEuStartupEvents.registry("gtceu:dimension_marker", event => { // Edit existing dimension icon, const DimensionMarker = Java.loadClass('com.gregtechceu.gtceu.api.data.DimensionMarker') - let netherKey = new ResourceLocation("minecraft", "the_nether") + let netherKey = ResourceLocation.withDefaultNamespace("the_nether") let upgradedNetherMarker = new DimensionMarker( 5, diff --git a/src/main/java/com/gregtechceu/gtceu/GTCEu.java b/src/main/java/com/gregtechceu/gtceu/GTCEu.java index b834dccf3b0..42d489e9297 100644 --- a/src/main/java/com/gregtechceu/gtceu/GTCEu.java +++ b/src/main/java/com/gregtechceu/gtceu/GTCEu.java @@ -28,7 +28,7 @@ public class GTCEu { public static final String MOD_ID = "gtceu"; - private static final ResourceLocation TEMPLATE_LOCATION = new ResourceLocation(MOD_ID, ""); + private static final ResourceLocation TEMPLATE_LOCATION = ResourceLocation.fromNamespaceAndPath(MOD_ID, ""); public static final String NAME = "GregTechCEu"; public static final Logger LOGGER = LogManager.getLogger(NAME); @@ -51,7 +51,7 @@ public static ResourceLocation id(String path) { int i = path.indexOf(':'); if (i > 0) { - return new ResourceLocation(path); + return ResourceLocation.parse(path); } else if (i == 0) { path = path.substring(i + 1); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java b/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java index c5d414781d0..1d50b052329 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java @@ -313,7 +313,7 @@ private CompoundTag createCoverConfigTag(@Nullable CoverBehavior cover) { private void applyCoverConfigTag(ServerPlayer player, Direction dir, CompoundTag tag) { if (tag.isEmpty()) return; - var def = GTRegistries.COVERS.get(new ResourceLocation(tag.getString("id"))); + var def = GTRegistries.COVERS.get(ResourceLocation.tryParse(tag.getString("id"))); ItemStack stack = ItemStack.of(tag.getCompound("item")); if (def == null) return; diff --git a/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java index 67eb95d1efb..7f420ac2b31 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java @@ -118,7 +118,7 @@ private CapeRegistry load(CompoundTag tag) { String capeId = capesTag.getString(j); if (capeId.isEmpty()) continue; - capes.add(new ResourceLocation(capeId)); + capes.add(ResourceLocation.parse(capeId)); } UNLOCKED_CAPES.put(uuid, capes); } @@ -130,7 +130,7 @@ private CapeRegistry load(CompoundTag tag) { if (capeId.isEmpty()) continue; UUID uuid = entryTag.getUUID("owner"); - CURRENT_CAPES.put(uuid, new ResourceLocation(capeId)); + CURRENT_CAPES.put(uuid, ResourceLocation.tryParse(capeId)); } return this; diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java b/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java index 1a31777c85c..8e4a030fbd7 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagPrefix.java @@ -104,28 +104,28 @@ public boolean isEmpty() { .registerOre( Blocks.STONE::defaultBlockState, () -> GTMaterials.Stone, BlockBehaviour.Properties.of() .mapColor(MapColor.STONE).requiresCorrectToolForDrops().strength(3.0F, 3.0F), - new ResourceLocation("block/stone"), false, false, true); + ResourceLocation.withDefaultNamespace("block/stone"), false, false, true); public static final TagPrefix oreGranite = oreTagPrefix(GTCEu.id("granite"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Granite %s Ore") .registerOre( Blocks.GRANITE::defaultBlockState, () -> GTMaterials.Granite, BlockBehaviour.Properties.of() .mapColor(MapColor.DIRT).requiresCorrectToolForDrops().strength(3.0F, 3.0F), - new ResourceLocation("block/granite")); + ResourceLocation.withDefaultNamespace("block/granite")); public static final TagPrefix oreDiorite = oreTagPrefix(GTCEu.id("diorite"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Diorite %s Ore") .registerOre( Blocks.DIORITE::defaultBlockState, () -> GTMaterials.Diorite, BlockBehaviour.Properties.of() .mapColor(MapColor.QUARTZ).requiresCorrectToolForDrops().strength(3.0F, 3.0F), - new ResourceLocation("block/diorite")); + ResourceLocation.withDefaultNamespace("block/diorite")); public static final TagPrefix oreAndesite = oreTagPrefix(GTCEu.id("andesite"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Andesite %s Ore") .registerOre( Blocks.ANDESITE::defaultBlockState, () -> GTMaterials.Andesite, BlockBehaviour.Properties.of() .mapColor(MapColor.DIRT).requiresCorrectToolForDrops().strength(3.0F, 3.0F), - new ResourceLocation("block/andesite")); + ResourceLocation.withDefaultNamespace("block/andesite")); public static final TagPrefix oreRedGranite = oreTagPrefix("red_granite", BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Red Granite %s Ore") @@ -147,7 +147,7 @@ public boolean isEmpty() { Blocks.DEEPSLATE::defaultBlockState, () -> GTMaterials.Deepslate, BlockBehaviour.Properties.of() .mapColor(MapColor.DEEPSLATE).requiresCorrectToolForDrops().strength(4.5F, 3.0F) .sound(SoundType.DEEPSLATE), - new ResourceLocation("block/deepslate"), false, false, true); + ResourceLocation.withDefaultNamespace("block/deepslate"), false, false, true); public static final TagPrefix oreTuff = oreTagPrefix(GTCEu.id("tuff"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Tuff %s Ore") @@ -155,28 +155,28 @@ public boolean isEmpty() { Blocks.TUFF::defaultBlockState, () -> GTMaterials.Tuff, BlockBehaviour.Properties.of() .mapColor(MapColor.TERRACOTTA_GRAY).requiresCorrectToolForDrops().strength(3.0F, 3.0F) .sound(SoundType.TUFF), - new ResourceLocation("block/tuff")); + ResourceLocation.withDefaultNamespace("block/tuff")); public static final TagPrefix oreSand = oreTagPrefix(GTCEu.id("sand"), BlockTags.MINEABLE_WITH_SHOVEL) .langValue("Sand %s Ore") .registerOre(Blocks.SAND::defaultBlockState, () -> GTMaterials.SiliconDioxide, BlockBehaviour.Properties.of().mapColor(MapColor.SAND).instrument(NoteBlockInstrument.SNARE) .strength(0.5F).sound(SoundType.SAND), - new ResourceLocation("block/sand"), false, true, false); + ResourceLocation.withDefaultNamespace("block/sand"), false, true, false); public static final TagPrefix oreRedSand = oreTagPrefix(GTCEu.id("redSand"), BlockTags.MINEABLE_WITH_SHOVEL) .langValue("Red Sand %s Ore") .registerOre(Blocks.RED_SAND::defaultBlockState, () -> GTMaterials.SiliconDioxide, BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_ORANGE).instrument(NoteBlockInstrument.SNARE) .strength(0.5F).sound(SoundType.SAND), - new ResourceLocation("block/red_sand"), false, true, false); + ResourceLocation.withDefaultNamespace("block/red_sand"), false, true, false); public static final TagPrefix oreGravel = oreTagPrefix(GTCEu.id("gravel"), BlockTags.MINEABLE_WITH_SHOVEL) .langValue("Gravel %s Ore") .registerOre(Blocks.GRAVEL::defaultBlockState, () -> GTMaterials.Flint, BlockBehaviour.Properties.of().mapColor(MapColor.STONE).instrument(NoteBlockInstrument.SNARE) .strength(0.6F).sound(SoundType.GRAVEL), - new ResourceLocation("block/gravel"), false, true, false); + ResourceLocation.withDefaultNamespace("block/gravel"), false, true, false); public static final TagPrefix oreBasalt = oreTagPrefix(GTCEu.id("basalt"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Basalt %s Ore") @@ -184,14 +184,14 @@ public boolean isEmpty() { BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK) .instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops().strength(2.5F, 4.2F) .sound(SoundType.BASALT), - new ResourceLocation("block/basalt"), true); + ResourceLocation.withDefaultNamespace("block/basalt"), true); public static final TagPrefix oreNetherrack = oreTagPrefix(GTCEu.id("netherrack"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Nether %s Ore") .registerOre(Blocks.NETHERRACK::defaultBlockState, () -> GTMaterials.Netherrack, BlockBehaviour.Properties.of().mapColor(MapColor.NETHER).instrument(NoteBlockInstrument.BASEDRUM) .requiresCorrectToolForDrops().strength(3.0F, 3.0F).sound(SoundType.NETHER_ORE), - new ResourceLocation("block/netherrack"), true, false, true); + ResourceLocation.withDefaultNamespace("block/netherrack"), true, false, true); public static final TagPrefix oreBlackstone = oreTagPrefix(GTCEu.id("blackstone"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("Blackstone %s Ore") @@ -199,14 +199,14 @@ public boolean isEmpty() { BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK) .instrument(NoteBlockInstrument.BASEDRUM).requiresCorrectToolForDrops() .strength(3.0F, 3.0F), - new ResourceLocation("block/blackstone"), true, false, false); + ResourceLocation.withDefaultNamespace("block/blackstone"), true, false, false); public static final TagPrefix oreEndstone = oreTagPrefix(GTCEu.id("endstone"), BlockTags.MINEABLE_WITH_PICKAXE) .langValue("End %s Ore") .registerOre(Blocks.END_STONE::defaultBlockState, () -> GTMaterials.Endstone, BlockBehaviour.Properties.of().mapColor(MapColor.SAND).instrument(NoteBlockInstrument.BASEDRUM) .requiresCorrectToolForDrops().strength(4.5F, 9.0F), - new ResourceLocation("block/end_stone"), true, false, true); + ResourceLocation.withDefaultNamespace("block/end_stone"), true, false, true); public static final TagPrefix rawOre = new TagPrefix(GTCEu.id("raw"), true) .idPattern("raw_%s") diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagUtil.java b/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagUtil.java index bd09735b024..5e11a916600 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/tag/TagUtil.java @@ -28,8 +28,8 @@ public static TagKey optionalTag(ResourceKey> regis * @return optional tag #forge:path or #minecraft:path */ public static TagKey createTag(Registry registry, String path, boolean vanilla) { - if (vanilla) return optionalTag(registry, new ResourceLocation("minecraft", path)); - return optionalTag(registry, new ResourceLocation("forge", path)); + if (vanilla) return optionalTag(registry, ResourceLocation.withDefaultNamespace(path)); + return optionalTag(registry, ResourceLocation.fromNamespaceAndPath("forge", path)); } /** @@ -40,8 +40,8 @@ public static TagKey createTag(Registry registry, String path, boolean */ public static TagKey createTag(ResourceKey> registryKey, String path, boolean vanilla) { - if (vanilla) return optionalTag(registryKey, new ResourceLocation("minecraft", path)); - return optionalTag(registryKey, new ResourceLocation("forge", path)); + if (vanilla) return optionalTag(registryKey, ResourceLocation.withDefaultNamespace(path)); + return optionalTag(registryKey, ResourceLocation.fromNamespaceAndPath("forge", path)); } /** diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java index 91a931cc417..1e072b35872 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java @@ -77,7 +77,7 @@ public static FluidVeinWorldEntry readFromNBT(@NotNull CompoundTag tag) { if (tag.contains("vein")) { veinId = tag.getString("vein"); vein = GTMemoizer.memoize(() -> { - ResourceLocation key = new ResourceLocation(veinId); + ResourceLocation key = ResourceLocation.tryParse(veinId); return GTRegistries.BEDROCK_FLUID_DEFINITIONS.get(key); }); } else { diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java index bbfea9203e8..b647e0ce34e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java @@ -55,7 +55,7 @@ public static OreVeinWorldEntry readFromNBT(@NotNull CompoundTag tag) { info.operationsRemaining = tag.getInt("operationsRemaining"); if (tag.contains("vein")) { - ResourceLocation id = new ResourceLocation(tag.getString("vein")); + ResourceLocation id = ResourceLocation.tryParse(tag.getString("vein")); if (GTRegistries.BEDROCK_ORE_DEFINITIONS.containsKey(id)) { info.definition = GTRegistries.BEDROCK_ORE_DEFINITIONS.get(id); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/fluids/FluidBuilder.java b/src/main/java/com/gregtechceu/gtceu/api/fluids/FluidBuilder.java index fa30161ce2c..a91b626bd25 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/fluids/FluidBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/api/fluids/FluidBuilder.java @@ -298,16 +298,16 @@ private void determineName(@NotNull Material material, @Nullable FluidStorageKey private void determineTextures(@NotNull Material material, @Nullable FluidStorageKey key, @NotNull String modid) { if (!material.isNull() && key != null) { if (hasCustomStill) { - still = new ResourceLocation(modid, "block/fluids/fluid." + name); + still = ResourceLocation.fromNamespaceAndPath(modid, "block/fluids/fluid." + name); } else { still = key.getIconType().getBlockTexturePath(material.getMaterialIconSet(), true); } } else { - still = new ResourceLocation(modid, "block/fluids/fluid." + name); + still = ResourceLocation.fromNamespaceAndPath(modid, "block/fluids/fluid." + name); } if (hasCustomFlowing) { - flowing = new ResourceLocation(modid, "block/fluids/fluid." + name + "_flow"); + flowing = ResourceLocation.fromNamespaceAndPath(modid, "block/fluids/fluid." + name + "_flow"); } else { flowing = still; } diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java b/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java index ab4792e386c..5b639d0fe20 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java @@ -822,10 +822,10 @@ default Map getDefaultEnchantments(ItemStack stack) { } } - ResourceLocation COFH_SMASHING_ENCHANT_ID = new ResourceLocation(GTValues.MODID_ENSORCELLATION, "smashing"); + ResourceLocation COFH_SMASHING_ENCHANT_ID = ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENSORCELLATION, "smashing"); Set AUTOSMELT_ENCHANT_IDS = Util.make(new HashSet<>(), set -> { - set.add(new ResourceLocation(GTValues.MODID_ENDERIO, "auto_smelt")); // EnderIO - set.add(new ResourceLocation(GTValues.MODID_ENSORCELLATION, "smelting")); // CoFH + set.add(ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENDERIO, "auto_smelt")); // EnderIO + set.add(ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENSORCELLATION, "smelting")); // CoFH }); default boolean definition$canApplyAtEnchantingTable(@NotNull ItemStack stack, Enchantment enchantment) { diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java b/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java index d646064f6bb..4fc18781603 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/armor/DummyArmorLogic.java @@ -28,6 +28,6 @@ public boolean isValidArmor(ItemStack itemStack, Entity entity, EquipmentSlot eq @Override public ResourceLocation getArmorTexture(ItemStack stack, Entity entity, EquipmentSlot slot, String type) { - return new ResourceLocation("minecraft", "textures/armor/diamond_layer_0.png"); + return ResourceLocation.withDefaultNamespace("textures/armor/diamond_layer_0.png"); } } diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java index 8c7acd92b7d..18df044fa7b 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java @@ -199,7 +199,7 @@ public FluidStack asStack() { } public static FluidInfo fromNbt(CompoundTag tag) { - Fluid fluid = BuiltInRegistries.FLUID.get(new ResourceLocation(tag.getString("fluid"))); + Fluid fluid = BuiltInRegistries.FLUID.get(ResourceLocation.tryParse(tag.getString("fluid"))); int left = tag.getInt("left"); int yield = tag.getInt("yield"); return new FluidInfo(fluid, yield, left); @@ -271,7 +271,7 @@ public void serialize(FluidInfo item, FriendlyByteBuf buf) { @Override public FluidInfo deserialize(FriendlyByteBuf buf) { - return new FluidInfo(BuiltInRegistries.FLUID.get(new ResourceLocation(buf.readUtf())), buf.readVarInt(), + return new FluidInfo(BuiltInRegistries.FLUID.get(ResourceLocation.tryParse(buf.readUtf())), buf.readVarInt(), buf.readVarInt()); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/recipe/ingredient/FluidIngredient.java b/src/main/java/com/gregtechceu/gtceu/api/recipe/ingredient/FluidIngredient.java index bda901a7aa2..61a56a0f9cb 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/recipe/ingredient/FluidIngredient.java +++ b/src/main/java/com/gregtechceu/gtceu/api/recipe/ingredient/FluidIngredient.java @@ -290,11 +290,11 @@ public static FluidIngredient fromJson(@Nullable JsonElement json, boolean allow } else if (GsonHelper.isStringValue(jsonObject, "value")) { String value = GsonHelper.getAsString(jsonObject, "value"); if (value.startsWith("#")) { - ResourceLocation resourceLocation = new ResourceLocation(value.substring(1)); + ResourceLocation resourceLocation = ResourceLocation.parse(value.substring(1)); TagKey tagKey = TagKey.create(Registries.FLUID, resourceLocation); return FluidIngredient.fromValue(new TagValue(tagKey), amount, nbt); } else { - Fluid fluid = BuiltInRegistries.FLUID.get(new ResourceLocation(value)); + Fluid fluid = BuiltInRegistries.FLUID.get(ResourceLocation.parse(value)); return FluidIngredient.fromValue(new FluidValue(fluid), amount, nbt); } } else { @@ -307,11 +307,11 @@ private static FluidIngredient.Value valueFromJson(JsonObject json) { throw new JsonParseException("A fluid ingredient entry is either a tag or a fluid, not both"); } if (json.has("fluid")) { - Fluid fluid = BuiltInRegistries.FLUID.get(new ResourceLocation(GsonHelper.getAsString(json, "fluid"))); + Fluid fluid = BuiltInRegistries.FLUID.get(ResourceLocation.parse(GsonHelper.getAsString(json, "fluid"))); return new FluidValue(fluid); } if (json.has("tag")) { - ResourceLocation resourceLocation = new ResourceLocation(GsonHelper.getAsString(json, "tag")); + ResourceLocation resourceLocation = ResourceLocation.parse(GsonHelper.getAsString(json, "tag")); TagKey tagKey = TagKey.create(Registries.FLUID, resourceLocation); return new TagValue(tagKey); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java index b549d41eba3..2662d1bbc73 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java @@ -226,7 +226,7 @@ public void writeBuf(V value, FriendlyByteBuf buf) { @Override public V readBuf(FriendlyByteBuf buf) { if (buf.readBoolean()) { - return get(new ResourceLocation(buf.readUtf())); + return get(ResourceLocation.parse(buf.readUtf())); } return null; } @@ -241,7 +241,7 @@ public Tag saveToNBT(V value) { @Override public V loadFromNBT(Tag tag) { - return get(new ResourceLocation(tag.getAsString())); + return get(ResourceLocation.parse(tag.getAsString())); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java index 1374b066720..f26cb031c03 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/GTRegistrate.java @@ -71,7 +71,7 @@ protected GTRegistrate(String modId) { } public ResourceLocation makeResourceLocation(String path) { - return new ResourceLocation(this.getModid(), path); + return ResourceLocation.fromNamespaceAndPath(this.getModid(), path); } /** diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java index 0ee2122f1f3..9e2eec97997 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java @@ -162,7 +162,7 @@ public MachineBuilder(GTRegistrate registrate, String name, BiFunction blockFactory, BiFunction itemFactory, MachineInstanceFactory instanceFactory) { - super(new ResourceLocation(registrate.getModid(), name)); + super(ResourceLocation.fromNamespaceAndPath(registrate.getModid(), name)); this.registrate = registrate; this.name = name; this.blockFactory = blockFactory; @@ -372,7 +372,7 @@ public SELF simpleModel(ResourceLocation modelName) { } public SELF defaultModel() { - return simpleModel(new ResourceLocation(registrate.getModid(), "block/machine/template/" + name)); + return simpleModel(registrate.makeResourceLocation("block/machine/template/" + name)); } public SELF tieredHullModel(ResourceLocation model) { @@ -381,7 +381,7 @@ public SELF tieredHullModel(ResourceLocation model) { public SELF overlayTieredHullModel(String name) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - return overlayTieredHullModel(new ResourceLocation(registrate.getModid(), "block/machine/part/" + name)); + return overlayTieredHullModel(registrate.makeResourceLocation( "block/machine/part/" + name)); } public SELF overlayTieredHullModel(ResourceLocation overlayModel) { @@ -396,11 +396,11 @@ public SELF colorOverlayTieredHullModel(String overlay, @Nullable String pipeOverlay, @Nullable String emissiveOverlay) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - ResourceLocation overlayTex = new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + overlay); + ResourceLocation overlayTex = registrate.makeResourceLocation( "block/overlay/machine/" + overlay); ResourceLocation pipeOverlayTex = pipeOverlay == null ? null : - new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + pipeOverlay); + registrate.makeResourceLocation( "block/overlay/machine/" + pipeOverlay); ResourceLocation emissiveOverlayTex = emissiveOverlay == null ? null : - new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + emissiveOverlay); + registrate.makeResourceLocation( "block/overlay/machine/" + emissiveOverlay); return colorOverlayTieredHullModel(overlayTex, pipeOverlayTex, emissiveOverlayTex); } @@ -418,7 +418,7 @@ public SELF colorOverlayTieredHullModel(ResourceLocation overlay, public SELF overlaySteamHullModel(String name) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - return overlaySteamHullModel(new ResourceLocation(registrate.getModid(), "block/machine/part/" + name)); + return overlaySteamHullModel(registrate.makeResourceLocation( "block/machine/part/" + name)); } public SELF overlaySteamHullModel(ResourceLocation overlayModel) { @@ -434,11 +434,11 @@ public SELF colorOverlaySteamHullModel(String overlay, @Nullable String pipeOverlay, @Nullable String emissiveOverlay) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - ResourceLocation overlayTex = new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + overlay); + ResourceLocation overlayTex = registrate.makeResourceLocation( "block/overlay/machine/" + overlay); ResourceLocation pipeOverlayTex = pipeOverlay == null ? null : - new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + pipeOverlay); + registrate.makeResourceLocation( "block/overlay/machine/" + pipeOverlay); ResourceLocation emissiveOverlayTex = emissiveOverlay == null ? null : - new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + emissiveOverlay); + registrate.makeResourceLocation( "block/overlay/machine/" + emissiveOverlay); return colorOverlaySteamHullModel(overlayTex, pipeOverlayTex, emissiveOverlayTex); } @@ -446,11 +446,11 @@ public SELF colorOverlaySteamHullModel(String overlay, @Nullable ResourceLocation pipeOverlay, @Nullable String emissiveOverlay) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - ResourceLocation overlayTex = new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + overlay); + ResourceLocation overlayTex = registrate.makeResourceLocation( "block/overlay/machine/" + overlay); ResourceLocation pipeOverlayTex = pipeOverlay == null ? null : - new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + pipeOverlay); + registrate.makeResourceLocation( "block/overlay/machine/" + pipeOverlay); ResourceLocation emissiveOverlayTex = emissiveOverlay == null ? null : - new ResourceLocation(registrate.getModid(), "block/overlay/machine/" + emissiveOverlay); + registrate.makeResourceLocation( "block/overlay/machine/" + emissiveOverlay); return colorOverlaySteamHullModel(overlayTex, pipeOverlayTex, emissiveOverlayTex); } @@ -630,7 +630,7 @@ public SELF multiblockPreviewRenderer(boolean multiBlockWorldPreview, } protected DEFINITION createDefinition() { - return definition.apply(new ResourceLocation(registrate.getModid(), name)); + return definition.apply(registrate.makeResourceLocation( name)); } @Override @@ -671,7 +671,7 @@ public DEFINITION register() { definition.setRotationState(rotationState); setupStateDefinition(definition); if (model == null && blockModel == null) { - simpleModel(new ResourceLocation(registrate.getModid(), "block/machine/template/" + name)); + simpleModel(registrate.makeResourceLocation( "block/machine/template/" + name)); } var blockBuilder = BlockBuilderWrapper.makeBlockBuilder(getThis(), definition); if (this.langValue != null) { @@ -811,7 +811,7 @@ protected static class ItemBuilderWrapper { .item(properties -> builder.itemFactory.apply((MetaMachineBlock) block.get(), properties)) .setData(ProviderType.LANG, NonNullBiConsumer.noop()) // do not gen any lang keys // copied from BlockBuilder#item - .model((ctx, prov) -> prov.withExistingParent(ctx.getName(), new ResourceLocation(builder.registrate.getModid(), + .model((ctx, prov) -> prov.withExistingParent(ctx.getName(), ResourceLocation.fromNamespaceAndPath(builder.registrate.getModid(), "block/machine/" + ctx.getName()))) .color(() -> () -> builder.itemColor::apply) .properties(builder.itemProp); diff --git a/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java b/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java index 5a9ac641761..520bcdddf4b 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java @@ -48,7 +48,7 @@ public SoundEvent getMainEvent() { } 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 diff --git a/src/main/java/com/gregtechceu/gtceu/api/sync_system/data_transformers/gtceu/GTRecipeTransformer.java b/src/main/java/com/gregtechceu/gtceu/api/sync_system/data_transformers/gtceu/GTRecipeTransformer.java index 97dbece53a7..e3123485fb0 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/sync_system/data_transformers/gtceu/GTRecipeTransformer.java +++ b/src/main/java/com/gregtechceu/gtceu/api/sync_system/data_transformers/gtceu/GTRecipeTransformer.java @@ -50,16 +50,16 @@ public Tag serializeNBT(GTRecipe value, ValueTransformer.TransformerContext getForResourceUnsafe(Resource resource public static class Serializer implements MetadataSectionSerializer { - protected static final ResourceLocation EMPTY_CONNECTION = new ResourceLocation("", ""); + protected static final ResourceLocation EMPTY_CONNECTION = ResourceLocation.fromNamespaceAndPath("", ""); // spotless:off public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group( diff --git a/src/main/java/com/gregtechceu/gtceu/client/model/machine/MachineModelLoader.java b/src/main/java/com/gregtechceu/gtceu/client/model/machine/MachineModelLoader.java index 9dc6e3e532a..0677ea71f3e 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/model/machine/MachineModelLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/client/model/machine/MachineModelLoader.java @@ -70,7 +70,7 @@ private MachineModelLoader() {} @Override public @Nullable UnbakedMachineModel read(JsonObject json, JsonDeserializationContext context) throws JsonParseException { - ResourceLocation machineId = new ResourceLocation(GsonHelper.getAsString(json, "machine")); + ResourceLocation machineId = ResourceLocation.parse(GsonHelper.getAsString(json, "machine")); MachineDefinition definition = GTRegistries.MACHINES.get(machineId); if (definition == null) return null; @@ -162,7 +162,7 @@ private MachineModelLoader() {} if (overrideJson != null) { for (var entry : overrideJson.asMap().entrySet()) { String value = GsonHelper.convertToString(entry.getValue(), entry.getKey()); - textureOverrides.put(entry.getKey(), new ResourceLocation(value)); + textureOverrides.put(entry.getKey(), ResourceLocation.parse(value)); } } @@ -241,7 +241,7 @@ public static Either parseVariant(JsonElement va JsonDeserializationContext context) throws JsonParseException { if (value.isJsonPrimitive() && value.getAsJsonPrimitive().isString()) { String modelName = value.getAsString(); - return Either.left(new ResourceLocation(modelName)); + return Either.left(ResourceLocation.parse(modelName)); } else { return Either.right(context.deserialize(value, BlockModel.class)); } diff --git a/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java b/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java index c8637cbb7ef..9dd4567f685 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java +++ b/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java @@ -88,7 +88,7 @@ public class PipeModel { SIDE_OVERLAY_KEY = "side_overlay", END_OVERLAY_KEY = "end_overlay"; // spotless:on - protected static final ResourceLocation RENDERTYPE_CUTOUT_MIPPED = new ResourceLocation("cutout_mipped"); + protected static final ResourceLocation RENDERTYPE_CUTOUT_MIPPED = ResourceLocation.withDefaultNamespace("cutout_mipped"); public static final Set DYNAMIC_MODELS = new HashSet<>(); diff --git a/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTBoatRenderer.java b/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTBoatRenderer.java index f5b3d71d55d..c860746d625 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTBoatRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/client/renderer/entity/GTBoatRenderer.java @@ -27,7 +27,7 @@ public class GTBoatRenderer extends BoatRenderer { public GTBoatRenderer(EntityRendererProvider.Context context, boolean chestBoat) { super(context, chestBoat); boats = Stream.of(GTBoat.BoatType.values()).collect(ImmutableMap.toImmutableMap(k -> k, - (m) -> Pair.of(new ResourceLocation(GTCEu.MOD_ID, + (m) -> Pair.of(GTCEu.id( getTextureLocation(m, chestBoat)), createBoatModel(context, m, chestBoat)))); } @@ -51,10 +51,10 @@ private BoatModel createBoatModel(EntityRendererProvider.Context context, GTBoat } public static ModelLayerLocation getChestBoatModelName(GTBoat.BoatType type) { - return new ModelLayerLocation(new ResourceLocation(GTCEu.MOD_ID, "chest_boat/" + type.getName()), "main"); + return new ModelLayerLocation(GTCEu.id("chest_boat/" + type.getName()), "main"); } public static ModelLayerLocation getBoatModelName(GTBoat.BoatType type) { - return new ModelLayerLocation(new ResourceLocation(GTCEu.MOD_ID, "boat/" + type.getName()), "main"); + return new ModelLayerLocation(GTCEu.id("boat/" + type.getName()), "main"); } } diff --git a/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java b/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java index 5b541315ce1..942c4c75ad0 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/client/util/RenderUtil.java @@ -70,7 +70,7 @@ public enum FluidTextureType { else return fluidTypeExtensions.getOverlayTexture(); }); - private static final ResourceLocation WATER_STILL = new ResourceLocation("minecraft", "block/water_still"); + private static final ResourceLocation WATER_STILL = ResourceLocation.withDefaultNamespace("block/water_still"); private final BiFunction mapper; diff --git a/src/main/java/com/gregtechceu/gtceu/common/commands/arguments/GTRegistryArgument.java b/src/main/java/com/gregtechceu/gtceu/common/commands/arguments/GTRegistryArgument.java index f2ac5210b39..17cf6d1a659 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/commands/arguments/GTRegistryArgument.java +++ b/src/main/java/com/gregtechceu/gtceu/common/commands/arguments/GTRegistryArgument.java @@ -52,7 +52,7 @@ public static GTRegistryArgument registry(GTRegistry registry public V parse(StringReader reader) throws CommandSyntaxException { String id = readId(reader); if (ResourceLocation.class.isAssignableFrom(keyClass)) { - K loc = (K) new ResourceLocation(id); + K loc = (K) ResourceLocation.parse(id); if (!registry.containsKey(loc)) { throw new SimpleCommandExceptionType(new LiteralMessage("Failed to find object" + id + " in registry")) .createWithContext(reader); diff --git a/src/main/java/com/gregtechceu/gtceu/common/cover/data/BucketMode.java b/src/main/java/com/gregtechceu/gtceu/common/cover/data/BucketMode.java index 9108d05b11d..c969ea1b053 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/cover/data/BucketMode.java +++ b/src/main/java/com/gregtechceu/gtceu/common/cover/data/BucketMode.java @@ -9,7 +9,7 @@ public enum BucketMode { - BUCKET("cover.bucket.mode.bucket", new ResourceLocation("minecraft", "textures/item/water_bucket"), 1000), + BUCKET("cover.bucket.mode.bucket", ResourceLocation.withDefaultNamespace("textures/item/water_bucket"), 1000), MILLI_BUCKET("cover.bucket.mode.milli_bucket", GTCEu.id("textures/gui/icon/bucket_mode/water_drop"), 1); @Getter diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java index 008e1165264..d199bbe5228 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTBlocks.java @@ -676,8 +676,8 @@ private static BlockEntry createFireboxCasing(BoilerFireboxType typ .tag(BlockTags.MINEABLE_WITH_AXE) .blockstate((ctx, prov) -> prov.simpleBlock(ctx.get(), prov.models().cubeBottomTop(ctx.getName(), GTCEu.id("block/misc/industrial_tnt_side"), - new ResourceLocation("minecraft", "block/tnt_bottom"), - new ResourceLocation("minecraft", "block/tnt_top")))) + ResourceLocation.withDefaultNamespace("block/tnt_bottom"), + ResourceLocation.withDefaultNamespace("block/tnt_top")))) .simpleItem() .register(); @@ -1206,7 +1206,7 @@ public static void generateStoneBlocks() { if (!strata.generateBlocks) continue; for (StoneBlockType type : StoneBlockType.values()) { String blockId = type.blockId.formatted(strata.getSerializedName()); - if (BuiltInRegistries.BLOCK.containsKey(new ResourceLocation(blockId))) continue; + if (BuiltInRegistries.BLOCK.containsKey(ResourceLocation.parse(blockId))) continue; var entry = REGISTRATE.block(blockId, Block::new) .initialProperties(() -> Blocks.STONE) .properties(p -> p.strength(type.hardness, type.resistance).mapColor(strata.mapColor)) diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java index 36f5af9d085..4804237a873 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTOres.java @@ -718,11 +718,11 @@ private static Supplier ore(TagPrefix oreTag, Material material if (block == null) { ResourceLocation oreKey; if (oreTag == ore) { - oreKey = new ResourceLocation("%s_ore".formatted(material.getName())); + oreKey = ResourceLocation.tryParse("%s_ore".formatted(material.getName())); } else if (oreTag == oreNetherrack) { - oreKey = new ResourceLocation("nether_%s_ore".formatted(material.getName())); + oreKey = ResourceLocation.tryParse("nether_%s_ore".formatted(material.getName())); } else { - oreKey = new ResourceLocation("%s_%s_ore".formatted(oreTag.name, material.getName())); + oreKey = ResourceLocation.tryParse("%s_%s_ore".formatted(oreTag.name, material.getName())); } return BuiltInRegistries.BLOCK.containsKey(oreKey) ? () -> BuiltInRegistries.BLOCK.get(oreKey) : () -> Blocks.AIR; diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/GTToolTiers.java b/src/main/java/com/gregtechceu/gtceu/common/data/GTToolTiers.java index 7de377bf706..6f810bf2e75 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/GTToolTiers.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/GTToolTiers.java @@ -20,7 +20,7 @@ public class GTToolTiers { private static Tier NEUTRONIUM; public static void init() { - var netherite = new ResourceLocation("netherite"); + var netherite = ResourceLocation.withDefaultNamespace("netherite"); var duranium = GTCEu.id("duranium"); var neutronium = GTCEu.id("neutronium"); DURANIUM = TierSortingRegistry.registerTier( diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java b/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java index 294a8aefa75..7068c1c6f3e 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java @@ -859,7 +859,7 @@ public MachineDefinition[] register() { .rotationState(RotationState.NON_Y_AXIS) .recipeType(recipeType) .workableTieredHullModel( - new ResourceLocation(registrate.getModid(), "block/machines/" + name)) + registrate.makeResourceLocation( "block/machines/" + name)) .tooltips(workableTiered(tier, GTValues.V[tier], GTValues.V[tier] * 64, recipeType, tankScalingFunction.applyAsInt(tier), true)) .ui(panelFactory); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java b/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java index 2974ffe2dd5..1269f343f15 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java @@ -237,7 +237,7 @@ public static NonNullBiConsumer, Regist ModelFile inactive = prov.models().cubeAll(name, casingType.getTexture()); ModelFile active = prov.models().withExistingParent(name + "_active", GTCEu.id("block/cube_2_layer/all")) .texture("bot_all", casingType.getTexture()) - .texture("top_all", new ResourceLocation(casingType.getTexture() + "_bloom")); + .texture("top_all", ResourceLocation.parse(casingType.getTexture() + "_bloom")); prov.getVariantBuilder(block) .partialState().with(GTBlockStateProperties.ACTIVE, false).modelForState().modelFile(inactive) .addModel() diff --git a/src/main/java/com/gregtechceu/gtceu/common/item/behavior/ColorSprayBehaviour.java b/src/main/java/com/gregtechceu/gtceu/common/item/behavior/ColorSprayBehaviour.java index 5568beff413..05d1539e6da 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/item/behavior/ColorSprayBehaviour.java +++ b/src/main/java/com/gregtechceu/gtceu/common/item/behavior/ColorSprayBehaviour.java @@ -70,7 +70,7 @@ public class ColorSprayBehaviour implements IDurabilityBar, IInteractionItem, IA @SuppressWarnings("deprecation") private static Block getBlock(DyeColor color, String postfix) { - ResourceLocation id = new ResourceLocation("minecraft", color.getSerializedName() + "_" + postfix); + ResourceLocation id = ResourceLocation.withDefaultNamespace(color.getSerializedName() + "_" + postfix); return BuiltInRegistries.BLOCK.get(id); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/monitor/MonitorGroup.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/monitor/MonitorGroup.java index 35df7bf7f9a..bcc51c555e9 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/monitor/MonitorGroup.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/monitor/MonitorGroup.java @@ -186,7 +186,7 @@ public Level getTargetLevel(Level level) { } if (level.getServer() == null) return level; return level.getServer() - .getLevel(ResourceKey.create(Registries.DIMENSION, new ResourceLocation(tag.getString("dim")))); + .getLevel(ResourceKey.create(Registries.DIMENSION, ResourceLocation.parse(tag.getString("dim")))); } return level; } diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/ResearchStationMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/ResearchStationMachine.java index d6e9444d013..26a45bf00cc 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/ResearchStationMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/ResearchStationMachine.java @@ -27,6 +27,7 @@ import brachy.modularui.value.sync.PanelSyncManager; import lombok.Getter; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.Collections; @@ -40,9 +41,9 @@ public class ResearchStationMachine extends WorkableElectricMultiblockMachine implements IOpticalComputationReceiver { @Getter - private IOpticalComputationProvider computationProvider; + private @Nullable IOpticalComputationProvider computationProvider; @Getter - private ObjectHolderMachine objectHolder; + private @Nullable ObjectHolderMachine objectHolder; public ResearchStationMachine(BlockEntityCreationInfo info) { super(info, new ResearchStationRecipeLogic()); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java new file mode 100644 index 00000000000..dc4417f1234 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java @@ -0,0 +1,4 @@ +@NotNullByDefault +package com.gregtechceu.gtceu.common.machine.multiblock.electric.research; + +import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java new file mode 100644 index 00000000000..059aaa92978 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java @@ -0,0 +1,4 @@ +@NotNullByDefault +package com.gregtechceu.gtceu.common.machine.multiblock.generator; + +import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/CleaningMaintenanceHatchPartMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/CleaningMaintenanceHatchPartMachine.java index 4b992198435..7a2c8544864 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/CleaningMaintenanceHatchPartMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/CleaningMaintenanceHatchPartMachine.java @@ -6,19 +6,13 @@ import com.gregtechceu.gtceu.common.machine.trait.CleanroomProviderTrait; import com.gregtechceu.gtceu.common.machine.trait.CleanroomReceiverTrait; -import net.minecraft.MethodsReturnNonnullByDefault; - import lombok.Getter; import java.util.Set; -import javax.annotation.ParametersAreNonnullByDefault; - import static com.gregtechceu.gtceu.api.GTValues.UHV; import static com.gregtechceu.gtceu.api.GTValues.UV; -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault public class CleaningMaintenanceHatchPartMachine extends AutoMaintenanceHatchPartMachine { private final CleanroomProviderTrait cleanroomProvider; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java new file mode 100644 index 00000000000..7ef90df9851 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java @@ -0,0 +1,4 @@ +@NotNullByDefault +package com.gregtechceu.gtceu.common.machine.multiblock.part.hpca; + +import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CharcoalPileIgniterMachine.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CharcoalPileIgniterMachine.java index 1735221646a..d160fe93b14 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CharcoalPileIgniterMachine.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/primitive/CharcoalPileIgniterMachine.java @@ -234,7 +234,7 @@ public InteractionResult onUse(ExtendedUseOnContext context) { return InteractionResult.PASS; } - if (level.isClientSide && !isActive()) { + if (getLevel().isClientSide && !isActive()) { return InteractionResult.SUCCESS; } else if (!isActive()) { boolean shouldActivate = false; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java new file mode 100644 index 00000000000..5791a15d973 --- /dev/null +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java @@ -0,0 +1,4 @@ +@NotNullByDefault +package com.gregtechceu.gtceu.common.machine; + +import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file diff --git a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentBlockCondition.java b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentBlockCondition.java index 8641992b2e9..fd156475ef1 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentBlockCondition.java +++ b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentBlockCondition.java @@ -160,11 +160,11 @@ public boolean testCondition(@NotNull GTRecipe recipe, @NotNull RecipeLogic reci if (recipe != null && recipe.data.contains("blockA") && recipe.data.contains("blockB")) { this.resolvedBlocks.clear(); - Block blockA = BuiltInRegistries.BLOCK.get(new ResourceLocation(recipe.data.getString("blockA"))); + Block blockA = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(recipe.data.getString("blockA"))); if (!blockA.defaultBlockState().isAir()) { this.resolvedBlocks.add(HolderSet.direct(blockA.builtInRegistryHolder())); } - Block blockB = BuiltInRegistries.BLOCK.get(new ResourceLocation(recipe.data.getString("blockB"))); + Block blockB = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(recipe.data.getString("blockB"))); if (!blockB.defaultBlockState().isAir()) { this.resolvedBlocks.add(HolderSet.direct(blockB.builtInRegistryHolder())); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentFluidCondition.java b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentFluidCondition.java index aa30306905c..97b902631cf 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentFluidCondition.java +++ b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/AdjacentFluidCondition.java @@ -173,11 +173,11 @@ public boolean testCondition(@NotNull GTRecipe recipe, @NotNull RecipeLogic reci if (recipe != null && recipe.data.contains("fluidA") && recipe.data.contains("fluidB")) { this.resolvedFluids.clear(); - Fluid fluidA = BuiltInRegistries.FLUID.get(new ResourceLocation(recipe.data.getString("fluidA"))); + Fluid fluidA = BuiltInRegistries.FLUID.get(ResourceLocation.parse(recipe.data.getString("fluidA"))); if (!fluidA.defaultFluidState().isEmpty()) { this.resolvedFluids.add(HolderSet.direct(fluidA.builtInRegistryHolder())); } - Fluid fluidB = BuiltInRegistries.FLUID.get(new ResourceLocation(recipe.data.getString("fluidB"))); + Fluid fluidB = BuiltInRegistries.FLUID.get(ResourceLocation.parse(recipe.data.getString("fluidB"))); if (!fluidB.defaultFluidState().isEmpty()) { this.resolvedFluids.add(HolderSet.direct(fluidB.builtInRegistryHolder())); } diff --git a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java index 40f9c7a3c40..f727a49ed1a 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java +++ b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java @@ -30,7 +30,7 @@ public class BiomeCondition extends RecipeCondition { // spotless:on @Getter - private ResourceKey biome = ResourceKey.create(Registries.BIOME, new ResourceLocation("dummy")); + private ResourceKey biome = ResourceKey.create(Registries.BIOME, ResourceLocation.withDefaultNamespace("dummy")); public BiomeCondition(boolean isReverse, ResourceKey biome) { super(isReverse); diff --git a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeTagCondition.java b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeTagCondition.java index 034b231e5f2..3189ecd2718 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeTagCondition.java +++ b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeTagCondition.java @@ -30,7 +30,7 @@ public class BiomeTagCondition extends RecipeCondition { public final static BiomeTagCondition INSTANCE = new BiomeTagCondition(); @Getter - private TagKey biome = TagKey.create(Registries.BIOME, new ResourceLocation("dummy")); + private TagKey biome = TagKey.create(Registries.BIOME, ResourceLocation.withDefaultNamespace("dummy")); public BiomeTagCondition(boolean isReverse, TagKey biome) { super(isReverse); diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index 650c5a48ba0..8ab367aebb0 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -122,7 +122,7 @@ public static void generateGTDynamicTags(Map void generateGTDynamicTags(Map new ArrayList<>()).add(entry); FluidState state; @@ -274,7 +274,7 @@ public static void generateGTDynamicLoot(Map lootTa if (TagPrefix.ORES.containsKey(prefix)) { final TagPrefix.OreType type = TagPrefix.ORES.get(prefix); map.forEach((material, blockEntry) -> { - ResourceLocation lootTableId = new ResourceLocation(blockEntry.getId().getNamespace(), + ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(blockEntry.getId().getNamespace(), "blocks/" + blockEntry.getId().getPath()); Block block = blockEntry.get(); @@ -324,7 +324,7 @@ public static void generateGTDynamicLoot(Map lootTa MixinHelpers.addMaterialBlockLootTables(lootTables, prefix, map); }); GTMaterialBlocks.SURFACE_ROCK_BLOCKS.forEach((material, blockEntry) -> { - ResourceLocation lootTableId = new ResourceLocation(blockEntry.getId().getNamespace(), + ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(blockEntry.getId().getNamespace(), "blocks/" + blockEntry.getId().getPath()); LootTable.Builder builder = BLOCK_LOOT .createSingleItemTable(ChemicalHelper.get(TagPrefix.dustTiny, material).getItem(), @@ -336,7 +336,7 @@ public static void generateGTDynamicLoot(Map lootTa GTRegistries.MACHINES.forEach(machine -> { Block block = machine.getBlock(); ResourceLocation id = machine.getId(); - ResourceLocation lootTableId = new ResourceLocation(id.getNamespace(), "blocks/" + id.getPath()); + ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(id.getNamespace(), "blocks/" + id.getPath()); ((BlockBehaviourAccessor) block).setDrops(lootTableId); lootTables.put(lootTableId, BLOCK_LOOT.createSingleItemTable(block).setParamSet(LootContextParamSets.BLOCK).build()); @@ -346,7 +346,7 @@ public static void generateGTDynamicLoot(Map lootTa public static void addMaterialBlockLootTables(Map lootTables, TagPrefix prefix, Map> map) { map.forEach((material, blockEntry) -> { - ResourceLocation lootTableId = new ResourceLocation(blockEntry.getId().getNamespace(), + ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(blockEntry.getId().getNamespace(), "blocks/" + blockEntry.getId().getPath()); ((BlockBehaviourAccessor) blockEntry.get()).setDrops(lootTableId); lootTables.put(lootTableId, diff --git a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java index 103ffba6b4d..70c7e6a9502 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java +++ b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java @@ -186,16 +186,16 @@ public void close() { } public static ResourceLocation getRecipeLocation(ResourceLocation recipeId) { - return new ResourceLocation(recipeId.getNamespace(), String.join("", "recipes/", recipeId.getPath(), ".json")); + return ResourceLocation.fromNamespaceAndPath(recipeId.getNamespace(), String.join("", "recipes/", recipeId.getPath(), ".json")); } public static ResourceLocation getAdvancementLocation(ResourceLocation advancementId) { - return new ResourceLocation(advancementId.getNamespace(), + return ResourceLocation.fromNamespaceAndPath(advancementId.getNamespace(), String.join("", "advancements/", advancementId.getPath(), ".json")); } public static ResourceLocation getTagLocation(String identifier, ResourceLocation tagId) { - return new ResourceLocation(tagId.getNamespace(), + return ResourceLocation.fromNamespaceAndPath(tagId.getNamespace(), String.join("", "tags/", identifier, "/", tagId.getPath(), ".json")); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicPackContents.java b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicPackContents.java index 6ffb8e23cb9..9d68606e2dc 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicPackContents.java +++ b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicPackContents.java @@ -58,7 +58,7 @@ private Map getChildren() { void outputResources(String namespace, String path, PackResources.ResourceOutput output) { if (isTerminalNode()) { // This is a terminal node. - ResourceLocation location = new ResourceLocation(namespace, path); + ResourceLocation location = ResourceLocation.fromNamespaceAndPath(namespace, path); output.accept(location, this.createIoSupplier()); } else { for (var entry : getChildren().entrySet()) { diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/CustomTags.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/CustomTags.java index fdaa30c2445..956d1c658f4 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/CustomTags.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/CustomTags.java @@ -208,7 +208,7 @@ public class CustomTags { public static final TagKey CHARCOAL_PILE_IGNITER_WALLS = TagUtil.createModBlockTag( "charcoal_pile_igniter_walls"); public static final TagKey CREATE_WRENCH_PICKUP = TagUtil.optionalTag(BuiltInRegistries.BLOCK, - new ResourceLocation("create", "wrench_pickup")); + ResourceLocation.fromNamespaceAndPath("create", "wrench_pickup")); public static final TagKey TALL_PLANTS = TagUtil.createModBlockTag("tall_plants"); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java index 4c3adcfef5d..7dd6e4d2ba9 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java @@ -23,10 +23,10 @@ public static void init() { for (DyeColor color : DyeColor.values()) { String dye = color.getName(); ItemMaterialData.registerMaterialInfo( - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dye + "_terracotta"))).getItem(), + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.parse(dye + "_terracotta"))).getItem(), new ItemMaterialInfo(new MaterialStack(GTMaterials.Clay, M * 4))); ItemMaterialData.registerMaterialInfo( - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dye + "_glazed_terracotta"))) + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.parse(dye + "_glazed_terracotta"))) .getItem(), new ItemMaterialInfo(new MaterialStack(GTMaterials.Clay, M * 4))); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java index 48c07dae04a..364b56a2c68 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/WoodTypeEntry.java @@ -688,7 +688,7 @@ public WoodTypeEntry build() { // add default tag if logTag is null if (logTag == null) logTag = TagUtil.optionalTag(BuiltInRegistries.ITEM, - new ResourceLocation(modid, woodName + "_logs")); + ResourceLocation.fromNamespaceAndPath(modid, woodName + "_logs")); return new WoodTypeEntry(modid, woodName, logTag, log, strippedLog, wood, strippedWood, removeCharcoalRecipe, addCharcoalRecipe, diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java index f23120d0b62..99b392e3f10 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java @@ -1615,7 +1615,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { - return new ResourceLocation(id.getNamespace(), recipeType.registryName.getPath() + "/" + id.getPath()); + return id.withPath(recipeType.registryName.getPath() + "/" + id.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java index 03045533971..09d3f3ee838 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java @@ -112,7 +112,7 @@ public ShapedEnergyTransferRecipeBuilder id(ResourceLocation id) { } public ShapedEnergyTransferRecipeBuilder id(String id) { - this.id = new ResourceLocation(id); + this.id = ResourceLocation.parse(id); return this; } @@ -189,7 +189,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return new ResourceLocation(ID.getNamespace(), "shaped" + "/" + ID.getPath()); + return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shaped" + "/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java index f74f871570f..cf1a578f078 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java @@ -28,7 +28,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return new ResourceLocation(ID.getNamespace(), "shaped_fluid_container/" + ID.getPath()); + return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shaped_fluid_container/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java index 86af94a89d7..58194785764 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java @@ -96,7 +96,7 @@ public ShapedRecipeBuilder id(ResourceLocation id) { } public ShapedRecipeBuilder id(String id) { - this.id = new ResourceLocation(id); + this.id = ResourceLocation.parse(id); return this; } @@ -178,7 +178,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return new ResourceLocation(ID.getNamespace(), "shaped" + "/" + ID.getPath()); + return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shaped" + "/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java index d61a6c21421..e8d0aecc6f0 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java @@ -122,7 +122,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return new ResourceLocation(ID.getNamespace(), "shapeless" + "/" + ID.getPath()); + return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shapeless" + "/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java index ec7afe2ab02..a86c511be8f 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java @@ -1319,9 +1319,9 @@ private static void vanillaBlockRecipes(Consumer provider) { private static void addBedRecipe(Consumer provider, DyeColor color) { String colorName = color.getName(); VanillaRecipeHelper.addShapedRecipe(provider, colorName + "_bed", - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(colorName + "_bed"))), "WWW", "PPP", + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_bed"))), "WWW", "PPP", "FrF", - 'W', BuiltInRegistries.ITEM.get(new ResourceLocation(colorName + "_carpet")), + 'W', BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_carpet")), 'P', ItemTags.PLANKS, 'F', ItemTags.WOODEN_FENCES); } @@ -1329,8 +1329,8 @@ private static void addBedRecipe(Consumer provider, DyeColor col private static void addCarpetRecipe(Consumer provider, DyeColor color) { String colorName = color.getName(); VanillaRecipeHelper.addShapedRecipe(provider, colorName + "_carpet", - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(colorName + "_carpet"))), "WW", - 'W', BuiltInRegistries.ITEM.get(new ResourceLocation(colorName + "_wool"))); + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_carpet"))), "WW", + 'W', BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_wool"))); } private static void hardGlassRecipes(Consumer provider) { @@ -1340,9 +1340,9 @@ private static void hardGlassRecipes(Consumer provider) { for (DyeColor color : DyeColor.values()) { String dyeName = color.getName(); VanillaRecipeHelper.addShapedRecipe(provider, dyeName + "_glass_pane", - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_stained_glass_pane")), 2), + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")), 2), "sG", - 'G', BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_stained_glass"))); + 'G', BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass"))); } ALLOY_SMELTER_RECIPES.recipeBuilder("tinted_glass") diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java index 667cb5e47ce..3b40ab93a6e 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java @@ -33,7 +33,7 @@ public static void init(Consumer registry) { private static void generalRemovals(Consumer registry) { if (ConfigHolder.INSTANCE.recipes.removeVanillaTNTRecipe) - registry.accept(new ResourceLocation("minecraft:tnt")); + registry.accept(ResourceLocation.withDefaultNamespace("tnt")); // todo /* @@ -72,115 +72,115 @@ private static void generalRemovals(Consumer registry) { */ // removed these for parity with the other torch recipes - registry.accept(new ResourceLocation("minecraft:soul_torch")); - registry.accept(new ResourceLocation("minecraft:soul_lantern")); - registry.accept(new ResourceLocation("minecraft:leather_horse_armor")); + registry.accept(ResourceLocation.withDefaultNamespace("soul_torch")); + registry.accept(ResourceLocation.withDefaultNamespace("soul_lantern")); + registry.accept(ResourceLocation.withDefaultNamespace("leather_horse_armor")); } /** * Remove recipes for any item that is 4x4 or 9x9 crafting (nuggets <-> ingot, ingot <-> block, etc.) */ private static void disableManualCompression(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:gold_block")); - registry.accept(new ResourceLocation("minecraft:gold_nugget")); - registry.accept(new ResourceLocation("minecraft:gold_ingot_from_gold_block")); - registry.accept(new ResourceLocation("minecraft:gold_ingot_from_nuggets")); - registry.accept(new ResourceLocation("minecraft:coal_block")); - registry.accept(new ResourceLocation("minecraft:coal")); - registry.accept(new ResourceLocation("minecraft:redstone_block")); - registry.accept(new ResourceLocation("minecraft:redstone")); - registry.accept(new ResourceLocation("minecraft:emerald_block")); - registry.accept(new ResourceLocation("minecraft:emerald")); - registry.accept(new ResourceLocation("minecraft:diamond_block")); - registry.accept(new ResourceLocation("minecraft:diamond")); - registry.accept(new ResourceLocation("minecraft:iron_block")); - registry.accept(new ResourceLocation("minecraft:iron_nugget")); - registry.accept(new ResourceLocation("minecraft:iron_ingot_from_iron_block")); - registry.accept(new ResourceLocation("minecraft:iron_ingot_from_nuggets")); - registry.accept(new ResourceLocation("minecraft:lapis_block")); - registry.accept(new ResourceLocation("minecraft:lapis_lazuli")); - registry.accept(new ResourceLocation("minecraft:quartz_block")); - registry.accept(new ResourceLocation("minecraft:clay")); - registry.accept(new ResourceLocation("minecraft:nether_brick")); - registry.accept(new ResourceLocation("minecraft:glowstone")); - registry.accept(new ResourceLocation("minecraft:amethyst_block")); - registry.accept(new ResourceLocation("minecraft:copper_block")); - registry.accept(new ResourceLocation("minecraft:copper_ingot")); - registry.accept(new ResourceLocation("minecraft:copper_ingot_from_waxed_copper_block")); - registry.accept(new ResourceLocation("minecraft:honeycomb_block")); - registry.accept(new ResourceLocation("minecraft:snow_block")); - registry.accept(new ResourceLocation("minecraft:netherite_block")); - registry.accept(new ResourceLocation("minecraft:netherite_ingot_from_netherite_block")); - registry.accept(new ResourceLocation("minecraft:dripstone_block")); + registry.accept(ResourceLocation.withDefaultNamespace("gold_block")); + registry.accept(ResourceLocation.withDefaultNamespace("gold_nugget")); + registry.accept(ResourceLocation.withDefaultNamespace("gold_ingot_from_gold_block")); + registry.accept(ResourceLocation.withDefaultNamespace("gold_ingot_from_nuggets")); + registry.accept(ResourceLocation.withDefaultNamespace("coal_block")); + registry.accept(ResourceLocation.withDefaultNamespace("coal")); + registry.accept(ResourceLocation.withDefaultNamespace("redstone_block")); + registry.accept(ResourceLocation.withDefaultNamespace("redstone")); + registry.accept(ResourceLocation.withDefaultNamespace("emerald_block")); + registry.accept(ResourceLocation.withDefaultNamespace("emerald")); + registry.accept(ResourceLocation.withDefaultNamespace("diamond_block")); + registry.accept(ResourceLocation.withDefaultNamespace("diamond")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_block")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_nugget")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_ingot_from_iron_block")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_ingot_from_nuggets")); + registry.accept(ResourceLocation.withDefaultNamespace("lapis_block")); + registry.accept(ResourceLocation.withDefaultNamespace("lapis_lazuli")); + registry.accept(ResourceLocation.withDefaultNamespace("quartz_block")); + registry.accept(ResourceLocation.withDefaultNamespace("clay")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_brick")); + registry.accept(ResourceLocation.withDefaultNamespace("glowstone")); + registry.accept(ResourceLocation.withDefaultNamespace("amethyst_block")); + registry.accept(ResourceLocation.withDefaultNamespace("copper_block")); + registry.accept(ResourceLocation.withDefaultNamespace("copper_ingot")); + registry.accept(ResourceLocation.withDefaultNamespace("copper_ingot_from_waxed_copper_block")); + registry.accept(ResourceLocation.withDefaultNamespace("honeycomb_block")); + registry.accept(ResourceLocation.withDefaultNamespace("snow_block")); + registry.accept(ResourceLocation.withDefaultNamespace("netherite_block")); + registry.accept(ResourceLocation.withDefaultNamespace("netherite_ingot_from_netherite_block")); + registry.accept(ResourceLocation.withDefaultNamespace("dripstone_block")); } private static void harderBrickRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:brick")); - registry.accept(new ResourceLocation("minecraft:bricks")); - registry.accept(new ResourceLocation("minecraft:nether_brick")); - registry.accept(new ResourceLocation("minecraft:nether_bricks")); - registry.accept(new ResourceLocation("minecraft:red_nether_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("brick")); + registry.accept(ResourceLocation.withDefaultNamespace("bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_brick")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("red_nether_bricks")); } private static void hardWoodRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:ladder")); - registry.accept(new ResourceLocation("minecraft:bowl")); - registry.accept(new ResourceLocation("minecraft:chest")); - registry.accept(new ResourceLocation("minecraft:barrel")); + registry.accept(ResourceLocation.withDefaultNamespace("ladder")); + registry.accept(ResourceLocation.withDefaultNamespace("bowl")); + registry.accept(ResourceLocation.withDefaultNamespace("chest")); + registry.accept(ResourceLocation.withDefaultNamespace("barrel")); } private static void hardIronRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:cauldron")); - registry.accept(new ResourceLocation("minecraft:hopper")); - registry.accept(new ResourceLocation("minecraft:iron_bars")); - registry.accept(new ResourceLocation("minecraft:bucket")); - registry.accept(new ResourceLocation("minecraft:chain")); + registry.accept(ResourceLocation.withDefaultNamespace("cauldron")); + registry.accept(ResourceLocation.withDefaultNamespace("hopper")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_bars")); + registry.accept(ResourceLocation.withDefaultNamespace("bucket")); + registry.accept(ResourceLocation.withDefaultNamespace("chain")); } private static void hardRedstoneRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:dispenser")); - registry.accept(new ResourceLocation("minecraft:sticky_piston")); - registry.accept(new ResourceLocation("minecraft:piston")); - registry.accept(new ResourceLocation("minecraft:lever")); - registry.accept(new ResourceLocation("minecraft:daylight_detector")); - registry.accept(new ResourceLocation("minecraft:redstone_lamp")); - registry.accept(new ResourceLocation("minecraft:tripwire_hook")); - registry.accept(new ResourceLocation("minecraft:dropper")); - registry.accept(new ResourceLocation("minecraft:observer")); - registry.accept(new ResourceLocation("minecraft:repeater")); - registry.accept(new ResourceLocation("minecraft:comparator")); - registry.accept(new ResourceLocation("minecraft:powered_rail")); - registry.accept(new ResourceLocation("minecraft:detector_rail")); - registry.accept(new ResourceLocation("minecraft:rail")); - registry.accept(new ResourceLocation("minecraft:activator_rail")); - registry.accept(new ResourceLocation("minecraft:redstone_torch")); - registry.accept(new ResourceLocation("minecraft:stone_pressure_plate")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_pressure_plate")); - registry.accept(new ResourceLocation("minecraft:heavy_weighted_pressure_plate")); - registry.accept(new ResourceLocation("minecraft:light_weighted_pressure_plate")); - registry.accept(new ResourceLocation("minecraft:stone_button")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_button")); - registry.accept(new ResourceLocation("minecraft:calibrated_sculk_sensor")); + registry.accept(ResourceLocation.withDefaultNamespace("dispenser")); + registry.accept(ResourceLocation.withDefaultNamespace("sticky_piston")); + registry.accept(ResourceLocation.withDefaultNamespace("piston")); + registry.accept(ResourceLocation.withDefaultNamespace("lever")); + registry.accept(ResourceLocation.withDefaultNamespace("daylight_detector")); + registry.accept(ResourceLocation.withDefaultNamespace("redstone_lamp")); + registry.accept(ResourceLocation.withDefaultNamespace("tripwire_hook")); + registry.accept(ResourceLocation.withDefaultNamespace("dropper")); + registry.accept(ResourceLocation.withDefaultNamespace("observer")); + registry.accept(ResourceLocation.withDefaultNamespace("repeater")); + registry.accept(ResourceLocation.withDefaultNamespace("comparator")); + registry.accept(ResourceLocation.withDefaultNamespace("powered_rail")); + registry.accept(ResourceLocation.withDefaultNamespace("detector_rail")); + registry.accept(ResourceLocation.withDefaultNamespace("rail")); + registry.accept(ResourceLocation.withDefaultNamespace("activator_rail")); + registry.accept(ResourceLocation.withDefaultNamespace("redstone_torch")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_pressure_plate")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_pressure_plate")); + registry.accept(ResourceLocation.withDefaultNamespace("heavy_weighted_pressure_plate")); + registry.accept(ResourceLocation.withDefaultNamespace("light_weighted_pressure_plate")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_button")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_button")); + registry.accept(ResourceLocation.withDefaultNamespace("calibrated_sculk_sensor")); } private static void hardToolArmorRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:compass")); - registry.accept(new ResourceLocation("minecraft:fishing_rod")); - registry.accept(new ResourceLocation("minecraft:clock")); - registry.accept(new ResourceLocation("minecraft:shears")); - registry.accept(new ResourceLocation("minecraft:shield")); - registry.accept(new ResourceLocation("minecraft:crossbow")); - registry.accept(new ResourceLocation("minecraft:bow")); + registry.accept(ResourceLocation.withDefaultNamespace("compass")); + registry.accept(ResourceLocation.withDefaultNamespace("fishing_rod")); + registry.accept(ResourceLocation.withDefaultNamespace("clock")); + registry.accept(ResourceLocation.withDefaultNamespace("shears")); + registry.accept(ResourceLocation.withDefaultNamespace("shield")); + registry.accept(ResourceLocation.withDefaultNamespace("crossbow")); + registry.accept(ResourceLocation.withDefaultNamespace("bow")); for (String type : new String[] { "iron", "golden", "diamond" }) { - registry.accept(new ResourceLocation("minecraft:" + type + "_shovel")); - registry.accept(new ResourceLocation("minecraft:" + type + "_pickaxe")); - registry.accept(new ResourceLocation("minecraft:" + type + "_axe")); - registry.accept(new ResourceLocation("minecraft:" + type + "_sword")); - registry.accept(new ResourceLocation("minecraft:" + type + "_hoe")); - registry.accept(new ResourceLocation("minecraft:" + type + "_helmet")); - registry.accept(new ResourceLocation("minecraft:" + type + "_chestplate")); - registry.accept(new ResourceLocation("minecraft:" + type + "_leggings")); - registry.accept(new ResourceLocation("minecraft:" + type + "_boots")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_shovel")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_pickaxe")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_axe")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_sword")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_hoe")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_helmet")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_chestplate")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_leggings")); + registry.accept(ResourceLocation.withDefaultNamespace(type + "_boots")); } } @@ -190,138 +190,138 @@ private static void hardToolArmorRecipes(Consumer registry) { * disableManualCompression, or any of the other config options */ private static void hardMiscRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:jack_o_lantern")); - registry.accept(new ResourceLocation("minecraft:beacon")); - registry.accept(new ResourceLocation("minecraft:respawn_anchor")); - registry.accept(new ResourceLocation("minecraft:chiseled_bookshelf")); - registry.accept(new ResourceLocation("minecraft:brewing_stand")); - registry.accept(new ResourceLocation("minecraft:enchanting_table")); - registry.accept(new ResourceLocation("minecraft:jukebox")); - registry.accept(new ResourceLocation("minecraft:note_block")); - registry.accept(new ResourceLocation("minecraft:furnace")); - registry.accept(new ResourceLocation("minecraft:crafting_table")); - registry.accept(new ResourceLocation("minecraft:flower_pot")); - registry.accept(new ResourceLocation("minecraft:armor_stand")); - registry.accept(new ResourceLocation("minecraft:trapped_chest")); - registry.accept(new ResourceLocation("minecraft:ender_chest")); - registry.accept(new ResourceLocation("minecraft:lantern")); - registry.accept(new ResourceLocation("minecraft:stonecutter")); - registry.accept(new ResourceLocation("minecraft:cartography_table")); - registry.accept(new ResourceLocation("minecraft:fletching_table")); - registry.accept(new ResourceLocation("minecraft:smithing_table")); - registry.accept(new ResourceLocation("minecraft:grindstone")); - registry.accept(new ResourceLocation("minecraft:smoker")); - registry.accept(new ResourceLocation("minecraft:blast_furnace")); - registry.accept(new ResourceLocation("minecraft:loom")); - registry.accept(new ResourceLocation("minecraft:composter")); - registry.accept(new ResourceLocation("minecraft:bell")); - registry.accept(new ResourceLocation("minecraft:conduit")); - registry.accept(new ResourceLocation("minecraft:candle")); - registry.accept(new ResourceLocation("minecraft:scaffolding")); - registry.accept(new ResourceLocation("minecraft:beehive")); - registry.accept(new ResourceLocation("minecraft:lightning_rod")); - registry.accept(new ResourceLocation("minecraft:lectern")); - registry.accept(new ResourceLocation("minecraft:golden_apple")); - registry.accept(new ResourceLocation("minecraft:book")); - registry.accept(new ResourceLocation("minecraft:ender_eye")); - registry.accept(new ResourceLocation("minecraft:glistering_melon_slice")); - registry.accept(new ResourceLocation("minecraft:golden_carrot")); - registry.accept(new ResourceLocation("minecraft:magma_cream")); - registry.accept(new ResourceLocation("minecraft:lead")); - registry.accept(new ResourceLocation("minecraft:item_frame")); - registry.accept(new ResourceLocation("minecraft:painting")); - registry.accept(new ResourceLocation("minecraft:chest_minecart")); - registry.accept(new ResourceLocation("minecraft:furnace_minecart")); - registry.accept(new ResourceLocation("minecraft:tnt_minecart")); - registry.accept(new ResourceLocation("minecraft:hopper_minecart")); + registry.accept(ResourceLocation.withDefaultNamespace("jack_o_lantern")); + registry.accept(ResourceLocation.withDefaultNamespace("beacon")); + registry.accept(ResourceLocation.withDefaultNamespace("respawn_anchor")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_bookshelf")); + registry.accept(ResourceLocation.withDefaultNamespace("brewing_stand")); + registry.accept(ResourceLocation.withDefaultNamespace("enchanting_table")); + registry.accept(ResourceLocation.withDefaultNamespace("jukebox")); + registry.accept(ResourceLocation.withDefaultNamespace("note_block")); + registry.accept(ResourceLocation.withDefaultNamespace("furnace")); + registry.accept(ResourceLocation.withDefaultNamespace("crafting_table")); + registry.accept(ResourceLocation.withDefaultNamespace("flower_pot")); + registry.accept(ResourceLocation.withDefaultNamespace("armor_stand")); + registry.accept(ResourceLocation.withDefaultNamespace("trapped_chest")); + registry.accept(ResourceLocation.withDefaultNamespace("ender_chest")); + registry.accept(ResourceLocation.withDefaultNamespace("lantern")); + registry.accept(ResourceLocation.withDefaultNamespace("stonecutter")); + registry.accept(ResourceLocation.withDefaultNamespace("cartography_table")); + registry.accept(ResourceLocation.withDefaultNamespace("fletching_table")); + registry.accept(ResourceLocation.withDefaultNamespace("smithing_table")); + registry.accept(ResourceLocation.withDefaultNamespace("grindstone")); + registry.accept(ResourceLocation.withDefaultNamespace("smoker")); + registry.accept(ResourceLocation.withDefaultNamespace("blast_furnace")); + registry.accept(ResourceLocation.withDefaultNamespace("loom")); + registry.accept(ResourceLocation.withDefaultNamespace("composter")); + registry.accept(ResourceLocation.withDefaultNamespace("bell")); + registry.accept(ResourceLocation.withDefaultNamespace("conduit")); + registry.accept(ResourceLocation.withDefaultNamespace("candle")); + registry.accept(ResourceLocation.withDefaultNamespace("scaffolding")); + registry.accept(ResourceLocation.withDefaultNamespace("beehive")); + registry.accept(ResourceLocation.withDefaultNamespace("lightning_rod")); + registry.accept(ResourceLocation.withDefaultNamespace("lectern")); + registry.accept(ResourceLocation.withDefaultNamespace("golden_apple")); + registry.accept(ResourceLocation.withDefaultNamespace("book")); + registry.accept(ResourceLocation.withDefaultNamespace("ender_eye")); + registry.accept(ResourceLocation.withDefaultNamespace("glistering_melon_slice")); + registry.accept(ResourceLocation.withDefaultNamespace("golden_carrot")); + registry.accept(ResourceLocation.withDefaultNamespace("magma_cream")); + registry.accept(ResourceLocation.withDefaultNamespace("lead")); + registry.accept(ResourceLocation.withDefaultNamespace("item_frame")); + registry.accept(ResourceLocation.withDefaultNamespace("painting")); + registry.accept(ResourceLocation.withDefaultNamespace("chest_minecart")); + registry.accept(ResourceLocation.withDefaultNamespace("furnace_minecart")); + registry.accept(ResourceLocation.withDefaultNamespace("tnt_minecart")); + registry.accept(ResourceLocation.withDefaultNamespace("hopper_minecart")); for (DyeColor color : DyeColor.values()) { - registry.accept(new ResourceLocation(color.getName() + "_bed")); + registry.accept(ResourceLocation.tryParse(color.getName() + "_bed")); } - registry.accept(new ResourceLocation("minecraft:fermented_spider_eye")); - registry.accept(new ResourceLocation("minecraft:fire_charge")); - registry.accept(new ResourceLocation("minecraft:music_disc_5")); - registry.accept(new ResourceLocation("minecraft:turtle_helmet")); - registry.accept(new ResourceLocation("minecraft:brush")); - registry.accept(new ResourceLocation("minecraft:recovery_compass")); - registry.accept(new ResourceLocation("minecraft:spyglass")); - registry.accept(new ResourceLocation("minecraft:respawn_anchor")); - registry.accept(new ResourceLocation("minecraft:lodestone")); - registry.accept(new ResourceLocation("minecraft:chiseled_bookshelf")); - registry.accept(new ResourceLocation("minecraft:bread")); - registry.accept(new ResourceLocation("minecraft:cake")); - registry.accept(new ResourceLocation("minecraft:cookie")); - registry.accept(new ResourceLocation("minecraft:pumpkin_pie")); + registry.accept(ResourceLocation.withDefaultNamespace("fermented_spider_eye")); + registry.accept(ResourceLocation.withDefaultNamespace("fire_charge")); + registry.accept(ResourceLocation.withDefaultNamespace("music_disc_5")); + registry.accept(ResourceLocation.withDefaultNamespace("turtle_helmet")); + registry.accept(ResourceLocation.withDefaultNamespace("brush")); + registry.accept(ResourceLocation.withDefaultNamespace("recovery_compass")); + registry.accept(ResourceLocation.withDefaultNamespace("spyglass")); + registry.accept(ResourceLocation.withDefaultNamespace("respawn_anchor")); + registry.accept(ResourceLocation.withDefaultNamespace("lodestone")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_bookshelf")); + registry.accept(ResourceLocation.withDefaultNamespace("bread")); + registry.accept(ResourceLocation.withDefaultNamespace("cake")); + registry.accept(ResourceLocation.withDefaultNamespace("cookie")); + registry.accept(ResourceLocation.withDefaultNamespace("pumpkin_pie")); } private static void hardGlassRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:glass")); - registry.accept(new ResourceLocation("minecraft:glass_bottle")); - registry.accept(new ResourceLocation("minecraft:glass_pane")); + registry.accept(ResourceLocation.withDefaultNamespace("glass")); + registry.accept(ResourceLocation.withDefaultNamespace("glass_bottle")); + registry.accept(ResourceLocation.withDefaultNamespace("glass_pane")); for (DyeColor color : DyeColor.values()) { - registry.accept(new ResourceLocation(String.format("minecraft:%s_stained_glass_pane_from_glass_pane", + registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_stained_glass_pane_from_glass_pane", color.name().toLowerCase(Locale.ROOT)))); - registry.accept(new ResourceLocation( - String.format("minecraft:%s_stained_glass_pane", color.name().toLowerCase(Locale.ROOT)))); + registry.accept(ResourceLocation.withDefaultNamespace( + String.format("%s_stained_glass_pane", color.name().toLowerCase(Locale.ROOT)))); } - registry.accept(new ResourceLocation("minecraft:tinted_glass")); + registry.accept(ResourceLocation.withDefaultNamespace("tinted_glass")); } private static void nerfPaperCrafting(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:paper")); - registry.accept(new ResourceLocation("minecraft:sugar_from_sugar_cane")); + registry.accept(ResourceLocation.withDefaultNamespace("paper")); + registry.accept(ResourceLocation.withDefaultNamespace("sugar_from_sugar_cane")); } private static void hardAdvancedIronRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:iron_door")); - registry.accept(new ResourceLocation("minecraft:anvil")); - registry.accept(new ResourceLocation("minecraft:iron_trapdoor")); - registry.accept(new ResourceLocation("minecraft:minecart")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_door")); + registry.accept(ResourceLocation.withDefaultNamespace("anvil")); + registry.accept(ResourceLocation.withDefaultNamespace("iron_trapdoor")); + registry.accept(ResourceLocation.withDefaultNamespace("minecart")); } private static void hardDyeRecipes(Consumer registry) { for (MarkerMaterial colorMaterial : MarkerMaterials.Color.VALUES) { registry.accept( - new ResourceLocation(String.format("minecraft:%s_concrete_powder", colorMaterial.getName()))); - registry.accept(new ResourceLocation(String.format("minecraft:%s_terracotta", colorMaterial.getName()))); - registry.accept(new ResourceLocation(String.format("minecraft:%s_stained_glass", colorMaterial.getName()))); - registry.accept(new ResourceLocation(String.format("minecraft:%s_candle", colorMaterial.getName()))); - registry.accept(new ResourceLocation(String.format("minecraft:dye_%s_wool", colorMaterial.getName()))); - registry.accept(new ResourceLocation(String.format("minecraft:dye_%s_carpet", colorMaterial.getName()))); - registry.accept(new ResourceLocation(String.format("minecraft:dye_%s_bed", colorMaterial.getName()))); + ResourceLocation.withDefaultNamespace(String.format("%s_concrete_powder", colorMaterial.getName()))); + registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_terracotta", colorMaterial.getName()))); + registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_stained_glass", colorMaterial.getName()))); + registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_candle", colorMaterial.getName()))); + registry.accept(ResourceLocation.withDefaultNamespace(String.format("dye_%s_wool", colorMaterial.getName()))); + registry.accept(ResourceLocation.withDefaultNamespace(String.format("dye_%s_carpet", colorMaterial.getName()))); + registry.accept(ResourceLocation.withDefaultNamespace(String.format("dye_%s_bed", colorMaterial.getName()))); - registry.accept(new ResourceLocation("white_dye")); - registry.accept(new ResourceLocation("black_dye")); - registry.accept(new ResourceLocation("black_dye_from_wither_rose")); - registry.accept(new ResourceLocation("blue_dye")); - registry.accept(new ResourceLocation("white_dye_from_lily_of_the_valley")); - registry.accept(new ResourceLocation("light_blue_dye_from_blue_orchid")); - registry.accept(new ResourceLocation("yellow_dye_from_dandelion")); - registry.accept(new ResourceLocation("light_gray_dye_from_white_tulip")); - registry.accept(new ResourceLocation("light_gray_dye_from_azure_bluet")); - registry.accept(new ResourceLocation("red_dye_from_poppy")); - registry.accept(new ResourceLocation("red_dye_from_tulip")); - registry.accept(new ResourceLocation("red_dye_from_rose_bush")); - registry.accept(new ResourceLocation("red_dye_from_beetroot")); - registry.accept(new ResourceLocation("orange_dye_from_orange_tulip")); - registry.accept(new ResourceLocation("orange_dye_from_torchflower")); - registry.accept(new ResourceLocation("yellow_dye_from_dandelion")); - registry.accept(new ResourceLocation("cyan_dye_from_pitcher_plant")); - registry.accept(new ResourceLocation("light_blue_dye_from_blue_orchid")); - registry.accept(new ResourceLocation("blue_dye_from_cornflower")); - registry.accept(new ResourceLocation("magenta_dye_from_allium")); - registry.accept(new ResourceLocation("magenta_dye_from_lilac")); - registry.accept(new ResourceLocation("lime_dye_from_lime")); - registry.accept(new ResourceLocation("pink_dye_from_pink_tulip")); - registry.accept(new ResourceLocation("pink_dye_from_pink_petals")); - registry.accept(new ResourceLocation("pink_dye_from_peony")); - registry.accept(new ResourceLocation("yellow_dye_from_sunflower")); - registry.accept(new ResourceLocation("light_gray_dye_from_oxeye_daisy")); + registry.accept(ResourceLocation.withDefaultNamespace("white_dye")); + registry.accept(ResourceLocation.withDefaultNamespace("black_dye")); + registry.accept(ResourceLocation.withDefaultNamespace("black_dye_from_wither_rose")); + registry.accept(ResourceLocation.withDefaultNamespace("blue_dye")); + registry.accept(ResourceLocation.withDefaultNamespace("white_dye_from_lily_of_the_valley")); + registry.accept(ResourceLocation.withDefaultNamespace("light_blue_dye_from_blue_orchid")); + registry.accept(ResourceLocation.withDefaultNamespace("yellow_dye_from_dandelion")); + registry.accept(ResourceLocation.withDefaultNamespace("light_gray_dye_from_white_tulip")); + registry.accept(ResourceLocation.withDefaultNamespace("light_gray_dye_from_azure_bluet")); + registry.accept(ResourceLocation.withDefaultNamespace("red_dye_from_poppy")); + registry.accept(ResourceLocation.withDefaultNamespace("red_dye_from_tulip")); + registry.accept(ResourceLocation.withDefaultNamespace("red_dye_from_rose_bush")); + registry.accept(ResourceLocation.withDefaultNamespace("red_dye_from_beetroot")); + registry.accept(ResourceLocation.withDefaultNamespace("orange_dye_from_orange_tulip")); + registry.accept(ResourceLocation.withDefaultNamespace("orange_dye_from_torchflower")); + registry.accept(ResourceLocation.withDefaultNamespace("yellow_dye_from_dandelion")); + registry.accept(ResourceLocation.withDefaultNamespace("cyan_dye_from_pitcher_plant")); + registry.accept(ResourceLocation.withDefaultNamespace("light_blue_dye_from_blue_orchid")); + registry.accept(ResourceLocation.withDefaultNamespace("blue_dye_from_cornflower")); + registry.accept(ResourceLocation.withDefaultNamespace("magenta_dye_from_allium")); + registry.accept(ResourceLocation.withDefaultNamespace("magenta_dye_from_lilac")); + registry.accept(ResourceLocation.withDefaultNamespace("lime_dye_from_lime")); + registry.accept(ResourceLocation.withDefaultNamespace("pink_dye_from_pink_tulip")); + registry.accept(ResourceLocation.withDefaultNamespace("pink_dye_from_pink_petals")); + registry.accept(ResourceLocation.withDefaultNamespace("pink_dye_from_peony")); + registry.accept(ResourceLocation.withDefaultNamespace("yellow_dye_from_sunflower")); + registry.accept(ResourceLocation.withDefaultNamespace("light_gray_dye_from_oxeye_daisy")); } - registry.accept(new ResourceLocation("minecraft:dark_prismarine")); + registry.accept(ResourceLocation.withDefaultNamespace("dark_prismarine")); } private static void flintAndSteelRequireSteel(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:flint_and_steel")); + registry.accept(ResourceLocation.withDefaultNamespace("flint_and_steel")); } /** @@ -329,195 +329,195 @@ private static void flintAndSteelRequireSteel(Consumer registr * normal recipe configs (think stairs, ladders, etc. having a crafting table recipe as well as a machine recipe) */ private static void removeVanillaBlockRecipes(Consumer registry) { - registry.accept(new ResourceLocation("minecraft:dripstone_block")); - registry.accept(new ResourceLocation("minecraft:polished_granite")); - registry.accept(new ResourceLocation("minecraft:polished_diorite")); - registry.accept(new ResourceLocation("minecraft:polished_andesite")); - registry.accept(new ResourceLocation("minecraft:packed_ice")); - registry.accept(new ResourceLocation("minecraft:blue_ice")); - registry.accept(new ResourceLocation("minecraft:slime_block")); - registry.accept(new ResourceLocation("minecraft:slime_ball")); - registry.accept(new ResourceLocation("minecraft:melon")); - registry.accept(new ResourceLocation("minecraft:hay_block")); - registry.accept(new ResourceLocation("minecraft:wheat")); - registry.accept(new ResourceLocation("minecraft:magma_block")); - registry.accept(new ResourceLocation("minecraft:nether_wart_block")); - registry.accept(new ResourceLocation("minecraft:bone_block")); - registry.accept(new ResourceLocation("minecraft:bone_meal_from_bone_block")); - registry.accept(new ResourceLocation("minecraft:honey_block")); - registry.accept(new ResourceLocation("minecraft:purpur_block")); - registry.accept(new ResourceLocation("minecraft:prismarine_bricks")); - registry.accept(new ResourceLocation("minecraft:prismarine")); - registry.accept(new ResourceLocation("minecraft:snow_block")); - registry.accept(new ResourceLocation("minecraft:sandstone")); - registry.accept(new ResourceLocation("minecraft:polished_andesite")); - registry.accept(new ResourceLocation("minecraft:polished_diorite")); - registry.accept(new ResourceLocation("minecraft:polished_granite")); - registry.accept(new ResourceLocation("minecraft:coarse_dirt")); - registry.accept(new ResourceLocation("minecraft:chiseled_sandstone")); - registry.accept(new ResourceLocation("minecraft:chiseled_quartz_block")); - registry.accept(new ResourceLocation("minecraft:stone_bricks")); - registry.accept(new ResourceLocation("minecraft:chiseled_stone_bricks")); - registry.accept(new ResourceLocation("minecraft:purpur_pillar")); - registry.accept(new ResourceLocation("minecraft:end_stone_bricks")); - registry.accept(new ResourceLocation("minecraft:red_nether_bricks")); - registry.accept(new ResourceLocation("minecraft:red_sandstone")); - registry.accept(new ResourceLocation("minecraft:chiseled_red_sandstone")); - registry.accept(new ResourceLocation("minecraft:bookshelf")); - registry.accept(new ResourceLocation("minecraft:quartz_pillar")); - registry.accept(new ResourceLocation("minecraft:sea_lantern")); - registry.accept(new ResourceLocation("minecraft:white_wool_from_string")); - registry.accept(new ResourceLocation("minecraft:cracked_stone_bricks")); - registry.accept(new ResourceLocation("minecraft:mossy_cobblestone_from_moss_block")); - registry.accept(new ResourceLocation("minecraft:mossy_cobblestone_from_vine")); - registry.accept(new ResourceLocation("minecraft:deepslate_bricks")); - registry.accept(new ResourceLocation("minecraft:cracked_nether_bricks")); - registry.accept(new ResourceLocation("minecraft:chiseled_nether_bricks")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_bricks")); - registry.accept(new ResourceLocation("minecraft:cracked_polished_blackstone_bricks")); - registry.accept(new ResourceLocation("minecraft:quartz_bricks")); - registry.accept(new ResourceLocation("minecraft:polished_deepslate")); - registry.accept(new ResourceLocation("minecraft:polished_basalt")); - registry.accept(new ResourceLocation("minecraft:chiseled_polished_blackstone")); - registry.accept(new ResourceLocation("minecraft:deepslate_tiles")); - registry.accept(new ResourceLocation("minecraft:cracked_deepslate_tiles")); - registry.accept(new ResourceLocation("minecraft:chiseled_deepslate")); - registry.accept(new ResourceLocation("minecraft:cracked_deepslate_bricks")); - registry.accept(new ResourceLocation("minecraft:cut_red_sandstone")); - registry.accept(new ResourceLocation("minecraft:polished_basalt")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone")); - registry.accept(new ResourceLocation("minecraft:cut_copper")); - registry.accept(new ResourceLocation("minecraft:exposed_cut_copper")); - registry.accept(new ResourceLocation("minecraft:weathered_cut_copper")); - registry.accept(new ResourceLocation("minecraft:oxidized_cut_copper")); - registry.accept(new ResourceLocation("minecraft:waxed_cut_copper")); - registry.accept(new ResourceLocation("minecraft:waxed_exposed_cut_copper")); - registry.accept(new ResourceLocation("minecraft:waxed_weathered_cut_copper")); - registry.accept(new ResourceLocation("minecraft:waxed_oxidized_cut_copper")); - registry.accept(new ResourceLocation("minecraft:end_crystal")); - registry.accept(new ResourceLocation("minecraft:end_rod")); - registry.accept(new ResourceLocation("minecraft:mud_bricks")); - registry.accept(new ResourceLocation("minecraft:mossy_stone_bricks_from_vine")); - registry.accept(new ResourceLocation("minecraft:mossy_stone_bricks_from_moss_block")); - registry.accept(new ResourceLocation("minecraft:packed_mud")); + registry.accept(ResourceLocation.withDefaultNamespace("dripstone_block")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_granite")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_diorite")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_andesite")); + registry.accept(ResourceLocation.withDefaultNamespace("packed_ice")); + registry.accept(ResourceLocation.withDefaultNamespace("blue_ice")); + registry.accept(ResourceLocation.withDefaultNamespace("slime_block")); + registry.accept(ResourceLocation.withDefaultNamespace("slime_ball")); + registry.accept(ResourceLocation.withDefaultNamespace("melon")); + registry.accept(ResourceLocation.withDefaultNamespace("hay_block")); + registry.accept(ResourceLocation.withDefaultNamespace("wheat")); + registry.accept(ResourceLocation.withDefaultNamespace("magma_block")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_wart_block")); + registry.accept(ResourceLocation.withDefaultNamespace("bone_block")); + registry.accept(ResourceLocation.withDefaultNamespace("bone_meal_from_bone_block")); + registry.accept(ResourceLocation.withDefaultNamespace("honey_block")); + registry.accept(ResourceLocation.withDefaultNamespace("purpur_block")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine")); + registry.accept(ResourceLocation.withDefaultNamespace("snow_block")); + registry.accept(ResourceLocation.withDefaultNamespace("sandstone")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_andesite")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_diorite")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_granite")); + registry.accept(ResourceLocation.withDefaultNamespace("coarse_dirt")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_sandstone")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_quartz_block")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_stone_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("purpur_pillar")); + registry.accept(ResourceLocation.withDefaultNamespace("end_stone_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("red_nether_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("red_sandstone")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_red_sandstone")); + registry.accept(ResourceLocation.withDefaultNamespace("bookshelf")); + registry.accept(ResourceLocation.withDefaultNamespace("quartz_pillar")); + registry.accept(ResourceLocation.withDefaultNamespace("sea_lantern")); + registry.accept(ResourceLocation.withDefaultNamespace("white_wool_from_string")); + registry.accept(ResourceLocation.withDefaultNamespace("cracked_stone_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_cobblestone_from_moss_block")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_cobblestone_from_vine")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("cracked_nether_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_nether_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("cracked_polished_blackstone_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("quartz_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_deepslate")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_basalt")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_polished_blackstone")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_tiles")); + registry.accept(ResourceLocation.withDefaultNamespace("cracked_deepslate_tiles")); + registry.accept(ResourceLocation.withDefaultNamespace("chiseled_deepslate")); + registry.accept(ResourceLocation.withDefaultNamespace("cracked_deepslate_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("cut_red_sandstone")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_basalt")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone")); + registry.accept(ResourceLocation.withDefaultNamespace("cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("exposed_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("weathered_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("oxidized_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_exposed_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_weathered_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_oxidized_cut_copper")); + registry.accept(ResourceLocation.withDefaultNamespace("end_crystal")); + registry.accept(ResourceLocation.withDefaultNamespace("end_rod")); + registry.accept(ResourceLocation.withDefaultNamespace("mud_bricks")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_stone_bricks_from_vine")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_stone_bricks_from_moss_block")); + registry.accept(ResourceLocation.withDefaultNamespace("packed_mud")); // Carpet replacement for (DyeColor color : DyeColor.values()) { - registry.accept(new ResourceLocation(String.format("minecraft:%s_carpet", + registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_carpet", color.name().toLowerCase(Locale.ROOT)))); } // Slab replacement - registry.accept(new ResourceLocation("minecraft:stone_slab")); - registry.accept(new ResourceLocation("minecraft:smooth_stone_slab")); - registry.accept(new ResourceLocation("minecraft:andesite_slab")); - registry.accept(new ResourceLocation("minecraft:granite_slab")); - registry.accept(new ResourceLocation("minecraft:diorite_slab")); - registry.accept(new ResourceLocation("minecraft:polished_andesite_slab")); - registry.accept(new ResourceLocation("minecraft:polished_granite_slab")); - registry.accept(new ResourceLocation("minecraft:polished_diorite_slab")); - registry.accept(new ResourceLocation("minecraft:sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:smooth_sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:red_sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:smooth_red_sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:cobblestone_slab")); - registry.accept(new ResourceLocation("minecraft:blackstone_slab")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_slab")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_brick_slab")); - registry.accept(new ResourceLocation("minecraft:brick_slab")); - registry.accept(new ResourceLocation("minecraft:stone_brick_slab")); - registry.accept(new ResourceLocation("minecraft:mud_brick_slab")); - registry.accept(new ResourceLocation("minecraft:nether_brick_slab")); - registry.accept(new ResourceLocation("minecraft:red_nether_brick_slab")); - registry.accept(new ResourceLocation("minecraft:quartz_slab")); - registry.accept(new ResourceLocation("minecraft:smooth_quartz_slab")); - registry.accept(new ResourceLocation("minecraft:cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:exposed_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:oxidized_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:weathered_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:waxed_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:waxed_exposed_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:waxed_oxidized_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:waxed_weathered_cut_copper_slab")); - registry.accept(new ResourceLocation("minecraft:red_sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:purpur_slab")); - registry.accept(new ResourceLocation("minecraft:end_stone_brick_slab")); - registry.accept(new ResourceLocation("minecraft:prismarine_slab")); - registry.accept(new ResourceLocation("minecraft:prismarine_brick_slab")); - registry.accept(new ResourceLocation("minecraft:dark_prismarine_slab")); - registry.accept(new ResourceLocation("minecraft:mossy_cobblestone_slab")); - registry.accept(new ResourceLocation("minecraft:mossy_stone_brick_slab")); - registry.accept(new ResourceLocation("minecraft:cut_sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:cut_red_sandstone_slab")); - registry.accept(new ResourceLocation("minecraft:bamboo_mosaic_slab")); - registry.accept(new ResourceLocation("minecraft:cobbled_deepslate_slab")); - registry.accept(new ResourceLocation("minecraft:polished_deepslate_slab")); - registry.accept(new ResourceLocation("minecraft:deepslate_brick_slab")); - registry.accept(new ResourceLocation("minecraft:deepslate_tile_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_stone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("andesite_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("granite_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("diorite_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_andesite_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_granite_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_diorite_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("red_sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_red_sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("cobblestone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("blackstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("mud_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("red_nether_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("quartz_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_quartz_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("exposed_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("oxidized_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("weathered_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_exposed_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_oxidized_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_weathered_cut_copper_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("red_sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("purpur_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("end_stone_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("dark_prismarine_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_cobblestone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_stone_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("cut_sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("cut_red_sandstone_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("bamboo_mosaic_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("cobbled_deepslate_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_deepslate_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_brick_slab")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_tile_slab")); // stair - registry.accept(new ResourceLocation("minecraft:stone_stairs")); - registry.accept(new ResourceLocation("minecraft:cobblestone_stairs")); - registry.accept(new ResourceLocation("minecraft:mossy_cobblestone_stairs")); - registry.accept(new ResourceLocation("minecraft:stone_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:mossy_stone_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:granite_stairs")); - registry.accept(new ResourceLocation("minecraft:polished_granite_stairs")); - registry.accept(new ResourceLocation("minecraft:diorite_stairs")); - registry.accept(new ResourceLocation("minecraft:polished_diorite_stairs")); - registry.accept(new ResourceLocation("minecraft:andesite_stairs")); - registry.accept(new ResourceLocation("minecraft:polished_andesite_stairs")); - registry.accept(new ResourceLocation("minecraft:cobbled_deepslate_stairs")); - registry.accept(new ResourceLocation("minecraft:polished_deepslate_stairs")); - registry.accept(new ResourceLocation("minecraft:deepslate_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:deepslate_tile_stairs")); - registry.accept(new ResourceLocation("minecraft:brick_stairs")); - registry.accept(new ResourceLocation("minecraft:mud_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:sandstone_stairs")); - registry.accept(new ResourceLocation("minecraft:smooth_sandstone_stairs")); - registry.accept(new ResourceLocation("minecraft:red_sandstone_stairs")); - registry.accept(new ResourceLocation("minecraft:smooth_red_sandstone_stairs")); - registry.accept(new ResourceLocation("minecraft:prismarine_stairs")); - registry.accept(new ResourceLocation("minecraft:prismarine_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:dark_prismarine_stairs")); - registry.accept(new ResourceLocation("minecraft:nether_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:red_nether_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:blackstone_stairs")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_stairs")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:end_stone_brick_stairs")); - registry.accept(new ResourceLocation("minecraft:purpur_stairs")); - registry.accept(new ResourceLocation("minecraft:quartz_stairs")); - registry.accept(new ResourceLocation("minecraft:smooth_quartz_stairs")); - registry.accept(new ResourceLocation("minecraft:cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:exposed_cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:weathered_cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:oxidized_cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:waxed_cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:waxed_exposed_cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:waxed_weathered_cut_copper_stairs")); - registry.accept(new ResourceLocation("minecraft:waxed_oxidized_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("cobblestone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_cobblestone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_stone_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("granite_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_granite_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("diorite_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_diorite_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("andesite_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_andesite_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("cobbled_deepslate_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_deepslate_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_tile_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("mud_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("sandstone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_sandstone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("red_sandstone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_red_sandstone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("dark_prismarine_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("red_nether_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("blackstone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("end_stone_brick_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("purpur_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("quartz_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("smooth_quartz_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("exposed_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("weathered_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("oxidized_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_exposed_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_weathered_cut_copper_stairs")); + registry.accept(ResourceLocation.withDefaultNamespace("waxed_oxidized_cut_copper_stairs")); // wall - registry.accept(new ResourceLocation("minecraft:cobblestone_wall")); - registry.accept(new ResourceLocation("minecraft:mossy_cobblestone_wall")); - registry.accept(new ResourceLocation("minecraft:stone_brick_wall")); - registry.accept(new ResourceLocation("minecraft:mossy_stone_brick_wall")); - registry.accept(new ResourceLocation("minecraft:granite_wall")); - registry.accept(new ResourceLocation("minecraft:diorite_wall")); - registry.accept(new ResourceLocation("minecraft:andesite_wall")); - registry.accept(new ResourceLocation("minecraft:cobbled_deepslate_wall")); - registry.accept(new ResourceLocation("minecraft:polished_deepslate_wall")); - registry.accept(new ResourceLocation("minecraft:deepslate_brick_wall")); - registry.accept(new ResourceLocation("minecraft:deepslate_tile_wall")); - registry.accept(new ResourceLocation("minecraft:brick_wall")); - registry.accept(new ResourceLocation("minecraft:mud_brick_wall")); - registry.accept(new ResourceLocation("minecraft:sandstone_wall")); - registry.accept(new ResourceLocation("minecraft:red_sandstone_wall")); - registry.accept(new ResourceLocation("minecraft:prismarine_wall")); - registry.accept(new ResourceLocation("minecraft:nether_brick_wall")); - registry.accept(new ResourceLocation("minecraft:red_nether_brick_wall")); - registry.accept(new ResourceLocation("minecraft:blackstone_wall")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_wall")); - registry.accept(new ResourceLocation("minecraft:polished_blackstone_brick_wall")); - registry.accept(new ResourceLocation("minecraft:end_stone_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("cobblestone_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_cobblestone_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("stone_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("mossy_stone_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("granite_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("diorite_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("andesite_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("cobbled_deepslate_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_deepslate_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("deepslate_tile_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("mud_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("sandstone_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("red_sandstone_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("prismarine_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("nether_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("red_nether_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("blackstone_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("polished_blackstone_brick_wall")); + registry.accept(ResourceLocation.withDefaultNamespace("end_stone_brick_wall")); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java index 8240fa9d09a..c1bfa9b292c 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java @@ -533,14 +533,14 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(Tags.Items.GRAVEL, 4) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L)) .outputItems(new ItemStack( - BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_concrete_powder")), 8)) + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete_powder")), 8)) .save(provider); CHEMICAL_BATH_RECIPES.recipeBuilder(dyeName + "_concrete").duration(20).EUt(VA[ULV]) .inputItems(new ItemStack( - BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_concrete_powder")))) + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete_powder")))) .inputFluids(Water.getFluid(1000)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_concrete")))) + .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -549,7 +549,7 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(CustomTags.CONCRETE_ITEM) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_concrete")))) + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); } @@ -558,7 +558,7 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(new ItemStack(Blocks.TERRACOTTA)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_terracotta")))) + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_terracotta")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -566,7 +566,7 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(new ItemStack(Blocks.GLASS)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_stained_glass")))) + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -574,20 +574,20 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(new ItemStack(Blocks.GLASS_PANE)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems(new ItemStack( - BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_stained_glass_pane")))) + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); CUTTER_RECIPES.recipeBuilder("cut_" + dyeName + "_glass_to_pane").duration(20).EUt(VA[ULV]) - .inputItems(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_stained_glass")), 3) - .outputItems(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_stained_glass_pane")), 8) + .inputItems(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass")), 3) + .outputItems(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")), 8) .save(provider); CHEMICAL_BATH_RECIPES.recipeBuilder("dye_candle_to_" + dyeName).duration(20).EUt(VA[ULV]) .inputItems(new ItemStack(Items.CANDLE)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems(new ItemStack( - BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_candle")))) + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_candle")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -595,29 +595,29 @@ private static void dyingCleaningRecipes(Consumer provider) { CHEMICAL_BATH_RECIPES.recipeBuilder("dye_wool_to_" + dyeName).duration(20).EUt(VA[ULV]) .inputItems(new ItemStack(Blocks.WHITE_WOOL)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_wool")))) + .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); CHEMICAL_BATH_RECIPES.recipeBuilder("dye_bed_to_" + dyeName).duration(20).EUt(VA[ULV]) .inputItems(new ItemStack(Blocks.WHITE_BED)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_bed")))) + .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_bed")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); } CUTTER_RECIPES.recipeBuilder("cut_" + dyeName + "_wool_to_carpet").duration(20).EUt(VA[ULV]) - .inputItems(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_wool")), 1)) + .inputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")), 1)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_carpet")), 2)) + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_carpet")), 2)) .save(provider); ASSEMBLER_RECIPES.recipeBuilder(dyeName + "_banner").duration(20).EUt(VA[ULV]) .circuitMeta(6) .inputItems(new ItemStack(Items.STICK)) - .inputItems(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_wool")), 6)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(new ResourceLocation(dyeName + "_banner")))) + .inputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")), 6)) + .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_banner")))) .save(provider); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java index e2809b304a8..b842e48a72d 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/WoodMachineRecipes.java @@ -947,7 +947,7 @@ private static void registerGTWoodRecipes(Consumer provider) { public static void hardWoodRecipes(Consumer registry) { if (ConfigHolder.INSTANCE.recipes.nerfWoodCrafting) { - registry.accept(new ResourceLocation("minecraft:stick")); + registry.accept(ResourceLocation.withDefaultNamespace("stick")); } for (WoodTypeEntry entry : getDefaultEntries()) { hardWoodTypeRecipes(registry, entry); @@ -957,13 +957,13 @@ public static void hardWoodRecipes(Consumer registry) { private static void hardWoodTypeRecipes(Consumer registry, @NotNull WoodTypeEntry entry) { if (ConfigHolder.INSTANCE.recipes.nerfWoodCrafting) { if (entry.planksRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.planksRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.planksRecipeName)); } } if (ConfigHolder.INSTANCE.recipes.harderCharcoalRecipe) { if (entry.removeCharcoalRecipe) { - registry.accept(new ResourceLocation("charcoal")); + registry.accept(ResourceLocation.withDefaultNamespace("charcoal")); } } @@ -971,68 +971,68 @@ private static void hardWoodTypeRecipes(Consumer registry, @No if (entry.door != null) { // hard plank -> door crafting if (entry.doorRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.doorRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.doorRecipeName)); } } if (entry.slab != null) { if (ConfigHolder.INSTANCE.recipes.hardWoodRecipes && entry.slabRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.slabRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.slabRecipeName)); } if (entry.boat != null) { // hard plank -> boat crafting if (entry.boatRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.boatRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.boatRecipeName)); } if (entry.chestBoatRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.chestBoatRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.chestBoatRecipeName)); } } } if (entry.fence != null) { // hard plank -> fence crafting if (entry.fenceRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.fenceRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.fenceRecipeName)); } } if (entry.fenceGate != null) { // hard plank -> fence gate crafting if (entry.fenceGateRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.fenceGateRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.fenceGateRecipeName)); } } if (entry.trapdoor != null) { // hard plank -> trapdoor crafting if (entry.trapdoorRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.trapdoorRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.trapdoorRecipeName)); } } if (entry.chestBoat != null) { if (entry.chestBoatRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.chestBoatRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.chestBoatRecipeName)); } } if (entry.sign != null) { // hard plank -> sign crafting if (entry.signRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.signRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.signRecipeName)); } } if (entry.hangingSign != null) { // hard plank -> hanging sign crafting if (entry.hangingSignRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.hangingSignRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.hangingSignRecipeName)); } } if (entry.button != null) { // hard plank -> button crafting if (entry.buttonRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.buttonRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.buttonRecipeName)); } } if (entry.pressurePlate != null) { // hard plank -> pressure plate crafting if (entry.pressurePlateRecipeName != null) { - registry.accept(new ResourceLocation(entry.modid, entry.pressurePlateRecipeName)); + registry.accept(ResourceLocation.fromNamespaceAndPath(entry.modid, entry.pressurePlateRecipeName)); } } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java index 4a19e622c0a..9c8d521994c 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java @@ -5,6 +5,7 @@ import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; +import net.minecraft.world.level.Level; import java.util.function.Consumer; @@ -99,19 +100,19 @@ public static void init(Consumer provider) { GAS_COLLECTOR_RECIPES.recipeBuilder("air") .circuitMeta(1) .outputFluids(Air.getFluid(10000)) - .dimension(new ResourceLocation("overworld")) + .dimension(Level.OVERWORLD.location()) .duration(200).EUt(16).save(provider); GAS_COLLECTOR_RECIPES.recipeBuilder("nether_air") .circuitMeta(2) .outputFluids(NetherAir.getFluid(10000)) - .dimension(new ResourceLocation("the_nether")) + .dimension(Level.NETHER.location()) .duration(200).EUt(64).save(provider); GAS_COLLECTOR_RECIPES.recipeBuilder("ender_air") .circuitMeta(3) .outputFluids(EnderAir.getFluid(10000)) - .dimension(new ResourceLocation("the_end")) + .dimension(Level.END.location()) .duration(200).EUt(256).save(provider); // CaCO3 + 2NaCl -> Na2CO3 + CaCl2 diff --git a/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java b/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java index 97059fa874f..6efedf96a8a 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java @@ -54,10 +54,10 @@ public static void init(RegistrateTagsProvider.IntrinsicImpl provider) { .add(Blocks.PITCHER_CROP) .addTag(BlockTags.CAVE_VINES) .addTag(BlockTags.TALL_FLOWERS) - .addOptionalTag(new ResourceLocation("forge:cacti")) - .addOptionalTag(new ResourceLocation("forge:crops/cactus")) - .addOptionalTag(new ResourceLocation("forge:crops/sugar_cane")) - .addOptionalTag(new ResourceLocation("forge:reeds")); + .addOptionalTag(ResourceLocation.parse("forge:cacti")) + .addOptionalTag(ResourceLocation.parse("forge:crops/cactus")) + .addOptionalTag(ResourceLocation.parse("forge:crops/sugar_cane")) + .addOptionalTag(ResourceLocation.parse("forge:reeds")); provider.addTag(BlockTags.REPLACEABLE) .add(GTMaterials.Oil.getFluid().defaultFluidState().createLegacyBlock().getBlock()) @@ -90,12 +90,12 @@ public static void init(RegistrateTagsProvider.IntrinsicImpl provider) { Blocks.WEEPING_VINES); provider.addTag(CustomTags.CLEANROOM_FLOORS) - .addOptionalTag(new ResourceLocation("elevatorid:elevators")) - .addOptional(new ResourceLocation("enderio:travel_anchor")) - .addOptional(new ResourceLocation("rftoolsutility:matter_transmitter")) - .addOptional(new ResourceLocation("rftoolsutility:matter_receiver")) - .addOptional(new ResourceLocation("rftoolsutility:dialing_device")) - .addOptional(new ResourceLocation("travelanchors:travel_anchor")); + .addOptionalTag(ResourceLocation.parse("elevatorid:elevators")) + .addOptional(ResourceLocation.parse("enderio:travel_anchor")) + .addOptional(ResourceLocation.parse("rftoolsutility:matter_transmitter")) + .addOptional(ResourceLocation.parse("rftoolsutility:matter_receiver")) + .addOptional(ResourceLocation.parse("rftoolsutility:dialing_device")) + .addOptional(ResourceLocation.parse("travelanchors:travel_anchor")); provider.addTag(CustomTags.CHARCOAL_PILE_IGNITER_WALLS) .addTag(BlockTags.DIRT) // any dirt blocks diff --git a/src/main/java/com/gregtechceu/gtceu/integration/ae2/GTAEPlaceholders.java b/src/main/java/com/gregtechceu/gtceu/integration/ae2/GTAEPlaceholders.java index 4db30093561..8d819f07b3c 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/ae2/GTAEPlaceholders.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/ae2/GTAEPlaceholders.java @@ -58,7 +58,7 @@ private static IGrid getGrid(PlaceholderContext ctx) throws PlaceholderException } private static long countItems(String id, IGrid grid) { - Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(id)); + Item item = ForgeRegistries.ITEMS.getValue(ResourceLocation.parse(id)); if (item == null) return 0; GenericStack stack = GenericStack.fromItemStack(new ItemStack(item, 1)); if (stack == null) return 0; @@ -85,7 +85,7 @@ private static long countFluids(@Nullable String id, IGrid grid) { } return count; } - Fluid fluid = ForgeRegistries.FLUIDS.getValue(new ResourceLocation(id)); + Fluid fluid = ForgeRegistries.FLUIDS.getValue(ResourceLocation.parse(id)); if (fluid == null) return 0; GenericStack stack = GenericStack.fromFluidStack(new FluidStack(fluid, 1)); if (stack == null) return 0; diff --git a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/AutoOutputBlockProvider.java b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/AutoOutputBlockProvider.java index f96862e2eef..a8891cb5ece 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/AutoOutputBlockProvider.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/AutoOutputBlockProvider.java @@ -79,7 +79,7 @@ private void addAutoOutputInfo(ITooltip iTooltip, BlockAccessor blockAccessor, C if (direction != null) { iTooltip.add(Component.translatable(text, StringUtils.capitalize(direction.getName()))); if (blockAccessor.showDetails()) { - var block = BuiltInRegistries.BLOCK.get(new ResourceLocation(compoundTag.getString("block"))).asItem() + var block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(compoundTag.getString("block"))).asItem() .getDefaultInstance(); if (!block.isEmpty()) { iTooltip.append(iTooltip.getElementHelper().smallItem(block)); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/ExhaustVentBlockProvider.java b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/ExhaustVentBlockProvider.java index 3622c32053a..4bc9469c2ab 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/ExhaustVentBlockProvider.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/ExhaustVentBlockProvider.java @@ -46,7 +46,7 @@ protected void addTooltip(CompoundTag compoundTag, ITooltip iTooltip, Player pla if (!compoundTag.getBoolean("ventBlocked")) return; if (blockAccessor.showDetails()) { - var block = BuiltInRegistries.BLOCK.get(new ResourceLocation(compoundTag.getString("ventBlock"))) + var block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(compoundTag.getString("ventBlock"))) .asItem().getDefaultInstance(); iTooltip.append(iTooltip.getElementHelper().smallItem(block)); } diff --git a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/GTFluidStorageProvider.java b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/GTFluidStorageProvider.java index c586e9062c4..a377e2b5e43 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/GTFluidStorageProvider.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/GTFluidStorageProvider.java @@ -87,7 +87,7 @@ private static FluidView readFluid(CompoundTag tag) { long capacity = tag.getLong("capacity"); if (capacity <= 0) return null; - Fluid fluid = BuiltInRegistries.FLUID.get(new ResourceLocation(tag.getString("fluid"))); + Fluid fluid = BuiltInRegistries.FLUID.get(ResourceLocation.parse(tag.getString("fluid"))); CompoundTag nbt = tag.contains("tag") ? tag.getCompound("tag") : null; long amount = tag.getLong("amount"); JadeFluidObject fluidObject = JadeFluidObject.of(fluid, 1000, nbt); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/MachineModeProvider.java b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/MachineModeProvider.java index a5e342bdd09..ad8e801959f 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/MachineModeProvider.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/jade/provider/MachineModeProvider.java @@ -56,7 +56,7 @@ protected void addTooltip(CompoundTag data, ITooltip tooltip, Player player, Blo if (block.showDetails()) { tooltip.add(Component.translatable("gtceu.top.machine_mode")); for (int i = 0; i < recipeTypesTagList.size(); i++) { - ResourceLocation recipeType = new ResourceLocation(recipeTypesTagList.getString(i)); + ResourceLocation recipeType = ResourceLocation.parse(recipeTypesTagList.getString(i)); MutableComponent text; if (currentRecipeTypeIndex == i) { text = Component.literal(" > ").withStyle(ChatFormatting.BLUE); @@ -68,7 +68,7 @@ protected void addTooltip(CompoundTag data, ITooltip tooltip, Player player, Blo tooltip.add(text); } } else { - ResourceLocation recipeType = new ResourceLocation( + ResourceLocation recipeType = ResourceLocation.parse( recipeTypesTagList.getString(currentRecipeTypeIndex)); tooltip.add(Component.translatable("gtceu.top.machine_mode").append( Component.translatable("%s.%s".formatted(recipeType.getNamespace(), recipeType.getPath())))); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java index 61ed993496d..d5137787361 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java @@ -63,9 +63,9 @@ public FluidVeinBuilderJS biomes(int weight, String biomes) { this.biomes.add( new BiomeWeightModifier(() -> biomes.startsWith("#") ? registry.getOrCreateTag( - TagKey.create(Registries.BIOME, new ResourceLocation(biomes.substring(1)))) : + TagKey.create(Registries.BIOME, ResourceLocation.parse(biomes.substring(1)))) : (HolderSet.direct(registry - .getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation(biomes))))), + .getHolderOrThrow(ResourceKey.create(Registries.BIOME, ResourceLocation.parse(biomes))))), weight)); return this; } @@ -75,9 +75,9 @@ public FluidVeinBuilderJS biomes(int weight, String... biomes) { List> biomeKeys = new LinkedList<>(); for (String biome : biomes) { biomeKeys.add(biome.startsWith("#") ? - registry.getOrCreateTag(TagKey.create(Registries.BIOME, new ResourceLocation(biome.substring(1)))) : + registry.getOrCreateTag(TagKey.create(Registries.BIOME, ResourceLocation.parse(biome.substring(1)))) : HolderSet.direct(registry - .getHolderOrThrow(ResourceKey.create(Registries.BIOME, new ResourceLocation(biome))))); + .getHolderOrThrow(ResourceKey.create(Registries.BIOME, ResourceLocation.parse(biome))))); } this.biomes.add(new BiomeWeightModifier( () -> HolderSet.direct(biomeKeys.stream().flatMap(HolderSet::stream).toList()), weight)); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java index 15d183a1a7c..8ac1bc80b74 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/block/CoilBlockBuilder.java @@ -63,7 +63,7 @@ public CoilBlockBuilder coilMaterial(@NotNull Supplier material) { @Override public Block createObject() { SimpleCoilType coilType = new SimpleCoilType(this.id.getPath(), temperature, level, energyDiscount, tier, - material, new ResourceLocation(texture)); + material, ResourceLocation.parse(texture)); CoilBlock result = new CoilBlock(this.createProperties(), coilType); GTCEuAPI.HEATING_COILS.put(coilType, () -> result); return result; diff --git a/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/GTRecipeSchema.java b/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/GTRecipeSchema.java index 7d9c7f3557e..87622cdc36f 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/GTRecipeSchema.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/GTRecipeSchema.java @@ -111,7 +111,7 @@ class GTRecipeJS extends RecipeJS { @HideFromJS @Override public GTRecipeJS id(ResourceLocation _id) { - this.idWithoutType = new ResourceLocation( + this.idWithoutType = ResourceLocation.fromNamespaceAndPath( _id.getNamespace().equals("minecraft") ? this.type.id.getNamespace() : _id.getNamespace(), _id.getPath()); this.id = idWithoutType.withPrefix(this.type.id.getPath() + "/"); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/components/GTRecipeComponents.java b/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/components/GTRecipeComponents.java index 1f3aa7b27da..1dad38c6b23 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/components/GTRecipeComponents.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/kjs/recipe/components/GTRecipeComponents.java @@ -452,7 +452,7 @@ public static FluidIngredientJS of(Object o) { isTag = true; } var split = s.split(" ", 3); - ResourceLocation id = new ResourceLocation(split[0]); + ResourceLocation id = ResourceLocation.parse(split[0]); int amount = UtilsJS.parseInt(split.length >= 2 ? split[1] : "", FluidType.BUCKET_VOLUME); CompoundTag nbt = null; if (split.length == 3) { diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/cache/fluid/FluidCache.java b/src/main/java/com/gregtechceu/gtceu/integration/map/cache/fluid/FluidCache.java index ca21683da90..ca6b036398f 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/cache/fluid/FluidCache.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/cache/fluid/FluidCache.java @@ -34,7 +34,7 @@ public void fromNbt(CompoundTag nbt) { for (var fluidTagRaw : fluidList) { if (fluidTagRaw instanceof CompoundTag fluidTag) { ResourceKey dim = ResourceKey.create(Registries.DIMENSION, - new ResourceLocation(fluidTag.getString("dim"))); + ResourceLocation.parse(fluidTag.getString("dim"))); ChunkPos pos = new ChunkPos(fluidTag.getLong("pos")); var fluid = ProspectorMode.FluidInfo.fromNbt(fluidTag); fluidCache.put(dim, pos, fluid); diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/journeymap/JourneymapRenderer.java b/src/main/java/com/gregtechceu/gtceu/integration/map/journeymap/JourneymapRenderer.java index 7dc05241163..482b6693db2 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/journeymap/JourneymapRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/journeymap/JourneymapRenderer.java @@ -46,7 +46,7 @@ */ public class JourneymapRenderer extends GenericMapRenderer { - protected static final ResourceLocation STONE = new ResourceLocation("block/stone"); + protected static final ResourceLocation STONE = ResourceLocation.withDefaultNamespace("block/stone"); protected static final Map MATERIAL_ICONS = new HashMap<>(); @Getter diff --git a/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/worldmap/ore/OreVeinElementRenderer.java b/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/worldmap/ore/OreVeinElementRenderer.java index 0fbe9fa45be..8d5718c8778 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/worldmap/ore/OreVeinElementRenderer.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/map/xaeros/worldmap/ore/OreVeinElementRenderer.java @@ -26,7 +26,7 @@ public class OreVeinElementRenderer extends MapElementRenderer { - protected static final ResourceLocation STONE = new ResourceLocation("block/stone"); + protected static final ResourceLocation STONE = ResourceLocation.withDefaultNamespace("block/stone"); protected OreVeinElementRenderer(OreVeinElementContext context, MapElementRenderProvider provider, diff --git a/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java b/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java index 72fe4b221e5..7b5960aff6b 100644 --- a/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java @@ -521,7 +521,7 @@ public static boolean canSeeSunClearly(Level world, BlockPos blockPos) { return false; } - ResourceLocation javdVoidBiome = new ResourceLocation("javd", "void"); + ResourceLocation javdVoidBiome = ResourceLocation.fromNamespaceAndPath("javd", "void"); if (GTCEu.Mods.isJAVDLoaded() && world.registryAccess().registryOrThrow(Registries.BIOME).getKey(biome).equals(javdVoidBiome)) { return !world.isDay(); @@ -593,7 +593,7 @@ public static CompoundTag saveItemStack(ItemStack itemStack, CompoundTag compoun public static ItemStack loadItemStack(CompoundTag compoundTag) { try { - Item item = BuiltInRegistries.ITEM.get(new ResourceLocation(compoundTag.getString("id"))); + Item item = BuiltInRegistries.ITEM.get(ResourceLocation.parse(compoundTag.getString("id"))); int count = compoundTag.getInt("Count"); ItemStack stack = new ItemStack(item, count); if (compoundTag.contains("tag", Tag.TAG_COMPOUND)) { @@ -744,13 +744,13 @@ public static boolean resourceExists(@NotNull ResourceLocation rs) { } public static boolean textureResourceExists(@NotNull ResourceLocation location) { - var textureLocation = new ResourceLocation(location.getNamespace(), + var textureLocation = ResourceLocation.fromNamespaceAndPath(location.getNamespace(), "textures/%s.png".formatted(location.getPath())); return resourceExists(textureLocation); } public static boolean modelResourceExists(@NotNull ResourceLocation location) { - var modelLocation = new ResourceLocation(location.getNamespace(), + var modelLocation = ResourceLocation.fromNamespaceAndPath(location.getNamespace(), "models/%s.json".formatted(location.getPath())); return resourceExists(modelLocation); } From cf385a6c9558ad96028a2b8cce89ed14d8a26714 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Aug 2026 11:43:40 +1000 Subject: [PATCH 2/8] update ore miner fallback --- .../machine/trait/BedrockOreMinerLogic.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java b/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java index cca21fc33bf..41a891a4e4f 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java @@ -77,12 +77,17 @@ private GTRecipe getOreMinerRecipe() { WeightedMaterial wm = GTUtil.getRandomItem(serverLevel.random, veinMaterials); if (wm == null) return null; Material material = wm.material(); - ItemStack stack = GTUtil.getFirstNonEmpty( - ChemicalHelper.get(TagPrefix.get(ConfigHolder.INSTANCE.machines.bedrockOreDropTagPrefix), material), - ChemicalHelper.get(TagPrefix.crushed, material), - ChemicalHelper.get(TagPrefix.gem, material), - ChemicalHelper.get(TagPrefix.ore, material), - ChemicalHelper.get(TagPrefix.dust, material)); + if (material.isNull()) return null; + ItemStack stack = ChemicalHelper.get(TagPrefix.get(ConfigHolder.INSTANCE.machines.bedrockOreDropTagPrefix), + material, getOreToProduce()); + // backup 1: crushed; if raw ore doesn't exist + if (stack.isEmpty()) stack = ChemicalHelper.get(TagPrefix.crushed, material, getOreToProduce()); + // backup 2: gem; if crushed ore doesn't exist + if (stack.isEmpty()) stack = ChemicalHelper.get(TagPrefix.gem, material, getOreToProduce()); + // backup 3: normal ore; if gem doesn't exist. + if (stack.isEmpty()) stack = ChemicalHelper.get(TagPrefix.ore, material, getOreToProduce()); + // backup 4: fallback to dust + if (stack.isEmpty()) stack = ChemicalHelper.get(TagPrefix.dust, material, getOreToProduce()); if (stack.isEmpty()) { return null; } From 2510804958f61dcf2241e02b0f70587d8ef603b4 Mon Sep 17 00:00:00 2001 From: Gustavo <77560533+gustovafing@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:46:48 +1000 Subject: [PATCH 3/8] Update docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md Co-authored-by: screret <68943070+screret@users.noreply.github.com> --- docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md b/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md index cabf53b62fb..8151c396cca 100644 --- a/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md +++ b/docs/content/Modpacks/Other-Topics/Ambiguous-Methods.md @@ -90,7 +90,7 @@ or GTCEuStartupEvents.registry("gtceu:recipe_type", event => { event.create("unboxinator") .setProgressBar( - ResourceTexture["(net.minecraft.resources.ResourceLocation)"](ResourceLocation.tryParse("kubejs:textures/gui/progress_bar/progress_bar_stone_oreifier.png")), + ResourceTexture["(net.minecraft.resources.ResourceLocation)"]("kubejs:textures/gui/progress_bar/progress_bar_stone_oreifier.png"), FillDirection.LEFT_TO_RIGHT ) // Rest of the recipe type From 9c984bac477fbe71c94fcf77f49f36e06b0f697c Mon Sep 17 00:00:00 2001 From: Gustavo <77560533+gustovafing@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:46:57 +1000 Subject: [PATCH 4/8] Update src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java Co-authored-by: screret <68943070+screret@users.noreply.github.com> --- .../java/com/gregtechceu/gtceu/api/capability/ICoverable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java b/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java index 1d50b052329..6b78876f6f1 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java +++ b/src/main/java/com/gregtechceu/gtceu/api/capability/ICoverable.java @@ -313,7 +313,7 @@ private CompoundTag createCoverConfigTag(@Nullable CoverBehavior cover) { private void applyCoverConfigTag(ServerPlayer player, Direction dir, CompoundTag tag) { if (tag.isEmpty()) return; - var def = GTRegistries.COVERS.get(ResourceLocation.tryParse(tag.getString("id"))); + var def = GTRegistries.COVERS.get(ResourceLocation.parse(tag.getString("id"))); ItemStack stack = ItemStack.of(tag.getCompound("item")); if (def == null) return; From c5c17c40567c5bdbc97e81e1de5bb3f7a3c7d7d4 Mon Sep 17 00:00:00 2001 From: Gustavo <77560533+gustovafing@users.noreply.github.com> Date: Tue, 4 Aug 2026 19:50:06 +1000 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: screret <68943070+screret@users.noreply.github.com> --- .../gtceu/api/cosmetics/CapeRegistry.java | 2 +- .../bedrockfluid/FluidVeinWorldEntry.java | 2 +- .../bedrockore/OreVeinWorldEntry.java | 2 +- .../component/prospector/ProspectorMode.java | 4 ++-- .../gtceu/api/registry/GTRegistry.java | 2 +- .../registry/registrate/MachineBuilder.java | 3 +-- .../gtceu/api/sound/WrappedSoundEntry.java | 3 ++- .../gtceu/common/data/models/GTModels.java | 2 +- .../gtceu/data/pack/GTDynamicDataPack.java | 8 +++----- .../gtceu/data/recipe/MaterialInfoLoader.java | 5 ++--- .../ShapedEnergyTransferRecipeBuilder.java | 2 +- .../ShapedFluidContainerRecipeBuilder.java | 2 +- .../recipe/builder/ShapedRecipeBuilder.java | 2 +- .../builder/ShapelessRecipeBuilder.java | 2 +- .../chemistry/ChemistryRecipes.java | 4 ++-- .../gtceu/data/tags/BlockTagLoader.java | 20 +++++++++---------- .../com/gregtechceu/gtceu/utils/GTUtil.java | 8 ++------ 17 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java index 7f420ac2b31..8e1af963849 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/cosmetics/CapeRegistry.java @@ -130,7 +130,7 @@ private CapeRegistry load(CompoundTag tag) { if (capeId.isEmpty()) continue; UUID uuid = entryTag.getUUID("owner"); - CURRENT_CAPES.put(uuid, ResourceLocation.tryParse(capeId)); + CURRENT_CAPES.put(uuid, ResourceLocation.parse(capeId)); } return this; diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java index 1e072b35872..4391362bab5 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockfluid/FluidVeinWorldEntry.java @@ -77,7 +77,7 @@ public static FluidVeinWorldEntry readFromNBT(@NotNull CompoundTag tag) { if (tag.contains("vein")) { veinId = tag.getString("vein"); vein = GTMemoizer.memoize(() -> { - ResourceLocation key = ResourceLocation.tryParse(veinId); + ResourceLocation key = ResourceLocation.parse(veinId); return GTRegistries.BEDROCK_FLUID_DEFINITIONS.get(key); }); } else { diff --git a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java index b647e0ce34e..e8e66695ee4 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/data/worldgen/bedrockore/OreVeinWorldEntry.java @@ -55,7 +55,7 @@ public static OreVeinWorldEntry readFromNBT(@NotNull CompoundTag tag) { info.operationsRemaining = tag.getInt("operationsRemaining"); if (tag.contains("vein")) { - ResourceLocation id = ResourceLocation.tryParse(tag.getString("vein")); + ResourceLocation id = ResourceLocation.parse(tag.getString("vein")); if (GTRegistries.BEDROCK_ORE_DEFINITIONS.containsKey(id)) { info.definition = GTRegistries.BEDROCK_ORE_DEFINITIONS.get(id); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java index 18df044fa7b..962d7d6de33 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java @@ -199,7 +199,7 @@ public FluidStack asStack() { } public static FluidInfo fromNbt(CompoundTag tag) { - Fluid fluid = BuiltInRegistries.FLUID.get(ResourceLocation.tryParse(tag.getString("fluid"))); + Fluid fluid = BuiltInRegistries.FLUID.get(ResourceLocation.parse(tag.getString("fluid"))); int left = tag.getInt("left"); int yield = tag.getInt("yield"); return new FluidInfo(fluid, yield, left); @@ -271,7 +271,7 @@ public void serialize(FluidInfo item, FriendlyByteBuf buf) { @Override public FluidInfo deserialize(FriendlyByteBuf buf) { - return new FluidInfo(BuiltInRegistries.FLUID.get(ResourceLocation.tryParse(buf.readUtf())), buf.readVarInt(), + return new FluidInfo(BuiltInRegistries.FLUID.get(buf.readResourceLocation()), buf.readVarInt(), buf.readVarInt()); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java b/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java index 2662d1bbc73..c567e09f336 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/GTRegistry.java @@ -226,7 +226,7 @@ public void writeBuf(V value, FriendlyByteBuf buf) { @Override public V readBuf(FriendlyByteBuf buf) { if (buf.readBoolean()) { - return get(ResourceLocation.parse(buf.readUtf())); + return get(buf.readResourceLocation()); } return null; } diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java index 9e2eec97997..147d9e4d2f6 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java @@ -811,8 +811,7 @@ protected static class ItemBuilderWrapper { .item(properties -> builder.itemFactory.apply((MetaMachineBlock) block.get(), properties)) .setData(ProviderType.LANG, NonNullBiConsumer.noop()) // do not gen any lang keys // copied from BlockBuilder#item - .model((ctx, prov) -> prov.withExistingParent(ctx.getName(), ResourceLocation.fromNamespaceAndPath(builder.registrate.getModid(), - "block/machine/" + ctx.getName()))) + .model((ctx, prov) -> prov.withExistingParent(ctx.getName(), builder.registrate.makeResourceLocation("block/machine/" + ctx.getName()))) .color(() -> () -> builder.itemColor::apply) .properties(builder.itemProp); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java b/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java index 520bcdddf4b..6ab37e7aff0 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java +++ b/src/main/java/com/gregtechceu/gtceu/api/sound/WrappedSoundEntry.java @@ -48,7 +48,8 @@ public SoundEvent getMainEvent() { } protected ResourceLocation getIdOf(int i) { - return ResourceLocation.fromNamespaceAndPath(id.getNamespace(), i == 0 ? id.getPath() : id.getPath() + "_compounded_" + i); + if (i == 0) return this.id; + else return this.id.withSuffix("_compounded_" + i); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java b/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java index 1269f343f15..cf424a77fca 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/models/GTModels.java @@ -237,7 +237,7 @@ public static NonNullBiConsumer, Regist ModelFile inactive = prov.models().cubeAll(name, casingType.getTexture()); ModelFile active = prov.models().withExistingParent(name + "_active", GTCEu.id("block/cube_2_layer/all")) .texture("bot_all", casingType.getTexture()) - .texture("top_all", ResourceLocation.parse(casingType.getTexture() + "_bloom")); + .texture("top_all", casingType.getTexture().withSuffix("_bloom")); prov.getVariantBuilder(block) .partialState().with(GTBlockStateProperties.ACTIVE, false).modelForState().modelFile(inactive) .addModel() diff --git a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java index 70c7e6a9502..33682c5e516 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java +++ b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java @@ -186,16 +186,14 @@ public void close() { } public static ResourceLocation getRecipeLocation(ResourceLocation recipeId) { - return ResourceLocation.fromNamespaceAndPath(recipeId.getNamespace(), String.join("", "recipes/", recipeId.getPath(), ".json")); + return RECIPE_ID_CONVERTER.idToFile(recipeId); } public static ResourceLocation getAdvancementLocation(ResourceLocation advancementId) { - return ResourceLocation.fromNamespaceAndPath(advancementId.getNamespace(), - String.join("", "advancements/", advancementId.getPath(), ".json")); + return ADVANCEMENT_ID_CONVERTER.idToFile(advancementId); } public static ResourceLocation getTagLocation(String identifier, ResourceLocation tagId) { - return ResourceLocation.fromNamespaceAndPath(tagId.getNamespace(), - String.join("", "tags/", identifier, "/", tagId.getPath(), ".json")); + return TAG_ID_CONVERTER.apply(identifier).idToFile(tagId); } } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java index 7dd6e4d2ba9..615da26edee 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java @@ -23,11 +23,10 @@ public static void init() { for (DyeColor color : DyeColor.values()) { String dye = color.getName(); ItemMaterialData.registerMaterialInfo( - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.parse(dye + "_terracotta"))).getItem(), + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dye + "_terracotta")), new ItemMaterialInfo(new MaterialStack(GTMaterials.Clay, M * 4))); ItemMaterialData.registerMaterialInfo( - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.parse(dye + "_glazed_terracotta"))) - .getItem(), + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dye + "_glazed_terracotta")), new ItemMaterialInfo(new MaterialStack(GTMaterials.Clay, M * 4))); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java index 09d3f3ee838..288c7745d4a 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedEnergyTransferRecipeBuilder.java @@ -189,7 +189,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shaped" + "/" + ID.getPath()); + return ID.withPath("shaped/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java index cf1a578f078..f2d03c6ca7d 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedFluidContainerRecipeBuilder.java @@ -28,7 +28,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shaped_fluid_container/" + ID.getPath()); + return ID.withPath("shaped_fluid_container/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java index 58194785764..6c99e4ec69f 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapedRecipeBuilder.java @@ -178,7 +178,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shaped" + "/" + ID.getPath()); + return ID.withPath("shaped/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java index e8d0aecc6f0..dd808168076 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/ShapelessRecipeBuilder.java @@ -122,7 +122,7 @@ public void serializeRecipeData(JsonObject pJson) { @Override public ResourceLocation getId() { var ID = id == null ? defaultId() : id; - return ResourceLocation.fromNamespaceAndPath(ID.getNamespace(), "shapeless" + "/" + ID.getPath()); + return ID.withPath("shapeless/" + ID.getPath()); } @Override diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java index 9c8d521994c..16b22d25efc 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java @@ -106,13 +106,13 @@ public static void init(Consumer provider) { GAS_COLLECTOR_RECIPES.recipeBuilder("nether_air") .circuitMeta(2) .outputFluids(NetherAir.getFluid(10000)) - .dimension(Level.NETHER.location()) + .dimension(Level.NETHER) .duration(200).EUt(64).save(provider); GAS_COLLECTOR_RECIPES.recipeBuilder("ender_air") .circuitMeta(3) .outputFluids(EnderAir.getFluid(10000)) - .dimension(Level.END.location()) + .dimension(Level.END) .duration(200).EUt(256).save(provider); // CaCO3 + 2NaCl -> Na2CO3 + CaCl2 diff --git a/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java b/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java index 6efedf96a8a..97133560c8e 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/tags/BlockTagLoader.java @@ -54,10 +54,10 @@ public static void init(RegistrateTagsProvider.IntrinsicImpl provider) { .add(Blocks.PITCHER_CROP) .addTag(BlockTags.CAVE_VINES) .addTag(BlockTags.TALL_FLOWERS) - .addOptionalTag(ResourceLocation.parse("forge:cacti")) - .addOptionalTag(ResourceLocation.parse("forge:crops/cactus")) - .addOptionalTag(ResourceLocation.parse("forge:crops/sugar_cane")) - .addOptionalTag(ResourceLocation.parse("forge:reeds")); + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("forge", "cacti")) + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("forge", "crops/cactus")) + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("forge", "crops/sugar_cane")) + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("forge", "reeds")); provider.addTag(BlockTags.REPLACEABLE) .add(GTMaterials.Oil.getFluid().defaultFluidState().createLegacyBlock().getBlock()) @@ -90,12 +90,12 @@ public static void init(RegistrateTagsProvider.IntrinsicImpl provider) { Blocks.WEEPING_VINES); provider.addTag(CustomTags.CLEANROOM_FLOORS) - .addOptionalTag(ResourceLocation.parse("elevatorid:elevators")) - .addOptional(ResourceLocation.parse("enderio:travel_anchor")) - .addOptional(ResourceLocation.parse("rftoolsutility:matter_transmitter")) - .addOptional(ResourceLocation.parse("rftoolsutility:matter_receiver")) - .addOptional(ResourceLocation.parse("rftoolsutility:dialing_device")) - .addOptional(ResourceLocation.parse("travelanchors:travel_anchor")); + .addOptionalTag(ResourceLocation.fromNamespaceAndPath("elevatorid", "elevators")) + .addOptional(ResourceLocation.fromNamespaceAndPath("enderio", "travel_anchor")) + .addOptional(ResourceLocation.fromNamespaceAndPath("rftoolsutility", "matter_transmitter")) + .addOptional(ResourceLocation.fromNamespaceAndPath("rftoolsutility", "matter_receiver")) + .addOptional(ResourceLocation.fromNamespaceAndPath("rftoolsutility", "dialing_device")) + .addOptional(ResourceLocation.fromNamespaceAndPath("travelanchors", "travel_anchor")); provider.addTag(CustomTags.CHARCOAL_PILE_IGNITER_WALLS) .addTag(BlockTags.DIRT) // any dirt blocks diff --git a/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java b/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java index 7b5960aff6b..599bea4d8d8 100644 --- a/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java @@ -744,15 +744,11 @@ public static boolean resourceExists(@NotNull ResourceLocation rs) { } public static boolean textureResourceExists(@NotNull ResourceLocation location) { - var textureLocation = ResourceLocation.fromNamespaceAndPath(location.getNamespace(), - "textures/%s.png".formatted(location.getPath())); - return resourceExists(textureLocation); + return resourceExists(GTDynamicResourcePack.TEXTURE_ID_CONVERTER.idToFile(location)); } public static boolean modelResourceExists(@NotNull ResourceLocation location) { - var modelLocation = ResourceLocation.fromNamespaceAndPath(location.getNamespace(), - "models/%s.json".formatted(location.getPath())); - return resourceExists(modelLocation); + return resourceExists(GTDynamicResourcePack.MODEL_ID_CONVERTER.idToFile(location)); } public static void openRecipeViewerCategory(GTRecipeCategory category) { From 031455fa8a8ad4d9ccfe29af6e9133d9821da698 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Aug 2026 19:53:06 +1000 Subject: [PATCH 6/8] a bit more cleanup --- .../gregtechceu/gtceu/api/item/IGTTool.java | 3 +- .../component/prospector/ProspectorMode.java | 2 +- .../registry/registrate/MachineBuilder.java | 26 +++++------ .../gtceu/client/model/pipe/PipeModel.java | 3 +- .../common/data/machines/GTMachineUtils.java | 2 +- .../electric/research/package-info.java | 2 +- .../multiblock/generator/package-info.java | 2 +- .../multiblock/part/hpca/package-info.java | 2 +- .../gtceu/common/machine/package-info.java | 2 +- .../machine/trait/BedrockOreMinerLogic.java | 2 +- .../recipe/condition/BiomeCondition.java | 3 +- .../gregtechceu/gtceu/core/MixinHelpers.java | 9 ++-- .../gtceu/data/pack/GTDynamicDataPack.java | 11 +++++ .../gtceu/data/recipe/MaterialInfoLoader.java | 1 - .../data/recipe/builder/GTRecipeBuilder.java | 8 ++++ .../recipe/configurable/RecipeAddition.java | 9 ++-- .../recipe/configurable/RecipeRemoval.java | 18 +++++--- .../recipe/misc/VanillaStandardRecipes.java | 46 +++++++++++++------ .../chemistry/ChemistryRecipes.java | 3 +- .../kjs/builders/FluidVeinBuilderJS.java | 6 ++- .../com/gregtechceu/gtceu/utils/GTUtil.java | 1 + 21 files changed, 106 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java b/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java index 5b639d0fe20..da382589042 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/IGTTool.java @@ -822,7 +822,8 @@ default Map getDefaultEnchantments(ItemStack stack) { } } - ResourceLocation COFH_SMASHING_ENCHANT_ID = ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENSORCELLATION, "smashing"); + ResourceLocation COFH_SMASHING_ENCHANT_ID = ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENSORCELLATION, + "smashing"); Set AUTOSMELT_ENCHANT_IDS = Util.make(new HashSet<>(), set -> { set.add(ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENDERIO, "auto_smelt")); // EnderIO set.add(ResourceLocation.fromNamespaceAndPath(GTValues.MODID_ENSORCELLATION, "smelting")); // CoFH diff --git a/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java b/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java index 962d7d6de33..e64e5a5c89e 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java +++ b/src/main/java/com/gregtechceu/gtceu/api/item/component/prospector/ProspectorMode.java @@ -264,7 +264,7 @@ public String getUniqueId(FluidInfo item) { @Override public void serialize(FluidInfo item, FriendlyByteBuf buf) { - buf.writeUtf(BuiltInRegistries.FLUID.getKey(item.fluid).toString()); + buf.writeResourceLocation(BuiltInRegistries.FLUID.getKey(item.fluid)); buf.writeVarInt(item.yield); buf.writeVarInt(item.left); } diff --git a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java index 147d9e4d2f6..134d520d1b1 100644 --- a/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/api/registry/registrate/MachineBuilder.java @@ -381,7 +381,7 @@ public SELF tieredHullModel(ResourceLocation model) { public SELF overlayTieredHullModel(String name) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - return overlayTieredHullModel(registrate.makeResourceLocation( "block/machine/part/" + name)); + return overlayTieredHullModel(registrate.makeResourceLocation("block/machine/part/" + name)); } public SELF overlayTieredHullModel(ResourceLocation overlayModel) { @@ -396,11 +396,11 @@ public SELF colorOverlayTieredHullModel(String overlay, @Nullable String pipeOverlay, @Nullable String emissiveOverlay) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - ResourceLocation overlayTex = registrate.makeResourceLocation( "block/overlay/machine/" + overlay); + ResourceLocation overlayTex = registrate.makeResourceLocation("block/overlay/machine/" + overlay); ResourceLocation pipeOverlayTex = pipeOverlay == null ? null : - registrate.makeResourceLocation( "block/overlay/machine/" + pipeOverlay); + registrate.makeResourceLocation("block/overlay/machine/" + pipeOverlay); ResourceLocation emissiveOverlayTex = emissiveOverlay == null ? null : - registrate.makeResourceLocation( "block/overlay/machine/" + emissiveOverlay); + registrate.makeResourceLocation("block/overlay/machine/" + emissiveOverlay); return colorOverlayTieredHullModel(overlayTex, pipeOverlayTex, emissiveOverlayTex); } @@ -418,7 +418,7 @@ public SELF colorOverlayTieredHullModel(ResourceLocation overlay, public SELF overlaySteamHullModel(String name) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - return overlaySteamHullModel(registrate.makeResourceLocation( "block/machine/part/" + name)); + return overlaySteamHullModel(registrate.makeResourceLocation("block/machine/part/" + name)); } public SELF overlaySteamHullModel(ResourceLocation overlayModel) { @@ -434,11 +434,11 @@ public SELF colorOverlaySteamHullModel(String overlay, @Nullable String pipeOverlay, @Nullable String emissiveOverlay) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - ResourceLocation overlayTex = registrate.makeResourceLocation( "block/overlay/machine/" + overlay); + ResourceLocation overlayTex = registrate.makeResourceLocation("block/overlay/machine/" + overlay); ResourceLocation pipeOverlayTex = pipeOverlay == null ? null : - registrate.makeResourceLocation( "block/overlay/machine/" + pipeOverlay); + registrate.makeResourceLocation("block/overlay/machine/" + pipeOverlay); ResourceLocation emissiveOverlayTex = emissiveOverlay == null ? null : - registrate.makeResourceLocation( "block/overlay/machine/" + emissiveOverlay); + registrate.makeResourceLocation("block/overlay/machine/" + emissiveOverlay); return colorOverlaySteamHullModel(overlayTex, pipeOverlayTex, emissiveOverlayTex); } @@ -446,11 +446,11 @@ public SELF colorOverlaySteamHullModel(String overlay, @Nullable ResourceLocation pipeOverlay, @Nullable String emissiveOverlay) { modelProperty(GTMachineModelProperties.IS_FORMED, false); - ResourceLocation overlayTex = registrate.makeResourceLocation( "block/overlay/machine/" + overlay); + ResourceLocation overlayTex = registrate.makeResourceLocation("block/overlay/machine/" + overlay); ResourceLocation pipeOverlayTex = pipeOverlay == null ? null : - registrate.makeResourceLocation( "block/overlay/machine/" + pipeOverlay); + registrate.makeResourceLocation("block/overlay/machine/" + pipeOverlay); ResourceLocation emissiveOverlayTex = emissiveOverlay == null ? null : - registrate.makeResourceLocation( "block/overlay/machine/" + emissiveOverlay); + registrate.makeResourceLocation("block/overlay/machine/" + emissiveOverlay); return colorOverlaySteamHullModel(overlayTex, pipeOverlayTex, emissiveOverlayTex); } @@ -630,7 +630,7 @@ public SELF multiblockPreviewRenderer(boolean multiBlockWorldPreview, } protected DEFINITION createDefinition() { - return definition.apply(registrate.makeResourceLocation( name)); + return definition.apply(registrate.makeResourceLocation(name)); } @Override @@ -671,7 +671,7 @@ public DEFINITION register() { definition.setRotationState(rotationState); setupStateDefinition(definition); if (model == null && blockModel == null) { - simpleModel(registrate.makeResourceLocation( "block/machine/template/" + name)); + simpleModel(registrate.makeResourceLocation("block/machine/template/" + name)); } var blockBuilder = BlockBuilderWrapper.makeBlockBuilder(getThis(), definition); if (this.langValue != null) { diff --git a/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java b/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java index 9dd4567f685..e703563ab1e 100644 --- a/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java +++ b/src/main/java/com/gregtechceu/gtceu/client/model/pipe/PipeModel.java @@ -88,7 +88,8 @@ public class PipeModel { SIDE_OVERLAY_KEY = "side_overlay", END_OVERLAY_KEY = "end_overlay"; // spotless:on - protected static final ResourceLocation RENDERTYPE_CUTOUT_MIPPED = ResourceLocation.withDefaultNamespace("cutout_mipped"); + protected static final ResourceLocation RENDERTYPE_CUTOUT_MIPPED = ResourceLocation + .withDefaultNamespace("cutout_mipped"); public static final Set DYNAMIC_MODELS = new HashSet<>(); diff --git a/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java b/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java index 7068c1c6f3e..524b6d018e0 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java +++ b/src/main/java/com/gregtechceu/gtceu/common/data/machines/GTMachineUtils.java @@ -859,7 +859,7 @@ public MachineDefinition[] register() { .rotationState(RotationState.NON_Y_AXIS) .recipeType(recipeType) .workableTieredHullModel( - registrate.makeResourceLocation( "block/machines/" + name)) + registrate.makeResourceLocation("block/machines/" + name)) .tooltips(workableTiered(tier, GTValues.V[tier], GTValues.V[tier] * 64, recipeType, tankScalingFunction.applyAsInt(tier), true)) .ui(panelFactory); diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java index dc4417f1234..1f529b40b96 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/electric/research/package-info.java @@ -1,4 +1,4 @@ @NotNullByDefault package com.gregtechceu.gtceu.common.machine.multiblock.electric.research; -import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file +import org.jetbrains.annotations.NotNullByDefault; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java index 059aaa92978..244f20112ba 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/generator/package-info.java @@ -1,4 +1,4 @@ @NotNullByDefault package com.gregtechceu.gtceu.common.machine.multiblock.generator; -import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file +import org.jetbrains.annotations.NotNullByDefault; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java index 7ef90df9851..98c2d16a09d 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/multiblock/part/hpca/package-info.java @@ -1,4 +1,4 @@ @NotNullByDefault package com.gregtechceu.gtceu.common.machine.multiblock.part.hpca; -import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file +import org.jetbrains.annotations.NotNullByDefault; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java b/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java index 5791a15d973..3a1983d255d 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/package-info.java @@ -1,4 +1,4 @@ @NotNullByDefault package com.gregtechceu.gtceu.common.machine; -import org.jetbrains.annotations.NotNullByDefault; \ No newline at end of file +import org.jetbrains.annotations.NotNullByDefault; diff --git a/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java b/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java index 41a891a4e4f..a7cf6735dee 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java +++ b/src/main/java/com/gregtechceu/gtceu/common/machine/trait/BedrockOreMinerLogic.java @@ -79,7 +79,7 @@ private GTRecipe getOreMinerRecipe() { Material material = wm.material(); if (material.isNull()) return null; ItemStack stack = ChemicalHelper.get(TagPrefix.get(ConfigHolder.INSTANCE.machines.bedrockOreDropTagPrefix), - material, getOreToProduce()); + material, getOreToProduce()); // backup 1: crushed; if raw ore doesn't exist if (stack.isEmpty()) stack = ChemicalHelper.get(TagPrefix.crushed, material, getOreToProduce()); // backup 2: gem; if crushed ore doesn't exist diff --git a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java index f727a49ed1a..26042451020 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java +++ b/src/main/java/com/gregtechceu/gtceu/common/recipe/condition/BiomeCondition.java @@ -30,7 +30,8 @@ public class BiomeCondition extends RecipeCondition { // spotless:on @Getter - private ResourceKey biome = ResourceKey.create(Registries.BIOME, ResourceLocation.withDefaultNamespace("dummy")); + private ResourceKey biome = ResourceKey.create(Registries.BIOME, + ResourceLocation.withDefaultNamespace("dummy")); public BiomeCondition(boolean isReverse, ResourceKey biome) { super(isReverse); diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index 8ab367aebb0..fb947f0fed7 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -122,7 +122,8 @@ public static void generateGTDynamicTags(Map lootTa if (TagPrefix.ORES.containsKey(prefix)) { final TagPrefix.OreType type = TagPrefix.ORES.get(prefix); map.forEach((material, blockEntry) -> { - ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(blockEntry.getId().getNamespace(), + ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath( + blockEntry.getId().getNamespace(), "blocks/" + blockEntry.getId().getPath()); Block block = blockEntry.get(); @@ -336,7 +338,8 @@ public static void generateGTDynamicLoot(Map lootTa GTRegistries.MACHINES.forEach(machine -> { Block block = machine.getBlock(); ResourceLocation id = machine.getId(); - ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(id.getNamespace(), "blocks/" + id.getPath()); + ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath(id.getNamespace(), + "blocks/" + id.getPath()); ((BlockBehaviourAccessor) block).setDrops(lootTableId); lootTables.put(lootTableId, BLOCK_LOOT.createSingleItemTable(block).setParamSet(LootContextParamSets.BLOCK).build()); diff --git a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java index 33682c5e516..e1c47ee6994 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java +++ b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java @@ -7,8 +7,10 @@ import com.gregtechceu.gtceu.config.ConfigHolder; import net.minecraft.SharedConstants; +import net.minecraft.Util; import net.minecraft.data.recipes.FinishedRecipe; import net.minecraft.network.chat.Component; +import net.minecraft.resources.FileToIdConverter; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.PackResources; import net.minecraft.server.packs.PackType; @@ -32,6 +34,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; import javax.annotation.ParametersAreNonnullByDefault; @@ -39,6 +42,14 @@ @ParametersAreNonnullByDefault public class GTDynamicDataPack implements PackResources { + // change the path to `recipe` on 1.21!! + public static final FileToIdConverter RECIPE_ID_CONVERTER = FileToIdConverter.json("recipes"); + // change the path to `advancement` on 1.21!! + public static final FileToIdConverter ADVANCEMENT_ID_CONVERTER = FileToIdConverter.json("advancements"); + public static final Function TAG_ID_CONVERTER = Util + .memoize(registryName -> FileToIdConverter.json("tags/" + registryName)); + public static final FileToIdConverter TEXTURE_ID_CONVERTER = new FileToIdConverter("textures", ".png"); + protected static final ObjectSet SERVER_DOMAINS = new ObjectOpenHashSet<>(); protected static final GTDynamicPackContents CONTENTS = new GTDynamicPackContents(); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java index 615da26edee..e69ad64abe8 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/MaterialInfoLoader.java @@ -9,7 +9,6 @@ import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.DyeColor; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java index 99b392e3f10..1786e51da1c 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/builder/GTRecipeBuilder.java @@ -1097,10 +1097,18 @@ public GTRecipeBuilder cleanroom(CleanroomType cleanroomType) { return addCondition(new CleanroomCondition(cleanroomType)); } + /** + * @deprecated Use {@link #dimension(ResourceKey)} instead + */ + @Deprecated public GTRecipeBuilder dimension(ResourceLocation dimension, boolean reverse) { return dimension(ResourceKey.create(Registries.DIMENSION, dimension), reverse); } + /** + * @deprecated Use {@link #dimension(ResourceKey, boolean)} instead + */ + @Deprecated public GTRecipeBuilder dimension(ResourceLocation dimension) { return dimension(dimension, false); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java index a86c511be8f..a0e32ecb735 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeAddition.java @@ -1319,7 +1319,8 @@ private static void vanillaBlockRecipes(Consumer provider) { private static void addBedRecipe(Consumer provider, DyeColor color) { String colorName = color.getName(); VanillaRecipeHelper.addShapedRecipe(provider, colorName + "_bed", - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_bed"))), "WWW", "PPP", + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_bed"))), + "WWW", "PPP", "FrF", 'W', BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_carpet")), 'P', ItemTags.PLANKS, @@ -1329,7 +1330,8 @@ private static void addBedRecipe(Consumer provider, DyeColor col private static void addCarpetRecipe(Consumer provider, DyeColor color) { String colorName = color.getName(); VanillaRecipeHelper.addShapedRecipe(provider, colorName + "_carpet", - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_carpet"))), "WW", + new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_carpet"))), + "WW", 'W', BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(colorName + "_wool"))); } @@ -1340,7 +1342,8 @@ private static void hardGlassRecipes(Consumer provider) { for (DyeColor color : DyeColor.values()) { String dyeName = color.getName(); VanillaRecipeHelper.addShapedRecipe(provider, dyeName + "_glass_pane", - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")), 2), + new ItemStack(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")), 2), "sG", 'G', BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass"))); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java index 3b40ab93a6e..51d79d50194 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/configurable/RecipeRemoval.java @@ -281,13 +281,19 @@ private static void hardAdvancedIronRecipes(Consumer registry) private static void hardDyeRecipes(Consumer registry) { for (MarkerMaterial colorMaterial : MarkerMaterials.Color.VALUES) { registry.accept( - ResourceLocation.withDefaultNamespace(String.format("%s_concrete_powder", colorMaterial.getName()))); - registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_terracotta", colorMaterial.getName()))); - registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_stained_glass", colorMaterial.getName()))); + ResourceLocation + .withDefaultNamespace(String.format("%s_concrete_powder", colorMaterial.getName()))); + registry.accept( + ResourceLocation.withDefaultNamespace(String.format("%s_terracotta", colorMaterial.getName()))); + registry.accept( + ResourceLocation.withDefaultNamespace(String.format("%s_stained_glass", colorMaterial.getName()))); registry.accept(ResourceLocation.withDefaultNamespace(String.format("%s_candle", colorMaterial.getName()))); - registry.accept(ResourceLocation.withDefaultNamespace(String.format("dye_%s_wool", colorMaterial.getName()))); - registry.accept(ResourceLocation.withDefaultNamespace(String.format("dye_%s_carpet", colorMaterial.getName()))); - registry.accept(ResourceLocation.withDefaultNamespace(String.format("dye_%s_bed", colorMaterial.getName()))); + registry.accept( + ResourceLocation.withDefaultNamespace(String.format("dye_%s_wool", colorMaterial.getName()))); + registry.accept( + ResourceLocation.withDefaultNamespace(String.format("dye_%s_carpet", colorMaterial.getName()))); + registry.accept( + ResourceLocation.withDefaultNamespace(String.format("dye_%s_bed", colorMaterial.getName()))); registry.accept(ResourceLocation.withDefaultNamespace("white_dye")); registry.accept(ResourceLocation.withDefaultNamespace("black_dye")); diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java index c1bfa9b292c..1ddf37fcaad 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/VanillaStandardRecipes.java @@ -533,14 +533,18 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(Tags.Items.GRAVEL, 4) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L)) .outputItems(new ItemStack( - BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete_powder")), 8)) + BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete_powder")), + 8)) .save(provider); CHEMICAL_BATH_RECIPES.recipeBuilder(dyeName + "_concrete").duration(20).EUt(VA[ULV]) .inputItems(new ItemStack( - BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete_powder")))) + BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete_powder")))) .inputFluids(Water.getFluid(1000)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete")))) + .outputItems(new ItemStack( + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -549,7 +553,8 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(CustomTags.CONCRETE_ITEM) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete")))) + new ItemStack(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_concrete")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); } @@ -558,7 +563,8 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(new ItemStack(Blocks.TERRACOTTA)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_terracotta")))) + new ItemStack(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_terracotta")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -566,7 +572,8 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(new ItemStack(Blocks.GLASS)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass")))) + new ItemStack(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); @@ -574,13 +581,16 @@ private static void dyingCleaningRecipes(Consumer provider) { .inputItems(new ItemStack(Blocks.GLASS_PANE)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L / 8)) .outputItems(new ItemStack( - BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")))) + BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); CUTTER_RECIPES.recipeBuilder("cut_" + dyeName + "_glass_to_pane").duration(20).EUt(VA[ULV]) - .inputItems(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass")), 3) - .outputItems(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")), 8) + .inputItems(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass")), 3) + .outputItems(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_stained_glass_pane")), 8) .save(provider); CHEMICAL_BATH_RECIPES.recipeBuilder("dye_candle_to_" + dyeName).duration(20).EUt(VA[ULV]) @@ -595,29 +605,35 @@ private static void dyingCleaningRecipes(Consumer provider) { CHEMICAL_BATH_RECIPES.recipeBuilder("dye_wool_to_" + dyeName).duration(20).EUt(VA[ULV]) .inputItems(new ItemStack(Blocks.WHITE_WOOL)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")))) + .outputItems(new ItemStack( + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); CHEMICAL_BATH_RECIPES.recipeBuilder("dye_bed_to_" + dyeName).duration(20).EUt(VA[ULV]) .inputItems(new ItemStack(Blocks.WHITE_BED)) .inputFluids(CHEMICAL_DYES[color.ordinal()].getFluid(L)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_bed")))) + .outputItems(new ItemStack( + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_bed")))) .category(GTRecipeCategories.CHEM_DYES) .save(provider); } CUTTER_RECIPES.recipeBuilder("cut_" + dyeName + "_wool_to_carpet").duration(20).EUt(VA[ULV]) - .inputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")), 1)) + .inputItems(new ItemStack( + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")), 1)) .outputItems( - new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_carpet")), 2)) + new ItemStack(BuiltInRegistries.ITEM + .get(ResourceLocation.withDefaultNamespace(dyeName + "_carpet")), 2)) .save(provider); ASSEMBLER_RECIPES.recipeBuilder(dyeName + "_banner").duration(20).EUt(VA[ULV]) .circuitMeta(6) .inputItems(new ItemStack(Items.STICK)) - .inputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")), 6)) - .outputItems(new ItemStack(BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_banner")))) + .inputItems(new ItemStack( + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_wool")), 6)) + .outputItems(new ItemStack( + BuiltInRegistries.ITEM.get(ResourceLocation.withDefaultNamespace(dyeName + "_banner")))) .save(provider); } diff --git a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java index 16b22d25efc..150170312e6 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java +++ b/src/main/java/com/gregtechceu/gtceu/data/recipe/serialized/chemistry/ChemistryRecipes.java @@ -3,7 +3,6 @@ import com.gregtechceu.gtceu.api.fluids.store.FluidStorageKeys; import net.minecraft.data.recipes.FinishedRecipe; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; @@ -100,7 +99,7 @@ public static void init(Consumer provider) { GAS_COLLECTOR_RECIPES.recipeBuilder("air") .circuitMeta(1) .outputFluids(Air.getFluid(10000)) - .dimension(Level.OVERWORLD.location()) + .dimension(Level.OVERWORLD) .duration(200).EUt(16).save(provider); GAS_COLLECTOR_RECIPES.recipeBuilder("nether_air") diff --git a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java index d5137787361..55fa208eed1 100644 --- a/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java +++ b/src/main/java/com/gregtechceu/gtceu/integration/kjs/builders/FluidVeinBuilderJS.java @@ -65,7 +65,8 @@ public FluidVeinBuilderJS biomes(int weight, String biomes) { registry.getOrCreateTag( TagKey.create(Registries.BIOME, ResourceLocation.parse(biomes.substring(1)))) : (HolderSet.direct(registry - .getHolderOrThrow(ResourceKey.create(Registries.BIOME, ResourceLocation.parse(biomes))))), + .getHolderOrThrow( + ResourceKey.create(Registries.BIOME, ResourceLocation.parse(biomes))))), weight)); return this; } @@ -75,7 +76,8 @@ public FluidVeinBuilderJS biomes(int weight, String... biomes) { List> biomeKeys = new LinkedList<>(); for (String biome : biomes) { biomeKeys.add(biome.startsWith("#") ? - registry.getOrCreateTag(TagKey.create(Registries.BIOME, ResourceLocation.parse(biome.substring(1)))) : + registry.getOrCreateTag( + TagKey.create(Registries.BIOME, ResourceLocation.parse(biome.substring(1)))) : HolderSet.direct(registry .getHolderOrThrow(ResourceKey.create(Registries.BIOME, ResourceLocation.parse(biome))))); } diff --git a/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java b/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java index 599bea4d8d8..062ed4fbf8b 100644 --- a/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java +++ b/src/main/java/com/gregtechceu/gtceu/utils/GTUtil.java @@ -7,6 +7,7 @@ import com.gregtechceu.gtceu.api.recipe.category.GTRecipeCategory; import com.gregtechceu.gtceu.config.ConfigHolder; import com.gregtechceu.gtceu.core.mixins.emi.EmiApiAccessor; +import com.gregtechceu.gtceu.data.pack.GTDynamicResourcePack; import com.gregtechceu.gtceu.data.recipe.CustomTags; import com.gregtechceu.gtceu.integration.recipeviewer.emi.recipe.GTRecipeEMICategory; import com.gregtechceu.gtceu.integration.recipeviewer.jei.GTJEIPlugin; From 485275bf18cfb996ba6ac4dfa7802a0c62bd8825 Mon Sep 17 00:00:00 2001 From: Gustavo <77560533+gustovafing@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:19:54 +1000 Subject: [PATCH 7/8] Update src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java Co-authored-by: screret <68943070+screret@users.noreply.github.com> --- src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java index fb947f0fed7..acc714959a8 100644 --- a/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java +++ b/src/main/java/com/gregtechceu/gtceu/core/MixinHelpers.java @@ -275,9 +275,7 @@ public static void generateGTDynamicLoot(Map lootTa if (TagPrefix.ORES.containsKey(prefix)) { final TagPrefix.OreType type = TagPrefix.ORES.get(prefix); map.forEach((material, blockEntry) -> { - ResourceLocation lootTableId = ResourceLocation.fromNamespaceAndPath( - blockEntry.getId().getNamespace(), - "blocks/" + blockEntry.getId().getPath()); + ResourceLocation lootTableId = blockEntry.getId().withPrefix("blocks/"); Block block = blockEntry.get(); ItemStack dropItem = ChemicalHelper.get(TagPrefix.rawOre, material); From ec940d800e367398cbcf2021ca51928361f45d74 Mon Sep 17 00:00:00 2001 From: Gustavo Date: Tue, 4 Aug 2026 20:20:11 +1000 Subject: [PATCH 8/8] m --- .../java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java | 2 -- .../com/gregtechceu/gtceu/data/pack/GTDynamicResourcePack.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java index e1c47ee6994..91e1aceb012 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java +++ b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicDataPack.java @@ -42,13 +42,11 @@ @ParametersAreNonnullByDefault public class GTDynamicDataPack implements PackResources { - // change the path to `recipe` on 1.21!! public static final FileToIdConverter RECIPE_ID_CONVERTER = FileToIdConverter.json("recipes"); // change the path to `advancement` on 1.21!! public static final FileToIdConverter ADVANCEMENT_ID_CONVERTER = FileToIdConverter.json("advancements"); public static final Function TAG_ID_CONVERTER = Util .memoize(registryName -> FileToIdConverter.json("tags/" + registryName)); - public static final FileToIdConverter TEXTURE_ID_CONVERTER = new FileToIdConverter("textures", ".png"); protected static final ObjectSet SERVER_DOMAINS = new ObjectOpenHashSet<>(); protected static final GTDynamicPackContents CONTENTS = new GTDynamicPackContents(); diff --git a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicResourcePack.java b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicResourcePack.java index 986d7be8744..cd704c094b7 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicResourcePack.java +++ b/src/main/java/com/gregtechceu/gtceu/data/pack/GTDynamicResourcePack.java @@ -56,9 +56,9 @@ public class GTDynamicResourcePack implements PackResources { protected static final GTDynamicPackContents CONTENTS = new GTDynamicPackContents(); private static final FileToIdConverter ATLAS_ID_CONVERTER = FileToIdConverter.json("atlases"); - public static final FileToIdConverter TEXTURE_ID_CONVERTER = SpriteSource.TEXTURE_ID_CONVERTER; public static final FileToIdConverter BLOCKSTATE_ID_CONVERTER = FileToIdConverter.json("blockstates"); public static final FileToIdConverter MODEL_ID_CONVERTER = FileToIdConverter.json("models"); + public static final FileToIdConverter TEXTURE_ID_CONVERTER = new FileToIdConverter("textures", ".png"); private final String name;