Package com.ldtteam.structurize.util
Class TickedWorldOperation
java.lang.Object
com.ldtteam.structurize.util.TickedWorldOperation
- All Implemented Interfaces:
ITickedWorldOperation
Contains an operation, as remove block, replace block, place structure, etc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumScan tool operation types. -
Constructor Summary
ConstructorsConstructorDescriptionTickedWorldOperation(StructurePlacer placer, @Nullable net.minecraft.world.entity.player.Player player) Create a ScanToolOperation for an structure placement.TickedWorldOperation(ChangeStorage storage, @Nullable net.minecraft.world.entity.player.Player player, TickedWorldOperation.OperationType operation) Create a ScanToolOperation for an UNDO.TickedWorldOperation(TickedWorldOperation.OperationType type, net.minecraft.core.BlockPos startPos, net.minecraft.core.BlockPos endPos, @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack firstBlock, net.minecraft.world.item.ItemStack secondBlock, int pct) Create a ScanToolOperation. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(net.minecraft.server.level.ServerLevel world) Apply the operation on the world.Get the current change storage of this operation.booleanCheck if operation is an undo already.
-
Constructor Details
-
TickedWorldOperation
public TickedWorldOperation(TickedWorldOperation.OperationType type, net.minecraft.core.BlockPos startPos, net.minecraft.core.BlockPos endPos, @Nullable @Nullable net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack firstBlock, net.minecraft.world.item.ItemStack secondBlock, int pct) Create a ScanToolOperation.- Parameters:
type- the type.startPos- the start position.endPos- the end position.player- the player who triggered the event.firstBlock- the block being altered.secondBlock- the block it will be replaced with.pct- the percentage of positions to execute the operation on.
-
TickedWorldOperation
public TickedWorldOperation(ChangeStorage storage, @Nullable @Nullable net.minecraft.world.entity.player.Player player, TickedWorldOperation.OperationType operation) Create a ScanToolOperation for an UNDO.- Parameters:
storage- the storage for the UNDO.player- the player.
-
TickedWorldOperation
public TickedWorldOperation(StructurePlacer placer, @Nullable @Nullable net.minecraft.world.entity.player.Player player) Create a ScanToolOperation for an structure placement.- Parameters:
placer- the structure for the placement..player- the player.
-
-
Method Details
-
apply
public boolean apply(net.minecraft.server.level.ServerLevel world) Description copied from interface:ITickedWorldOperationApply the operation on the world.- Specified by:
applyin interfaceITickedWorldOperation- Parameters:
world- the world to apply them on.- Returns:
- true if finished.
-
getChangeStorage
Description copied from interface:ITickedWorldOperationGet the current change storage of this operation.- Specified by:
getChangeStoragein interfaceITickedWorldOperation- Returns:
- the ChangeStorage object.
-
isUndoRedo
public boolean isUndoRedo()Description copied from interface:ITickedWorldOperationCheck if operation is an undo already.- Specified by:
isUndoRedoin interfaceITickedWorldOperation- Returns:
- true if so.
-