Skip to content

Commit 3b15ee3

Browse files
committed
em- add energymeter wiki
1 parent 5488425 commit 3b15ee3

11 files changed

Lines changed: 247 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { defineConfig } from "../../../main/defineAlmostWiki"
2+
3+
export default defineConfig({
4+
srcDir: "./docs",
5+
title: "Energy Meter",
6+
base: "/energymeter/",
7+
themeConfig: {
8+
sidebar: [
9+
{
10+
text: "Introduction",
11+
items: [
12+
{ text: "Getting Started", link: "/" },
13+
{ text: "What's New", link: "/whats_new" },
14+
],
15+
},
16+
{
17+
text: "Usage",
18+
items: [
19+
{ text: "Basics", link: "/basics" },
20+
{ text: "Interface", link: "/interface" },
21+
],
22+
},
23+
],
24+
},
25+
})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// https://vitepress.dev/guide/custom-theme
2+
import Theme from "../../../../main/theme"
3+
export default Theme

wikis/energymeter/docs/basics.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Basics
2+
3+
Welcome to the **Energy Meter** mod!
4+
5+
![](/../img/preview.png)
6+
7+
<img src="/../img/logo.png" width="300" style="float:right; margin-left:10px;" />
8+
9+
Energy Meter is a small content mod that adds a block called the Energy Meter which allows you to measure energy flow rates.
10+
The block functions as a cable: incoming requests are simply forwarded to the outputs. All values of these requests are stored and used at
11+
a configurable interval to calculate the flow rate.
12+
13+
In addition to a comprehensive user interface, the block also features a digital display on its front. The current rate can be checked
14+
there at any time. The display can be rotated in any direction, including upwards and downwards. Since the front of the Energy Meter is
15+
used for the display, only the remaining five sides can be configured as input or output.
16+
17+
To review the rates of previous intervals, the Energy Meter’s user interface also includes a graph view. This shows the measurements of
18+
the last 10 intervals and can also be paused. The interface provides many additional configuration options. Besides different
19+
measurement methods, both the measurement interval and the calculation mode can be adjusted.<br/>
20+
You can find more details on the [Interface](interface.md) page.

