Class Manager
java.lang.Object
com.ldtteam.structurize.management.Manager
Singleton class that links colonies to minecraft.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToQueue(ITickedWorldOperation operation) Add a new item to the scanTool operation queue.static voidaddToUndoRedoCache(ChangeStorage storage) Add a new item to the queue.static BlueprintgenerateRandomShape(int height, int width, int length, String equation, net.minecraft.world.level.block.state.BlockState block) Randomly generates shape based on an equation.static List<ChangeStorage>getChangeStoragesForPlayer(UUID player) Returns a list of the recently cached operations for this playerstatic BlueprintgetStructureFromFormula(int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow) Just returns a cube for now, I can tinker this later.static booleanWhether or not a new schematic have been downloaded.static voidonWorldTick(net.minecraft.server.level.ServerLevel world) Method called on world tick to run cached operations.static voidpasteStructure(net.minecraft.server.level.ServerLevel server, net.minecraft.core.BlockPos pos, int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow, net.minecraft.server.level.ServerPlayer player, RotationMirror rotMir) Paste a structure into the world.static voidredo(net.minecraft.world.entity.player.Player player, int operationID) Undo a change to the world made by a player.static voidsetSchematicDownloaded(boolean downloaded) Set the schematic downloadedstatic voidundo(net.minecraft.world.entity.player.Player player, int operationID) Undo a change to the world made by a player.
-
Method Details
-
onWorldTick
public static void onWorldTick(net.minecraft.server.level.ServerLevel world) Method called on world tick to run cached operations.- Parameters:
world- the world which is ticking.
-
addToQueue
Add a new item to the scanTool operation queue.- Parameters:
operation- the operation to add.
-
addToUndoRedoCache
Add a new item to the queue.- Parameters:
storage- the storage to add.
-
getChangeStoragesForPlayer
Returns a list of the recently cached operations for this player- Parameters:
player-- Returns:
-
pasteStructure
public static void pasteStructure(net.minecraft.server.level.ServerLevel server, net.minecraft.core.BlockPos pos, int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow, net.minecraft.server.level.ServerPlayer player, RotationMirror rotMir) Paste a structure into the world.- Parameters:
server- the server world.pos- the position.width- the width.length- the length.height- the height.frequency- the frequency.equation- the equation.shape- the shape.inputBlock- the input block.inputFillBlock- the fill block.hollow- if hollow or not.player- the player.rotMir- the mirror and the rotation.
-
getStructureFromFormula
public static Blueprint getStructureFromFormula(int width, int length, int height, int frequency, String equation, Shape shape, net.minecraft.world.item.ItemStack inputBlock, net.minecraft.world.item.ItemStack inputFillBlock, boolean hollow) Just returns a cube for now, I can tinker this later.- Parameters:
width- the width.length- the length.height- the height.frequency- the frequency.equation- the equation.shape- the shape.inputBlock- the input block.inputFillBlock- the fill block.hollow- if hollow or not.- Returns:
- the new blueprint.
-
generateRandomShape
public static Blueprint generateRandomShape(int height, int width, int length, String equation, net.minecraft.world.level.block.state.BlockState block) Randomly generates shape based on an equation.- Parameters:
height- the height.width- the width.length- the length.equation- the equation.block- the block.- Returns:
- the created blueprint
-
undo
public static void undo(net.minecraft.world.entity.player.Player player, int operationID) Undo a change to the world made by a player.- Parameters:
player- the player who made it.operationID-
-
redo
public static void redo(net.minecraft.world.entity.player.Player player, int operationID) Undo a change to the world made by a player.- Parameters:
player- the player who made it.operationID-
-
isSchematicDownloaded
public static boolean isSchematicDownloaded()Whether or not a new schematic have been downloaded.- Returns:
- True if a new schematic have been received.
-
setSchematicDownloaded
public static void setSchematicDownloaded(boolean downloaded) Set the schematic downloaded- Parameters:
downloaded- True if a new schematic have been received.
-