类 FarmlandWaterManager
java.lang.Object
net.minecraftforge.common.FarmlandWaterManager
-
字段概要
字段修饰符和类型字段说明private static final Map
<LevelReader, Map<ChunkPos, ChunkTicketManager<Vec3>>> private static final boolean
private static final org.apache.logging.log4j.Logger
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static AABBTicket
addAABBTicket
(Level level, AABB aabb) Convenience method to add a ticket that is backed by an AABB.static <T extends SimpleTicket<Vec3>>
TaddCustomTicket
(Level level, T ticket, ChunkPos masterChunk, ChunkPos... additionalChunks) Adds a custom ticket.private static double
getDistanceSq
(ChunkPos pos, Vec3 vec3d) private static ChunkTicketManager
<Vec3> getTicketManager
(ChunkPos pos, LevelReader level) static boolean
hasBlockWaterTicket
(LevelReader level, BlockPos pos) Tests if a block is in a region that is watered by blocks.(专用程序包) static void
removeTickets
(ChunkAccess chunk)
-
字段详细资料
-
DEBUG
private static final boolean DEBUG -
customWaterHandler
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
-
构造器详细资料
-
FarmlandWaterManager
public FarmlandWaterManager()
-
-
方法详细资料
-
addCustomTicket
public static <T extends SimpleTicket<Vec3>> T addCustomTicket(Level level, T ticket, ChunkPos masterChunk, ChunkPos... additionalChunks) Adds a custom ticket. UseaddAABBTicket(Level, AABB)
if you just need a ticket that can water a certain area.
If you don't want to water the region anymore, callSimpleTicket.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- 参数:
level
- The level 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.- 返回:
- The ticket for your requested region.
-
addAABBTicket
Convenience method to add a ticket that is backed by an AABB.
If you don't want to water the region anymore, callSimpleTicket.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
The AABB in the ticket is immutable- 参数:
level
- The level where the region should be marked. Only server-side worlds are allowedaabb
- The region where blocks should be watered- 返回:
- The ticket for your requested region.
-
getDistanceSq
-
hasBlockWaterTicket
Tests if a block is in a region that is watered by blocks. This does not check vanilla water, seenet.minecraft.level.level.block.FarmBlock#isNearWater(LevelReader, BlockPos)
- 返回:
- true if there is a ticket with an AABB that includes your block
-
removeTickets
-
getTicketManager
-