public class FarmlandWaterManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.util.Map<ChunkPos,ChunkTicketManager<Vec3d>>> |
customWaterHandler |
private static boolean |
DEBUG |
private static org.apache.logging.log4j.Logger |
LOGGER |
Constructor and Description |
---|
FarmlandWaterManager() |
Modifier and Type | Method and Description |
---|---|
static AABBTicket |
addAABBTicket(World world,
AxisAlignedBB aabb)
Convenience method to add a ticket that is backed by an AABB.
|
static <T extends SimpleTicket<Vec3d>> |
addCustomTicket(World world,
T ticket,
ChunkPos masterChunk,
ChunkPos... additionalChunks)
Adds a custom ticket.
|
private static double |
getDistanceSq(ChunkPos pos,
Vec3d vec3d) |
private static ChunkTicketManager<Vec3d> |
getTicketManager(ChunkPos pos,
IWorldReader world) |
static boolean |
hasBlockWaterTicket(IWorldReader world,
BlockPos pos)
Tests if a block is in a region that is watered by blocks.
|
(package private) static void |
removeTickets(IChunk chunk) |
private static boolean DEBUG
private static final it.unimi.dsi.fastutil.ints.Int2ObjectMap<java.util.Map<ChunkPos,ChunkTicketManager<Vec3d>>> customWaterHandler
private static final org.apache.logging.log4j.Logger LOGGER
public static <T extends SimpleTicket<Vec3d>> T addCustomTicket(World world, T ticket, ChunkPos masterChunk, ChunkPos... additionalChunks)
addAABBTicket(World, AxisAlignedBB)
if you just need a ticket that can water a certain area.
SimpleTicket.invalidate()
. Also call this
when the region this is unloaded (e.g. your TE is unloaded or the block is removed), and validate once it is loadedworld
- The world where the region should be marked. Only server-side worlds are allowedticket
- Your ticket you want to have registeredmasterChunk
- The chunk pos that is controls when the ticket may be unloaded. The ticket should originate from here.additionalChunks
- The chunks in that this ticket wants to operate as well.public static AABBTicket addAABBTicket(World world, AxisAlignedBB aabb)
SimpleTicket.invalidate()
. Also call this
when the region this is unloaded (e.g. your TE is unloaded or the block is removed), and validate once it is loaded
world
- The world where the region should be marked. Only server-side worlds are allowedaabb
- The region where blocks should be wateredpublic static boolean hasBlockWaterTicket(IWorldReader world, BlockPos pos)
FarmlandBlock.hasWater(IWorldReader, BlockPos)
static void removeTickets(IChunk chunk)
private static ChunkTicketManager<Vec3d> getTicketManager(ChunkPos pos, IWorldReader world)