Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,7 @@
"config.jade.plugin_gtceu.cable_info": "oɟuI ǝןqɐƆ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.controllable_provider": "ǝןqɐןןoɹʇuoƆ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.data_bank": "oɟuI ʞuɐᗺ ɐʇɐᗡ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.diode_provider": "oɟuI ǝpoıᗡ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.electric_container_provider": "ɹǝuıɐʇuoƆ ɔıɹʇɔǝןƎ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.energy_converter_provider": "ǝpoW ɹǝʇɹǝʌuoƆ ʎbɹǝuƎ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.exhaust_vent_info": "oɟuI ʇuǝΛ ʇsnɐɥxƎ ]nƎƆ⟘⅁[",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,7 @@
"config.jade.plugin_gtceu.cable_info": "[GTCEu] Cable Info",
"config.jade.plugin_gtceu.controllable_provider": "[GTCEu] Controllable",
"config.jade.plugin_gtceu.data_bank": "[GTCEu] Data Bank Info",
"config.jade.plugin_gtceu.diode_provider": "[GTCEu] Diode Info",
"config.jade.plugin_gtceu.electric_container_provider": "[GTCEu] Electric Container",
"config.jade.plugin_gtceu.energy_converter_provider": "[GTCEu] Energy Converter Mode",
"config.jade.plugin_gtceu.exhaust_vent_info": "[GTCEu] Exhaust Vent Info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import net.minecraft.network.chat.Component;
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.level.block.state.properties.EnumProperty;

import lombok.Getter;

Expand Down Expand Up @@ -61,7 +60,6 @@ public static AmpMode getByValue(int amps) {
}
}

public static final EnumProperty<DiodePartMachine.AmpMode> AMP_MODE_PROPERTY = GTMachineModelProperties.DIODE_AMP_MODE;
// spotless:on

public static int MAX_AMPS = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1323,6 +1323,8 @@ public static void init(RegistrateLangProvider provider) {
provider.add("config.jade.plugin_gtceu.me_pattern_buffer", "[GTCEu] Pattern Buffer Info");
provider.add("config.jade.plugin_gtceu.me_pattern_buffer_proxy", "[GTCEu] Pattern Buffer Proxy Info");
provider.add("config.jade.plugin_gtceu.energy_converter_provider", "[GTCEu] Energy Converter Mode");
provider.add("config.jade.plugin_gtceu.diode_provider", "[GTCEu] Diode Info");

provider.add("config.jade.plugin_gtceu.ldp_endpoint", "[GTCEu] Long Distance Pipeline Endpoint Info");

// gui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public void register(IWailaCommonRegistration registration) {
new StainedColorProvider(),
new HazardCleanerBlockProvider(),
new TransformerBlockProvider(),
new DiodeModeProvider(),
new PrimitivePumpBlockProvider(),
new DataBankBlockProvider(),
new EnergyConverterModeProvider(),
Expand Down Expand Up @@ -73,6 +74,7 @@ public void registerClient(IWailaClientRegistration registration) {
new StainedColorProvider(),
new HazardCleanerBlockProvider(),
new TransformerBlockProvider(),
new DiodeModeProvider(),
new PrimitivePumpBlockProvider(),
new DataBankBlockProvider(),
new LDPEndpointProvider(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.gregtechceu.gtceu.integration.jade.provider;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.GTValues;
import com.gregtechceu.gtceu.common.machine.multiblock.part.DiodePartMachine;

import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.entity.BlockEntity;

import snownee.jade.api.BlockAccessor;
import snownee.jade.api.ITooltip;
import snownee.jade.api.config.IPluginConfig;

public class DiodeModeProvider extends MachineInfoProvider<DiodePartMachine, CompoundTag> {

public DiodeModeProvider() {
super(GTCEu.id("diode_provider"), DiodePartMachine.class);
}

@Override
protected CompoundTag write(DiodePartMachine machine) {
var tag = new CompoundTag();
tag.putInt("side", machine.getFrontFacing().get3DDataValue());
tag.putInt("voltage", machine.getTier());
tag.putInt("amps", machine.getAmps());
return tag;
}

@Override
protected void addTooltip(CompoundTag data, ITooltip tooltip, Player player, BlockAccessor block,
BlockEntity blockEntity, IPluginConfig config) {
if (block.getHitResult().getDirection() ==
Direction.from3DDataValue(data.getInt("side"))) {
tooltip.add(Component.translatable(
"gtceu.top.transform_output",
(GTValues.VNF[data.getInt("voltage")] + " §r(" + data.getInt("amps") + "A)")));
} else {
tooltip.add(Component.translatable(
"gtceu.top.transform_input",
(GTValues.VNF[data.getInt("voltage")] + " §r(16A)")));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 16A supposed to be data.getInt("amps")?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diodes are hardcoded to 16a in

}
}
}
Loading