From cf14efb515875373fce0af499c80af99a930a9a4 Mon Sep 17 00:00:00 2001 From: Swedz Date: Fri, 1 Nov 2024 06:01:27 -0400 Subject: [PATCH] Use ResourceLocation for depleted nuclear fuel counterpart (#917) --- .../nuclear/NuclearFuel.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/aztech/modern_industrialization/nuclear/NuclearFuel.java b/src/main/java/aztech/modern_industrialization/nuclear/NuclearFuel.java index 9e06b60d0..4a2f7efb3 100644 --- a/src/main/java/aztech/modern_industrialization/nuclear/NuclearFuel.java +++ b/src/main/java/aztech/modern_industrialization/nuclear/NuclearFuel.java @@ -30,6 +30,7 @@ import aztech.modern_industrialization.machines.components.NuclearEfficiencyHistoryComponent; import aztech.modern_industrialization.thirdparty.fabrictransfer.api.item.ItemVariant; import net.minecraft.core.registries.BuiltInRegistries; +import net.minecraft.resources.ResourceLocation; import net.minecraft.util.RandomSource; import net.minecraft.world.item.ItemStack; @@ -38,7 +39,7 @@ public class NuclearFuel extends NuclearAbsorbable { public final double directEnergyFactor; public final double neutronMultiplicationFactor; - public final String depletedVersionId; + public final ResourceLocation depletedVersionId; public final int size; @@ -52,7 +53,7 @@ public final static record NuclearFuelParams(int desintegrationMax, int maxTempe double neutronMultiplicationFactor, double directEnergyFactor, int size) { } - public NuclearFuel(Properties settings, NuclearFuelParams params, INeutronBehaviour neutronBehaviour, String depletedVersionId) { + public NuclearFuel(Properties settings, NuclearFuelParams params, INeutronBehaviour neutronBehaviour, ResourceLocation depletedVersionId) { this(settings, params.desintegrationMax, params.maxTemperature, params.tempLimitLow, params.tempLimitHigh, params.neutronMultiplicationFactor, params.directEnergyFactor, neutronBehaviour, params.size, depletedVersionId); @@ -64,7 +65,8 @@ private static int clampTemp(int temperature) { } private NuclearFuel(Properties settings, int desintegrationMax, int maxTemperature, int tempLimitLow, int tempLimitHigh, - double neutronMultiplicationFactor, double directEnergyFactor, INeutronBehaviour neutronBehaviour, int size, String depletedVersionId) { + double neutronMultiplicationFactor, double directEnergyFactor, INeutronBehaviour neutronBehaviour, int size, + ResourceLocation depletedVersionId) { super(settings, clampTemp(maxTemperature), 0.8 * NuclearConstant.BASE_HEAT_CONDUCTION, neutronBehaviour, desintegrationMax); @@ -84,13 +86,13 @@ private NuclearFuel(Properties settings, int desintegrationMax, int maxTemperatu public static ItemDefinition of(String englishName, String id, NuclearFuelParams params, INeutronBehaviour neutronBehaviour, String depletedVersionId) { return MIItem - .item(englishName, id, (settings) -> new NuclearFuel(settings.stacksTo(1), params, neutronBehaviour, depletedVersionId), + .item(englishName, id, (settings) -> new NuclearFuel(settings.stacksTo(1), params, neutronBehaviour, MI.id(depletedVersionId)), SortOrder.ITEMS_OTHER); } @Override public ItemVariant getNeutronProduct() { - return ItemVariant.of(BuiltInRegistries.ITEM.getOptional(MI.id(depletedVersionId)).get()); + return ItemVariant.of(BuiltInRegistries.ITEM.getOptional(depletedVersionId).get()); } @Override