Dieser Commit ist enthalten in:
Ursprung
4462c95607
Commit
8f544c3fd0
@ -33,7 +33,7 @@ targetCompatibility = 1.8
|
||||
sourceSets {
|
||||
main {
|
||||
java {
|
||||
srcDirs = ['src/']
|
||||
srcDirs = ['src/', 'build/generated/sources/annotationProcessor/java/main/']
|
||||
}
|
||||
resources {
|
||||
srcDirs = ['src/']
|
||||
@ -65,10 +65,5 @@ dependencies {
|
||||
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||||
|
||||
implementation project(':CommonCore')
|
||||
}
|
||||
|
||||
processResources {
|
||||
from("build/classes/java/main/META-INF/annotations/") {
|
||||
into("de.steamwar.bausystem")
|
||||
}
|
||||
annotationProcessor project(":CommonCore")
|
||||
}
|
||||
|
@ -19,11 +19,14 @@
|
||||
|
||||
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)
|
||||
public class CaseInsensitiveCommandsListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||
|
@ -26,6 +26,10 @@ 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;
|
||||
@ -115,22 +119,13 @@ public class Core extends JavaPlugin{
|
||||
}
|
||||
});
|
||||
Bukkit.getScheduler().runTaskTimer(this, TabCompletionCache::invalidateOldEntries, 20, 20);
|
||||
Bukkit.getPluginManager().registerEvents(new CaseInsensitiveCommandsListener(), this);
|
||||
|
||||
Bukkit.getPluginManager().registerEvents(new PlayerJoinedEvent(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new ChattingEvent(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new WorldLoadEvent(), this);
|
||||
getServer().getMessenger().registerIncomingPluginChannel(this, "sw:bridge", new NetworkReceiver());
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "sw:bridge");
|
||||
if(Core.getVersion() < 19)
|
||||
AuthlibInjector.inject();
|
||||
|
||||
LinkageUtils.run(ListenerLink.class, EnableLink.class);
|
||||
TinyProtocol.init();
|
||||
|
||||
if(Core.getVersion() < 17 && Bukkit.getPluginManager().getPlugin("ViaVersion") != null)
|
||||
new PartialChunkFixer();
|
||||
|
||||
if(Core.getVersion() >= 19)
|
||||
//new ServerDataHandler();
|
||||
LinkageUtils.run(Plain.class);
|
||||
|
||||
try {
|
||||
getLogger().log(Level.INFO, "Running on: " + new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("hostname").getInputStream())).readLine());
|
||||
|
@ -22,11 +22,17 @@ package de.steamwar.core.authlib;
|
||||
import com.comphenix.tinyprotocol.Reflection;
|
||||
import com.mojang.authlib.GameProfileRepository;
|
||||
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;
|
||||
|
||||
public class AuthlibInjector {
|
||||
private AuthlibInjector() {}
|
||||
@Linked(EnableLink.class)
|
||||
@MaxVersion(19)
|
||||
public class AuthlibInjector implements Enable {
|
||||
|
||||
public static void inject() {
|
||||
@Override
|
||||
public void enable() {
|
||||
Class<?> minecraftServerClass = Reflection.getClass("{nms.server}.MinecraftServer");
|
||||
Reflection.FieldAccessor<GameProfileRepository> gameProfile = Reflection.getField(minecraftServerClass, GameProfileRepository.class, 0);
|
||||
Object minecraftServer = Reflection.getTypedMethod(minecraftServerClass, "getServer", minecraftServerClass).invoke(null);
|
||||
|
@ -20,15 +20,18 @@
|
||||
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)
|
||||
public class ChattingEvent implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
private void onChat(AsyncPlayerChatEvent event) {
|
||||
public void onChat(AsyncPlayerChatEvent event) {
|
||||
event.setCancelled(true);
|
||||
Core.MESSAGE.broadcastPrefixless("LOCAL_CHAT", event.getPlayer().getDisplayName(), event.getMessage());
|
||||
}
|
||||
|
@ -25,6 +25,10 @@ import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.ViaAPI;
|
||||
import de.steamwar.core.Core;
|
||||
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;
|
||||
|
||||
@ -35,6 +39,9 @@ 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)
|
||||
@MaxVersion(17)
|
||||
@PluginCheck("ViaVersion")
|
||||
public class PartialChunkFixer {
|
||||
|
||||
private static final int PROTOCOL1_17 = 755;
|
||||
|
@ -19,6 +19,8 @@
|
||||
|
||||
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;
|
||||
@ -28,10 +30,11 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
|
||||
@Linked(ListenerLink.class)
|
||||
public class PlayerJoinedEvent implements Listener{
|
||||
|
||||
@EventHandler
|
||||
private void onJoin(PlayerJoinEvent event) {
|
||||
public void onJoin(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||
|
||||
@ -45,7 +48,7 @@ public class PlayerJoinedEvent implements Listener{
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onQuit(PlayerQuitEvent event) {
|
||||
public void onQuit(PlayerQuitEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
event.setQuitMessage("§c§l« §r" + player.getDisplayName());
|
||||
|
@ -19,10 +19,13 @@
|
||||
|
||||
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)
|
||||
public class WorldLoadEvent implements Listener {
|
||||
|
||||
@EventHandler
|
||||
|
@ -4,8 +4,13 @@ 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)
|
||||
@MinVersion(19)
|
||||
public class ServerDataHandler {
|
||||
|
||||
private Class<?> serverDataPacket = Reflection.getClass("{nms.network.protocol.game}.ClientboundServerDataPacket");
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren