Skip to content

Commit

Permalink
Use ResourceLocation for depleted nuclear fuel counterpart (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swedz authored Nov 1, 2024
1 parent 4460125 commit cf14efb
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -84,13 +86,13 @@ private NuclearFuel(Properties settings, int desintegrationMax, int maxTemperatu
public static ItemDefinition<NuclearFuel> 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
Expand Down

0 comments on commit cf14efb

Please sign in to comment.