diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauMemberUpdate.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauMemberUpdate.java new file mode 100644 index 00000000..fe90be02 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/BauMemberUpdate.java @@ -0,0 +1,50 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2023 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.features.world; + +import de.steamwar.bausystem.utils.BauMemberUpdateEvent; +import de.steamwar.command.SWCommand; +import de.steamwar.linkage.Linked; +import de.steamwar.network.packets.PacketHandler; +import de.steamwar.network.packets.server.BaumemberUpdatePacket; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + +@Linked +public class BauMemberUpdate extends PacketHandler { + + @Handler + public void baumemberUpdate(BaumemberUpdatePacket baumemberUpdatePacket) { + Bukkit.getPluginManager().callEvent(new BauMemberUpdateEvent()); + } + + @Linked + public static class TestCommand extends SWCommand { // TODO: Remove before merge + + public TestCommand() { + super("test"); + } + + @Register + public void test(Player player) { + PacketHandler.handlePacket(new BaumemberUpdatePacket()); + } + } +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/utils/BauMemberUpdateEvent.java b/BauSystem_Main/src/de/steamwar/bausystem/utils/BauMemberUpdateEvent.java new file mode 100644 index 00000000..4d26dc6f --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/utils/BauMemberUpdateEvent.java @@ -0,0 +1,36 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2023 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero 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 Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.bausystem.utils; + +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public class BauMemberUpdateEvent extends Event { + + private static final HandlerList handlers = new HandlerList(); + + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } +}