diff --git a/common/src/main/java/com/gregtechceu/gtceu/api/capability/GTCapabilityHelper.java b/common/src/main/java/com/gregtechceu/gtceu/api/capability/GTCapabilityHelper.java index 58991cd828..004b69219c 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/api/capability/GTCapabilityHelper.java +++ b/common/src/main/java/com/gregtechceu/gtceu/api/capability/GTCapabilityHelper.java @@ -21,6 +21,12 @@ public static IElectricItem getElectricItem(ItemStack itemStack) { throw new AssertionError(); } + @ExpectPlatform + @Nullable + public static IPlatformEnergyStorage getPlatformEnergyItem(ItemStack itemStack) { + throw new AssertionError(); + } + @ExpectPlatform @Nullable public static IEnergyContainer getEnergyContainer(Level level, BlockPos pos, @Nullable Direction side) { diff --git a/common/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableEnergyContainer.java b/common/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableEnergyContainer.java index 2b288af0d0..1a6a7c928c 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableEnergyContainer.java +++ b/common/src/main/java/com/gregtechceu/gtceu/api/machine/trait/NotifiableEnergyContainer.java @@ -90,7 +90,7 @@ public void onMachineLoad() { checkOutputSubscription(); } - protected void checkOutputSubscription() { + public void checkOutputSubscription() { if (getOutputVoltage() > 0 && getOutputAmperage() > 0) { if (getEnergyStored() >= getOutputVoltage()) { outputSubs = getMachine().subscribeServerTick(outputSubs, this::serverTick); diff --git a/common/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/ChargerRenderer.java b/common/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/ChargerRenderer.java new file mode 100644 index 0000000000..2af901ea19 --- /dev/null +++ b/common/src/main/java/com/gregtechceu/gtceu/client/renderer/machine/ChargerRenderer.java @@ -0,0 +1,87 @@ +package com.gregtechceu.gtceu.client.renderer.machine; + +import com.gregtechceu.gtceu.GTCEu; +import com.gregtechceu.gtceu.api.machine.MachineDefinition; +import com.gregtechceu.gtceu.api.machine.MetaMachine; +import com.gregtechceu.gtceu.common.machine.electric.ChargerMachine; +import com.gregtechceu.gtceu.config.ConfigHolder; +import com.lowdragmc.lowdraglib.client.bakedpipeline.FaceQuad; +import com.lowdragmc.lowdraglib.client.model.ModelFactory; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.renderer.texture.TextureAtlas; +import net.minecraft.client.resources.model.ModelState; +import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.util.RandomSource; +import org.jetbrains.annotations.Nullable; + +import java.util.*; +import java.util.function.Consumer; + +/** + * @author lucifer_ll + * @date 2023/7/13 + * @implNote ChargerRenderer + */ +public class ChargerRenderer extends TieredHullMachineRenderer{ + public final static ResourceLocation CHARGER_IDLE = GTCEu.id("block/machines/charger/overlay_charger_idle"); + public final static ResourceLocation CHARGER_RUNNING = GTCEu.id("block/machines/charger/overlay_charger_running"); + public final static ResourceLocation CHARGER_RUNNING_EMISSIVE = GTCEu.id("block/machines/charger/overlay_charger_running_emissive"); + public final static ResourceLocation CHARGER_FINISHED = GTCEu.id("block/machines/charger/overlay_charger_finished"); + public final static ResourceLocation CHARGER_FINISHED_EMISSIVE = GTCEu.id("block/machines/charger/overlay_charger_finished_emissive"); + + public ChargerRenderer(int tier) { + super(tier, GTCEu.id("block/machine/hull_machine")); + } + + @Override + @Environment(EnvType.CLIENT) + public void renderMachine(List quads, MachineDefinition definition, @Nullable MetaMachine machine, Direction frontFacing, @Nullable Direction side, RandomSource rand, Direction modelFacing, ModelState modelState) { + super.renderMachine(quads, definition, machine, frontFacing, side, rand, modelFacing, modelState); + var state = ChargerMachine.State.IDLE; + if (machine instanceof ChargerMachine charger) { + state = charger.getState(); + } + + if (side == frontFacing && modelFacing != null) { + var bakedFaces = new ArrayList(); + switch (state) { + case IDLE -> bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_IDLE), modelState, -1, 0, false, true)); + case RUNNING -> { + if (ConfigHolder.INSTANCE.client.machinesEmissiveTextures) { + bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_RUNNING), modelState, -1, 0, true, true)); + bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_RUNNING_EMISSIVE), modelState, 0, 15, true, false)); + } else { + bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_RUNNING), modelState, -1, 0, true, true)); + } + } + case FINISHED -> { + if (ConfigHolder.INSTANCE.client.machinesEmissiveTextures) { + bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_FINISHED), modelState, -1, 0, true, true)); + bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_FINISHED_EMISSIVE), modelState, 0, 15, true, false)); + } else { + bakedFaces.add(FaceQuad.bakeFace(modelFacing, ModelFactory.getBlockSprite(CHARGER_FINISHED), modelState, -1, 0, true, true)); + } + } + } + quads.addAll(bakedFaces); + + } + } + + @Override + @Environment(EnvType.CLIENT) + public void onPrepareTextureAtlas(ResourceLocation atlasName, Consumer register) { + super.onPrepareTextureAtlas(atlasName, register); + if (atlasName.equals(TextureAtlas.LOCATION_BLOCKS)) { + register.accept(CHARGER_IDLE); + register.accept(CHARGER_RUNNING); + register.accept(CHARGER_RUNNING_EMISSIVE); + register.accept(CHARGER_FINISHED); + register.accept(CHARGER_FINISHED_EMISSIVE); + } + } + +} diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java b/common/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java index b783629704..eb33aac4a4 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java +++ b/common/src/main/java/com/gregtechceu/gtceu/common/data/GTMachines.java @@ -229,6 +229,8 @@ public class GTMachines { public final static MachineDefinition[] BATTERY_BUFFER_16 = registerBatteryBuffer(16); + public final static MachineDefinition[] CHARGER_4 = registerCharger(4); + public final static MachineDefinition[] PUMP = registerTieredMachines("pump", PumpMachine::new, (tier, builder) -> builder .rotationState(RotationState.NON_Y_AXIS) @@ -1387,6 +1389,21 @@ public static MachineDefinition[] registerBatteryBuffer(int batterySlotSize){ ALL_TIERS); } + public static MachineDefinition[] registerCharger(int itemSlotSize) { + return registerTieredMachines("charger_" + itemSlotSize + "x", + (holder, tier) -> new ChargerMachine(holder, tier, itemSlotSize), + (tier, builder) -> builder + .rotationState(RotationState.NON_Y_AXIS) + .renderer(() -> new ChargerRenderer(tier)) + .langValue("%s %s%s".formatted(VOLTAGE_NAMES[tier], itemSlotSize, "x Turbo Charger")) + .tooltips(explosion()) + .tooltips(Component.translatable("gtceu.universal.tooltip.item_storage_capacity", itemSlotSize), + Component.translatable("gtceu.universal.tooltip.voltage_in_out", GTValues.V[tier], GTValues.VNF[tier]), + Component.translatable("gtceu.universal.tooltip.amperage_in_till", itemSlotSize * ChargerMachine.AMPS_PER_ITEM)) + .register(), + ALL_TIERS); + } + public static MultiblockMachineDefinition[] registerTieredMultis(String name, BiFunction factory, BiFunction builder, diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java b/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java index a53557c151..0b6b5fb412 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java +++ b/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/BatteryBufferMachine.java @@ -15,6 +15,7 @@ import com.lowdragmc.lowdraglib.gui.widget.Widget; import com.lowdragmc.lowdraglib.gui.widget.WidgetGroup; import com.lowdragmc.lowdraglib.misc.ItemStackTransfer; +import com.lowdragmc.lowdraglib.syncdata.ISubscription; import com.lowdragmc.lowdraglib.syncdata.annotation.Persisted; import com.lowdragmc.lowdraglib.syncdata.field.ManagedFieldHolder; import com.lowdragmc.lowdraglib.utils.Position; @@ -51,6 +52,7 @@ public BatteryBufferMachine(IMachineBlockEntity holder, int tier, int inventoryS this.isWorkingEnabled = true; this.inventorySize = inventorySize; this.batteryInventory = createBatteryInventory(args); + this.batteryInventory.setOnContentsChanged(energyContainer::checkOutputSubscription); } ////////////////////////////////////// @@ -72,11 +74,6 @@ protected ItemStackTransfer createBatteryInventory(Object... args) { return itemTransfer; } - @Override - public void onLoad() { - super.onLoad(); - } - @Override public int tintColor(int index) { if (index == 2) { @@ -186,7 +183,7 @@ public void serverTick() { var voltage = getOutputVoltage(); var batteries = getNonEmptyBatteries(); - if (batteries.size() > 0) { + if (!batteries.isEmpty()) { //Prioritize as many packets as available of energy created long internalAmps = Math.abs(Math.min(0, getInternalStorage() / voltage)); long genAmps = Math.max(0, batteries.size() - internalAmps); diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/ChargerMachine.java b/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/ChargerMachine.java new file mode 100644 index 0000000000..2c202ce9ff --- /dev/null +++ b/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/ChargerMachine.java @@ -0,0 +1,291 @@ +package com.gregtechceu.gtceu.common.machine.electric; + +import com.gregtechceu.gtceu.api.GTValues; +import com.gregtechceu.gtceu.api.capability.*; +import com.gregtechceu.gtceu.api.gui.GuiTextures; +import com.gregtechceu.gtceu.api.machine.IMachineBlockEntity; +import com.gregtechceu.gtceu.api.machine.TieredEnergyMachine; +import com.gregtechceu.gtceu.api.machine.feature.IFancyUIMachine; +import com.gregtechceu.gtceu.api.machine.trait.NotifiableEnergyContainer; +import com.gregtechceu.gtceu.api.syncdata.RequireRerender; +import com.gregtechceu.gtceu.config.ConfigHolder; +import com.gregtechceu.gtceu.utils.GTUtil; +import com.lowdragmc.lowdraglib.gui.texture.GuiTextureGroup; +import com.lowdragmc.lowdraglib.gui.widget.SlotWidget; +import com.lowdragmc.lowdraglib.gui.widget.Widget; +import com.lowdragmc.lowdraglib.gui.widget.WidgetGroup; +import com.lowdragmc.lowdraglib.misc.ItemStackTransfer; +import com.lowdragmc.lowdraglib.syncdata.annotation.DescSynced; +import com.lowdragmc.lowdraglib.syncdata.annotation.Persisted; +import com.lowdragmc.lowdraglib.syncdata.field.ManagedFieldHolder; +import com.lowdragmc.lowdraglib.utils.Position; +import lombok.Getter; +import lombok.Setter; +import net.minecraft.MethodsReturnNonnullByDefault; +import net.minecraft.core.Direction; + +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.ArrayList; +import java.util.List; + +/** + * @author lucifer_ll + * @date 2023/7/12 + * @implNote ChargerMachine + */ +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +public class ChargerMachine extends TieredEnergyMachine implements IControllable, IFancyUIMachine { + public static final long AMPS_PER_ITEM = 4L; + + protected static final ManagedFieldHolder MANAGED_FIELD_HOLDER = new ManagedFieldHolder(ChargerMachine.class, TieredEnergyMachine.MANAGED_FIELD_HOLDER); + + public enum State { + IDLE, + RUNNING, + FINISHED + } + + @Persisted + @Getter + @Setter + private boolean isWorkingEnabled; + @Getter + private final int inventorySize; + @Getter + @Persisted + protected final ItemStackTransfer chargerInventory; + + @Getter + @DescSynced + @RequireRerender + private State state; + + public ChargerMachine(IMachineBlockEntity holder, int tier, int inventorySize, Object... args) { + super(holder, tier, inventorySize); + this.isWorkingEnabled = true; + this.inventorySize = inventorySize; + this.chargerInventory = createChargerInventory(args); + this.state = State.IDLE; + } + + ////////////////////////////////////// + //***** Initialization ******// + ////////////////////////////////////// + @Override + public ManagedFieldHolder getFieldHolder() { + return MANAGED_FIELD_HOLDER; + } + + @Override + protected NotifiableEnergyContainer createEnergyContainer(Object... args) { + return new EnergyBatteryTrait((int) args[0]); + } + + protected ItemStackTransfer createChargerInventory(Object... args) { + var itemTransfer = new ItemStackTransfer(this.inventorySize); + itemTransfer.setFilter(item -> GTCapabilityHelper.getElectricItem(item) != null || GTCapabilityHelper.getPlatformEnergyItem(item) != null); + return itemTransfer; + } + + @Override + public int tintColor(int index) { + if (index == 2) { + return GTValues.VC[getTier()]; + } + return super.tintColor(index); + } + + ////////////////////////////////////// + //********** GUI ***********// + ////////////////////////////////////// + + @Override + public Widget createUIWidget() { + int rowSize = (int) Math.sqrt(inventorySize); + int colSize = rowSize; + if (inventorySize == 8) { + rowSize = 4; + colSize = 2; + } + var template = new WidgetGroup(0, 0, 18 * rowSize + 8, 18 * colSize + 8); + template.setBackground(GuiTextures.BACKGROUND_INVERSE); + int index = 0; + for (int y = 0; y < colSize; y++) { + for (int x = 0; x < rowSize; x++) { + template.addWidget(new SlotWidget(chargerInventory, index++, 4 + x * 18, 4 + y * 18, true, true) + .setBackgroundTexture(new GuiTextureGroup(GuiTextures.SLOT, GuiTextures.CHARGER_OVERLAY))); + } + } + + var editableUI = createEnergyBar(); + var energyBar = editableUI.createDefault(); + + var group = new WidgetGroup(0, 0, + Math.max(energyBar.getSize().width + template.getSize().width + 4 + 8, 172), + Math.max(template.getSize().height + 8, energyBar.getSize().height + 8)); + var size = group.getSize(); + energyBar.setSelfPosition(new Position(3, (size.height - energyBar.getSize().height) / 2)); + template.setSelfPosition(new Position( + (size.width - energyBar.getSize().width - 4 - template.getSize().width) / 2 + 2 + energyBar.getSize().width + 2, + (size.height - template.getSize().height) / 2)); + group.addWidget(energyBar); + group.addWidget(template); + editableUI.setupUI(group, this); + return group; + } + + ////////////////////////////////////// + //****** Charger Logic ******// + ////////////////////////////////////// + + private List getNonFullElectricItem() { + List electricItems = new ArrayList<>(); + for (int i = 0; i < chargerInventory.getSlots(); i++) { + var electricItemStack = chargerInventory.getStackInSlot(i); + var electricItem = GTCapabilityHelper.getElectricItem(electricItemStack); + if (electricItem != null) { + if (electricItem.getCharge() < electricItem.getMaxCharge()) { + electricItems.add(electricItem); + } + } else if (ConfigHolder.INSTANCE.compat.energy.nativeEUToPlatformNative) { + var energyStorage = GTCapabilityHelper.getPlatformEnergyItem(electricItemStack); + if (energyStorage != null) { + if (energyStorage.getAmount() < energyStorage.getCapacity()) { + electricItems.add(energyStorage); + } + } + } + } + return electricItems; + } + + private void changeState(State newState) { + if (state != newState) { + state = newState; + } + } + + protected class EnergyBatteryTrait extends NotifiableEnergyContainer { + + protected EnergyBatteryTrait(int inventorySize) { + super(ChargerMachine.this, GTValues.V[tier] * inventorySize * 32L, GTValues.V[tier], inventorySize * AMPS_PER_ITEM, 0L, 0L); + this.setSideInputCondition(side -> isWorkingEnabled()); + this.setSideOutputCondition(side -> false); + } + + @Override + public long acceptEnergyFromNetwork(@Nullable Direction side, long voltage, long amperage) { + var latestTS = getMachine().getOffsetTimer(); + if (lastTS < latestTS) { + amps = 0; + lastTS = latestTS; + } + if (amperage <= 0 || voltage <= 0) { + changeState(State.IDLE); + return 0; + } + + var electricItems = getNonFullElectricItem(); + var maxAmps = electricItems.size() * AMPS_PER_ITEM - amps; + var usedAmps = Math.min(maxAmps, amperage); + if (maxAmps <= 0) { + return 0; + } + + if (side == null || inputsEnergy(side)) { + if (voltage > getInputVoltage()) { + doExplosion(GTUtil.getExplosionPower(voltage)); + return usedAmps; + } + + //Prioritizes as many packets as available from the buffer + long internalAmps = Math.min(maxAmps, Math.max(0, getInternalStorage() / voltage)); + + usedAmps = Math.min(usedAmps, maxAmps - internalAmps); + amps += usedAmps; + + long energy = (usedAmps + internalAmps) * voltage; + long distributed = energy / electricItems.size(); + + boolean changed = false; + var charged = 0L; + for (var electricItem : electricItems) { + if (electricItem instanceof IElectricItem item) { + charged += item.charge(Math.min(distributed, GTValues.V[item.getTier()] * AMPS_PER_ITEM), getTier(), true, false); + } else if (electricItem instanceof IPlatformEnergyStorage energyStorage) { + energy += PlatformEnergyCompat.insertEu(energyStorage, Math.min(distributed, GTValues.V[getTier()] * AMPS_PER_ITEM)); + } + if (charged > 0) { + changed = true; + } + energy -= charged; + } + + if (changed) { + ChargerMachine.this.markDirty(); + changeState(State.RUNNING); + } + + //Remove energy used and then transfer overflow energy into the internal buffer + setEnergyStored(getInternalStorage() - internalAmps * voltage + energy); + return usedAmps; + } + return 0; + } + + @Override + public long getEnergyCapacity() { + long energyCapacity = 0L; + for (int i = 0; i < chargerInventory.getSlots(); i++) { + var electricItemStack = chargerInventory.getStackInSlot(i); + var electricItem = GTCapabilityHelper.getElectricItem(electricItemStack); + if (electricItem != null) { + energyCapacity += electricItem.getMaxCharge(); + } else if (ConfigHolder.INSTANCE.compat.energy.nativeEUToPlatformNative) { + var energyStorage = GTCapabilityHelper.getPlatformEnergyItem(electricItemStack); + if (energyStorage != null) { + energyCapacity += PlatformEnergyCompat.toEu(energyStorage.getCapacity(), PlatformEnergyCompat.ratio(false)); + } + } + } + + if (energyCapacity == 0) { + changeState(State.IDLE); + } + + return energyCapacity; + } + + @Override + public long getEnergyStored() { + long energyStored = 0L; + for (int i = 0; i < chargerInventory.getSlots(); i++) { + var electricItemStack = chargerInventory.getStackInSlot(i); + var electricItem = GTCapabilityHelper.getElectricItem(electricItemStack); + if (electricItem != null) { + energyStored += electricItem.getCharge(); + } else if (ConfigHolder.INSTANCE.compat.energy.nativeEUToPlatformNative) { + var energyStorage = GTCapabilityHelper.getPlatformEnergyItem(electricItemStack); + if (energyStorage != null) { + energyStored += PlatformEnergyCompat.toEu(energyStorage.getAmount(), PlatformEnergyCompat.ratio(false)); + } + } + } + + var capacity = getEnergyCapacity(); + + if (capacity != 0 && capacity == energyStored) { + changeState(State.FINISHED); + } + + return energyStored; + } + + private long getInternalStorage() { + return energyStored; + } + + } +} diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java b/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java index b194c9903c..88ded299c8 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java +++ b/common/src/main/java/com/gregtechceu/gtceu/common/machine/electric/FisherMachine.java @@ -405,7 +405,7 @@ protected static EditableUI createTemplate(int inven } }); WidgetUtils.widgetByIdForEach(group, "^bait_slot$", SlotWidget.class, slot -> { - slot.setHandlerSlot(machine.baitHandler, 0); + slot.setHandlerSlot(machine.baitHandler.storage, 0); slot.setCanTakeItems(true); slot.setCanPutItems(true); }); diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/machine/trait/ConverterTrait.java b/common/src/main/java/com/gregtechceu/gtceu/common/machine/trait/ConverterTrait.java index 472d032097..573572fe89 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/common/machine/trait/ConverterTrait.java +++ b/common/src/main/java/com/gregtechceu/gtceu/common/machine/trait/ConverterTrait.java @@ -51,7 +51,7 @@ public void setFeToEu(boolean feToEu) { ////////////////////////////////////// //********* logic *********// ////////////////////////////////////// - protected void checkOutputSubscription() { + public void checkOutputSubscription() { outputSubs = getMachine().subscribeServerTick(outputSubs, this::serverTick); } diff --git a/common/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityLoader.java b/common/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityLoader.java index f317cf261d..f145f42931 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityLoader.java +++ b/common/src/main/java/com/gregtechceu/gtceu/data/recipe/misc/MetaTileEntityLoader.java @@ -310,8 +310,7 @@ public static void init(Consumer provider) { registerMachineRecipe(provider, GTMachines.BATTERY_BUFFER_8, "WTW", "WMW", 'M', HULL, 'W', WIRE_OCT, 'T', CustomTags.TAG_WOODEN_CHESTS); registerMachineRecipe(provider, GTMachines.BATTERY_BUFFER_16, "WTW", "WMW", 'M', HULL, 'W', WIRE_HEX, 'T', CustomTags.TAG_WOODEN_CHESTS); - // TODO Charger - //registerMachineRecipe(provider, GTMachines.CHARGER, "WTW", "WMW", "BCB", 'M', HULL, 'W', WIRE_QUAD, 'T', OreDictNames.chestWood, 'B', CABLE, 'C', CIRCUIT); + registerMachineRecipe(provider, GTMachines.CHARGER_4, "WTW", "WMW", "BCB", 'M', HULL, 'W', WIRE_QUAD, 'T', CustomTags.TAG_WOODEN_CHESTS, 'B', CABLE, 'C', CIRCUIT); registerMachineRecipe(provider, GTMachines.FLUID_IMPORT_HATCH, " G", " M", 'M', HULL, 'G', GLASS); registerMachineRecipe(provider, GTMachines.FLUID_EXPORT_HATCH, " M", " G", 'M', HULL, 'G', GLASS); diff --git a/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_finished.png b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_finished.png new file mode 100644 index 0000000000..f5c8010be1 Binary files /dev/null and b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_finished.png differ diff --git a/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_finished_emissive.png b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_finished_emissive.png new file mode 100644 index 0000000000..7e1d869bc8 Binary files /dev/null and b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_finished_emissive.png differ diff --git a/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_idle.png b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_idle.png new file mode 100644 index 0000000000..1433323faa Binary files /dev/null and b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_idle.png differ diff --git a/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_running.png b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_running.png new file mode 100644 index 0000000000..f96abfc4e7 Binary files /dev/null and b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_running.png differ diff --git a/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_running_emissive.png b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_running_emissive.png new file mode 100644 index 0000000000..248fc5f393 Binary files /dev/null and b/common/src/main/resources/assets/gtceu/textures/block/machines/charger/overlay_charger_running_emissive.png differ diff --git a/fabric/src/generated/resources/assets/gtceu/lang/en_ud.json b/fabric/src/generated/resources/assets/gtceu/lang/en_ud.json index b4aeda8815..033169048e 100644 --- a/fabric/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/fabric/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -150,6 +150,7 @@ "block.gtceu.ev_brewery": "ɹ§III ʎɹǝʍǝɹᗺ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_canner": "ɹ§III ɹǝuuɐƆ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_centrifuge": "ɹ§III ǝbnɟıɹʇuǝƆ pǝɔuɐʌpⱯϛ§", + "block.gtceu.ev_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ǝɯǝɹʇxƎ", "block.gtceu.ev_chemical_bath": "ɹ§III ɥʇɐᗺ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_chemical_reactor": "ɹ§III ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_circuit_assembler": "ɹ§III ɹǝןqɯǝssⱯ ʇınɔɹıƆ pǝɔuɐʌpⱯϛ§", @@ -252,6 +253,7 @@ "block.gtceu.hv_brewery": "ɹ§II ʎɹǝʍǝɹᗺ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_canner": "ɹ§II ɹǝuuɐƆ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_centrifuge": "ɹ§II ǝbnɟıɹʇuǝƆ pǝɔuɐʌpⱯ9§", + "block.gtceu.hv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ɥbıH", "block.gtceu.hv_chemical_bath": "ɹ§II ɥʇɐᗺ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_chemical_reactor": "ɹ§II ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_circuit_assembler": "ɹ§II ɹǝןqɯǝssⱯ ʇınɔɹıƆ pǝɔuɐʌpⱯ9§", @@ -332,6 +334,7 @@ "block.gtceu.iv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ ǝʇıןƎƖ§", "block.gtceu.iv_canner": "ɹ§ ɹǝuuɐƆ ǝʇıןƎƖ§", "block.gtceu.iv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ ǝʇıןƎƖ§", + "block.gtceu.iv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ǝuɐsuI", "block.gtceu.iv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇıןƎƖ§", "block.gtceu.iv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇıןƎƖ§", "block.gtceu.iv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇıןƎƖ§", @@ -415,6 +418,7 @@ "block.gtceu.luv_brewery": "ɹ§II ʎɹǝʍǝɹᗺ ǝʇıןƎp§", "block.gtceu.luv_canner": "ɹ§II ɹǝuuɐƆ ǝʇıןƎp§", "block.gtceu.luv_centrifuge": "ɹ§II ǝbnɟıɹʇuǝƆ ǝʇıןƎp§", + "block.gtceu.luv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ snoɹɔıpnꞀ", "block.gtceu.luv_chemical_bath": "ɹ§II ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇıןƎp§", "block.gtceu.luv_chemical_reactor": "ɹ§II ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇıןƎp§", "block.gtceu.luv_circuit_assembler": "ɹ§II ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇıןƎp§", @@ -487,6 +491,7 @@ "block.gtceu.lv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ ɔısɐᗺ", "block.gtceu.lv_canner": "ɹ§ ɹǝuuɐƆ ɔısɐᗺ", "block.gtceu.lv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ ɔısɐᗺ", + "block.gtceu.lv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ʍoꞀ", "block.gtceu.lv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ ɔısɐᗺ", "block.gtceu.lv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ɔısɐᗺ", "block.gtceu.lv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ ɔısɐᗺ", @@ -566,6 +571,7 @@ "block.gtceu.mv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ pǝɔuɐʌpⱯq§", "block.gtceu.mv_canner": "ɹ§ ɹǝuuɐƆ pǝɔuɐʌpⱯq§", "block.gtceu.mv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ pǝɔuɐʌpⱯq§", + "block.gtceu.mv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ɯnıpǝW", "block.gtceu.mv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯq§", "block.gtceu.mv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯq§", "block.gtceu.mv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ pǝɔuɐʌpⱯq§", @@ -707,6 +713,7 @@ "block.gtceu.uhv_battery_buffer_16x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x9Ɩ ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", "block.gtceu.uhv_battery_buffer_4x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ xㄣ ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", "block.gtceu.uhv_battery_buffer_8x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x8 ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", + "block.gtceu.uhv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", "block.gtceu.uhv_energy_input_hatch": "ɥɔʇɐH ʎbɹǝuƎ ΛH∩ㄣ§", "block.gtceu.uhv_energy_input_hatch_16a": "ɥɔʇɐH ʎbɹǝuƎ Ɐ9Ɩ ΛH∩ㄣ§", "block.gtceu.uhv_energy_input_hatch_4a": "ɥɔʇɐH ʎbɹǝuƎ Ɐㄣ ΛH∩ㄣ§", @@ -729,6 +736,7 @@ "block.gtceu.ulv_battery_buffer_16x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x9Ɩ ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", "block.gtceu.ulv_battery_buffer_4x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ xㄣ ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", "block.gtceu.ulv_battery_buffer_8x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x8 ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", + "block.gtceu.ulv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", "block.gtceu.ulv_energy_input_hatch": "ɥɔʇɐH ʎbɹǝuƎ ΛꞀ∩8§", "block.gtceu.ulv_energy_output_hatch": "ɥɔʇɐH oɯɐuʎᗡ ΛꞀ∩8§", "block.gtceu.ulv_input_bus": "snᗺ ʇnduI ΛꞀ∩8§", @@ -756,6 +764,7 @@ "block.gtceu.uv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_canner": "ɹ§ ɹǝuuɐƆ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ ǝʇɐɯıʇן∩Ɛ§", + "block.gtceu.uv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ǝʇɐɯıʇן∩", "block.gtceu.uv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇɐɯıʇן∩Ɛ§", @@ -846,6 +855,7 @@ "block.gtceu.zpm_brewery": "ɹ§III ʎɹǝʍǝɹᗺ ǝʇıןƎɔ§", "block.gtceu.zpm_canner": "ɹ§III ɹǝuuɐƆ ǝʇıןƎɔ§", "block.gtceu.zpm_centrifuge": "ɹ§III ǝbnɟıɹʇuǝƆ ǝʇıןƎɔ§", + "block.gtceu.zpm_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ WԀZ", "block.gtceu.zpm_chemical_bath": "ɹ§III ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇıןƎɔ§", "block.gtceu.zpm_chemical_reactor": "ɹ§III ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇıןƎɔ§", "block.gtceu.zpm_circuit_assembler": "ɹ§III ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇıןƎɔ§", diff --git a/fabric/src/generated/resources/assets/gtceu/lang/en_us.json b/fabric/src/generated/resources/assets/gtceu/lang/en_us.json index 2069ebbf49..98268226b4 100644 --- a/fabric/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/fabric/src/generated/resources/assets/gtceu/lang/en_us.json @@ -150,6 +150,7 @@ "block.gtceu.ev_brewery": "§5Advanced Brewery III§r", "block.gtceu.ev_canner": "§5Advanced Canner III§r", "block.gtceu.ev_centrifuge": "§5Advanced Centrifuge III§r", + "block.gtceu.ev_charger_4x": "Extreme Voltage 4x Turbo Charger", "block.gtceu.ev_chemical_bath": "§5Advanced Chemical Bath III§r", "block.gtceu.ev_chemical_reactor": "§5Advanced Chemical Reactor III§r", "block.gtceu.ev_circuit_assembler": "§5Advanced Circuit Assembler III§r", @@ -252,6 +253,7 @@ "block.gtceu.hv_brewery": "§6Advanced Brewery II§r", "block.gtceu.hv_canner": "§6Advanced Canner II§r", "block.gtceu.hv_centrifuge": "§6Advanced Centrifuge II§r", + "block.gtceu.hv_charger_4x": "High Voltage 4x Turbo Charger", "block.gtceu.hv_chemical_bath": "§6Advanced Chemical Bath II§r", "block.gtceu.hv_chemical_reactor": "§6Advanced Chemical Reactor II§r", "block.gtceu.hv_circuit_assembler": "§6Advanced Circuit Assembler II§r", @@ -332,6 +334,7 @@ "block.gtceu.iv_brewery": "§1Elite Brewery §r", "block.gtceu.iv_canner": "§1Elite Canner §r", "block.gtceu.iv_centrifuge": "§1Elite Centrifuge §r", + "block.gtceu.iv_charger_4x": "Insane Voltage 4x Turbo Charger", "block.gtceu.iv_chemical_bath": "§1Elite Chemical Bath §r", "block.gtceu.iv_chemical_reactor": "§1Elite Chemical Reactor §r", "block.gtceu.iv_circuit_assembler": "§1Elite Circuit Assembler §r", @@ -415,6 +418,7 @@ "block.gtceu.luv_brewery": "§dElite Brewery II§r", "block.gtceu.luv_canner": "§dElite Canner II§r", "block.gtceu.luv_centrifuge": "§dElite Centrifuge II§r", + "block.gtceu.luv_charger_4x": "Ludicrous Voltage 4x Turbo Charger", "block.gtceu.luv_chemical_bath": "§dElite Chemical Bath II§r", "block.gtceu.luv_chemical_reactor": "§dElite Chemical Reactor II§r", "block.gtceu.luv_circuit_assembler": "§dElite Circuit Assembler II§r", @@ -487,6 +491,7 @@ "block.gtceu.lv_brewery": "Basic Brewery §r", "block.gtceu.lv_canner": "Basic Canner §r", "block.gtceu.lv_centrifuge": "Basic Centrifuge §r", + "block.gtceu.lv_charger_4x": "Low Voltage 4x Turbo Charger", "block.gtceu.lv_chemical_bath": "Basic Chemical Bath §r", "block.gtceu.lv_chemical_reactor": "Basic Chemical Reactor §r", "block.gtceu.lv_circuit_assembler": "Basic Circuit Assembler §r", @@ -566,6 +571,7 @@ "block.gtceu.mv_brewery": "§bAdvanced Brewery §r", "block.gtceu.mv_canner": "§bAdvanced Canner §r", "block.gtceu.mv_centrifuge": "§bAdvanced Centrifuge §r", + "block.gtceu.mv_charger_4x": "Medium Voltage 4x Turbo Charger", "block.gtceu.mv_chemical_bath": "§bAdvanced Chemical Bath §r", "block.gtceu.mv_chemical_reactor": "§bAdvanced Chemical Reactor §r", "block.gtceu.mv_circuit_assembler": "§bAdvanced Circuit Assembler §r", @@ -707,6 +713,7 @@ "block.gtceu.uhv_battery_buffer_16x": "Ultra High Voltage 16x Battery Buffer", "block.gtceu.uhv_battery_buffer_4x": "Ultra High Voltage 4x Battery Buffer", "block.gtceu.uhv_battery_buffer_8x": "Ultra High Voltage 8x Battery Buffer", + "block.gtceu.uhv_charger_4x": "Ultra High Voltage 4x Turbo Charger", "block.gtceu.uhv_energy_input_hatch": "§4UHV Energy Hatch", "block.gtceu.uhv_energy_input_hatch_16a": "§4UHV 16A Energy Hatch", "block.gtceu.uhv_energy_input_hatch_4a": "§4UHV 4A Energy Hatch", @@ -729,6 +736,7 @@ "block.gtceu.ulv_battery_buffer_16x": "Ultra Low Voltage 16x Battery Buffer", "block.gtceu.ulv_battery_buffer_4x": "Ultra Low Voltage 4x Battery Buffer", "block.gtceu.ulv_battery_buffer_8x": "Ultra Low Voltage 8x Battery Buffer", + "block.gtceu.ulv_charger_4x": "Ultra Low Voltage 4x Turbo Charger", "block.gtceu.ulv_energy_input_hatch": "§8ULV Energy Hatch", "block.gtceu.ulv_energy_output_hatch": "§8ULV Dynamo Hatch", "block.gtceu.ulv_input_bus": "§8ULV Input Bus", @@ -756,6 +764,7 @@ "block.gtceu.uv_brewery": "§3Ultimate Brewery §r", "block.gtceu.uv_canner": "§3Ultimate Canner §r", "block.gtceu.uv_centrifuge": "§3Ultimate Centrifuge §r", + "block.gtceu.uv_charger_4x": "Ultimate Voltage 4x Turbo Charger", "block.gtceu.uv_chemical_bath": "§3Ultimate Chemical Bath §r", "block.gtceu.uv_chemical_reactor": "§3Ultimate Chemical Reactor §r", "block.gtceu.uv_circuit_assembler": "§3Ultimate Circuit Assembler §r", @@ -846,6 +855,7 @@ "block.gtceu.zpm_brewery": "§cElite Brewery III§r", "block.gtceu.zpm_canner": "§cElite Canner III§r", "block.gtceu.zpm_centrifuge": "§cElite Centrifuge III§r", + "block.gtceu.zpm_charger_4x": "ZPM Voltage 4x Turbo Charger", "block.gtceu.zpm_chemical_bath": "§cElite Chemical Bath III§r", "block.gtceu.zpm_chemical_reactor": "§cElite Chemical Reactor III§r", "block.gtceu.zpm_circuit_assembler": "§cElite Circuit Assembler III§r", diff --git a/fabric/src/main/java/com/gregtechceu/gtceu/api/capability/fabric/GTCapabilityHelperImpl.java b/fabric/src/main/java/com/gregtechceu/gtceu/api/capability/fabric/GTCapabilityHelperImpl.java index d74a7f8f7b..23cfe88365 100644 --- a/fabric/src/main/java/com/gregtechceu/gtceu/api/capability/fabric/GTCapabilityHelperImpl.java +++ b/fabric/src/main/java/com/gregtechceu/gtceu/api/capability/fabric/GTCapabilityHelperImpl.java @@ -54,6 +54,15 @@ public static IElectricItem getElectricItem(ItemStack itemStack) { return GTCapability.CAPABILITY_ELECTRIC_ITEM.find(itemStack, ContainerItemContext.withConstant(itemStack)); } + @Nullable + public static IPlatformEnergyStorage getPlatformEnergyItem(ItemStack itemStack) { + if (GTCEu.isRebornEnergyLoaded()) { + var energyItem = ContainerItemContext.withConstant(itemStack).find(EnergyStorage.ITEM); + return energyItem == null ? null : GTEnergyHelperImpl.toPlatformEnergyStorage(energyItem); + } + return null; + } + @Nullable public static IPlatformEnergyStorage getPlatformEnergy(Level level, BlockPos pos, @Nullable Direction side) { if (GTCEu.isRebornEnergyLoaded()) { diff --git a/forge/src/generated/resources/assets/gtceu/lang/en_ud.json b/forge/src/generated/resources/assets/gtceu/lang/en_ud.json index b4aeda8815..033169048e 100644 --- a/forge/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/forge/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -150,6 +150,7 @@ "block.gtceu.ev_brewery": "ɹ§III ʎɹǝʍǝɹᗺ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_canner": "ɹ§III ɹǝuuɐƆ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_centrifuge": "ɹ§III ǝbnɟıɹʇuǝƆ pǝɔuɐʌpⱯϛ§", + "block.gtceu.ev_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ǝɯǝɹʇxƎ", "block.gtceu.ev_chemical_bath": "ɹ§III ɥʇɐᗺ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_chemical_reactor": "ɹ§III ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯϛ§", "block.gtceu.ev_circuit_assembler": "ɹ§III ɹǝןqɯǝssⱯ ʇınɔɹıƆ pǝɔuɐʌpⱯϛ§", @@ -252,6 +253,7 @@ "block.gtceu.hv_brewery": "ɹ§II ʎɹǝʍǝɹᗺ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_canner": "ɹ§II ɹǝuuɐƆ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_centrifuge": "ɹ§II ǝbnɟıɹʇuǝƆ pǝɔuɐʌpⱯ9§", + "block.gtceu.hv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ɥbıH", "block.gtceu.hv_chemical_bath": "ɹ§II ɥʇɐᗺ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_chemical_reactor": "ɹ§II ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯ9§", "block.gtceu.hv_circuit_assembler": "ɹ§II ɹǝןqɯǝssⱯ ʇınɔɹıƆ pǝɔuɐʌpⱯ9§", @@ -332,6 +334,7 @@ "block.gtceu.iv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ ǝʇıןƎƖ§", "block.gtceu.iv_canner": "ɹ§ ɹǝuuɐƆ ǝʇıןƎƖ§", "block.gtceu.iv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ ǝʇıןƎƖ§", + "block.gtceu.iv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ǝuɐsuI", "block.gtceu.iv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇıןƎƖ§", "block.gtceu.iv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇıןƎƖ§", "block.gtceu.iv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇıןƎƖ§", @@ -415,6 +418,7 @@ "block.gtceu.luv_brewery": "ɹ§II ʎɹǝʍǝɹᗺ ǝʇıןƎp§", "block.gtceu.luv_canner": "ɹ§II ɹǝuuɐƆ ǝʇıןƎp§", "block.gtceu.luv_centrifuge": "ɹ§II ǝbnɟıɹʇuǝƆ ǝʇıןƎp§", + "block.gtceu.luv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ snoɹɔıpnꞀ", "block.gtceu.luv_chemical_bath": "ɹ§II ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇıןƎp§", "block.gtceu.luv_chemical_reactor": "ɹ§II ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇıןƎp§", "block.gtceu.luv_circuit_assembler": "ɹ§II ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇıןƎp§", @@ -487,6 +491,7 @@ "block.gtceu.lv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ ɔısɐᗺ", "block.gtceu.lv_canner": "ɹ§ ɹǝuuɐƆ ɔısɐᗺ", "block.gtceu.lv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ ɔısɐᗺ", + "block.gtceu.lv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ʍoꞀ", "block.gtceu.lv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ ɔısɐᗺ", "block.gtceu.lv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ɔısɐᗺ", "block.gtceu.lv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ ɔısɐᗺ", @@ -566,6 +571,7 @@ "block.gtceu.mv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ pǝɔuɐʌpⱯq§", "block.gtceu.mv_canner": "ɹ§ ɹǝuuɐƆ pǝɔuɐʌpⱯq§", "block.gtceu.mv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ pǝɔuɐʌpⱯq§", + "block.gtceu.mv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ɯnıpǝW", "block.gtceu.mv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯq§", "block.gtceu.mv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ pǝɔuɐʌpⱯq§", "block.gtceu.mv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ pǝɔuɐʌpⱯq§", @@ -707,6 +713,7 @@ "block.gtceu.uhv_battery_buffer_16x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x9Ɩ ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", "block.gtceu.uhv_battery_buffer_4x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ xㄣ ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", "block.gtceu.uhv_battery_buffer_8x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x8 ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", + "block.gtceu.uhv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ɥbıH ɐɹʇן∩", "block.gtceu.uhv_energy_input_hatch": "ɥɔʇɐH ʎbɹǝuƎ ΛH∩ㄣ§", "block.gtceu.uhv_energy_input_hatch_16a": "ɥɔʇɐH ʎbɹǝuƎ Ɐ9Ɩ ΛH∩ㄣ§", "block.gtceu.uhv_energy_input_hatch_4a": "ɥɔʇɐH ʎbɹǝuƎ Ɐㄣ ΛH∩ㄣ§", @@ -729,6 +736,7 @@ "block.gtceu.ulv_battery_buffer_16x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x9Ɩ ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", "block.gtceu.ulv_battery_buffer_4x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ xㄣ ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", "block.gtceu.ulv_battery_buffer_8x": "ɹǝɟɟnᗺ ʎɹǝʇʇɐᗺ x8 ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", + "block.gtceu.ulv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ʍoꞀ ɐɹʇן∩", "block.gtceu.ulv_energy_input_hatch": "ɥɔʇɐH ʎbɹǝuƎ ΛꞀ∩8§", "block.gtceu.ulv_energy_output_hatch": "ɥɔʇɐH oɯɐuʎᗡ ΛꞀ∩8§", "block.gtceu.ulv_input_bus": "snᗺ ʇnduI ΛꞀ∩8§", @@ -756,6 +764,7 @@ "block.gtceu.uv_brewery": "ɹ§ ʎɹǝʍǝɹᗺ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_canner": "ɹ§ ɹǝuuɐƆ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_centrifuge": "ɹ§ ǝbnɟıɹʇuǝƆ ǝʇɐɯıʇן∩Ɛ§", + "block.gtceu.uv_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ ǝʇɐɯıʇן∩", "block.gtceu.uv_chemical_bath": "ɹ§ ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_chemical_reactor": "ɹ§ ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇɐɯıʇן∩Ɛ§", "block.gtceu.uv_circuit_assembler": "ɹ§ ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇɐɯıʇן∩Ɛ§", @@ -846,6 +855,7 @@ "block.gtceu.zpm_brewery": "ɹ§III ʎɹǝʍǝɹᗺ ǝʇıןƎɔ§", "block.gtceu.zpm_canner": "ɹ§III ɹǝuuɐƆ ǝʇıןƎɔ§", "block.gtceu.zpm_centrifuge": "ɹ§III ǝbnɟıɹʇuǝƆ ǝʇıןƎɔ§", + "block.gtceu.zpm_charger_4x": "ɹǝbɹɐɥƆ oqɹn⟘ xㄣ ǝbɐʇןoΛ WԀZ", "block.gtceu.zpm_chemical_bath": "ɹ§III ɥʇɐᗺ ןɐɔıɯǝɥƆ ǝʇıןƎɔ§", "block.gtceu.zpm_chemical_reactor": "ɹ§III ɹoʇɔɐǝᴚ ןɐɔıɯǝɥƆ ǝʇıןƎɔ§", "block.gtceu.zpm_circuit_assembler": "ɹ§III ɹǝןqɯǝssⱯ ʇınɔɹıƆ ǝʇıןƎɔ§", diff --git a/forge/src/generated/resources/assets/gtceu/lang/en_us.json b/forge/src/generated/resources/assets/gtceu/lang/en_us.json index 2069ebbf49..98268226b4 100644 --- a/forge/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/forge/src/generated/resources/assets/gtceu/lang/en_us.json @@ -150,6 +150,7 @@ "block.gtceu.ev_brewery": "§5Advanced Brewery III§r", "block.gtceu.ev_canner": "§5Advanced Canner III§r", "block.gtceu.ev_centrifuge": "§5Advanced Centrifuge III§r", + "block.gtceu.ev_charger_4x": "Extreme Voltage 4x Turbo Charger", "block.gtceu.ev_chemical_bath": "§5Advanced Chemical Bath III§r", "block.gtceu.ev_chemical_reactor": "§5Advanced Chemical Reactor III§r", "block.gtceu.ev_circuit_assembler": "§5Advanced Circuit Assembler III§r", @@ -252,6 +253,7 @@ "block.gtceu.hv_brewery": "§6Advanced Brewery II§r", "block.gtceu.hv_canner": "§6Advanced Canner II§r", "block.gtceu.hv_centrifuge": "§6Advanced Centrifuge II§r", + "block.gtceu.hv_charger_4x": "High Voltage 4x Turbo Charger", "block.gtceu.hv_chemical_bath": "§6Advanced Chemical Bath II§r", "block.gtceu.hv_chemical_reactor": "§6Advanced Chemical Reactor II§r", "block.gtceu.hv_circuit_assembler": "§6Advanced Circuit Assembler II§r", @@ -332,6 +334,7 @@ "block.gtceu.iv_brewery": "§1Elite Brewery §r", "block.gtceu.iv_canner": "§1Elite Canner §r", "block.gtceu.iv_centrifuge": "§1Elite Centrifuge §r", + "block.gtceu.iv_charger_4x": "Insane Voltage 4x Turbo Charger", "block.gtceu.iv_chemical_bath": "§1Elite Chemical Bath §r", "block.gtceu.iv_chemical_reactor": "§1Elite Chemical Reactor §r", "block.gtceu.iv_circuit_assembler": "§1Elite Circuit Assembler §r", @@ -415,6 +418,7 @@ "block.gtceu.luv_brewery": "§dElite Brewery II§r", "block.gtceu.luv_canner": "§dElite Canner II§r", "block.gtceu.luv_centrifuge": "§dElite Centrifuge II§r", + "block.gtceu.luv_charger_4x": "Ludicrous Voltage 4x Turbo Charger", "block.gtceu.luv_chemical_bath": "§dElite Chemical Bath II§r", "block.gtceu.luv_chemical_reactor": "§dElite Chemical Reactor II§r", "block.gtceu.luv_circuit_assembler": "§dElite Circuit Assembler II§r", @@ -487,6 +491,7 @@ "block.gtceu.lv_brewery": "Basic Brewery §r", "block.gtceu.lv_canner": "Basic Canner §r", "block.gtceu.lv_centrifuge": "Basic Centrifuge §r", + "block.gtceu.lv_charger_4x": "Low Voltage 4x Turbo Charger", "block.gtceu.lv_chemical_bath": "Basic Chemical Bath §r", "block.gtceu.lv_chemical_reactor": "Basic Chemical Reactor §r", "block.gtceu.lv_circuit_assembler": "Basic Circuit Assembler §r", @@ -566,6 +571,7 @@ "block.gtceu.mv_brewery": "§bAdvanced Brewery §r", "block.gtceu.mv_canner": "§bAdvanced Canner §r", "block.gtceu.mv_centrifuge": "§bAdvanced Centrifuge §r", + "block.gtceu.mv_charger_4x": "Medium Voltage 4x Turbo Charger", "block.gtceu.mv_chemical_bath": "§bAdvanced Chemical Bath §r", "block.gtceu.mv_chemical_reactor": "§bAdvanced Chemical Reactor §r", "block.gtceu.mv_circuit_assembler": "§bAdvanced Circuit Assembler §r", @@ -707,6 +713,7 @@ "block.gtceu.uhv_battery_buffer_16x": "Ultra High Voltage 16x Battery Buffer", "block.gtceu.uhv_battery_buffer_4x": "Ultra High Voltage 4x Battery Buffer", "block.gtceu.uhv_battery_buffer_8x": "Ultra High Voltage 8x Battery Buffer", + "block.gtceu.uhv_charger_4x": "Ultra High Voltage 4x Turbo Charger", "block.gtceu.uhv_energy_input_hatch": "§4UHV Energy Hatch", "block.gtceu.uhv_energy_input_hatch_16a": "§4UHV 16A Energy Hatch", "block.gtceu.uhv_energy_input_hatch_4a": "§4UHV 4A Energy Hatch", @@ -729,6 +736,7 @@ "block.gtceu.ulv_battery_buffer_16x": "Ultra Low Voltage 16x Battery Buffer", "block.gtceu.ulv_battery_buffer_4x": "Ultra Low Voltage 4x Battery Buffer", "block.gtceu.ulv_battery_buffer_8x": "Ultra Low Voltage 8x Battery Buffer", + "block.gtceu.ulv_charger_4x": "Ultra Low Voltage 4x Turbo Charger", "block.gtceu.ulv_energy_input_hatch": "§8ULV Energy Hatch", "block.gtceu.ulv_energy_output_hatch": "§8ULV Dynamo Hatch", "block.gtceu.ulv_input_bus": "§8ULV Input Bus", @@ -756,6 +764,7 @@ "block.gtceu.uv_brewery": "§3Ultimate Brewery §r", "block.gtceu.uv_canner": "§3Ultimate Canner §r", "block.gtceu.uv_centrifuge": "§3Ultimate Centrifuge §r", + "block.gtceu.uv_charger_4x": "Ultimate Voltage 4x Turbo Charger", "block.gtceu.uv_chemical_bath": "§3Ultimate Chemical Bath §r", "block.gtceu.uv_chemical_reactor": "§3Ultimate Chemical Reactor §r", "block.gtceu.uv_circuit_assembler": "§3Ultimate Circuit Assembler §r", @@ -846,6 +855,7 @@ "block.gtceu.zpm_brewery": "§cElite Brewery III§r", "block.gtceu.zpm_canner": "§cElite Canner III§r", "block.gtceu.zpm_centrifuge": "§cElite Centrifuge III§r", + "block.gtceu.zpm_charger_4x": "ZPM Voltage 4x Turbo Charger", "block.gtceu.zpm_chemical_bath": "§cElite Chemical Bath III§r", "block.gtceu.zpm_chemical_reactor": "§cElite Chemical Reactor III§r", "block.gtceu.zpm_circuit_assembler": "§cElite Circuit Assembler III§r", diff --git a/forge/src/main/java/com/gregtechceu/gtceu/api/capability/forge/GTCapabilityHelperImpl.java b/forge/src/main/java/com/gregtechceu/gtceu/api/capability/forge/GTCapabilityHelperImpl.java index 62185849e8..31c05c0ce5 100644 --- a/forge/src/main/java/com/gregtechceu/gtceu/api/capability/forge/GTCapabilityHelperImpl.java +++ b/forge/src/main/java/com/gregtechceu/gtceu/api/capability/forge/GTCapabilityHelperImpl.java @@ -88,6 +88,12 @@ public static IElectricItem getElectricItem(ItemStack itemStack) { return itemStack.getCapability(GTCapability.CAPABILITY_ELECTRIC_ITEM).resolve().orElse(null); } + @Nullable + public static IPlatformEnergyStorage getPlatformEnergyItem(ItemStack itemStack) { + IEnergyStorage energyItemStorage = itemStack.getCapability(ForgeCapabilities.ENERGY).resolve().orElse(null); + return energyItemStorage == null ? null : GTEnergyHelperImpl.toPlatformEnergyStorage(energyItemStorage); + } + @SuppressWarnings({"DataFlowIssue", "ConstantValue"}) @Nullable public static IPlatformEnergyStorage getPlatformEnergy(Level level, BlockPos pos, @Nullable Direction side) {