Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Quantum Storage Controller Network #1963

Open
wants to merge 164 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
95a766a
fix count of `virtualItemStack` being sent on packets
ghzdude Nov 2, 2023
6983871
first working controller model
serenibyss Dec 15, 2022
60964b7
add javadoc
ghzdude Jul 11, 2023
89bf7ce
fix quantum chest
ghzdude Jul 11, 2023
4cfc876
use `onPlacement()`
ghzdude Jul 11, 2023
08978c1
render quantum storage controller
ghzdude Jul 11, 2023
a0af3b7
use `onRemoval()`
ghzdude Jul 11, 2023
24200fd
small changes
ghzdude Jul 11, 2023
3ddf144
reposition icon
ghzdude Jul 12, 2023
18f2090
remove unneeded if check
ghzdude Jul 12, 2023
8afba50
add check for air block
ghzdude Jul 12, 2023
f0adc5f
more comments on logic
ghzdude Jul 12, 2023
c02dca3
prevent different items from entering qchest
ghzdude Jul 12, 2023
464d3fb
small qtank ui changes
ghzdude Jul 12, 2023
d884308
forgor space
ghzdude Jul 12, 2023
7be4589
small ui fixes
ghzdude Jul 12, 2023
54d62eb
add controller check
ghzdude Jul 12, 2023
4311a12
add lang for q storage controller
ghzdude Jul 14, 2023
749706c
add controller pos to qtank
ghzdude Jul 14, 2023
10c0a7b
return combined inventory for qchest
ghzdude Jul 14, 2023
009c25c
return handler proxy instead
ghzdude Jul 14, 2023
f87e79e
improve insertion logic
ghzdude Jul 14, 2023
b3f6081
use item inventory to insert
ghzdude Jul 14, 2023
b58cf48
return the item inventory
ghzdude Jul 14, 2023
d9ca38b
remove loop in insert item
ghzdude Jul 14, 2023
9f6d3f7
remove comment and logger
ghzdude Jul 14, 2023
43e331d
use `onRemoval()`
ghzdude Jul 14, 2023
6819748
fix item handling
ghzdude Jul 14, 2023
2c95cfb
implement primitive chest
ghzdude Jul 14, 2023
c286bb2
register prim chest better
ghzdude Jul 14, 2023
f4dd7ea
fix registering another qchest
ghzdude Jul 14, 2023
4b7dcbe
implement ulv super tank
ghzdude Jul 14, 2023
70aa603
fix qtank registration
ghzdude Jul 14, 2023
0d3f2b3
add recipe for quantum storage controller
ghzdude Jul 14, 2023
5fd5fc9
forgor hull
ghzdude Jul 14, 2023
3cf2922
forgor stackform for hull
ghzdude Jul 14, 2023
f0a6f52
more stackforms
ghzdude Jul 14, 2023
bd32e38
go back to handler proxy
ghzdude Jul 14, 2023
e58943a
delete unneeded if check
ghzdude Jul 14, 2023
57b811d
remove slot checks
ghzdude Jul 16, 2023
3313ff8
small capability improvements
ghzdude Jul 16, 2023
b52865f
methods
ghzdude Jul 16, 2023
e409d6a
rework insertion/extraction logic (again)
ghzdude Jul 16, 2023
145f5f4
invalidate handler instead of rebuild
ghzdude Jul 16, 2023
2e2c370
render particles for controller
ghzdude Jul 16, 2023
1745a17
make creative chest/tank work with storage controller
ghzdude Jul 17, 2023
239311c
make chest output overlay render when not connected and active
ghzdude Jul 17, 2023
2845a88
improve tile checking
ghzdude Jul 17, 2023
db7d9fe
try get output stack always
ghzdude Jul 17, 2023
ce55e2b
improve ulv chest/tank registration (2)
ghzdude Jul 21, 2023
330fd14
implement storage extender
ghzdude Jul 22, 2023
1513682
remove unneeded inner class
ghzdude Jul 22, 2023
6fe296a
rename "Extender" to "Proxy"
ghzdude Jul 31, 2023
b30e8ea
add lang
ghzdude Jul 31, 2023
a6bb6a0
improve proxy and extender
ghzdude Jul 31, 2023
a5a92a6
add recipes for quantum extender and proxy
ghzdude Aug 5, 2023
1464701
fix proxy recipe
ghzdude Aug 5, 2023
54371ce
move chest tooltip to super
ghzdude Aug 5, 2023
2cfeedd
remove comment
ghzdude Jul 14, 2023
87f4311
re-add datacodes
ghzdude Nov 17, 2023
3a8fd76
use itemhadlerlist for the combined item handlers
ghzdude Nov 17, 2023
6be616a
use combined inventory for type value
ghzdude Nov 17, 2023
d615378
remove debug logger calls
ghzdude Nov 19, 2023
0d6b73b
add new textures for quantum storage controller, extender, and proxy
ghzdude Nov 20, 2023
5c13254
update render when no longer connected
ghzdude Nov 21, 2023
932f1a7
implement emissive textures
ghzdude Nov 21, 2023
d26c506
fix emissive overlap
ghzdude Nov 21, 2023
2b5a062
shift registration by 1
ghzdude Nov 23, 2023
6269872
yeet javax
ghzdude Nov 27, 2023
2b5f8b3
spotless
ghzdude Nov 27, 2023
81b9010
i forgor 💀
ghzdude Nov 27, 2023
2aae45b
add proper front texture for controller
ghzdude Nov 27, 2023
e9dfe87
yeet commented code
ghzdude Nov 27, 2023
184ec03
use neighbor cache
ghzdude Dec 7, 2023
a979b84
forgor
ghzdude Dec 7, 2023
87a9191
fix storages not being properly disconnected when controller is removed
ghzdude Dec 7, 2023
77ccc9c
rename `NONE` to `PROXY`
ghzdude Dec 7, 2023
898dc07
move old instances into if check
ghzdude Dec 7, 2023
b458e41
use enhanced instanceof
ghzdude Dec 7, 2023
2afacdc
nvm, not adding extenders is bad
ghzdude Dec 7, 2023
0e1dfb0
spotless
ghzdude Dec 7, 2023
fded7e0
move `setConnected()` back
ghzdude Dec 8, 2023
5c8705a
add/remove todos
ghzdude Dec 8, 2023
ef5cdb2
clear weakref on data sync
ghzdude Dec 8, 2023
8c41fb5
fix rebase
ghzdude Dec 20, 2023
a4b7a9a
fix npe from `getController()` with world check
ghzdude Dec 21, 2023
cae9beb
add quantum energy acceptor
ghzdude Dec 21, 2023
af8b13b
add energy container to quantum storage controller
ghzdude Dec 21, 2023
3369eb6
sboblss
ghzdude Dec 21, 2023
68b98a9
fix energy container not working right on rejoin
ghzdude Dec 21, 2023
823df1d
consume energy every 10 ticks
ghzdude Dec 21, 2023
e9cbe2b
sptlss
ghzdude Dec 21, 2023
d123da0
move connection widget construction to MTEQuantumStorage
ghzdude Dec 22, 2023
9428943
casually refactor textures
ghzdude Dec 22, 2023
2a887c6
add quantum energy acceptor textures
ghzdude Dec 22, 2023
fdbedc3
allow qcontroller and energy acceptor to be rotated on all sides
ghzdude Dec 22, 2023
5fec23a
sbobless
ghzdude Dec 22, 2023
601cd93
lmao :floppaxd:
ghzdude Dec 22, 2023
d610d23
null check
ghzdude Dec 22, 2023
a5c9fc8
simplify syncing
ghzdude Dec 22, 2023
76f2b6a
change energy scaling slightly
ghzdude Dec 22, 2023
2da97fd
recalculate usage on load
ghzdude Dec 22, 2023
5f8af5e
color energy in overlay
ghzdude Dec 22, 2023
f3c61dd
do color multiplier to match qtanks/qchest
ghzdude Dec 22, 2023
dadfb21
make energy calculation more readable
ghzdude Dec 22, 2023
99c8767
schedule render update on controller removal/update
ghzdude Dec 22, 2023
9e19362
spotless
ghzdude Dec 22, 2023
b883757
start work on indicator overlay
ghzdude Dec 22, 2023
7ace275
use pattern matching
ghzdude Jan 29, 2024
95bd5fd
add indicator overlay
ghzdude Jan 29, 2024
650cb3e
add provider for TOP
ghzdude Jan 29, 2024
09b01bb
add lang for energy acceptor
ghzdude Jan 29, 2024
c85f64e
remove ULV super chests/tanks
ghzdude Jan 29, 2024
cf49395
spotless
ghzdude Jan 29, 2024
8c00a80
add recipe for energy acceptor
ghzdude Jan 30, 2024
86636be
allow controller to accept power as well
ghzdude Jan 30, 2024
4bc9ef3
hecc
ghzdude Jan 30, 2024
66c95ef
todo
ghzdude Mar 3, 2024
534a4a9
add block highlighting for controller
ghzdude Mar 4, 2024
1cbff6c
update ids
ghzdude Mar 18, 2024
c25c1ff
replace energy acceptor with tiered energy hatches
ghzdude Jul 24, 2024
3dc2b6a
move energy container collection to `calculateEnergyUsage()`
ghzdude Jul 24, 2024
d21adf2
attempt to cap extraction
ghzdude Jul 24, 2024
c657926
misc fixes
ghzdude Jul 24, 2024
fd24158
spobless
ghzdude Jul 24, 2024
50870b9
make creative qchest only extract if active
ghzdude Jul 25, 2024
1a440ce
remove unused class
ghzdude Jul 25, 2024
73f4e00
strip IItemHandler and IFluidHandler from IDualHandler
ghzdude Jul 25, 2024
3c0e621
add lang
ghzdude Jul 26, 2024
397f0a9
anticipate fix for ae2uel
ghzdude Jul 26, 2024
2173ca8
fix rebase + use casing texture when connected
ghzdude Sep 12, 2024
41ea426
simplify + fix energy hatch init sync connected
ghzdude Sep 12, 2024
587a484
improve quantum casing art
ghzdude Sep 13, 2024
1824424
fix active side rendering and add annotations
ghzdude Sep 14, 2024
19223d8
clear storage
ghzdude Sep 14, 2024
52993e0
add comment on interface extension
ghzdude Sep 15, 2024
380c232
add tooltip and lang for not connected
ghzdude Sep 15, 2024
2253cbd
add overload method
ghzdude Sep 15, 2024
8b6ce5c
simplify locate controller
ghzdude Sep 15, 2024
288eeb2
one tab too many
ghzdude Sep 15, 2024
5867027
make qcontroller like list with add/remove methods
ghzdude Sep 15, 2024
53ca96e
use ArrayDeque instead of LinkedList
ghzdude Sep 15, 2024
47117bb
javadocs + misc
ghzdude Sep 15, 2024
a4007a0
use getNeighbor to improve searching
ghzdude Sep 16, 2024
f9be6d6
no need for instanceof check
ghzdude Sep 16, 2024
6648e81
only rebuild handler if item/fluid storage is changed
ghzdude Sep 16, 2024
d2c63d6
cleanup
ghzdude Sep 16, 2024
336258e
back to rebuilding each time :pensive:
ghzdude Sep 18, 2024
b88f138
consolidate tryFindNetwork
ghzdude Sep 18, 2024
b4f3380
misc + spotless
ghzdude Sep 18, 2024
e80f3c1
remove unused methods
ghzdude Sep 29, 2024
12c137a
use proper air check method
ghzdude Sep 29, 2024
7a31247
add quantum network info to scanner
ghzdude Sep 30, 2024
ec578bd
do eu/t and formatting
ghzdude Sep 30, 2024
ee4cf1d
add info to TOP
ghzdude Sep 30, 2024
3381ac5
notify update to proxy/controller when creative storage is active
ghzdude Sep 30, 2024
67b44ae
notify when controller is broken or loses power
ghzdude Sep 30, 2024
33e62a2
update render when isPowered changes
ghzdude Oct 1, 2024
c41fd99
rework to not send list
ghzdude Oct 1, 2024
b4d230b
only show status for item/fluid types
ghzdude Oct 1, 2024
dc7173a
fix creative handlers not respecting limits
ghzdude Oct 1, 2024
d1247e1
simplify set stack method
ghzdude Oct 1, 2024
0d77b59
improve/add lang for TOP and tooltip
ghzdude Oct 9, 2024
cb8deac
improve bounds calculation
ghzdude Oct 9, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ public static int assignId() {
public static final int UPDATE_ITEM_COUNT = assignId();
public static final int UPDATE_FLUID_AMOUNT = assignId();

// Quantum Storage Controller
public static final int UPDATE_CONTROLLER_POS = assignId();
public static final int REMOVE_CONTROLLER = assignId();
public static final int LOCATE_CONTROLLER = assignId();

// Detector Covers
public static final int UPDATE_INVERTED = assignId();

Expand Down
14 changes: 14 additions & 0 deletions src/main/java/gregtech/api/capability/IDualHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package gregtech.api.capability;

import net.minecraftforge.items.IItemHandler;

public interface IDualHandler {

boolean hasFluidTanks();

boolean hasItemHandlers();

IMultipleTankHandler getFluidTanks();

IItemHandler getItemHandlers();
}
34 changes: 34 additions & 0 deletions src/main/java/gregtech/api/capability/IQuantumController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package gregtech.api.capability;

import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.capabilities.ICapabilityProvider;

// ICapabilityProvider is needed because getCapability is called in the quantum proxy against this interface
public interface IQuantumController extends ICapabilityProvider {
ghzdude marked this conversation as resolved.
Show resolved Hide resolved

/**
* Constructs the network upon placement and when storages are added/removed
* <br />
*/
void rebuildNetwork();

/**
* Return whether this storage block can connect. Can be used to implement a maximum distance from controller for
* example.
*/
boolean canConnect(IQuantumStorage<?> storage);

BlockPos getPos();

IDualHandler getHandler();

boolean isPowered();

long getEnergyUsage();

int getCount(IQuantumStorage.Type type);

long getTypeEnergy(IQuantumStorage<?> storage);

void updateHandler();
}
77 changes: 77 additions & 0 deletions src/main/java/gregtech/api/capability/IQuantumStorage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package gregtech.api.capability;

import gregtech.api.cover.CoverableView;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity;

import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;

import org.jetbrains.annotations.Nullable;

public interface IQuantumStorage<T> extends CoverableView {

Type getType();

void setConnected(IQuantumController controller);

void setDisconnected();

BlockPos getControllerPos();

@Nullable
IQuantumController getQuantumController();

BlockPos getPos();

default boolean isConnected() {
// use controllerPos here because it is synced
// on both sides, where controller is not
return getControllerPos() != null;
}

default void tryFindNetwork() {
for (EnumFacing facing : EnumFacing.VALUES) {
var offset = getPos().offset(facing);
var state = getWorld().getBlockState(offset);
if (state.getBlock().isAir(state, getWorld(), offset)) continue;
MetaTileEntity mte;
if (getNeighbor(facing) instanceof IGregTechTileEntity gtte) {
mte = gtte.getMetaTileEntity();
} else {
continue;
}

IQuantumController candidate = null;
if (mte instanceof IQuantumStorage<?>storage) {
if (storage.isConnected()) {
IQuantumController controller = storage.getQuantumController();
if (controller != null && controller.canConnect(this)) {
candidate = controller;
}
}
} else if (mte instanceof IQuantumController quantumController) {
if (quantumController.canConnect(this)) {
candidate = quantumController;
}
}
if (candidate != null) {
candidate.rebuildNetwork();
return;
}
}
}

T getTypeValue();

enum Type {

ITEM,
FLUID,
EXTENDER,
PROXY,
ENERGY;

public static final Type[] VALUES = values();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;

import com.google.common.base.Preconditions;
import org.lwjgl.input.Mouse;

import java.util.Arrays;
Expand Down Expand Up @@ -64,7 +63,6 @@ public ClickButtonWidget setDisplayFunction(Supplier<Boolean> displayFunction) {
}

public ClickButtonWidget setTooltipText(String tooltipText, Object... args) {
Preconditions.checkNotNull(tooltipText, "tooltipText");
this.tooltipText = tooltipText;
this.tooltipArgs = args;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,33 @@
public class BlockPosHighlightRenderer {

private static BlockPos posHighLight;
private static long hlEndTime;
private static long duration;
private static long offset;
private static long start;

public static void renderBlockBoxHighLight(BlockPos blockpos, long durTimeMillis) {
posHighLight = blockpos;
hlEndTime = System.currentTimeMillis() + durTimeMillis;
duration = durTimeMillis;
offset = 1500;
start = System.currentTimeMillis();
}

public static void renderBlockBoxHighLight(BlockPos blockpos, long durTimeMillis, long offsetTimeMillis) {
posHighLight = blockpos;
duration = durTimeMillis;
offset = offsetTimeMillis;
start = System.currentTimeMillis();
}

public static void renderWorldLastEvent(RenderWorldLastEvent evt) {
if (posHighLight != null) {
long time = System.currentTimeMillis();
if (time > hlEndTime) {
if (time > duration + start) {
posHighLight = null;
hlEndTime = 0;
duration = 0;
return;
}
if (((time / 500) & 1) == 0) {
if (time % offset >= offset / 2) {
return;
}
EntityPlayerSP p = Minecraft.getMinecraft().player;
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/gregtech/client/renderer/texture/Textures.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,32 @@ public class Textures {
"casings/pipe/machine_casing_grate");
public static final SimpleOverlayRenderer HIGH_POWER_CASING = new SimpleOverlayRenderer(
"casings/computer/high_power_casing");
public static final SimpleOverlayRenderer QUANTUM_CASING = new SimpleOverlayRenderer(
"casings/quantum/quantum_casing");
public static final SimpleOverlayRenderer QUANTUM_CONTROLLER_FRONT_INACTIVE = new SimpleOverlayRenderer(
"casings/quantum/controller_front_inactive");
public static final SimpleOverlayRenderer QUANTUM_CONTROLLER_FRONT_ACTIVE = new SimpleOverlayRenderer(
"casings/quantum/controller_front_active");
public static final SimpleOverlayRenderer QUANTUM_CONTROLLER_ACTIVE = new SimpleOverlayRenderer(
"casings/quantum/controller_active");
public static final SimpleOverlayRenderer QUANTUM_CONTROLLER_INACTIVE = new SimpleOverlayRenderer(
"casings/quantum/controller_inactive");
public static final SimpleOverlayRenderer QUANTUM_PROXY_INACTIVE = new SimpleOverlayRenderer(
"casings/quantum/proxy_inactive");
public static final SimpleOverlayRenderer QUANTUM_PROXY_ACTIVE = new SimpleOverlayRenderer(
"casings/quantum/proxy_active");
public static final SimpleOverlayRenderer QUANTUM_EXTENDER = new SimpleOverlayRenderer("casings/quantum/extender");
public static final SimpleOverlayRenderer QUANTUM_EXTENDER_ACTIVE = new SimpleOverlayRenderer(
"casings/quantum/extender_active");

public static final SimpleOverlayRenderer QUANTUM_INDICATOR = new SimpleOverlayRenderer(
"casings/quantum/quantum_indicator_disconnected");

public static final SimpleOverlayRenderer QUANTUM_INDICATOR_CONNECTED = new SimpleOverlayRenderer(
"casings/quantum/quantum_indicator_connected");

public static final SimpleOverlayRenderer QUANTUM_INDICATOR_POWERED = new SimpleOverlayRenderer(
"casings/quantum/quantum_indicator_powered");

// Simple Sided Cube Renderers
public static final SimpleSidedCubeRenderer STEAM_CASING_BRONZE = new SimpleSidedCubeRenderer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import gregtech.api.gui.resources.TextTexture;
import gregtech.api.metatileentity.ITieredMetaTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.util.TextFormattingUtil;
import gregtech.client.renderer.texture.Textures;
import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer.RenderSide;
import gregtech.client.utils.RenderUtil;
import gregtech.common.ConfigHolder;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumChest;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumStorage;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
Expand Down Expand Up @@ -69,10 +69,10 @@ public void registerIcons(TextureMap textureMap) {
.registerSprite(new ResourceLocation("gregtech:blocks/overlay/machine/overlay_screen_glass"));
}

public <T extends MetaTileEntity & ITieredMetaTileEntity> void renderMachine(CCRenderState renderState,
Matrix4 translation,
IVertexOperation[] pipeline,
T mte) {
public <T extends MetaTileEntityQuantumStorage<?> & ITieredMetaTileEntity> void renderMachine(CCRenderState renderState,
Matrix4 translation,
IVertexOperation[] pipeline,
T mte) {
EnumFacing frontFacing = mte.getFrontFacing();
int tier = mte.getTier();
Textures.renderFace(renderState, translation, pipeline, frontFacing, glassBox, glassTexture,
Expand All @@ -81,6 +81,10 @@ public <T extends MetaTileEntity & ITieredMetaTileEntity> void renderMachine(CCR
TextureAtlasSprite hullTexture = Textures.VOLTAGE_CASINGS[tier]
.getSpriteOnSide(RenderSide.bySide(EnumFacing.NORTH));

if (mte.isConnected()) {
hullTexture = Textures.QUANTUM_CASING.getParticleSprite();
}

for (var facing : boxFacingMap.keySet()) {
// do not render the box at the front face when "facing" is "frontFacing"
if (facing == frontFacing) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import gregtech.api.capability.GregtechTileCapabilities;
import gregtech.api.capability.IElectricItem;
import gregtech.api.capability.IEnergyContainer;
import gregtech.api.capability.IQuantumController;
import gregtech.api.capability.IQuantumStorage;
import gregtech.api.capability.IWorkable;
import gregtech.api.capability.impl.FluidTankList;
import gregtech.api.items.metaitem.stats.IItemBehaviour;
Expand Down Expand Up @@ -284,6 +286,30 @@ else if (metaTileEntity instanceof IDataInfoProvider)
list.addAll(provider.getDataInfo());
}

// quantum storage
if (metaTileEntity instanceof IQuantumController quantumController) {
list.add(new TextComponentTranslation("behavior.tricorder.divider"));
long eut = quantumController.getEnergyUsage(); // eu per 10 ticks
int tier = GTUtility.getTierByVoltage(eut / 10);
list.add(new TextComponentTranslation("behavior.tricorder.quantum_controller.usage",
TextFormatting.RED + String.format("%.1f", eut / 10d) + TextFormatting.RESET,
GTValues.VNF[tier]));
var handler = quantumController.getHandler();
list.add(new TextComponentTranslation("behavior.tricorder.quantum_controller.connected_items",
TextFormatting.RED.toString() + handler.getItemHandlers().getSlots()));
list.add(new TextComponentTranslation("behavior.tricorder.quantum_controller.connected_fluids",
TextFormatting.RED.toString() + handler.getFluidTanks().getTanks()));
} else if (metaTileEntity instanceof IQuantumStorage<?>storage) {
var qcontrollor = storage.getQuantumController();
if (qcontrollor != null) {
long eut = qcontrollor.getTypeEnergy(storage);

list.add(new TextComponentTranslation("behavior.tricorder.divider"));
list.add(new TextComponentTranslation("behavior.tricorder.quantum_storage.usage",
TextFormatting.RED + String.format("%.1f", eut / 10d)));
}
}

} else if (tileEntity instanceof IPipeTile) {
// pipes need special name handling
IPipeTile<?, ?> pipeTile = (IPipeTile<?, ?>) tileEntity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@
import gregtech.common.metatileentities.storage.MetaTileEntityCreativeTank;
import gregtech.common.metatileentities.storage.MetaTileEntityDrum;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumChest;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumExtender;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumProxy;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumStorageController;
import gregtech.common.metatileentities.storage.MetaTileEntityQuantumTank;
import gregtech.common.metatileentities.storage.MetaTileEntityWorkbench;
import gregtech.common.pipelike.fluidpipe.longdistance.MetaTileEntityLDFluidEndpoint;
Expand Down Expand Up @@ -222,6 +225,9 @@ public class MetaTileEntities {
public static final MetaTileEntityRotorHolder[] ROTOR_HOLDER = new MetaTileEntityRotorHolder[6]; // HV, EV, IV, LuV, ZPM, UV
public static final MetaTileEntityMufflerHatch[] MUFFLER_HATCH = new MetaTileEntityMufflerHatch[GTValues.UV + 1]; // LV-UV
public static final MetaTileEntityFusionReactor[] FUSION_REACTOR = new MetaTileEntityFusionReactor[3];
public static MetaTileEntityQuantumStorageController QUANTUM_STORAGE_CONTROLLER;
public static MetaTileEntityQuantumProxy QUANTUM_STORAGE_PROXY;
public static MetaTileEntityQuantumExtender QUANTUM_STORAGE_EXTENDER;
public static final MetaTileEntityQuantumChest[] QUANTUM_CHEST = new MetaTileEntityQuantumChest[10];
public static final MetaTileEntityQuantumTank[] QUANTUM_TANK = new MetaTileEntityQuantumTank[10];
public static final MetaTileEntityBuffer[] BUFFER = new MetaTileEntityBuffer[3];
Expand Down Expand Up @@ -977,6 +983,14 @@ public static void init() {
PUMP[2] = registerMetaTileEntity(1532, new MetaTileEntityPump(gregtechId("pump.hv"), 3));
PUMP[3] = registerMetaTileEntity(1533, new MetaTileEntityPump(gregtechId("pump.ev"), 4));

// Quantum Storage Network 1757 - 1759
QUANTUM_STORAGE_CONTROLLER = registerMetaTileEntity(1757,
new MetaTileEntityQuantumStorageController(gregtechId("quantum_storage_controller")));
QUANTUM_STORAGE_PROXY = registerMetaTileEntity(1758,
new MetaTileEntityQuantumProxy(gregtechId("quantum_storage_proxy")));
QUANTUM_STORAGE_EXTENDER = registerMetaTileEntity(1759,
new MetaTileEntityQuantumExtender(gregtechId("quantum_storage_extender")));

// Super / Quantum Chests, IDs 1560-1574
for (int i = 0; i < 5; i++) {
String voltageName = GTValues.VN[i + 1].toLowerCase();
Expand Down
Loading