public interface IExtentCache
IFarmLogics. Some IFarmLogics that potentially
could make many operation for a single position like the arboreal logic can use this to cache the last position they
worked on.| Modifier and Type | Method and Description |
|---|---|
void |
cleanExtents(FarmDirection direction)
Clears the cache for the given direction.
|
int |
getExtents(FarmDirection direction,
net.minecraft.util.math.BlockPos pos)
Gets the current extent for the given direction and position.
|
default int |
getValidExtent(FarmDirection direction,
net.minecraft.util.math.BlockPos pos,
int maxExtend)
Gets the current extend but returns 0 if the extend is bigger given maximal extent
|
default net.minecraft.util.math.BlockPos |
getValidPosition(FarmDirection direction,
net.minecraft.util.math.BlockPos pos,
int maxExtend,
net.minecraft.util.math.BlockPos baseLocation)
Offsets the given base location in the given direction by the valid extent of the logic position.
|
default int |
increaseExtent(FarmDirection direction,
net.minecraft.util.math.BlockPos pos,
int maxExtend)
Increases the valid position by one.
|
void |
setExtents(FarmDirection direction,
net.minecraft.util.math.BlockPos pos,
int extend)
Sets the current extent for the given direction and position.
|
int getExtents(FarmDirection direction, net.minecraft.util.math.BlockPos pos)
direction - The direction of the farm logic.pos - The position the logic starts to operate onvoid setExtents(FarmDirection direction, net.minecraft.util.math.BlockPos pos, int extend)
direction - The direction of the farm logic.pos - The position the logic starts to operate onextend - The extentvoid cleanExtents(FarmDirection direction)
For example used if the player remove the circuit from the farm.
direction - The direction that should be cleareddefault int getValidExtent(FarmDirection direction, net.minecraft.util.math.BlockPos pos, int maxExtend)
direction - The direction of the farm logic.pos - The position the logic starts to operate onmaxExtend - The maximal extent this method can return. If the current extend is bigger than this value 0
will be returned.default net.minecraft.util.math.BlockPos getValidPosition(FarmDirection direction, net.minecraft.util.math.BlockPos pos, int maxExtend, net.minecraft.util.math.BlockPos baseLocation)
direction - The direction of the farm logic.pos - The position the logic starts to operate onmaxExtend - The maximal extent as defined in "getValidExtent"baseLocation - The location that will be offset by the extentdefault int increaseExtent(FarmDirection direction, net.minecraft.util.math.BlockPos pos, int maxExtend)
direction - The direction of the farm logic.pos - The position the logic starts to operate onmaxExtend - The maximal extent as defined in "getValidExtent"