Open Terrain Generator (OTG)

Open Terrain Generator (OTG)

10M Downloads

Feature: Add registry for BO3s/BO4s on placement

SXRWahrheit opened this issue ยท 5 comments

commented

Some data like this exists for BO4s, but in the long-term we should add registry support for all OTG-generated objects (and perhaps other structures, depending on whether Minecraft exposes that kind of data).

Storing cuboid / location data for structures in an API would make it extremely simple for other plugins to add custom mob spawning to them, protect, them, etc. etc.

This is a long-term feature for after the next 1.0 release.

commented

Atm this is possible for Forge 1.12.2 via ModData(x,y,z,modname,data) tag, which fires an event to the specified mod with the specified data the moment the containing BO4 is spawned in the world. This allows other mods to receive and process the data and execute commands etc. Communication between mods is done via Forge InterModCommunication (IMC). Would have to see if something like this could be implemented for 1.16 and spigot, a "fire and forget" mechanism like this would be much easier to do than a persistent registry/cache.

commented

Denizen writes its flags for locations (blocks) and chunks directly to the world data, so it should be possible. The mechanism / storage might just differ as between Forge and Spigot.

commented

Spigot has PersistentDataHolder which Chunk (and most other Bukkit objects representing things capable of storing NBT data) implement. For other platforms, you could insert your own NBT data into chunks (which is exactly what PersistentDataHolders on Spigot do internally)

commented

Branch data for plotted BO4 structures is currently cached but not persisted. When using developermode:true and using /otg structure over a spawned BO4, it'll show you all the branches spawned in the current chunk. This information is lost on world exit/reload. Should be fairly easy to write branch data (bounding boxes, any relevant coords with data etc) to chunks/world save when branches are plotted/spawned.

Question is ofcourse, who would use this and how? If this is OTG specific data saved in some non-standard location, other mods would have to write code to do anything with it. How should the data look and how will it be used?

commented

*Just thinking btw, if we do persist branch data, we can also re-generate chunks with BO4's.