diff --git a/src/main/java/net/neganote/gtutilities/common/machine/UtilMachines.java b/src/main/java/net/neganote/gtutilities/common/machine/UtilMachines.java index 9d0a619..23c3a9c 100644 --- a/src/main/java/net/neganote/gtutilities/common/machine/UtilMachines.java +++ b/src/main/java/net/neganote/gtutilities/common/machine/UtilMachines.java @@ -28,6 +28,7 @@ import net.minecraft.network.chat.Component; import net.neganote.gtutilities.GregTechModernUtilities; import net.neganote.gtutilities.common.machine.multiblock.PTERBMachine; +import net.neganote.gtutilities.common.machine.multiblock.WEBMachine; import net.neganote.gtutilities.common.machine.singleblock.AutoChargerMachine; import net.neganote.gtutilities.common.materials.UtilMaterials; import net.neganote.gtutilities.config.UtilConfig; @@ -159,12 +160,13 @@ public static MachineDefinition[] registerTieredMachines(String name, } public static MultiblockMachineDefinition PTERB_MACHINE = null; + public static MultiblockMachineDefinition WEB_MACHINE = null; static { if (UtilConfig.INSTANCE.features.pterbEnabled || GTCEu.isDataGen()) { PTERB_MACHINE = REGISTRATE .multiblock("pterb_machine", PTERBMachine::new) - .langValue("Wireless Active Transformer") + .langValue("Wireless Energy Bridge Hub") .rotationState(RotationState.ALL) .recipeType(GTRecipeTypes.DUMMY_RECIPES) .appearanceBlock(CASING_PALLADIUM_SUBSTATION) @@ -208,7 +210,48 @@ public static MachineDefinition[] registerTieredMachines(String name, .allowExtendedFacing(true) .hasBER(true) .register(); + + WEB_MACHINE = REGISTRATE + .multiblock("web_machine", WEBMachine::new) + .langValue("Wireless Energy Bridge Reciever") + .rotationState(RotationState.ALL) + .recipeType(GTRecipeTypes.DUMMY_RECIPES) + .appearanceBlock(HIGH_POWER_CASING) + .tooltips(Component.translatable("tooltip.web_machine.purpose"), + Component.translatable("gtceu.machine.active_transformer.tooltip.1"), + Component.translatable("tooltip.web_machine.frequencies") + .withStyle(ChatFormatting.GRAY)) + .conditionalTooltip( + Component + .translatable("tooltip.pterb_machine.uses_coolant", + UtilMaterials.QuantumCoolant != + null ? UtilMaterials.QuantumCoolant.getLocalizedName() + .withStyle(ChatFormatting.AQUA) : "") + .withStyle(ChatFormatting.DARK_RED), + UtilConfig.coolantEnabled()) + .conditionalTooltip(Component.translatable("tooltip.pterb_machine.input_coolant_before_use") + .withStyle(ChatFormatting.DARK_RED), UtilConfig.coolantEnabled()) + .pattern((multiblockMachineDefinition -> FactoryBlockPattern.start() + .aisle("abbba", "aabaa", "aaaaa", "aaaaa", "aaaaa", "aacaa", "aacaa", "aadaa") + .aisle("bbbbb", "abdba", "aacaa", "aaaaa", "aaaaa", "aacaa", "aaaaa", "aaaaa") + .aisle("bbbbb", "bdddb", "acdca", "aadaa", "aadaa", "ccdcc", "cadac", "daaad") + .aisle("bbbbb", "abdba", "aacaa", "aaaaa", "aaaaa", "aacaa", "aaaaa", "aaaaa") + .aisle("abeba", "aabaa", "aaaaa", "aaaaa", "aaaaa", "aacaa", "aacaa", "aadaa") + .where("e", controller(blocks(multiblockMachineDefinition.getBlock()))) + .where('b', + blocks(HIGH_POWER_CASING.get()).setMinGlobalLimited(12) + .or(WEBMachine.getHatchPredicates())) + .where("d", blocks(SUPERCONDUCTING_COIL.get())) + .where("c", frames(GTMaterials.NaquadahAlloy)) + .where("a", air()) + .build())) + .workableCasingModel(GTCEu.id("block/casings/hpca/high_power_casing"), + GTCEu.id("block/multiblock/data_bank")) + .allowExtendedFacing(true) + .hasBER(true) + .register(); } + } public static void init() {} diff --git a/src/main/java/net/neganote/gtutilities/common/machine/multiblock/PTERBMachine.java b/src/main/java/net/neganote/gtutilities/common/machine/multiblock/PTERBMachine.java index f29820f..425b3a7 100644 --- a/src/main/java/net/neganote/gtutilities/common/machine/multiblock/PTERBMachine.java +++ b/src/main/java/net/neganote/gtutilities/common/machine/multiblock/PTERBMachine.java @@ -96,19 +96,13 @@ public void explode() { removeWirelessEnergy(); long inputVoltage = 0; - long outputVoltage = 0; if (!localPowerInput.isEmpty()) { EnergyContainerList localInputs = EnergyUtils.getEnergyListFromMultiParts(localPowerInput); inputVoltage = localInputs.getInputVoltage(); } - if (!localPowerOutput.isEmpty()) { - EnergyContainerList localOutputs = EnergyUtils.getEnergyListFromMultiParts(localPowerOutput); - outputVoltage = localOutputs.getOutputVoltage(); - } - - long tier = Math.max(GTUtil.getFloorTierByVoltage(inputVoltage), GTUtil.getFloorTierByVoltage(outputVoltage)); + long tier = GTUtil.getFloorTierByVoltage(inputVoltage); doExplosion(15f + tier); } @@ -169,8 +163,6 @@ public void convertEnergyTick() { private int calculateCoolantDrain() { long inputAmperage = 0; long inputVoltage = 0; - long outputAmperage = 0; - long outputVoltage = 0; if (!localPowerInput.isEmpty()) { EnergyContainerList localInputs = EnergyUtils.getEnergyListFromMultiParts(localPowerInput); @@ -178,13 +170,7 @@ private int calculateCoolantDrain() { inputVoltage = localInputs.getInputVoltage(); } - if (!localPowerOutput.isEmpty()) { - EnergyContainerList localOutputs = EnergyUtils.getEnergyListFromMultiParts(localPowerOutput); - outputAmperage = localOutputs.getOutputAmperage(); - outputVoltage = localOutputs.getOutputVoltage(); - } - - long scalingFactor = Math.max(inputAmperage * inputVoltage, outputAmperage * outputVoltage); + long scalingFactor = inputAmperage * inputVoltage; int coolantDrain = UtilConfig.INSTANCE.features.pterbCoolantBaseDrain + (int) (scalingFactor * UtilConfig.INSTANCE.features.pterbCoolantIOMultiplier); @@ -306,7 +292,6 @@ private void removeWirelessEnergy() { if (getLevel() instanceof ServerLevel serverLevel) { PTERBSavedData savedData = PTERBSavedData.getOrCreate(serverLevel.getServer().overworld()); savedData.removeEnergyInputs(frequency, localPowerInput); - savedData.removeEnergyOutputs(frequency, localPowerOutput); savedData.saveDataToCache(); } } @@ -315,18 +300,14 @@ private void addWirelessEnergy() { if (getLevel() instanceof ServerLevel serverLevel) { PTERBSavedData savedData = PTERBSavedData.getOrCreate(serverLevel.getServer().overworld()); savedData.addEnergyInputs(frequency, localPowerInput); - savedData.addEnergyOutputs(frequency, localPowerOutput); savedData.saveDataToCache(); } } public static TraceabilityPredicate getHatchPredicates() { var predicate = abilities(PartAbility.INPUT_ENERGY).setPreviewCount(1) - .or(abilities(PartAbility.OUTPUT_ENERGY).setPreviewCount(2)) .or(abilities(PartAbility.SUBSTATION_INPUT_ENERGY).setPreviewCount(1)) - .or(abilities(PartAbility.SUBSTATION_OUTPUT_ENERGY).setPreviewCount(1)) - .or(abilities(PartAbility.INPUT_LASER).setPreviewCount(1)) - .or(abilities(PartAbility.OUTPUT_LASER).setPreviewCount(1)); + .or(abilities(PartAbility.INPUT_LASER).setPreviewCount(1)); if (UtilConfig.coolantEnabled()) { predicate = predicate.or(abilities(PartAbility.IMPORT_FLUIDS).setExactLimit(1)); } @@ -335,7 +316,7 @@ public static TraceabilityPredicate getHatchPredicates() { @Override public void addDisplayText(@NotNull List textList) { - if (isFormed()) { + if (isFormed() && getLevel() instanceof ServerLevel serverLevel) { if (frequency == 0) { textList.add(Component.translatable("gtmutils.pterb_machine.invalid_frequency") .withStyle(ChatFormatting.RED)); @@ -346,8 +327,6 @@ public void addDisplayText(@NotNull List textList) { } else if (isActive()) { long inputAmperage = 0; long inputVoltage = 0; - long outputAmperage = 0; - long outputVoltage = 0; if (!localPowerInput.isEmpty()) { EnergyContainerList localInputs = EnergyUtils.getEnergyListFromMultiParts(localPowerInput); @@ -355,14 +334,7 @@ public void addDisplayText(@NotNull List textList) { inputVoltage = localInputs.getInputVoltage(); } - if (!localPowerOutput.isEmpty()) { - EnergyContainerList localOutputs = EnergyUtils.getEnergyListFromMultiParts(localPowerOutput); - outputAmperage = localOutputs.getOutputAmperage(); - outputVoltage = localOutputs.getOutputVoltage(); - } - long inputTotal = inputVoltage * inputAmperage; - long outputTotal = outputVoltage * outputAmperage; textList.add(Component.translatable("gtceu.multiblock.running")); if (inputTotal > 0) { @@ -371,12 +343,6 @@ public void addDisplayText(@NotNull List textList) { FormattingUtil.formatNumbers( Math.abs(inputTotal)))); } - if (outputTotal > 0) { - textList.add(Component - .translatable("gtceu.multiblock.active_transformer.max_output", - FormattingUtil.formatNumbers( - Math.abs(outputTotal)))); - } if (UtilConfig.coolantEnabled()) { textList.add(Component .translatable("gtmutils.multiblock.pterb_machine.coolant_usage", diff --git a/src/main/java/net/neganote/gtutilities/common/machine/multiblock/WEBMachine.java b/src/main/java/net/neganote/gtutilities/common/machine/multiblock/WEBMachine.java new file mode 100644 index 0000000..39ad0f7 --- /dev/null +++ b/src/main/java/net/neganote/gtutilities/common/machine/multiblock/WEBMachine.java @@ -0,0 +1,368 @@ +package net.neganote.gtutilities.common.machine.multiblock; + +import com.gregtechceu.gtceu.api.capability.IControllable; +import com.gregtechceu.gtceu.api.capability.IEnergyContainer; +import com.gregtechceu.gtceu.api.capability.recipe.EURecipeCapability; +import com.gregtechceu.gtceu.api.capability.recipe.IO; +import com.gregtechceu.gtceu.api.gui.GuiTextures; +import com.gregtechceu.gtceu.api.gui.fancy.ConfiguratorPanel; +import com.gregtechceu.gtceu.api.gui.fancy.FancyMachineUIWidget; +import com.gregtechceu.gtceu.api.gui.fancy.IFancyConfigurator; +import com.gregtechceu.gtceu.api.machine.ConditionalSubscriptionHandler; +import com.gregtechceu.gtceu.api.machine.IMachineBlockEntity; +import com.gregtechceu.gtceu.api.machine.MetaMachine; +import com.gregtechceu.gtceu.api.machine.feature.IExplosionMachine; +import com.gregtechceu.gtceu.api.machine.feature.IFancyUIMachine; +import com.gregtechceu.gtceu.api.machine.feature.multiblock.IDisplayUIMachine; +import com.gregtechceu.gtceu.api.machine.feature.multiblock.IMultiPart; +import com.gregtechceu.gtceu.api.machine.multiblock.PartAbility; +import com.gregtechceu.gtceu.api.machine.multiblock.WorkableElectricMultiblockMachine; +import com.gregtechceu.gtceu.api.machine.trait.RecipeLogic; +import com.gregtechceu.gtceu.api.misc.EnergyContainerList; +import com.gregtechceu.gtceu.api.pattern.TraceabilityPredicate; +import com.gregtechceu.gtceu.api.pattern.error.PatternError; +import com.gregtechceu.gtceu.common.data.GTItems; +import com.gregtechceu.gtceu.config.ConfigHolder; +import com.gregtechceu.gtceu.utils.FormattingUtil; +import com.gregtechceu.gtceu.utils.GTUtil; + +import com.lowdragmc.lowdraglib.gui.modular.ModularUI; +import com.lowdragmc.lowdraglib.gui.texture.IGuiTexture; +import com.lowdragmc.lowdraglib.gui.texture.ItemStackTexture; +import com.lowdragmc.lowdraglib.gui.widget.*; +import com.lowdragmc.lowdraglib.syncdata.annotation.DescSynced; +import com.lowdragmc.lowdraglib.syncdata.annotation.Persisted; +import com.lowdragmc.lowdraglib.syncdata.field.ManagedFieldHolder; + +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.level.block.Block; +import net.neganote.gtutilities.saveddata.PTERBSavedData; +import net.neganote.gtutilities.utils.EnergyUtils; + +import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; +import lombok.Getter; +import org.jetbrains.annotations.NotNull; + +import java.util.*; + +import static com.gregtechceu.gtceu.api.pattern.Predicates.abilities; + +// A lot of this is copied from the Active Transformer +public class WEBMachine extends WorkableElectricMultiblockMachine + implements IControllable, IExplosionMachine, IFancyUIMachine, + IDisplayUIMachine { + + protected static final ManagedFieldHolder MANAGED_FIELD_HOLDER = new ManagedFieldHolder( + WEBMachine.class, WorkableElectricMultiblockMachine.MANAGED_FIELD_HOLDER); + + private List localPowerOutput; + + private List localPowerInput; + + protected ConditionalSubscriptionHandler converterSubscription; + + @Persisted + @DescSynced + @Getter + private int frequency; + + @Persisted + @DescSynced + private int coolantTimer = 0; + + public WEBMachine(IMachineBlockEntity holder) { + super(holder); + this.localPowerOutput = new ArrayList<>(); + this.localPowerInput = new ArrayList<>(); + + this.converterSubscription = new ConditionalSubscriptionHandler(this, this::convertEnergyTick, + this::isSubscriptionActive); + + this.frequency = 0; + } + + public void explode() { + removeWirelessEnergy(); + + long outputVoltage = 0; + + if (!localPowerOutput.isEmpty()) { + EnergyContainerList localOutputs = EnergyUtils.getEnergyListFromMultiParts(localPowerOutput); + outputVoltage = localOutputs.getOutputVoltage(); + } + + long tier = GTUtil.getFloorTierByVoltage(outputVoltage); + + doExplosion(15f + tier); + } + + public void convertEnergyTick() { + if (frequency == 0) { + getRecipeLogic().setStatus(RecipeLogic.Status.SUSPEND); + return; + } + if (isWorkingEnabled()) { + getRecipeLogic() + .setStatus(isSubscriptionActive() ? RecipeLogic.Status.WORKING : RecipeLogic.Status.SUSPEND); + } + + if (isWorkingEnabled() && getRecipeLogic().getStatus() == RecipeLogic.Status.WORKING) { + coolantTimer = (coolantTimer + 1) % 20; + } + if (isWorkingEnabled() && frequency != 0) { + if (getLevel() instanceof ServerLevel serverLevel) { + PTERBSavedData savedData = PTERBSavedData.getOrCreate(serverLevel); + EnergyContainerList powerInput = savedData.getWirelessEnergyInputs(frequency); + EnergyContainerList powerOutput = savedData.getWirelessEnergyOutputs(frequency); + long canDrain = powerInput.getEnergyStored(); + long totalDrained = powerOutput.changeEnergy(canDrain); + powerInput.removeEnergy(totalDrained); + } + } + + converterSubscription.updateSubscription(); + } + + @SuppressWarnings("RedundantIfStatement") // It is cleaner to have the final return true separate. + protected boolean isSubscriptionActive() { + if (!isFormed()) return false; + + if (localPowerInput == null) return false; + if (localPowerOutput == null) return false; + + return true; + } + + @Override + public boolean onWorking() { + return super.onWorking(); + } + + @Override + public void onStructureFormed() { + super.onStructureFormed(); + + if (frequency == 0) { + setWorkingEnabled(false); + } + + // capture all energy containers + List localPowerInput = new ArrayList<>(); + List localPowerOutput = new ArrayList<>(); + Map ioMap = getMultiblockState().getMatchContext().getOrCreate("ioMap", Long2ObjectMaps::emptyMap); + + for (IMultiPart part : getPrioritySortedParts()) { + IO io = ioMap.getOrDefault(part.self().getPos().asLong(), IO.BOTH); + if (io == IO.NONE) continue; + for (var handlerList : part.getRecipeHandlers()) { + var handlerIO = handlerList.getHandlerIO(); + // If IO not compatible + if (io != IO.BOTH && handlerIO != IO.BOTH && io != handlerIO) continue; + var energyContainers = handlerList.getCapability(EURecipeCapability.CAP).stream() + .filter(IEnergyContainer.class::isInstance) + .map(IEnergyContainer.class::cast) + .toList(); + if (!energyContainers.isEmpty()) { + if (handlerIO == IO.IN) { + localPowerInput.add(part); + } else if (handlerIO == IO.OUT) { + localPowerOutput.add(part); + } + } + } + } + + // Invalidate the structure if there is not at least one output or one input + if (localPowerInput.isEmpty() && localPowerOutput.isEmpty()) { + this.onStructureInvalid(); + getMultiblockState().setError(new PatternError()); + return; + } + + this.localPowerOutput = localPowerOutput; + + if (frequency != 0 && isActive()) { + addWirelessEnergy(); + } + + converterSubscription.updateSubscription(); + } + + @NotNull + private List getPrioritySortedParts() { + return getParts().stream().sorted(Comparator.comparing(part -> { + if (part instanceof MetaMachine partMachine) { + Block partBlock = partMachine.getBlockState().getBlock(); + + if (PartAbility.OUTPUT_ENERGY.isApplicable(partBlock)) + return 1; + + if (PartAbility.SUBSTATION_OUTPUT_ENERGY.isApplicable(partBlock)) + return 2; + + if (PartAbility.OUTPUT_LASER.isApplicable(partBlock)) + return 3; + } + + return 4; + })).toList(); + } + + @Override + public @NotNull ManagedFieldHolder getFieldHolder() { + return MANAGED_FIELD_HOLDER; + } + + @Override + public void onStructureInvalid() { + coolantTimer = 0; + removeWirelessEnergy(); + if ((isWorkingEnabled() && recipeLogic.getStatus() == RecipeLogic.Status.WORKING) && + !ConfigHolder.INSTANCE.machines.harmlessActiveTransformers) { + explode(); + } + super.onStructureInvalid(); + this.localPowerOutput = new ArrayList<>(); + this.localPowerInput = new ArrayList<>(); + setWorkingEnabled(false); + converterSubscription.unsubscribe(); + } + + private void removeWirelessEnergy() { + if (getLevel() instanceof ServerLevel serverLevel) { + PTERBSavedData savedData = PTERBSavedData.getOrCreate(serverLevel.getServer().overworld()); + savedData.removeEnergyOutputs(frequency, localPowerOutput); + savedData.saveDataToCache(); + } + } + + private void addWirelessEnergy() { + if (getLevel() instanceof ServerLevel serverLevel) { + PTERBSavedData savedData = PTERBSavedData.getOrCreate(serverLevel.getServer().overworld()); + savedData.addEnergyOutputs(frequency, localPowerOutput); + savedData.saveDataToCache(); + } + } + + public static TraceabilityPredicate getHatchPredicates() { + return abilities(PartAbility.OUTPUT_ENERGY).setPreviewCount(2) + .or(abilities(PartAbility.SUBSTATION_OUTPUT_ENERGY).setPreviewCount(1)) + .or(abilities(PartAbility.OUTPUT_LASER).setPreviewCount(1)); + } + + @Override + public void addDisplayText(@NotNull List textList) { + if (frequency == 0) { + textList.add(Component.translatable("gtmutils.pterb_machine.invalid_frequency") + .withStyle(ChatFormatting.RED)); + return; + } + if (!isWorkingEnabled()) { + textList.add(Component.translatable("gtceu.multiblock.work_paused")); + } else if (isActive()) { + long outputAmperage = 0; + long outputVoltage = 0; + + if (!localPowerOutput.isEmpty()) { + EnergyContainerList localOutputs = EnergyUtils.getEnergyListFromMultiParts(localPowerOutput); + outputAmperage = localOutputs.getOutputAmperage(); + outputVoltage = localOutputs.getOutputVoltage(); + } + + long outputTotal = outputVoltage * outputAmperage; + + textList.add(Component.translatable("gtceu.multiblock.running")); + if (outputTotal > 0) { + textList.add(Component + .translatable("gtceu.multiblock.active_transformer.max_output", + FormattingUtil.formatNumbers( + Math.abs(outputTotal)))); + } + if (!ConfigHolder.INSTANCE.machines.harmlessActiveTransformers) { + textList.add(Component + .translatable("gtceu.multiblock.active_transformer.danger_enabled")); + } + } else { + textList.add(Component.translatable("gtceu.multiblock.idling")); + } + } + + public void setFrequencyFromString(String str) { + removeWirelessEnergy(); + frequency = Integer.parseInt(str); + if (frequency == 0) { + setWorkingEnabled(false); + } + if (frequency != 0) { + addWirelessEnergy(); + } + } + + public String getFrequencyString() { + return Integer.valueOf(frequency).toString(); + } + + @Override + public void setWorkingEnabled(boolean isWorkingAllowed) { + if (frequency == 0) { + super.setWorkingEnabled(false); + return; + } + super.setWorkingEnabled(isWorkingAllowed); + if (frequency != 0) { + if (isWorkingAllowed) { + addWirelessEnergy(); + } else { + removeWirelessEnergy(); + } + } + if (!isWorkingAllowed) { + coolantTimer = 0; + } + } + + @Override + public void attachConfigurators(@NotNull ConfiguratorPanel configuratorPanel) { + super.attachConfigurators(configuratorPanel); + configuratorPanel.attachConfigurators(new IFancyConfigurator() { + + @Override + public Component getTitle() { + return Component.translatable("gtmutils.gui.pterb.wireless_configurator.title"); + } + + @Override + public IGuiTexture getIcon() { + return new ItemStackTexture(GTItems.SENSOR_UV.asItem()); + } + + @Override + public Widget createConfigurator() { + return new WidgetGroup(0, 0, 130, 25) + .addWidget(new TextFieldWidget().setNumbersOnly(0, Integer.MAX_VALUE) + .setTextResponder(WEBMachine.this::setFrequencyFromString) + .setTextSupplier(WEBMachine.this::getFrequencyString)); + } + }); + } + + @Override + public @NotNull Widget createUIWidget() { + var group = new WidgetGroup(0, 0, 182 + 8, 117 + 8); + group.addWidget(new DraggableScrollableWidgetGroup(4, 4, 182, 117).setBackground(getScreenTexture()) + .addWidget(new LabelWidget(4, 5, self().getBlockState().getBlock().getDescriptionId())) + .addWidget(new ComponentPanelWidget(4, 17, this::addDisplayText) + .setMaxWidthLimit(150) + .clickHandler(this::handleDisplayClick))); + group.setBackground(GuiTextures.BACKGROUND_INVERSE); + return group; + } + + @Override + public @NotNull ModularUI createUI(@NotNull Player entityPlayer) { + return new ModularUI(198, 208, this, entityPlayer).widget(new FancyMachineUIWidget(this, 198, 208)); + } +} diff --git a/src/main/java/net/neganote/gtutilities/datagen/lang/UtilLangHandler.java b/src/main/java/net/neganote/gtutilities/datagen/lang/UtilLangHandler.java index 3396ad6..a5f9698 100644 --- a/src/main/java/net/neganote/gtutilities/datagen/lang/UtilLangHandler.java +++ b/src/main/java/net/neganote/gtutilities/datagen/lang/UtilLangHandler.java @@ -69,9 +69,14 @@ public static void init(RegistrateLangProvider provider) { provider.add("tooltip.pterb_machine.purpose", "Power Transfer Einstein-Rosen Bridge (PTERB)"); provider.add("tooltip.pterb_machine.frequencies", - "All WATs with the same frequency will wirelessly transfer energy between each other like a single Active Transformer."); + "The PTERB is the energy input of a wireless energy network, it shares a frequency with a ERAP and inputs energy into the wireless network"); provider.add("gtmutils.pterb.current_frequency", "Current frequency: %s"); + provider.add("tooltip.web_machine.purpose", "Einstein-Rosen Anchor Point (ERAP)"); + provider.add("tooltip.web_machine.frequencies", + "The ERAP is the energy output of a wireless energy network, it shares a frequency with a PTERB, it takes and outputs energy from the wireless network"); + provider.add("tooltip.web_machine.only_output", "Receives energy from a PTERB"); + provider.add("config.jade.plugin_gtmutils.pterb_info", "WAT Info"); multiLang(provider, "gtceu.placeholder_info.watfrequency", diff --git a/src/main/java/net/neganote/gtutilities/recipe/UtilRecipes.java b/src/main/java/net/neganote/gtutilities/recipe/UtilRecipes.java index 63a3e8e..3bccab7 100644 --- a/src/main/java/net/neganote/gtutilities/recipe/UtilRecipes.java +++ b/src/main/java/net/neganote/gtutilities/recipe/UtilRecipes.java @@ -53,23 +53,42 @@ public static void init(Consumer provider) { if (UtilConfig.INSTANCE.features.pterbEnabled) { ASSEMBLY_LINE_RECIPES.recipeBuilder("pterb") - .inputItems(GTMultiMachines.ACTIVE_TRANSFORMER) + .inputItems(UtilMachines.WEB_MACHINE) .inputItems(TagPrefix.plate, GTMaterials.Neutronium, 32) - .inputItems(SENSOR.get(GTValues.UV), 8) + .inputItems(SENSOR.get(GTValues.UV), 2) .inputItems(EMITTER.get(GTValues.UV), 8) .inputItems(FIELD_GENERATOR.get(GTValues.UV), 4) - .inputItems(CustomTags.UHV_CIRCUITS, 2) + .inputItems(CustomTags.UHV_CIRCUITS, 4) .inputItems(TagPrefix.pipeLargeFluid, GTMaterials.Neutronium, 4) - .inputItems(CABLE_QUAD.get(GTValues.UV), 8) + .inputItems(CABLE_QUAD.get(GTValues.UV), 16) .inputItems(LASER_PIPES[0], 8) .inputFluids(GTMaterials.SolderingAlloy.getFluid(GTValues.L * 32)) .EUt(1_600_000L) .duration(1200) .outputItems(UtilMachines.PTERB_MACHINE) .addMaterialInfo(true) + .stationResearch(b -> b + .researchStack(UtilMachines.WEB_MACHINE.asStack()).CWUt(16)) + .save(provider); + + ASSEMBLY_LINE_RECIPES.recipeBuilder("web") + .inputItems(GTMultiMachines.ACTIVE_TRANSFORMER) + .inputItems(TagPrefix.plate, NaquadahAlloy, 8) + .inputItems(SENSOR.get(UV), 4) + .inputItems(EMITTER.get(UV), 1) + .inputItems(CustomTags.UV_CIRCUITS, 1) + .inputItems(TagPrefix.pipeLargeFluid, Naquadah, 1) + .inputItems(CABLE_QUAD.get(GTValues.UV), 4) + .inputItems(LASER_PIPES[0], 8) + .inputFluids(GTMaterials.SolderingAlloy.getFluid(GTValues.L * 8)) + .EUt(1_600_000L) + .duration(250) + .outputItems(UtilMachines.WEB_MACHINE) + .addMaterialInfo(true) .stationResearch(b -> b .researchStack(GTMultiMachines.ACTIVE_TRANSFORMER.asStack()).CWUt(16)) .save(provider); + } if (UtilConfig.INSTANCE.features.expandedBuffersEnabled && GTCEu.Mods.isAE2Loaded()) {