diff --git a/build.gradle b/build.gradle index cb3c7fa..159b636 100644 --- a/build.gradle +++ b/build.gradle @@ -38,6 +38,8 @@ dependencies { compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT' compileOnly swdep("SpigotCore") compileOnly swdep("WorldEdit-1.15") + + compileOnly swdep('AxiomPaper') } steamwar { diff --git a/src/de/steamwar/teamserver/Builder.java b/src/de/steamwar/teamserver/Builder.java index 26de9d4..fffe767 100644 --- a/src/de/steamwar/teamserver/Builder.java +++ b/src/de/steamwar/teamserver/Builder.java @@ -21,6 +21,7 @@ package de.steamwar.teamserver; import de.steamwar.message.Message; import de.steamwar.teamserver.command.*; +import de.steamwar.teamserver.listener.AxiomHandshakeListener; import de.steamwar.teamserver.listener.FreezeListener; import de.steamwar.teamserver.listener.PlayerChange; import org.bukkit.Bukkit; @@ -47,6 +48,10 @@ public final class Builder extends JavaPlugin { new FreezeCommand(); new ArenaconfigCommand(); + if (Bukkit.getPluginManager().getPlugin("AxiomPaper") != null) { + new AxiomHandshakeListener(); + } + Bukkit.getPluginManager().registerEvents(new PlayerChange(), this); Bukkit.getPluginManager().registerEvents(new FreezeListener(), this); diff --git a/src/de/steamwar/teamserver/listener/AxiomHandshakeListener.java b/src/de/steamwar/teamserver/listener/AxiomHandshakeListener.java new file mode 100644 index 0000000..b68e6fc --- /dev/null +++ b/src/de/steamwar/teamserver/listener/AxiomHandshakeListener.java @@ -0,0 +1,32 @@ +/* + * 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.teamserver.listener; + +import com.moulberry.axiom.event.AxiomHandshakeEvent; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; + +public class AxiomHandshakeListener implements Listener { + + @EventHandler + public void onAxiomHandshake(AxiomHandshakeEvent event) { + event.setMaxBufferSize(Short.MAX_VALUE); + } +}