forked from SteamWar/SteamWar
Implement Linkage for LobbySystem
This commit is contained in:
@@ -23,6 +23,7 @@ import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.inventory.SWInventory;
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.inventory.SWListInv;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.sql.NodeMember;
|
||||
import de.steamwar.sql.SchematicNode;
|
||||
@@ -34,6 +35,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@Linked
|
||||
public class AdventCommand extends SWCommand {
|
||||
|
||||
public AdventCommand() {
|
||||
|
||||
@@ -20,15 +20,17 @@
|
||||
package de.steamwar.lobby.special.advent;
|
||||
|
||||
import de.steamwar.inventory.SWItem;
|
||||
import de.steamwar.lobby.listener.BasicListener;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class AdventListener extends BasicListener {
|
||||
@Linked
|
||||
public class AdventListener implements Listener {
|
||||
|
||||
public static final int ADVENT_SLOT = 7;
|
||||
public static final SWItem ADVENT = SWItem.getPlayerSkull("MHF_Present1");
|
||||
|
||||
@@ -35,15 +35,9 @@ public class AdventsCalendar {
|
||||
|
||||
private static List<Present> presentList = new ArrayList<>();
|
||||
|
||||
private static File file = new File(LobbySystem.getPlugin().getDataFolder(), "presents.yml");
|
||||
private static File file = new File(LobbySystem.getInstance().getDataFolder(), "presents.yml");
|
||||
private static FileConfiguration fileConfiguration = YamlConfiguration.loadConfiguration(file);
|
||||
|
||||
public static void init() {
|
||||
new AdventCommand();
|
||||
new AdventListener();
|
||||
new PresentClickListener();
|
||||
}
|
||||
|
||||
static {
|
||||
for (int i = 1; i <= 31; i++) {
|
||||
if (i > 24 && i < 31) continue;
|
||||
|
||||
@@ -115,7 +115,7 @@ public class Present {
|
||||
locations.add(point);
|
||||
}
|
||||
generate();
|
||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> {
|
||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getInstance(), () -> {
|
||||
BlockData blockData = location.getBlock().getBlockData();
|
||||
players.forEach(pl -> {
|
||||
if (pl == player) return;
|
||||
|
||||
@@ -19,18 +19,20 @@
|
||||
|
||||
package de.steamwar.lobby.special.advent;
|
||||
|
||||
import de.steamwar.linkage.Linked;
|
||||
import de.steamwar.lobby.LobbySystem;
|
||||
import de.steamwar.lobby.listener.BasicListener;
|
||||
import de.steamwar.sql.NodeMember;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class PresentClickListener extends BasicListener {
|
||||
@Linked
|
||||
public class PresentClickListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
|
||||
Reference in New Issue
Block a user