Description
This mod provides functional for RTS multiblock structures. It also can be used as a structure copy/paste
In-game functions
- Save structures
- Paste structures
To save structure you need structure tool - use /give or operator tab;
Right click - position 1;
Left click - position 2;
Shift + right click - anchor position
CTRL + mouse click - expand area (can be changed in keybinds)
Shift + left click - placement anchor
/rtstrucutres save <name> - saves structure
/rtstrucutres load <name> <anchor> - loads structure
/rtstrucutres execute - pastes structure in world
/rtstrucutres always_display_boxes - alway display tool selection area
/rtstrucutres debug - example of library use (requires saved structure named "house")
Mod-Developer functions
Installation Guide
Currently mod does not have maven so you should add mod file directly to your workspace gradle directory
dependencies {
implementation fg.deobf("net.awyvrix:structure-framework:0.1.0")
}
Mod Guide
Here is the example of /debug command
ServerLevel level = ctx.getSource().getLevel();
String filename = "house";
Path worldDir = level.getServer().getWorldPath(LevelResource.ROOT);
StructureTemplate template = StructureCache.get(worldDir, filename);
BlockPos anchorPos = StructureToolState.placeAnchor; // Place position
PlacementAnchor anchorMode = PlacementAnchor.CUSTOM; // Recommended to use custom anchor
StructureInstance instance = new StructureInstance(level, template, anchorPos, anchorMode);
StructureManager.add(instance);
instance.build(BuildType.FAST, 2.0f); // Execute in the world; Layer-by layer building
StructureInstance class provides more methods for structure management;
Basic Usage
Saving Structure
StructureTemplate template = StructureCapture.capture(level, pos1, pos2, customAnchor);
Path path = worldDir.resolve("generated/rtstructures/house.rtstructure");
StructureSerializer.save(template, path);
Loading Structure
Path path = worldDir.resolve("generated/rtstructures/house.rtstructure");
StructureTemplate template = StructureDeserializer.load(path);
Instant Placement
StructurePlacer.place(
level,
targetPos,
template,
PlacementAnchor.CENTER
);
Register Structure
StructureManager.add(instance);
Start Building
instance.build(BuildType.FAST,10);
BuildType= construction logicspeed= blocks per tick
Validation System
Check Damage
boolean damaged = instance.isDamaged();
Completion Percent
float percent = instance.getCompletionPercent();
Damage Percent
float percent = instance.getDamagePercent();
Full Validation Result
ValidationResult result = instance.validate();
Build Modes
FAST
Instant layered building
- fast
- unrestricted
- replaces blocks
Best for:
- debugging
- cinematic building
- RTS instant construction
FAST_SAFE
Layered building without replacing existing blocks
- preserves world
- safer placement
- slower completion
Best for:
- survival gameplay
- protected worlds
CONNECT
Builds only connected blocks
- realistic propagation
- support-dependent
- may stall if disconnected
Best for:
- RTS simulation
- organic building systems
SEPARATED
Growth-style construction from anchor
- spreading build effect
- directional expansion
- organic appearance
Best for:
- alien structures
- plant-like construction
- visual effects
More can be found on github wiki


