Quests/main/src/main/java/me/blackvein/quests/events/editor/conditions/ConditionsEditorEvent.java

81 lines
3.0 KiB
Java

/*******************************************************************************************************
* Continued by PikaMug (formerly HappyPikachu) with permission from _Blackvein_. All rights reserved.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************************************/
package me.blackvein.quests.events.editor.conditions;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
import org.bukkit.event.HandlerList;
import me.blackvein.quests.Quests;
import me.blackvein.quests.conditions.ConditionFactory;
import me.blackvein.quests.events.QuestsEvent;
/**
* Represents an Conditions Editor-related event
*/
public abstract class ConditionsEditorEvent extends QuestsEvent {
private static final HandlerList HANDLERS = new HandlerList();
protected ConversationContext context;
private final ConditionFactory factory;
private final Prompt prompt;
public ConditionsEditorEvent(final ConversationContext context, final Prompt prompt) {
this.context = context;
this.factory = ((Quests)context.getPlugin()).getConditionFactory();
this.prompt = prompt;
}
public ConditionsEditorEvent(final ConversationContext context, final Prompt prompt, final boolean async) {
super(async);
this.context = context;
this.factory = ((Quests)context.getPlugin()).getConditionFactory();
this.prompt = prompt;
}
/**
* Returns the context involved in this event
*
* @return ConversationContext which is involved in this event
*/
public ConversationContext getConversationContext() {
return context;
}
/**
* Returns the factory involved in this event
*
* @return ConditionFactory which is involved in this event
*/
public ConditionFactory getConditionFactory() {
return factory;
}
/**
* Returns the prompt involved in this event
*
* @return Prompt which is involved in this event
*/
public Prompt getPrompt() {
return prompt;
}
@Override
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlerList() {
return HANDLERS;
}
}