ObserverLib Mod pre Minecraft 1.21.1, 1.18.2
A Library mod that allows for generic area observation.
O mode ObserverLib
ObserverLib is a library mod, usable to reliably observe block changes in a potentially large area with very little performance implications.
The library is publicly usable and is primarily focused to be used in Astral Sorcery from 1.13+.
In essence this mod allows you to register an Observer - whatever it observes in the end is up to the implementation - for a specific area. Changes that happen in the world in its observed area are passed onto the Observer. The observer can then decide on its own what these changes mean; if they invalidate or validate the observer's state. So for example if the structure is now complete or not.
The actual call to check if things are valid or not is to query the ChangeSubscriber at the relevant position and then ask if its current state is valid or not.
What makes this better than generally just repeatedly checking a large area? What happens if the area you want to observe is larger than a chunk? What happens if the other chunk you have to check becomes unloaded? In order to be sure nothing has changed and the structure is intact, a mod would have to load said chunk and check the block. Potentially an issue if this causes a lot of chunk loading and unloading. The Implementation of ObserverLib makes sure you can relax and the changes passed onto your implementation of notifyChange contain all necessary information to make sure whatever you're observing is still valid or not.
One exemplary implementation for checking if a structure is built correctly or not can be seen here. Instead of always checking everything of the structure's components, the check makes sure to track the positions that are incorrect/mismatching and only works based off of mismatches to what the matcher expects.
If you're interested in using it for your own projects, you can grab it from maven here: https://maven.hellfiredev.net/hellfirepvp/observerlib/observerlib/
For further explanations and details, feel free to ask on the AstralSorcery discord: https://discord.gg/q37VRcT
Ako nainštalovať ObserverLib
With Millida Launcher
Install Millida Launcher
The launcher is free: download it at millida.net/launcher and sign in with any nickname.
Click “Install” on this page
The launcher opens and installs the mod for Minecraft 1.15.2–1.21.1 on Forge or NeoForge automatically.
Launch the game
A profile with it appears in the launcher: click “Play”.
Manually
Install Forge or NeoForge
The loader must match the game version of the mod file, for example Minecraft 1.21.1. After installing it, a separate profile appears in your launcher.
Download the file for your version
In the version list above, pick the file observerlib-1.10.3.jar (112 KB) for your game version and loader.
Put it in the mods folder
The folder is inside .minecraft (Windows: %appdata%\.minecraft\mods). If it does not exist, create it.
Launch the loader profile
Open “Mods” in the main menu: ObserverLib should be in the list.
Minecraft 1.21.1 runs on Java 21: with a different Java version the game may close right after launch.
Verzie
So závislosťami
| Minecraft | Loader | Súbor | Dátum | Akcie |
|---|---|---|---|---|
| 1.21.1 | NeoForge | ObserverLib-1.21.1-1.10.3.jar112 KB | ||
| 1.18.2 | Forge | ObserverLib-1.18.2-1.7.1.jar143 KB | ||
| 1.18.2 | Forge | ObserverLib-1.18.2-1.6.0.jar144 KB | ||
| 1.15.2 | — | ObserverLib-1.15.2-1.2.0.jar134 KB |
FAQ
Which Minecraft versions does ObserverLib work on?
There are files for 1.21.1, 1.18.2, 1.15.2. The newest is 1.21.1.
Is ObserverLib for Forge or Fabric?
There are files for Forge: 1.18.2 and for NeoForge: 1.21.1. There are no files for Fabric: a mod for another loader will not start.
Does ObserverLib need other mods?
The author lists no required dependencies: the Forge or NeoForge loader is enough.
Which Java does ObserverLib need?
Minecraft 1.21.1 runs on Java 21. If the game closes right after launch, the usual cause is the wrong Java version in the profile settings.
Where can I download ObserverLib safely?
On this page: the file observerlib-1.10.3.jar (112 KB) is stored on Millida’s server, with no link shorteners. SHA-1 checksum: f8b357513c22b62f0cdbe0259305620541a45fa2.
Recenzie
Buď prvý, kto ohodnotí ObserverLib

