Skip to content

Commit

Permalink
feat: go to snapshot, BedWarsGameEnabledEvent, BedWarsGameDisabledEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 committed Jan 2, 2024
1 parent 3e2a7f3 commit 8477933
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2023 ScreamingSandals
*
* This file is part of Screaming BedWars.
*
* Screaming BedWars 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.
*
* Screaming BedWars 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Screaming BedWars. If not, see <https://www.gnu.org/licenses/>.
*/

package org.screamingsandals.bedwars.api.events;

import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.screamingsandals.bedwars.api.game.Game;

/**
* @author Bedwars Team
*/
public class BedWarsGameDisabledEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private Game game;

/**
* @param game
*/
public BedWarsGameDisabledEvent(Game game) {
this.game = game;
}

@Override
public HandlerList getHandlers() {
return BedWarsGameDisabledEvent.handlers;
}

/**
* @return game
*/
public Game getGame() {
return this.game;
}

public static HandlerList getHandlerList() {
return BedWarsGameDisabledEvent.handlers;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright (C) 2023 ScreamingSandals
*
* This file is part of Screaming BedWars.
*
* Screaming BedWars 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.
*
* Screaming BedWars 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Screaming BedWars. If not, see <https://www.gnu.org/licenses/>.
*/

package org.screamingsandals.bedwars.api.events;

import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.screamingsandals.bedwars.api.game.Game;

/**
* @author Bedwars Team
*/
public class BedWarsGameEnabledEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private Game game;

/**
* @param game
*/
public BedWarsGameEnabledEvent(Game game) {
this.game = game;
}

@Override
public HandlerList getHandlers() {
return BedWarsGameEnabledEvent.handlers;
}

/**
* @return game
*/
public Game getGame() {
return this.game;
}

public static HandlerList getHandlerList() {
return BedWarsGameEnabledEvent.handlers;
}

}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {

allprojects {
group = 'org.screamingsandals.bedwars'
version = '0.2.31'
version = '0.2.32-SNAPSHOT'
}

if (version.toString().endsWith('-SNAPSHOT')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ public void run() {
statusbar = BossBarSelector.getBossBar(lobbySpawn);
}
preparing = false;
Bukkit.getPluginManager().callEvent(new BedWarsGameEnabledEvent(this));
}
}

Expand All @@ -1348,6 +1349,7 @@ public void stop() {
} else {
afterRebuild = GameStatus.DISABLED;
}
Bukkit.getPluginManager().callEvent(new BedWarsGameDisabledEvent(this));
}

public void joinToGame(Player player) {
Expand Down

0 comments on commit 8477933

Please sign in to comment.