SteamWar/SpigotCore
Archiviert
13
0

Update CommonCore
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Update handlers
Dieser Commit ist enthalten in:
yoyosource 2022-09-24 19:48:10 +02:00
Ursprung 3e1fb10abc
Commit 70de18adf4
3 geänderte Dateien mit 10 neuen und 14 gelöschten Zeilen

@ -1 +1 @@
Subproject commit be2b368802a2f6c188266f829f0743beaf1931c3
Subproject commit d90938eff2a258d3dbd9b975b9df0fc7fe87b938

Datei anzeigen

@ -20,9 +20,12 @@
package de.steamwar.network;
import de.steamwar.core.BountifulWrapper;
import de.steamwar.network.handlers.InventoryHandler;
import de.steamwar.linkage.Linked;
import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.server.*;
import de.steamwar.network.packets.server.BaumemberUpdatePacket;
import de.steamwar.network.packets.server.CloseInventoryPacket;
import de.steamwar.network.packets.server.LocaleInvalidationPacket;
import de.steamwar.network.packets.server.PingPacket;
import de.steamwar.sql.BauweltMember;
import de.steamwar.sql.SteamwarUser;
import org.bukkit.Bukkit;
@ -30,13 +33,9 @@ import org.bukkit.entity.Player;
import java.util.UUID;
@Linked
public class CoreNetworkHandler extends PacketHandler {
public CoreNetworkHandler() {
super();
new InventoryHandler().register();
}
@Handler
public void handleBaumemberUpdatePacket(BaumemberUpdatePacket packet) {
BauweltMember.clear();
@ -50,11 +49,6 @@ public class CoreNetworkHandler extends PacketHandler {
}
}
@Handler
public void handleInventoryPacket(InventoryPacket packet) {
InventoryHandler.handleInventoryPacket(packet);
}
@Handler
public void handlePingPacket(PingPacket packet) {
UUID uuid = SteamwarUser.get(packet.getId()).getUUID();

Datei anzeigen

@ -22,6 +22,7 @@ package de.steamwar.network.handlers;
import com.google.gson.JsonParser;
import de.steamwar.inventory.SWInventory;
import de.steamwar.inventory.SWItem;
import de.steamwar.linkage.Linked;
import de.steamwar.network.NetworkSender;
import de.steamwar.network.packets.PacketHandler;
import de.steamwar.network.packets.client.InventoryCallbackPacket;
@ -34,10 +35,11 @@ import org.bukkit.event.inventory.InventoryType;
import java.util.HashMap;
import java.util.Map;
@Linked
public class InventoryHandler extends PacketHandler {
@Handler
public static void handleInventoryPacket(InventoryPacket packet) {
public void handleInventoryPacket(InventoryPacket packet) {
Player player = Bukkit.getPlayer(SteamwarUser.get(packet.getPlayer()).getUUID());
Map<Integer, SWItem> items = new HashMap<>();
packet.getItems().forEach((i, item) -> {