wikis/energymeter/docs/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Getting Started
2+
3+
> [!WARNING] NOTE
4+
> This wiki is for Energy Meter for Minecraft 1.21.1 and above. For previous versions, please refer to the [old wiki](https://github.com/AlmostReliable/energymeter/wiki).
5+
6+
This mod adds a simple block you can use for measuring energy transfer rates. It has a screen always displaying the current rate to keep you up to date.
7+
8+
Useful links:
9+
10+
- [CurseForge](https://www.curseforge.com/minecraft/mc-mods/energymeter)
11+
- [Modrinth](https://modrinth.com/mod/energymeter)
12+
- [GitHub](https://github.com/almostreliable/energymeter)
13+
- [Discord](https://discord.com/invite/ThFnwZCyYY)
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Interface
2+
3+
This page explains all settings that can be configured for the Energy Meter. To access the settings, place the block and interact with
4+
it to open its user interface. The interface is divided into two sections. The left panel is the global panel and is always visible.
5+
The right panel depends on the currently selected tab in the top tab bar.
6+
7+
## Global Panel
8+
9+
<img src="/../img/global_panel.png" width="300" style="float:right; margin-left:10px;" />
10+
11+
The global panel is located on the left side of the interface. It remains visible even when switching tabs. This panel contains the
12+
current measurement values and the status. It also includes the I/O grid and the option to reset the total amount of measured energy.
13+
14+
### Measurements
15+
16+
The measurements include the current flow rate and the total amount of measured energy. The total value can be reset using the button
17+
below the I/O grid.
18+
19+
The values for the current measurements update once per configured interval. The only exception is reaching the [tolerance](#tolerance).
20+
See that section for more information.
21+
22+
### Status
23+
24+
The status updates whenever a setting or state changes that could affect it. This includes the current flow rate, changes to neighboring
25+
blocks, and changes to input and output configurations.
26+
27+
The status **Disconnected** indicates that the required settings for the currently selected mode have not been configured. In most cases,
28+
this means that an input or output is missing. **Idle** means that all settings are configured correctly and the Energy Meter is waiting to
29+
transfer energy. The final status depends on the selected [transfer mode](#transferring) and indicates that the Energy Meter is currently
30+
processing requests and operating correctly.
31+
32+
### I/O Grid
33+
34+
This section is used to configure the sides of the block. Each side can be configured as an input, an output, or disabled for energy
35+
requests. The front side cannot be configured because it is reserved for displaying the flow rate on the block. The sides can be configured
36+
using left-click or right-click. It is also possible to reset a single side instantly or reset all sides at once. More details can be found
37+
in the tooltips of the respective buttons.
38+
39+
Whether a side can be configured as an input or output depends on the selected [transfer mode](#transferring).
40+
41+
## Configuration Panel
42+
43+
<img src="/../img/configuration_tab.png" width="400" style="float:right; margin-left:10px;" />
44+
45+
The configuration panel, accessible by selecting the **Configuration** tab, allows you to adjust settings related to modes and measurements.
46+
47+
### Modes
48+
49+
In this section, different modes can be selected using radio buttons. Only one option per section can be selected at a time.
50+
51+
#### Transferring
52+
53+
The transfer mode determines how energy requests arriving on sides configured as inputs are forwarded to the output sides.
54+
The default mode is **Split**.
55+
56+
In **Split** mode, incoming requests are distributed evenly across all outputs. The system first attempts to divide the energy equally by
57+
the number of outputs so that each output receives the same share. If one of the outputs accepts less than its calculated share, the
58+
remaining energy is redistributed to the other outputs. This means the split is not forced. If there are more outputs than available energy,
59+
the remainder is sent to a randomly selected output.
60+
61+
The **Transfer** mode is a special mode. It changes the behavior of the I/O grid and allows priorities to be assigned to outputs. Outputs
62+
with higher priority always receive forwarded energy first. The energy is then forwarded in descending priority order. Lower-priority
63+
outputs only receive energy if higher-priority outputs cannot accept all available energy.
64+
65+
The **Consume** mode is used for testing setups. Instead of forwarding energy, this mode permanently deletes all incoming energy. This mode
66+
also changes the behavior of the I/O grid by disallowing outputs. It is typically used to measure how much energy can enter through all
67+
inputs, especially when the normal flow is limited by the outputs.
68+
69+
#### Measuring
70+
71+
The measuring mode determines how the flow rate for an interval is calculated. The default mode is **Instant**.
72+
73+
In **Instant** mode, only the stored values measured during the current interval are considered. Previous intervals are ignored. This mode
74+
is useful when exact values are required.
75+
76+
The **Smoothed** mode changes the calculation by incorporating the previous interval. Instead of using only the measurements of the current
77+
interval, the flow rate is adjusted using the previous interval. This produces a smoother graph and reduces the impact of sudden spikes in
78+
the flow rate. This mode is useful for observing average behavior over longer periods.
79+
80+
### Settings
81+
82+
The options in this section are text fields that modify certain Energy Meter settings that affect
83+
measurement and energy flow. These text boxes also have several special behaviors.
84+
85+
By default, the fields always display the current value. While editing a value, the displayed value does not update. Instead, the button on
86+
the right side becomes active. Pressing this button applies the entered value. Alternatively, the modified value can be confirmed using
87+
the **Enter** key.
88+
89+
The text boxes also support several smart features, including input validation. If an input is invalid, for example due to an invalid
90+
number, the box turns red and the value cannot be applied.
91+
92+
All text boxes also support mathematical expressions. Supported operations include addition, subtraction, multiplication, division,
93+
exponentiation, and parentheses. If a mathematical expression is detected, the text box displays a small popup with the calculated result
94+
that can be applied. Since all configurable values are integers, results from mathematical expressions are automatically rounded to the
95+
nearest whole number. Invalid symbols are also prevented while entering mathematical expressions. For example, closing parentheses can only
96+
be inserted if a matching opening parenthesis exists.
97+
98+
#### Limit
99+
100+
The transfer limit defines how much energy the Energy Meter can transfer per tick _(1 second = 20 ticks)_.
101+
All inputs are accumulated and limited by this value. The limit therefore applies globally and not per input. Any energy exceeding the
102+
limit is returned to the sender.
103+
104+
#### Interval
105+
106+
The interval defines the time in ticks _(1 second = 20 ticks)_ after which a new measurement is performed. During an interval, all relevant
107+
values are internally recorded and stored. Once the interval ends, these values are used to calculate the current flow rate and update the
108+
total measured energy.
109+
110+
By default, this value is **5 ticks (0.25 seconds)**. This default can be changed in the mod configuration. For performance reasons, the
111+
value can never be lower than 5 ticks.
112+
113+
The relatively small default value allows the Energy Meter to react quickly to changes. This is
114+
especially helpful when you want to immediately see when an energy supply is interrupted. However, this can cause fluctuating values to
115+
produce a changing average. Increasing the interval can smooth out fluctuations but results in less frequent updates of the flow rate.
116+
117+
#### Tolerance
118+
119+
Tolerance is a niche option and is rarely required. It is an additional option that refines the interval and defines how many ticks
120+
_(1 second = 20 ticks)_ the energy rate may remain zero before the interval resets.
121+
122+
During an interval, the energy supply may temporarily stop. In that case, the flow rate is only set to zero once the entire interval has
123+
elapsed. This makes it difficult to detect interruptions when long intervals are used. By default, tolerance is **5 ticks (0.25 seconds)**.
124+
This means it is acceptable for the energy flow through the Energy Meter to be zero for up to 5 ticks.
125+
If no energy is transferred on the 6th tick, the interval ends early. This option is therefore only useful when the interval is greater
126+
than 5 ticks.
127+
128+
The tolerance value is inclusive. With a value of 5, it is acceptable for energy to be absent for 5 ticks. Only the 6th tick resets
129+
the interval.
130+
131+
This option is useful for very long intervals where you want to detect a loss of energy flow early. For example, if the interval is set to
132+
**400 ticks (20 seconds)**, it may be useful to set the tolerance to **50 ticks (2.5 seconds)**. This would allow you to detect a power
133+
interruption after only 2.5 seconds instead of up to 20 seconds. This is particularly helpful when using the **Smoothed** [measurement mode](#measuring),
134+
since the flow rate takes longer to reach zero in that mode.
135+
136+
## Graph Panel
137+
138+
<img src="/../img/graph_tab.png" width="400" style="float:right; margin-left:10px;" />
139+
140+
The graph panel can be accessed by selecting the **Graph** tab. It displays a graphical representation of the last 10 intervals.
141+
142+
The data is shown in a simple coordinate system. The **x-axis** represents the most recent intervals, while the **y-axis** shows the
143+
average flow rate of each interval. The maximum value of the y-axis is always **10% higher** than the largest interval value to make the
144+
graph points easier to interpret.
145+
146+
If data for fewer than 10 intervals exists, only the available intervals are displayed. While the current interval is running, only a
147+
horizontal line is shown. The graph point appears once the interval result becomes available.
148+
149+
To inspect the data more easily, the graph can be paused using the button in the upper-right corner. Pausing only stops the graphical
150+
representation of the graph. Internally, new data is still processed and the Energy Meter continues operating. A label inside the graph
151+
indicates that it is paused. Press the button again to resume the graph.
152+
153+
## Redstone Panel
154+
155+
The Redstone panel is currently still under development and does not yet contain any options.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# What's New
2+
3+
> [!WARNING] NOTE
4+
> This wiki is for Energy Meter for Minecraft 1.21.1 and above. For previous versions, please refer to the [old wiki](https://github.com/AlmostReliable/energymeter/wiki).
5+
6+
If you have previously used **Energy Meter** with Minecraft 1.20 or earlier, you will notice that several things have changed. The mod has been
7+
completely rewritten from the ground up and now includes many technical improvements as well as new features.
8+
9+
Most importantly, it is now possible to have multiple inputs and outputs instead of only a single input as before. This was one of the biggest
10+
criticisms of the old version. Since the calculation system was rebuilt from scratch, it was finally possible to remove this limitation.
11+
12+
Another frequently requested feature, though not easy to implement, was the ability to limit the flow rate of the Energy Meter. The block no
13+
longer behaves like an unlimited cable when a limit is configured in the GUI. Naturally, the limit also supports multiple inputs. In this case,
14+
all inputs are limited collectively rather than individually.
15+
16+
More information is now available as well. The interface now displays the total throughput the Energy Meter has processed so far. This accumulated
17+
value can be reset at the press of a button in the GUI. It is also easier to see which mode the Energy Meter is currently operating in. Previously
18+
used toggleable labels have been replaced with convenient radio buttons. This makes it easier not only to see the currently selected option but also
19+
all available options. Related settings are also grouped together, improving clarity and usability.
20+
21+
The input fields have also been completely redesigned. They now provide feedback for invalid values and support mathematical expressions. The
22+
preliminary result is displayed in a small tooltip.
23+
24+
Another new feature is the graph view. It displays the values of previous intervals in a clear visual format. The graph can also be paused
25+
for closer inspection.
26+
27+
Finally, new configuration options have also been added. It is now possible to define the default interval frequency that every Energy Meter
28+
uses when placed. Additionally, you can configure whether Energy Meters are allowed to connect to each other.
29+
30+
Since the mod is still in the beta phase, additional features will be added over time. Planned features include things like **ComputerCraft integration**
31+
and interactions with **Redstone**. For a more detailed explanation of all features and the user interface, please refer to the other pages of this wiki.
15.3 KB
Loading
10.7 KB
Loading
10.6 KB
Loading

wikis/energymeter/img/logo.png

3.09 KB
Loading

0 commit comments

Comments
 (0)