Add new group event API

This commit is contained in:
Daniel Saukel 2020-04-25 14:42:53 +02:00
parent 42cadaf7d1
commit 462db92cb8
18 changed files with 674 additions and 722 deletions

View File

@ -0,0 +1,99 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a group is created explicitly or implicitly.
*
* @author Daniel Saukel
*/
public class GroupCreateEvent extends GroupEvent implements Cancellable {
/**
* The reason why the group is created.
*/
public enum Cause {
ANNOUNCER,
COMMAND,
/**
* When a group is created to mirror the state of a party plugin.
*
* @see de.erethon.dungeonsxl.api.player.GroupAdapter
*/
GROUP_ADAPTER,
GROUP_SIGN,
/**
* When a group is created by an addon.
*/
CUSTOM
}
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player creator;
private Cause cause;
public GroupCreateEvent(PlayerGroup group, Player creator, Cause cause) {
super(group);
this.creator = creator;
this.cause = cause;
}
/**
* Returns the player who created the group.
*
* @return the player who created the group
*/
public Player getCreator() {
return creator;
}
/**
* Returns the cause for the group creation.
*
* @return the cause for the group creation
*/
public Cause getCause() {
return cause;
}
@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,96 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a group is disbanded.
*
* @author Daniel Saukel
*/
public class GroupDisbandEvent extends GroupEvent implements Cancellable {
public enum Cause {
COMMAND,
DUNGEON_FINISHED,
GROUP_ADAPTER,
GROUP_IS_EMPTY,
LOST,
CUSTOM
}
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player disbander;
private Cause cause;
public GroupDisbandEvent(PlayerGroup group, Cause cause) {
super(group);
this.cause = cause;
}
public GroupDisbandEvent(PlayerGroup group, Player disbander, Cause cause) {
super(group);
this.disbander = disbander;
this.cause = cause;
}
/**
* The player who disbanded the group.
* <p>
* This is null if the cause is {@link Cause#DUNGEON_FINISHED}, {@link Cause#GROUP_ADAPTER}, {@link Cause#LOST} or {@link Cause#CUSTOM}.
*
* @return the player who disbanded the group
*/
public Player getDisbander() {
return disbander;
}
/**
* Returns the cause for the group deletion.
*
* @return the cause for the group deletion
*/
public Cause getCause() {
return cause;
}
@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,67 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.dungeon.Dungeon;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a group finishs a {@link Dungeon}, which means the end floor of a dungeon.
*
* @author Daniel Saukel
*/
public class GroupFinishDungeonEvent extends GroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Dungeon dungeon;
public GroupFinishDungeonEvent(PlayerGroup group, Dungeon dungeon) {
super(group);
this.dungeon = dungeon;
}
/**
* Returns the dungeon the group was playing.
*
* @return the dungeon the group was playing
*/
public Dungeon getDungeon() {
return dungeon;
}
@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,90 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import de.erethon.dungeonsxl.api.world.GameWorld;
import de.erethon.dungeonsxl.api.world.ResourceWorld;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a group finishs a dungeon floor.
*
* @author Daniel Saukel
*/
public class GroupFinishFloorEvent extends GroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private GameWorld finished;
private ResourceWorld next;
public GroupFinishFloorEvent(PlayerGroup group, GameWorld finished, ResourceWorld next) {
super(group);
this.finished = finished;
this.next = next;
}
/**
* Returns the game world that was just finished.
*
* @return the game world that was just finished
*/
public GameWorld getFinished() {
return finished;
}
/**
* Returns the resource world of the next floor.
*
* @return the resource world of the next floor
*/
public ResourceWorld getNext() {
return next;
}
/**
* Sets the next floor to load.
* <p>
* If one has already been loaded because another group finished the floor earlier, this will not do anything.
*
* @param next the next floor to load
*/
public void setNext(ResourceWorld next) {
this.next = next;
}
@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,78 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.GlobalPlayer;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a player joins a DungeonsXL group.
*
* @author Daniel Saukel
*/
public class GroupPlayerJoinEvent extends GroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private GlobalPlayer player;
private boolean creator;
public GroupPlayerJoinEvent(PlayerGroup group, GlobalPlayer player, boolean creator) {
super(group);
this.player = player;
this.creator = creator;
}
/**
* Returns the player who is joining the group.
*
* @return the player who is joining the group
*/
public GlobalPlayer getPlayer() {
return player;
}
/**
* Returns if the player is the creator of the group.
*
* @return if the player is the creator of the group
*/
public boolean isCreator() {
return creator;
}
@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

@ -14,22 +14,35 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dplayer;
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.player.DGlobalPlayer;
import de.erethon.dungeonsxl.api.player.GlobalPlayer;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DPlayerKickEvent extends DPlayerEvent implements Cancellable {
public class GroupPlayerKickEvent extends GroupEvent implements Cancellable {
public enum Cause {
COMMAND,
/**
* When the player is kicked because he does not have any lives left.
*/
DEATH,
/**
* When a player is kicked from a group to mirror the state of a party plugin.
*
* @see de.erethon.dungeonsxl.api.player.GroupAdapter
*/
GROUP_ADAPTER,
OFFLINE,
/**
* When the time for the group to reach a certain state expired.
*/
TIME_EXPIRED,
CUSTOM
@ -38,27 +51,33 @@ public class DPlayerKickEvent extends DPlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private GlobalPlayer player;
private Cause cause;
public DPlayerKickEvent(DGlobalPlayer dPlayer, Cause cause) {
super(dPlayer);
public GroupPlayerKickEvent(PlayerGroup group, GlobalPlayer player, Cause cause) {
super(group);
this.player = player;
this.cause = cause;
}
/**
* @return the cause
* Returns the player who is joining the group.
*
* @return the player who is joining the group
*/
public GlobalPlayer getPlayer() {
return player;
}
/**
* Returns the cause of the kick.
*
* @return the cause of the kick
*/
public Cause getCause() {
return cause;
}
/**
* @param cause the cause to set
*/
public void setCause(Cause cause) {
this.cause = cause;
}
@Override
public HandlerList getHandlers() {
return handlers;

View File

@ -0,0 +1,67 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a player leaves a group.
*
* @author Daniel Saukel
*/
public class GroupPlayerLeaveEvent extends GroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player player;
public GroupPlayerLeaveEvent(PlayerGroup group, Player player) {
super(group);
this.player = player;
}
/**
* Returns the player who left the group.
*
* @return the player who left the group
*/
public Player getPlayer() {
return 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,78 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a group scores a point.
*
* @author Daniel Saukel
*/
public class GroupScoreEvent extends GroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player scorer;
private PlayerGroup loserGroup;
public GroupScoreEvent(PlayerGroup group, Player scorer, PlayerGroup loserGroup) {
super(group);
this.scorer = scorer;
this.loserGroup = loserGroup;
}
/**
* Returns the player who scored.
*
* @return the player who scored
*/
public Player getScorer() {
return scorer;
}
/**
* Returns the group that lost a score to the scorers.
*
* @return the group that lost a score to the scorers
*/
public PlayerGroup getLoserGroup() {
return loserGroup;
}
@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,67 @@
/*
* Copyright (C) 2014-2020 Daniel Saukel
*
* This library is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNULesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.api.event.group;
import de.erethon.dungeonsxl.api.player.PlayerGroup;
import de.erethon.dungeonsxl.api.world.GameWorld;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Fired when a group starts playing a floor.
*
* @author Daniel Saukel
*/
public class GroupStartFloorEvent extends GroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private GameWorld gameWorld;
public GroupStartFloorEvent(PlayerGroup group, GameWorld gameWorld) {
super(group);
this.gameWorld = gameWorld;
}
/**
* Returns the game instance.
*
* @return the game instance
*/
public GameWorld getGameWorld() {
return 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

@ -1,98 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DGroupCreateEvent extends DGroupEvent implements Cancellable {
public enum Cause {
ANNOUNCER,
COMMAND,
GROUP_SIGN,
CUSTOM
}
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player creator;
private Cause cause;
public DGroupCreateEvent(DGroup dGroup, Player creator, Cause cause) {
super(dGroup);
this.creator = creator;
this.cause = cause;
}
/**
* @return the creator
*/
public Player getCreator() {
return creator;
}
/**
* @param creator the creator to set
*/
public void setCreator(Player creator) {
this.creator = creator;
}
/**
* @return the cause
*/
public Cause getCause() {
return cause;
}
/**
* @param cause the cause to set
*/
public void setCause(Cause cause) {
this.cause = cause;
}
@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,104 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DGroupDisbandEvent extends DGroupEvent implements Cancellable {
public enum Cause {
COMMAND,
DUNGEON_FINISHED,
GROUP_IS_EMPTY,
LOST,
CUSTOM
}
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player disbander;
private Cause cause;
public DGroupDisbandEvent(DGroup dGroup, Cause cause) {
super(dGroup);
this.cause = cause;
}
public DGroupDisbandEvent(DGroup dGroup, Player disbander, Cause cause) {
super(dGroup);
this.disbander = disbander;
this.cause = cause;
}
/**
* @return the disbander
*/
public Player getDisbander() {
return disbander;
}
/**
* @param disbander the disbander to set
*/
public void setDisbander(Player disbander) {
this.disbander = disbander;
}
/**
* @return the cause
*/
public Cause getCause() {
return cause;
}
/**
* @param cause the cause to set
*/
public void setCause(Cause cause) {
this.cause = cause;
}
@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,47 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.event.Event;
/**
* @author Daniel Saukel
*/
public abstract class DGroupEvent extends Event {
private DGroup dGroup;
public DGroupEvent(DGroup dGroup) {
this.dGroup = dGroup;
}
/**
* @return the dGroup
*/
public DGroup getDGroup() {
return dGroup;
}
/**
* @param dGroup the dGroup to set
*/
public void setDGroup(DGroup dGroup) {
this.dGroup = dGroup;
}
}

View File

@ -1,72 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.dungeon.DDungeon;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DGroupFinishDungeonEvent extends DGroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private DDungeon dungeon;
public DGroupFinishDungeonEvent(DDungeon dungeon, DGroup dGroup) {
super(dGroup);
this.dungeon = dungeon;
}
/**
* @return the dungeon
*/
public DDungeon getDungeon() {
return dungeon;
}
/**
* @param dungeon the dungeon to set
*/
public void setDisbander(DDungeon dungeon) {
this.dungeon = dungeon;
}
@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,89 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.player.DGroup;
import de.erethon.dungeonsxl.world.DGameWorld;
import de.erethon.dungeonsxl.world.DResourceWorld;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DGroupFinishFloorEvent extends DGroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private DGameWorld finished;
private DResourceWorld next;
public DGroupFinishFloorEvent(DGroup dGroup, DGameWorld finished, DResourceWorld next) {
super(dGroup);
this.finished = finished;
this.next = next;
}
/**
* @return the finished
*/
public DGameWorld getFinished() {
return finished;
}
/**
* @param finished the name of the DGameWorld to set
*/
public void setFinished(DGameWorld finished) {
this.finished = finished;
}
/**
* @return the next
*/
public DResourceWorld getNext() {
return next;
}
/**
* @param next the resource to set
*/
public void setNext(DResourceWorld next) {
this.next = next;
}
@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,88 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DGroupScoreEvent extends DGroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private Player scorer;
private DGroup loserGroup;
public DGroupScoreEvent(DGroup dGroup, Player scorer, DGroup loserGroup) {
super(dGroup);
this.scorer = scorer;
this.loserGroup = loserGroup;
}
/**
* @return the creator
*/
public Player getScorer() {
return scorer;
}
/**
* @param scorer the scoerer to set
*/
public void setCreator(Player scorer) {
this.scorer = scorer;
}
/**
* @return the group that lost a score to the scorers
*/
public DGroup getLoserGroup() {
return loserGroup;
}
/**
* @param loserGroup the group that lost a score to the scorers to set
*/
public void setLoserGroup(DGroup loserGroup) {
this.loserGroup = loserGroup;
}
@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,72 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dgroup;
import de.erethon.dungeonsxl.player.DGroup;
import de.erethon.dungeonsxl.world.DGameWorld;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DGroupStartFloorEvent extends DGroupEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private DGameWorld gameWorld;
public DGroupStartFloorEvent(DGroup dGroup, DGameWorld gameWorld) {
super(dGroup);
this.gameWorld = gameWorld;
}
/**
* @return the gameWorld
*/
public DGameWorld getGameWorld() {
return gameWorld;
}
/**
* @param gameWorld the gameWorld to set
*/
public void setGameWorld(DGameWorld 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

@ -1,74 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dplayer;
import de.erethon.dungeonsxl.player.DGlobalPlayer;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DPlayerJoinDGroupEvent extends DPlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private boolean creator;
private DGroup dGroup;
public DPlayerJoinDGroupEvent(DGlobalPlayer dPlayer, boolean creator, DGroup dGroup) {
super(dPlayer);
this.creator = creator;
this.dGroup = dGroup;
}
/**
* @return if the player is the creator of the group
*/
public boolean isCreator() {
return creator;
}
/**
* @return the dGroup
*/
public DGroup getDGroup() {
return dGroup;
}
@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,65 +0,0 @@
/*
* Copyright (C) 2012-2020 Frank Baumann
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.erethon.dungeonsxl.event.dplayer;
import de.erethon.dungeonsxl.player.DGlobalPlayer;
import de.erethon.dungeonsxl.player.DGroup;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* @author Daniel Saukel
*/
public class DPlayerLeaveDGroupEvent extends DPlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private DGroup dGroup;
public DPlayerLeaveDGroupEvent(DGlobalPlayer dPlayer, DGroup dGroup) {
super(dPlayer);
this.dGroup = dGroup;
}
/**
* @return the dGroup
*/
public DGroup getDGroup() {
return dGroup;
}
@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;
}
}