Update handlers
Dieser Commit ist enthalten in:
Ursprung
3e1fb10abc
Commit
70de18adf4
@ -1 +1 @@
|
|||||||
Subproject commit be2b368802a2f6c188266f829f0743beaf1931c3
|
Subproject commit d90938eff2a258d3dbd9b975b9df0fc7fe87b938
|
@ -20,9 +20,12 @@
|
|||||||
package de.steamwar.network;
|
package de.steamwar.network;
|
||||||
|
|
||||||
import de.steamwar.core.BountifulWrapper;
|
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.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.BauweltMember;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -30,13 +33,9 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@Linked
|
||||||
public class CoreNetworkHandler extends PacketHandler {
|
public class CoreNetworkHandler extends PacketHandler {
|
||||||
|
|
||||||
public CoreNetworkHandler() {
|
|
||||||
super();
|
|
||||||
new InventoryHandler().register();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Handler
|
@Handler
|
||||||
public void handleBaumemberUpdatePacket(BaumemberUpdatePacket packet) {
|
public void handleBaumemberUpdatePacket(BaumemberUpdatePacket packet) {
|
||||||
BauweltMember.clear();
|
BauweltMember.clear();
|
||||||
@ -50,11 +49,6 @@ public class CoreNetworkHandler extends PacketHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Handler
|
|
||||||
public void handleInventoryPacket(InventoryPacket packet) {
|
|
||||||
InventoryHandler.handleInventoryPacket(packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Handler
|
@Handler
|
||||||
public void handlePingPacket(PingPacket packet) {
|
public void handlePingPacket(PingPacket packet) {
|
||||||
UUID uuid = SteamwarUser.get(packet.getId()).getUUID();
|
UUID uuid = SteamwarUser.get(packet.getId()).getUUID();
|
||||||
|
@ -22,6 +22,7 @@ package de.steamwar.network.handlers;
|
|||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import de.steamwar.inventory.SWInventory;
|
import de.steamwar.inventory.SWInventory;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
|
import de.steamwar.linkage.Linked;
|
||||||
import de.steamwar.network.NetworkSender;
|
import de.steamwar.network.NetworkSender;
|
||||||
import de.steamwar.network.packets.PacketHandler;
|
import de.steamwar.network.packets.PacketHandler;
|
||||||
import de.steamwar.network.packets.client.InventoryCallbackPacket;
|
import de.steamwar.network.packets.client.InventoryCallbackPacket;
|
||||||
@ -34,10 +35,11 @@ import org.bukkit.event.inventory.InventoryType;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Linked
|
||||||
public class InventoryHandler extends PacketHandler {
|
public class InventoryHandler extends PacketHandler {
|
||||||
|
|
||||||
@Handler
|
@Handler
|
||||||
public static void handleInventoryPacket(InventoryPacket packet) {
|
public void handleInventoryPacket(InventoryPacket packet) {
|
||||||
Player player = Bukkit.getPlayer(SteamwarUser.get(packet.getPlayer()).getUUID());
|
Player player = Bukkit.getPlayer(SteamwarUser.get(packet.getPlayer()).getUUID());
|
||||||
Map<Integer, SWItem> items = new HashMap<>();
|
Map<Integer, SWItem> items = new HashMap<>();
|
||||||
packet.getItems().forEach((i, item) -> {
|
packet.getItems().forEach((i, item) -> {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren