Class LoupeStartScanningEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.github.pylonmc.pylon.api.event.LoupeStartScanningEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class LoupeStartScanningEvent
extends org.bukkit.event.player.PlayerEvent
implements org.bukkit.event.Cancellable
Called when a
If you'd like to add custom scanning functionality, use
Player attempts to start scanning something with the Loupe
This event marks the start of a scan and LoupeCompleteScanningEvent marks the completion of a scan
If you'd like to add custom scanning functionality, use
setCustomHandled(boolean)
to handle the starting logic (e.g. filtering out anything that shouldn't be scanned, communicating why to players, etc)
And use LoupeCompleteScanningEvent.setCustomHandled(boolean) to handle the scan completed logic (e.g. giving
research points, etc)-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionLoupeStartScanningEvent(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.util.RayTraceResult scanTarget) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListorg.bukkit.util.RayTraceResultThe target of theLoupe's scan, guaranteed to have either aRayTraceResult.getHitBlock()orRayTraceResult.getHitEntity()booleanbooleanIf the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.voidsetCancelled(boolean cancelled) voidsetCustomHandled(boolean customHandled) If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
LoupeStartScanningEvent
public LoupeStartScanningEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.util.RayTraceResult scanTarget)
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList() -
getScanTarget
public org.bukkit.util.RayTraceResult getScanTarget()The target of theLoupe's scan, guaranteed to have either aRayTraceResult.getHitBlock()orRayTraceResult.getHitEntity() -
isCustomHandled
public boolean isCustomHandled()If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.
When implementing custom handling, theLoupewill only act as a tracker for beginning and completing scans and assuring the target remains the same throughout. No other logic such as player feedback, research point rewards, etc, is run, you must do that all yourself.
If one plugin is already custom handling, it is recommended not to do it as well. -
setCustomHandled
public void setCustomHandled(boolean customHandled) If the scan logic is being handled by an outside plugin, such as to introduce scanning new objects or introducing special cases.
When implementing custom handling, theLoupewill only act as a tracker for beginning and completing scans and assuring the target remains the same throughout. No other logic such as player feedback, research point rewards, etc, is run, you must do that all yourself.
If one plugin is already custom handling, it is recommended not to do it as well. -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-