SteamWar/SpigotCore
Archiviert
13
0

Implementing prepare schem packet

Dieser Commit ist enthalten in:
Lixfel 2021-04-01 20:03:15 +02:00
Ursprung 495e468f6b
Commit 3252fae529
3 geänderte Dateien mit 43 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -24,6 +24,7 @@ public class PacketIdManager {
//0x0(X) Standalone Packets
public final static byte PING_PACKET = 0x01;
public final static byte TABLIST_NAME = 0x02;
public static final byte PREPARE_SCHEM = 0x03;
//0x1(X) Bungee Inventory
public final static byte INVENTORY_PACKET = 0x10;
public final static byte INVENTORY_CALLBACK_PACKET = 0x11;

Datei anzeigen

@ -0,0 +1,32 @@
package de.steamwar.comms.packets;
import com.google.common.io.ByteArrayDataOutput;
import de.steamwar.comms.PacketIdManager;
import de.steamwar.sql.Schematic;
import de.steamwar.sql.SchematicType;
import de.steamwar.sql.SteamwarUser;
public class PrepareSchemPacket extends SpigotPacket{
private final SteamwarUser user;
private final Schematic schematic;
private final SchematicType schematicType;
public PrepareSchemPacket(SteamwarUser user, Schematic schematic, SchematicType schematicType){
this.user = user;
this.schematic = schematic;
this.schematicType = schematicType;
}
@Override
public int getName() {
return PacketIdManager.PREPARE_SCHEM;
}
@Override
public void writeVars(ByteArrayDataOutput byteArrayDataOutput) {
byteArrayDataOutput.writeInt(user.getId());
byteArrayDataOutput.writeInt(schematic.getSchemID());
byteArrayDataOutput.writeUTF(schematicType.toDB());
}
}

Datei anzeigen

@ -0,0 +1,10 @@
package de.steamwar.core;
import org.bukkit.Bukkit;
public class ServerInit {
private static void initServer(){
Bukkit.getServer();
}
}