public interface ICustomBlockInteract
IDroneRegistry.registerCustomBlockInteractor(RegistryEvent.Register, ICustomBlockInteract).
This will add a puzzle piece that has only an Area white- and blacklist parameter (similar to a Goto piece).
This could be used to create energy import/export widgets, for example.| Modifier and Type | Method and Description |
|---|---|
boolean |
doInteract(net.minecraft.util.math.BlockPos pos,
IDrone drone,
IBlockInteractHandler interactHandler,
boolean simulate)
The actual interaction.
|
net.minecraft.item.DyeColor |
getColor()
Used for crafting, categorizes the puzzle piece.
|
net.minecraft.util.ResourceLocation |
getID()
Get a unique name for this puzzle piece.
|
net.minecraft.util.ResourceLocation |
getTexture()
Get the puzzle piece texture.
|
net.minecraft.util.ResourceLocation getID()
net.minecraft.util.ResourceLocation getTexture()
boolean doInteract(net.minecraft.util.math.BlockPos pos,
IDrone drone,
IBlockInteractHandler interactHandler,
boolean simulate)
For each blockpos in the specified area, the drone will visit that block (ordered from closest to furthest). It
will call this method with simulate = true. If this method returns true, the drone will navigate to this
location, and call this method again with simulate = false. It will keep doing this until this method
returns false.
In the puzzle piece GUI, players can specify a 'use count' and fill in the maximum count they want
to use. When IBlockInteractHandler.useCount() returns true, and simulate is false, you must only
import/export up to IBlockInteractHandler.getRemainingCount(), and you must notify the transferred amount
by doing IBlockInteractHandler.decreaseCount(int).
pos - current visited locationdrone - a reference to the drone objectinteractHandler - object you can use to use to get accessible sides and give feedback about counts.simulate - true when trying to figure out whether or not the drone should navigate to this block,
false when next to this block.net.minecraft.item.DyeColor getColor()