Mod

ObserverLib

Quick rating

ObserverLib

No reviews yet

A Library mod that allows for generic area observation.

No Theme
No Genre
Mod Addon
API/Library
Mod Loaders
Forge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
ObserverLib-1.18.2-1.7.1.jar
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

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

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

18m
Downloads
Last Updated
Created
Last synced
When ModDex last fetched and imported data for this project from CurseForge or Modrinth. High-traffic and active projects are checked more often.
Next pipeline sync