From 3e1fb10abcbb73c8558c02ecbd2e0db2e1e61b1f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 24 Sep 2022 13:43:42 +0200 Subject: [PATCH] Rebuild to new linkage system --- .../command/CaseInsensitiveCommandsListener.java | 3 +-- SpigotCore_Main/src/de/steamwar/core/Core.java | 10 +--------- .../src/de/steamwar/core/authlib/AuthlibInjector.java | 3 +-- .../src/de/steamwar/core/events/ChattingEvent.java | 3 +-- .../src/de/steamwar/core/events/PartialChunkFixer.java | 3 +-- .../src/de/steamwar/core/events/PlayerJoinedEvent.java | 3 +-- .../src/de/steamwar/core/events/WorldLoadEvent.java | 3 +-- .../steamwar/network/handlers/ServerDataHandler.java | 5 +---- 8 files changed, 8 insertions(+), 25 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/CaseInsensitiveCommandsListener.java b/SpigotCore_Main/src/de/steamwar/command/CaseInsensitiveCommandsListener.java index 72b0dda..8bb872a 100644 --- a/SpigotCore_Main/src/de/steamwar/command/CaseInsensitiveCommandsListener.java +++ b/SpigotCore_Main/src/de/steamwar/command/CaseInsensitiveCommandsListener.java @@ -20,13 +20,12 @@ package de.steamwar.command; import de.steamwar.linkage.Linked; -import de.steamwar.linkage.types.ListenerLink; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerCommandPreprocessEvent; -@Linked(ListenerLink.class) +@Linked public class CaseInsensitiveCommandsListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) diff --git a/SpigotCore_Main/src/de/steamwar/core/Core.java b/SpigotCore_Main/src/de/steamwar/core/Core.java index 82f63af..e53ea08 100644 --- a/SpigotCore_Main/src/de/steamwar/core/Core.java +++ b/SpigotCore_Main/src/de/steamwar/core/Core.java @@ -21,15 +21,7 @@ package de.steamwar.core; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.command.*; -import de.steamwar.core.authlib.AuthlibInjector; -import de.steamwar.core.events.ChattingEvent; -import de.steamwar.core.events.PartialChunkFixer; -import de.steamwar.core.events.PlayerJoinedEvent; -import de.steamwar.core.events.WorldLoadEvent; -import de.steamwar.linkage.types.EnableLink; -import de.steamwar.linkage.types.Plain; import de.steamwar.spigotcore.linkage.LinkageUtils; -import de.steamwar.linkage.types.ListenerLink; import de.steamwar.message.Message; import de.steamwar.network.NetworkReceiver; import de.steamwar.sql.Statement; @@ -124,7 +116,7 @@ public class Core extends JavaPlugin{ getServer().getMessenger().registerOutgoingPluginChannel(this, "sw:bridge"); TinyProtocol.init(); - LinkageUtils.run(ListenerLink.class, EnableLink.class, Plain.class); + LinkageUtils.link(); try { getLogger().log(Level.INFO, "Running on: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine()); diff --git a/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java b/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java index c83dce8..eb8b90e 100644 --- a/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java +++ b/SpigotCore_Main/src/de/steamwar/core/authlib/AuthlibInjector.java @@ -25,9 +25,8 @@ import com.mojang.authlib.yggdrasil.YggdrasilGameProfileRepository; import de.steamwar.linkage.Linked; import de.steamwar.linkage.MaxVersion; import de.steamwar.linkage.api.Enable; -import de.steamwar.linkage.types.EnableLink; -@Linked(EnableLink.class) +@Linked @MaxVersion(18) public class AuthlibInjector implements Enable { diff --git a/SpigotCore_Main/src/de/steamwar/core/events/ChattingEvent.java b/SpigotCore_Main/src/de/steamwar/core/events/ChattingEvent.java index 7d1cf61..a25a491 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/ChattingEvent.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/ChattingEvent.java @@ -21,13 +21,12 @@ package de.steamwar.core.events; import de.steamwar.core.Core; import de.steamwar.linkage.Linked; -import de.steamwar.linkage.types.ListenerLink; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.AsyncPlayerChatEvent; -@Linked(ListenerLink.class) +@Linked public class ChattingEvent implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) diff --git a/SpigotCore_Main/src/de/steamwar/core/events/PartialChunkFixer.java b/SpigotCore_Main/src/de/steamwar/core/events/PartialChunkFixer.java index 47f1748..e80442f 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/PartialChunkFixer.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/PartialChunkFixer.java @@ -28,7 +28,6 @@ import de.steamwar.core.CraftbukkitWrapper; import de.steamwar.linkage.Linked; import de.steamwar.linkage.MaxVersion; import de.steamwar.linkage.PluginCheck; -import de.steamwar.linkage.types.Plain; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -39,7 +38,7 @@ import java.util.List; * TinyProtocol can't translate BlockEntities during 1.16 to 1.17 conversions du to removed partial chunk update support. This class cancels PartialChunkUpdates for this players and sends them a complete chunk instead. * This class can only be loaded on 1.9 to 1.15 with active ViaVersion. **/ -@Linked(Plain.class) +@Linked @MaxVersion(16) @PluginCheck("ViaVersion") public class PartialChunkFixer { diff --git a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java index 3503fc0..0e7a156 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java @@ -20,7 +20,6 @@ package de.steamwar.core.events; import de.steamwar.linkage.Linked; -import de.steamwar.linkage.types.ListenerLink; import de.steamwar.sql.SteamwarUser; import de.steamwar.sql.UserGroup; import org.bukkit.entity.Player; @@ -30,7 +29,7 @@ import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; -@Linked(ListenerLink.class) +@Linked public class PlayerJoinedEvent implements Listener{ @EventHandler diff --git a/SpigotCore_Main/src/de/steamwar/core/events/WorldLoadEvent.java b/SpigotCore_Main/src/de/steamwar/core/events/WorldLoadEvent.java index 0babf9d..f7aba87 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/WorldLoadEvent.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/WorldLoadEvent.java @@ -20,12 +20,11 @@ package de.steamwar.core.events; import de.steamwar.linkage.Linked; -import de.steamwar.linkage.types.ListenerLink; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.world.WorldInitEvent; -@Linked(ListenerLink.class) +@Linked public class WorldLoadEvent implements Listener { @EventHandler diff --git a/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java b/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java index 865d811..e888db7 100644 --- a/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java +++ b/SpigotCore_Main/src/de/steamwar/network/handlers/ServerDataHandler.java @@ -3,13 +3,10 @@ package de.steamwar.network.handlers; import com.comphenix.tinyprotocol.Reflection; import com.comphenix.tinyprotocol.TinyProtocol; import de.steamwar.core.ChatWrapper; -import de.steamwar.core.CraftbukkitWrapper; -import de.steamwar.linkage.Linked; import de.steamwar.linkage.MinVersion; -import de.steamwar.linkage.types.Plain; import org.bukkit.entity.Player; -// @Linked(Plain.class) +// @Linked @MinVersion(19) public class ServerDataHandler {