Class 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, use getTheNewValue(). To change it, use setTheNewValue(Object).

    • 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 class org.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.
        Use getTheNewValue() 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.
        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 interface org.bukkit.event.Cancellable
      • setCancelled

        public void setCancelled​(boolean cancelled)
        Specified by:
        setCancelled in interface org.bukkit.event.Cancellable