Interface IStructureElementNoPlacement<T>
- All Superinterfaces:
IStructureElement<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface IStructureElement
IStructureElement.BlocksToPlace, IStructureElement.PlaceResult -
Method Summary
Modifier and TypeMethodDescriptiondefault IStructureElementNoPlacement<T> Forget the messed up class dependency graph for now.default booleanplaceBlock(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, Consumer<IChatComponent> chatter) Try place the block by taking resource from given IItemSource.Methods inherited from interface IStructureElement
check, couldBeValid, getBlocksToPlace, getDescription, getStepA, getStepB, getStepC, isNavigating, resetA, resetB, resetC, spawnHint
-
Method Details
-
placeBlock
- Specified by:
placeBlockin interfaceIStructureElement<T>
-
survivalPlaceBlock
default IStructureElement.PlaceResult survivalPlaceBlock(T t, World world, int x, int y, int z, ItemStack trigger, IItemSource s, EntityPlayerMP actor, 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>- Parameters:
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>- Parameters:
trigger- trigger itemenv- autoplacing environment
- Get
-
noPlacement
Description copied from interface:IStructureElementForget the messed up class dependency graph for now. this is just so convenient.- Specified by:
noPlacementin interfaceIStructureElement<T>
-