Changed and added some of the new events

This commit is contained in:
Daniel Saukel 2016-01-10 16:50:05 +01:00
parent 1499f71a28
commit 83a2f3058d
16 changed files with 435 additions and 14 deletions

View File

@ -6,7 +6,7 @@ import org.bukkit.event.Event;
public abstract class DMobEvent extends Event {
private DMob dMob;
protected DMob dMob;
public DMobEvent(DMob dMob) {
this.dMob = dMob;

View File

@ -6,7 +6,7 @@ import org.bukkit.event.Event;
public abstract class DPlayerEvent extends Event {
private DPlayer dPlayer;
protected DPlayer dPlayer;
public DPlayerEvent(DPlayer dPlayer) {
this.dPlayer = dPlayer;

View File

@ -0,0 +1,30 @@
package io.github.dre2n.dungeonsxl.event.dsign;
import org.bukkit.event.Event;
import io.github.dre2n.dungeonsxl.sign.DSign;
public abstract class DSignEvent extends Event {
protected DSign dSign;
public DSignEvent(DSign dSign) {
this.dSign = dSign;
}
/**
* @return the dSign
*/
public DSign getdSign() {
return dSign;
}
/**
* @param dSign
* the dSign to set
*/
public void setdSign(DSign dSign) {
this.dSign = dSign;
}
}

View File

@ -0,0 +1,73 @@
package io.github.dre2n.dungeonsxl.event.dsign;
import io.github.dre2n.dungeonsxl.dungeon.game.GameWorld;
import io.github.dre2n.dungeonsxl.sign.DSign;
import org.bukkit.block.Sign;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class DSignRegistrationEvent extends DSignEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Sign sign;
private GameWorld gameWorld;
public DSignRegistrationEvent(Sign sign, GameWorld gameWorld, DSign dSign) {
super(dSign);
this.sign = sign;
this.gameWorld = gameWorld;
}
/**
* @return the sign
*/
public Sign getSign() {
return sign;
}
/**
* @param sign
* the sign to set
*/
public void setSign(Sign sign) {
this.sign = sign;
}
/**
* @return the gameWorld
*/
public GameWorld getGameWorld() {
return gameWorld;
}
/**
* @param gameWorld
* the gameWorld to set
*/
public void setGameWorld(GameWorld gameWorld) {
this.gameWorld = gameWorld;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -6,7 +6,7 @@ import org.bukkit.event.Event;
public abstract class EditWorldEvent extends Event {
private EditWorld editWorld;
protected EditWorld editWorld;
public EditWorldEvent(EditWorld editWorld) {
this.editWorld = editWorld;

View File

@ -6,7 +6,7 @@ import org.bukkit.event.Event;
public abstract class GameWorldEvent extends Event {
private GameWorld gameWorld;
protected GameWorld gameWorld;
public GameWorldEvent(GameWorld gameWorld) {
this.gameWorld = gameWorld;

View File

@ -0,0 +1,37 @@
package io.github.dre2n.dungeonsxl.event.gameworld;
import io.github.dre2n.dungeonsxl.dungeon.game.GameWorld;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class GameWorldStartGameEvent extends GameWorldEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
public GameWorldStartGameEvent(GameWorld gameWorld) {
super(gameWorld);
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -0,0 +1,53 @@
package io.github.dre2n.dungeonsxl.event.requirement;
import io.github.dre2n.dungeonsxl.requirement.Requirement;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class RequirementCheckEvent extends RequirementEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player player;
public RequirementCheckEvent(Requirement requirement) {
super(requirement);
}
/**
* @return the player
*/
public Player getPlayer() {
return player;
}
/**
* @param player the player to set
*/
public void setPlayer(Player player) {
this.player = player;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -0,0 +1,30 @@
package io.github.dre2n.dungeonsxl.event.requirement;
import io.github.dre2n.dungeonsxl.requirement.Requirement;
import org.bukkit.event.Event;
public abstract class RequirementEvent extends Event {
protected Requirement requirement;
public RequirementEvent(Requirement requirement) {
this.requirement = requirement;
}
/**
* @return the requirement
*/
public Requirement getRequirement() {
return requirement;
}
/**
* @param requirement
* the requirement to set
*/
public void setRequirement(Requirement requirement) {
this.requirement = requirement;
}
}

View File

@ -0,0 +1,36 @@
package io.github.dre2n.dungeonsxl.event.requirement;
import io.github.dre2n.dungeonsxl.requirement.Requirement;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class RequirementRegistrationEvent extends RequirementEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
public RequirementRegistrationEvent(Requirement requirement) {
super(requirement);
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -0,0 +1,36 @@
package io.github.dre2n.dungeonsxl.event.reward;
import io.github.dre2n.dungeonsxl.reward.Reward;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class RewardAdditionEvent extends RewardEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
public RewardAdditionEvent(Reward reward) {
super(reward);
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -0,0 +1,30 @@
package io.github.dre2n.dungeonsxl.event.reward;
import org.bukkit.event.Event;
import io.github.dre2n.dungeonsxl.reward.Reward;
public abstract class RewardEvent extends Event {
protected Reward reward;
public RewardEvent(Reward reward) {
this.reward = reward;
}
/**
* @return the reward
*/
public Reward getReward() {
return reward;
}
/**
* @param reward
* the reward to set
*/
public void setReward(Reward reward) {
this.reward = reward;
}
}

View File

@ -0,0 +1,36 @@
package io.github.dre2n.dungeonsxl.event.reward;
import io.github.dre2n.dungeonsxl.reward.Reward;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class RewardRegistrationEvent extends RewardEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
public RewardRegistrationEvent(Reward reward) {
super(reward);
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}

View File

@ -1,23 +1,17 @@
package io.github.dre2n.dungeonsxl.event;
package io.github.dre2n.dungeonsxl.event.trigger;
import io.github.dre2n.dungeonsxl.trigger.Trigger;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class TriggerEvent extends Event implements Cancellable {
public class TriggerActionEvent extends TriggerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Trigger trigger;
/**
* @return the trigger
*/
public Trigger getTrigger() {
return trigger;
public TriggerActionEvent(Trigger trigger) {
super(trigger);
}
@Override

View File

@ -0,0 +1,22 @@
package io.github.dre2n.dungeonsxl.event.trigger;
import io.github.dre2n.dungeonsxl.trigger.Trigger;
import org.bukkit.event.Event;
public abstract class TriggerEvent extends Event {
protected Trigger trigger;
public TriggerEvent(Trigger trigger) {
this.trigger = trigger;
}
/**
* @return the trigger
*/
public Trigger getTrigger() {
return trigger;
}
}

View File

@ -0,0 +1,44 @@
package io.github.dre2n.dungeonsxl.event.trigger;
import io.github.dre2n.dungeonsxl.trigger.Trigger;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
public class TriggerRegistrationEvent extends TriggerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
public TriggerRegistrationEvent(Trigger trigger) {
super(trigger);
}
/**
* @param trigger
* the trigger to set
*/
public void setTrigger(Trigger trigger) {
this.trigger = trigger;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
}