OC: Energy Meter
OC: Energy Meter is a two-block-tall electricity meter for Forge Energy (FE). Put it between a power source and a consumer, and its LCD shows how much energy flows through it right now and how much has gone through in total.
With OpenComputers: Rebooted installed, computers can read the meter too, so you can build power monitors, logs and in-game billing.
Requirements
- Minecraft 1.21.1
- NeoForge 21.1.266 or newer
- Java 21
- OpenComputers: Rebooted 1.9.4-5 or newer (optional)
Features
- Live LCD with the flow in FE per tick and the lifetime total
- GUI with the lifetime total, a resettable session counter and the buffer
- Customer account name field in the GUI, readable from computers for in-game billing
- Only the owner or a server operator can open the GUI or dismantle the meter
- Cannot be mined, blown up or moved by pistons; dismantle it with the Meter Wrench or a Create Wrench
- Counters are saved with the world
- Works with any mod that uses Forge Energy, including Create: Crafts & Additions
How to connect
Looking at the LCD, connect the source to the blue port on the left and the consumer to the orange port on the right. The ports are on the upper half.
OpenComputers
Connect an Adapter to the lower half and use the energy_meter component:
| Method | Returns |
|---|---|
getRate() |
FE per tick in the last completed tick |
getTotal() |
Lifetime FE (string) |
getSession() |
FE since the last reset (string) |
getBuffer() |
Buffered FE and capacity |
getOwner() |
Name of the player who placed the meter |
getCustomer() |
Customer account name set in the GUI |
resetSession() |
Resets the session counter (can be disabled in the config) |
local meter = require("component").energy_meter
print(meter.getCustomer() .. ": " .. meter.getRate() .. " FE/t, total " .. meter.getTotal() .. " FE")
getRate() is in FE per tick. Only the owner or an operator can change the
customer, in the GUI; computers can only read it.
Recipes
| Item | Recipe |
|---|---|
| Energy Meter | 5 gold ingots, 1 glass pane, 2 copper ingots, 1 redstone comparator |
| Meter Wrench | 3 iron ingots, 2 sticks |
For pack makers
- Server and client both need the mod.
- OpenComputers: Rebooted is optional; without it the meter works on its own.
allowOcResetinconfig/ocem-common.toml(defaulttrue) controls whether computers can reset the session counter.
License
MIT.