Class MVWorldPropertyChangeEvent<T>
- java.lang.Object
-
- org.bukkit.event.Event
-
- com.onarandombox.MultiverseCore.event.MVWorldPropertyChangeEvent<T>
-
- Type Parameters:
T
- The type of the property that was set.
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class MVWorldPropertyChangeEvent<T> extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
This event is fired *before* the property is actually changed.If it is cancelled, no change will happen.
If you want to get the values of the world before the change, query the world. To get the name of the property that was changed, use
getPropertyName()
. To get the new value, usegetTheNewValue()
. To change it, usesetTheNewValue(Object)
.
-
-
Constructor Summary
Constructors Constructor Description MVWorldPropertyChangeEvent(MultiverseWorld world, org.bukkit.command.CommandSender changer, java.lang.String name, T value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.bukkit.command.CommandSender
getCommandSender()
Gets the person (or console) who was responsible for the change.static org.bukkit.event.HandlerList
getHandlerList()
Gets the handler list.org.bukkit.event.HandlerList
getHandlers()
java.lang.String
getNewValue()
Deprecated.UsegetTheNewValue()
instead.java.lang.String
getPropertyName()
Gets the changed world property's name.T
getTheNewValue()
Gets the new value.MultiverseWorld
getWorld()
Get the world targeted because of this change.boolean
isCancelled()
void
setCancelled(boolean cancelled)
void
setNewValue(java.lang.String value)
Deprecated.UsesetTheNewValue(Object)
instead.void
setTheNewValue(T value)
Sets the new value.
-
-
-
Constructor Detail
-
MVWorldPropertyChangeEvent
public MVWorldPropertyChangeEvent(MultiverseWorld world, org.bukkit.command.CommandSender changer, java.lang.String name, T value)
-
-
Method Detail
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()
- Specified by:
getHandlers
in classorg.bukkit.event.Event
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
Gets the handler list. This is required by the event system.- Returns:
- A list of handlers.
-
getPropertyName
public java.lang.String getPropertyName()
Gets the changed world property's name.- Returns:
- The changed world property's name.
-
getNewValue
@Deprecated public java.lang.String getNewValue()
Deprecated.UsegetTheNewValue()
instead.Gets the new value.- Returns:
- The new value.
-
getTheNewValue
public T getTheNewValue()
Gets the new value.- Returns:
- The new value.
-
setNewValue
@Deprecated public void setNewValue(java.lang.String value)
Deprecated.UsesetTheNewValue(Object)
instead.Sets the new value.This method is only a stub, it'll always throw an
UnsupportedOperationException
!- Parameters:
value
- The new new value.
-
setTheNewValue
public void setTheNewValue(T value)
Sets the new value.- Parameters:
value
- The new value.
-
getWorld
public MultiverseWorld getWorld()
Get the world targeted because of this change.- Returns:
- A valid MultiverseWorld.
-
getCommandSender
public org.bukkit.command.CommandSender getCommandSender()
Gets the person (or console) who was responsible for the change.This may be null!
- Returns:
- The person (or console) who was responsible for the change.
-
isCancelled
public boolean isCancelled()
- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancelled)
- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
-
-