Package com.plotsquared.core.events
Class PlayerBuyPlotEvent
java.lang.Object
com.plotsquared.core.events.PlotEvent
com.plotsquared.core.events.PlotPlayerEvent
com.plotsquared.core.events.PlayerBuyPlotEvent
- All Implemented Interfaces:
CancellablePlotEvent
Called when a user attempts to buy a plot.
Setting the Result to Result.FORCE ignores the price and players account balance and does not charge the
player anything. Result.DENY blocks the purchase completely, Result.ACCEPT and null do not modify
the behaviour.
Setting the price to 0 makes the plot practically free.
- Since:
- 7.3.2
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerBuyPlotEvent(PlotPlayer<?> plotPlayer, Plot plot, @org.checkerframework.checker.index.qual.NonNegative double price) -
Method Summary
Modifier and TypeMethodDescriptionThe currently setResultfor this event (as set by potential previous event listeners).@org.checkerframework.checker.index.qual.NonNegative doubleprice()Returns the currently set price required to buy the plot.voidsetEventResult(@Nullable Result eventResult) Set theResultfor this event.voidsetPrice(@org.checkerframework.checker.index.qual.NonNegative double price) Sets the price required to buy the plot.Methods inherited from class com.plotsquared.core.events.PlotPlayerEvent
getPlotPlayerMethods inherited from class com.plotsquared.core.events.PlotEvent
getEventName, getPlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.plotsquared.core.events.CancellablePlotEvent
getEventResultRaw
-
Constructor Details
-
PlayerBuyPlotEvent
public PlayerBuyPlotEvent(PlotPlayer<?> plotPlayer, Plot plot, @org.checkerframework.checker.index.qual.NonNegative double price)
-
-
Method Details
-
setPrice
Sets the price required to buy the plot.- Parameters:
price- the new price.- Since:
- 7.3.2
-
price
Returns the currently set price required to buy the plot.- Returns:
- the price.
- Since:
- 7.3.2
-
setEventResult
Set theResultfor this event.- Specified by:
setEventResultin interfaceCancellablePlotEvent- Parameters:
eventResult- the new result.
-
getEventResult
The currently setResultfor this event (as set by potential previous event listeners).- Specified by:
getEventResultin interfaceCancellablePlotEvent- Returns:
- the current result.
-