Interface IStructureElementCheckOnly<T>
-
- All Superinterfaces:
IStructureElement<T>
public interface IStructureElementCheckOnly<T> extends IStructureElement<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.gtnewhorizon.structurelib.structure.IStructureElement
IStructureElement.BlocksToPlace, IStructureElement.PlaceResult
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default booleancouldBeValid(T t, World world, int x, int y, int z, ItemStack trigger)Pure (stateless and side effect free) function to test if current block could be valid.default booleanplaceBlock(T t, World world, int x, int y, int z, ItemStack trigger)default booleanspawnHint(T t, World world, int x, int y, int z, ItemStack trigger)default IStructureElement.PlaceResultsurvivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env)Try place the block by taking resource from givenIItemSource.default IStructureElement.PlaceResultsurvivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, java.util.function.Consumer<IChatComponent> chatter)Try place the block by taking resource from given IItemSource.-
Methods inherited from interface com.gtnewhorizon.structurelib.structure.IStructureElement
check, getBlocksToPlace, getStepA, getStepB, getStepC, isNavigating, noPlacement, resetA, resetB, resetC
-
-
-
-
Method Detail
-
placeBlock
default boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger)
- Specified by:
placeBlockin interfaceIStructureElement<T>
-
couldBeValid
default boolean couldBeValid(T t, World world, int x, int y, int z, ItemStack trigger)
Description copied from interface:IStructureElementPure (stateless and side effect free) function to test if current block could be valid. Used to give user hints about incorrectly placed blocks given a controller and trigger item. If couldBeValid(...) == false for a set of channels, with those same tiers, check(...) == false. Not required, defaults to true which is always safe but won't give the user error hints.- Specified by:
couldBeValidin interfaceIStructureElement<T>
-
spawnHint
default boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger)
- Specified by:
spawnHintin interfaceIStructureElement<T>
-
survivalPlaceBlock
default IStructureElement.PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, java.util.function.Consumer<IChatComponent> chatter)
Description copied from interface:IStructureElementTry place the block by taking resource from given IItemSource.You might want to use
StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)or its overloads to implement this.- Specified by:
survivalPlaceBlockin interfaceIStructureElement<T>trigger- trigger items- drain resources from this placeactor- source of action. for very critical errors you can also just send the error messages here, bypassing any filter that chatter might have.chatter- send error messages here. Caller will choose an appropriate way to forward it to player if the other fallbacks also fails.
-
survivalPlaceBlock
default IStructureElement.PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, AutoPlaceEnvironment env)
Description copied from interface:IStructureElementTry place the block by taking resource from givenIItemSource.You might want to use
StructureUtility.survivalPlaceBlock(Block, int, World, int, int, int, IItemSource, net.minecraft.entity.player.EntityPlayer)or its overloads to implement this.The default implementation provided will
- Get
IStructureElement.BlocksToPlaceviaIStructureElement.getBlocksToPlace(Object, World, int, int, int, ItemStack, AutoPlaceEnvironment). If not null- call
IStructureElement.check(Object, World, int, int, int). If this returnstrue,IStructureElement.PlaceResult.SKIPwill be returned without further action. - Use the
IStructureElement.BlocksToPlaceretrieved earlier and passed inIItemSourceto determine an item to place - Hand over control to
StructureUtility.survivalPlaceBlock(ItemStack, NBTMode, NBTTagCompound, boolean, World, int, int, int, IItemSource, EntityPlayer, Consumer)
- call
- Call legacy
IStructureElement.survivalPlaceBlock(Object, World, int, int, int, ItemStack, IItemSource, EntityPlayerMP, Consumer)ifenv.getActor()contains anEntityPlayerMP - Emit warning under debug mode (or throw exception under panic mode), then return
IStructureElement.PlaceResult.SKIP
IStructureElement.check(Object, World, int, int, int)is not side effect free, or is not idempotent. E.g. theIStructureElement.check(Object, World, int, int, int)will add current coord to aList. As this method might be invoked at a location that is already accepted, this will cause the machine to have multiple of this coord in its list.- Specified by:
survivalPlaceBlockin interfaceIStructureElement<T>trigger- trigger itemenv- autoplacing environment
- Get
-
-