From a7ea216a03b044f7158b81038037d89616429a63 Mon Sep 17 00:00:00 2001 From: Flanks255 <32142731+Flanks255@users.noreply.github.com> Date: Mon, 29 Aug 2022 17:18:31 -0500 Subject: [PATCH] no more freezing. --- .../ellpeck/actuallyadditions/mod/config/CommonConfig.java | 5 ++--- .../actuallyadditions/mod/items/lens/LensMining.java | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java index d8e66d70a..90890a2b7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java @@ -38,6 +38,7 @@ public class CommonConfig { public static ForgeConfigSpec.IntValue FARMER_AREA; public static ForgeConfigSpec.IntValue RECONSTRUCTOR_POWER; public static ForgeConfigSpec.IntValue OIL_GENERATOR_TRANSFER; + public static ForgeConfigSpec.IntValue MINER_LENS_ENERGY; public static void build() { BUILDER.comment("Machine Settings").push("machineSettings"); @@ -45,6 +46,7 @@ public class CommonConfig { FARMER_AREA = BUILDER.comment("The size of the farmer's farming area. Default is 9x9, must be an odd number.").defineInRange("farmerArea", 9, 1, Integer.MAX_VALUE); RECONSTRUCTOR_POWER = BUILDER.comment("The amount of power the atomic reconstructor can store.").defineInRange("reconstructorPower", 300000, 300000, Integer.MAX_VALUE); OIL_GENERATOR_TRANSFER = BUILDER.comment("The amount of power the oil generator can transfer per tick.").defineInRange("oilGeneratorTransfer", 500, 100, Integer.MAX_VALUE); + MINER_LENS_ENERGY = BUILDER.comment("The energy use of the Atomic Reconstructor's Mining Lens.").defineInRange("minerLensEnergy", 60000, 1, Integer.MAX_VALUE); BUILDER.pop(); } @@ -67,7 +69,6 @@ public class CommonConfig { public static ForgeConfigSpec.BooleanValue TINY_COAL_STUFF; public static ForgeConfigSpec.BooleanValue SUPER_DUPER_HARD_MODE; public static ForgeConfigSpec.BooleanValue MOST_BLAND_PERSON_EVER; - public static ForgeConfigSpec.IntValue ELEVEN; public static ForgeConfigSpec.ConfigValue REDSTONECONFIGURATOR; public static ForgeConfigSpec.ConfigValue RELAYCONFIGURATOR; public static Item redstoneConfigureItem = Items.AIR; @@ -125,8 +126,6 @@ public class CommonConfig { MOST_BLAND_PERSON_EVER = BUILDER.comment("If you want to be really boring and lame, you can turn on this setting to disable colored names on Actually Additions items. Because why would you want things to look pretty anyways, right?") .define("noColoredItemNames", false); //TODO is this still needed? - ELEVEN = BUILDER.comment("11?").defineInRange("whatIs11", 11, 0, 12); - REDSTONECONFIGURATOR = BUILDER.comment("define the item used to configure Redstone Mode").define("redstoneConfigurator", Items.REDSTONE_TORCH.getRegistryName().toString(), obj -> obj instanceof String); RELAYCONFIGURATOR = BUILDER.comment("define the item used to configure Direction in laser relays").define("relayConfigurator", Items.COMPASS.getRegistryName().toString(), obj -> obj instanceof String); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java index 419cccd00..26f7ff200 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/lens/LensMining.java @@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.recipe.WeightedOre; +import de.ellpeck.actuallyadditions.mod.config.CommonConfig; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -112,9 +113,10 @@ public class LensMining extends Lens { @Override public boolean invoke(BlockState hitState, BlockPos hitPos, IAtomicReconstructor tile) { + final int energyUse = CommonConfig.Machines.MINER_LENS_ENERGY.get(); if (!tile.getWorldObject().isEmptyBlock(hitPos)) { - if (tile.getEnergy() >= ConfigIntValues.MINING_LENS_USE.getValue()) { - int adaptedUse = ConfigIntValues.MINING_LENS_USE.getValue(); + if (tile.getEnergy() >= energyUse) { + int adaptedUse = energyUse; List ores = null; Block hitBlock = hitState.getBlock();