Interface IChunkAccessOverriderAPI
-
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the display name for this chunk protection overrider.overrideChunkAccess(net.minecraft.resources.ResourceLocation dim, int x, int z, IPlayerConfigAPI claimConfig, net.minecraft.world.entity.Entity accessor, UUID accessorId, net.minecraft.server.MinecraftServer server, ChunkAccessOverride currentOverride) Lets you override full chunk access for a specified accessor.
-
Method Details
-
getName
Gets the display name for this chunk protection overrider.- Returns:
- the name String, not null
-
overrideChunkAccess
@Nonnull ChunkAccessOverride overrideChunkAccess(@Nullable net.minecraft.resources.ResourceLocation dim, int x, int z, @Nonnull IPlayerConfigAPI claimConfig, @Nullable net.minecraft.world.entity.Entity accessor, @Nonnull UUID accessorId, @Nonnull net.minecraft.server.MinecraftServer server, @Nonnull ChunkAccessOverride currentOverride) Lets you override full chunk access for a specified accessor.Argument for accessor being null usually means that the accessor entity doesn't exist anymore or it's an offline player. Argument for accessorId is never null though.
This is mainly meant for addons that want to implement a claim access expiration system or a claim raiding system but can be used for other things as well.
This only affects whether a player has full access to a claim. Other claim exceptions are not affected by this at all!
When you don't have a reason to override access, then it is recommended to simply return currentOverride.
To override access to a chunk, return a new instance of
ChunkAccessOverridewith one of the types fromChunkAccessOverrideType.Overriding access here doesn't cause any special notifications to be displayed to the player. You must appropriately explain the override to the player yourself, e.g. with your own UI. Because this method may be called multiple times for a single action, it is not the best place to notify the player from, but with a cooldown timer or a server tick count check, you can still get it to work nicely.
- Parameters:
dim- the dimension ID of the chunk, null when not providedx- the X chunk coordinate, Integer.MIN_VALUE when not providedz- the Z chunk coordinate, Integer.MIN_VALUE when not providedclaimConfig- the actual player (sub-)config used for the claim, not nullaccessor- the entity or player accessing the chunk, can be nullaccessorId- the UUID of the entity or player accessing the chunk, not nullserver- the Minecraft server, not nullcurrentOverride- the current candidate to override the access with, not null- Returns:
- the chunk access override instance, not null
-