Package io.papermc.paper.event.world
Class StructuresLocateEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.world.WorldEvent
io.papermc.paper.event.world.StructuresLocateEvent
- All Implemented Interfaces:
- Cancellable
Called before a set of configured structures is located.
 This happens when:
 
- The /locate command is used.
- An Eye of Ender is used.
- An Explorer/Treasure Map is activated.
- A dolphin swims to a treasure location.
- A trade is done with a villager for a map.
- World.locateNearestStructure(Location, StructureType, int, boolean)is invoked.
- World.locateNearestStructure(Location, Structure, int, boolean)is invoked.
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.static @NotNull HandlerListGets theLocationfrom which the search is to be conducted.intGets the search radius in which to attempt locating the structure.Gets an unmodifiable list of Structures that are valid targets for the search.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetConfiguredStructures(@NotNull List<ConfiguredStructure> configuredStructures) Deprecated, for removal: This API element is subject to removal in a future version.voidsetFindUnexplored(boolean findUnexplored) Sets whether to search exclusively for unexplored structures.voidsetRadius(int radius) Sets the search radius in which to attempt locating the structure.voidvoidsetStructures(@NotNull List<Structure> structures) Sets the list of Structures that are valid targets for the search.booleanGets whether to search exclusively for unexplored structures.Methods inherited from class org.bukkit.event.world.WorldEventgetWorldMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
StructuresLocateEvent
 
- 
- 
Method Details- 
getOriginGets theLocationfrom which the search is to be conducted.- Returns:
- Locationwhere search begins
 
- 
getResultGets theLocationandStructureset as the result, if it was defined.Returns nullif it has not been set bysetResult(Result). Since this event fires before the search is done, the actual result is unknown at this point.- Returns:
- The result location and structure, if it has been set. null if it has not.
- See Also:
 
- 
setResult
- 
getConfiguredStructures@Deprecated(forRemoval=true) @NotNull public @NotNull List<ConfiguredStructure> getConfiguredStructures()Deprecated, for removal: This API element is subject to removal in a future version.usegetStructures()Gets a mutable list of ConfiguredStructures that are valid targets for the search.- Returns:
- a mutable list of ConfiguredStructures
 
- 
setConfiguredStructures@Deprecated(forRemoval=true) public void setConfiguredStructures(@NotNull @NotNull List<ConfiguredStructure> configuredStructures) Deprecated, for removal: This API element is subject to removal in a future version.Sets the list of ConfiguredStructures that are valid targets for the search.- Parameters:
- configuredStructures- a list of ConfiguredStructure targets
 
- 
getStructuresGets an unmodifiable list of Structures that are valid targets for the search.- Returns:
- an unmodifiable list of Structures
 
- 
setStructuresSets the list of Structures that are valid targets for the search.- Parameters:
- structures- a list of Structures targets
 
- 
getRadiuspublic int getRadius()Gets the search radius in which to attempt locating the structure.This radius may not always be obeyed during the structure search! - Returns:
- the search radius (in chunks)
 
- 
setRadiuspublic void setRadius(int radius) Sets the search radius in which to attempt locating the structure.This radius may not always be obeyed during the structure search! - Parameters:
- radius- the search radius (in chunks)
 
- 
shouldFindUnexploredpublic boolean shouldFindUnexplored()Gets whether to search exclusively for unexplored structures.As with the search radius, this value is not always obeyed. - Returns:
- Whether to search for only unexplored structures.
 
- 
setFindUnexploredpublic void setFindUnexplored(boolean findUnexplored) Sets whether to search exclusively for unexplored structures.As with the search radius, this value is not always obeyed. - Parameters:
- findUnexplored- Whether to search for only unexplored structures.
 
- 
isCancelledpublic boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
- 
getStructures()