Class AbstractStructureHandler
java.lang.Object
com.ldtteam.structurize.placement.structure.AbstractStructureHandler
- All Implemented Interfaces:
IPlacementContext,IStructureHandler
- Direct Known Subclasses:
CreativeStructureHandler
Abstract implementation of the handler holding information that is common for all handlers.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractStructureHandler(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Blueprint blueprint, RotationMirror rotMir) Load the handler with the blueprint already.AbstractStructureHandler(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos worldPos, Future<Blueprint> blueprintFuture, RotationMirror rotMir) Abstract constructor of structure handler. -
Method Summary
Modifier and TypeMethodDescriptionGet the bluerint from the handler.net.minecraft.core.BlockPosGet the world position this is placed at.getMd5()Get the md5 value.Getter for the placement settings.net.minecraft.world.level.LevelgetWorld()Get the world from the handler.booleanCheck if the handler has a valid blueprint.booleanisReady()Check if the handler is ready.voidsetBlueprint(Blueprint blueprint) Set the blueprint.voidSet the md5 value.voidtriggerSuccess(net.minecraft.core.BlockPos pos, List<net.minecraft.world.item.ItemStack> requiredRes, boolean placement) Trigger success AFTER placement of block.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ldtteam.structurize.placement.IPlacementContext
fancyPlacement, getSolidBlockForPosMethods inherited from interface com.ldtteam.structurize.placement.structure.IStructureHandler
allowReplace, consume, getHeldItem, getInventory, getMaxBlocksCheckedPerCall, getProgressPosInWorld, getStepsPerCall, getStructurePosFromWorld, hasRequiredItems, isCorrectMD5, isCreative, isStackFree, onCompletion, prePlacementLogic, replaceWithSolidBlock, shouldBlocksBeConsideredEqual, triggerEntitySuccess
-
Constructor Details
-
AbstractStructureHandler
public AbstractStructureHandler(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos worldPos, Future<Blueprint> blueprintFuture, RotationMirror rotMir) Abstract constructor of structure handler.- Parameters:
world- the world it gets.worldPos- the position the anchor of the structure got placed.blueprintFuture- the name of the structure.rotMir- the placement settings.
-
AbstractStructureHandler
public AbstractStructureHandler(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Blueprint blueprint, RotationMirror rotMir) Load the handler with the blueprint already.- Parameters:
world- the world.pos- the position.blueprint- the blueprint.rotMir- the placement settings.
-
-
Method Details
-
triggerSuccess
public void triggerSuccess(net.minecraft.core.BlockPos pos, List<net.minecraft.world.item.ItemStack> requiredRes, boolean placement) Description copied from interface:IStructureHandlerTrigger success AFTER placement of block.- Specified by:
triggerSuccessin interfaceIStructureHandler- Parameters:
pos- the pos it was placed at.requiredRes- the list of required res.placement- if through placement (true) or through equality (false).
-
hasBluePrint
public boolean hasBluePrint()Description copied from interface:IStructureHandlerCheck if the handler has a valid blueprint.- Specified by:
hasBluePrintin interfaceIStructureHandler- Returns:
- true if so.
-
setMd5
Description copied from interface:IStructureHandlerSet the md5 value.- Specified by:
setMd5in interfaceIStructureHandler- Parameters:
md5- the calculated md5.
-
setBlueprint
Description copied from interface:IStructureHandlerSet the blueprint.- Specified by:
setBlueprintin interfaceIStructureHandler- Parameters:
blueprint- the blueprint to set.
-
getBluePrint
Description copied from interface:IPlacementContextGet the bluerint from the handler.- Specified by:
getBluePrintin interfaceIPlacementContext- Returns:
- the blueprint
-
getWorld
public net.minecraft.world.level.Level getWorld()Description copied from interface:IStructureHandlerGet the world from the handler.- Specified by:
getWorldin interfaceIStructureHandler- Returns:
- the world.
-
getMd5
Description copied from interface:IStructureHandlerGet the md5 value.- Specified by:
getMd5in interfaceIStructureHandler- Returns:
- the md5.
-
getCenterPos
public net.minecraft.core.BlockPos getCenterPos()Description copied from interface:IPlacementContextGet the world position this is placed at.- Specified by:
getCenterPosin interfaceIPlacementContext- Returns:
- the position.
-
getRotationMirror
Description copied from interface:IPlacementContextGetter for the placement settings.- Specified by:
getRotationMirrorin interfaceIPlacementContext- Returns:
- the settings object.
-
isReady
public boolean isReady()Description copied from interface:IStructureHandlerCheck if the handler is ready.- Specified by:
isReadyin interfaceIStructureHandler- Returns:
- true if so.
-