diff --git a/CommonCore/Network/src/de/steamwar/network/packets/common/PlayerSkinRequestPacket.java b/CommonCore/Network/src/de/steamwar/network/packets/common/PlayerSkinRequestPacket.java
new file mode 100644
index 00000000..4916e0f1
--- /dev/null
+++ b/CommonCore/Network/src/de/steamwar/network/packets/common/PlayerSkinRequestPacket.java
@@ -0,0 +1,36 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2020 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.network.packets.common;
+
+import de.steamwar.network.packets.NetworkPacket;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.ToString;
+
+import java.util.UUID;
+
+@AllArgsConstructor
+@Getter
+@ToString
+public class PlayerSkinRequestPacket extends NetworkPacket {
+
+ private static final long serialVersionUID = 277267302555671765L;
+ private UUID uuid;
+}
diff --git a/CommonCore/Network/src/de/steamwar/network/packets/common/PlayerSkinResponsePacket.java b/CommonCore/Network/src/de/steamwar/network/packets/common/PlayerSkinResponsePacket.java
new file mode 100644
index 00000000..5c3767ca
--- /dev/null
+++ b/CommonCore/Network/src/de/steamwar/network/packets/common/PlayerSkinResponsePacket.java
@@ -0,0 +1,38 @@
+/*
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2020 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.network.packets.common;
+
+import de.steamwar.network.packets.NetworkPacket;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.ToString;
+
+import java.util.UUID;
+
+@AllArgsConstructor
+@Getter
+@ToString
+public class PlayerSkinResponsePacket extends NetworkPacket {
+
+ private static final long serialVersionUID = 5792855362547625112L;
+ private UUID uuid;
+ private String skin;
+ private String signature;
+}
diff --git a/LobbySystem/build.gradle.kts b/LobbySystem/build.gradle.kts
index aa511a0c..8662545c 100644
--- a/LobbySystem/build.gradle.kts
+++ b/LobbySystem/build.gradle.kts
@@ -34,3 +34,12 @@ dependencies {
compileOnly(libs.nms20)
compileOnly(libs.worldedit15)
}
+
+tasks.register("DevLobby20") {
+ group = "run"
+ description = "Run a 1.20 Dev Lobby"
+ dependsOn(":SpigotCore:shadowJar")
+ dependsOn(":LobbySystem:jar")
+ template = "Lobby20"
+ worldName = "Lobby"
+}
diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java
index b4aaa3ee..2575a778 100644
--- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java
+++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/RPlayer.java
@@ -19,18 +19,22 @@
package de.steamwar.entity;
-import de.steamwar.Reflection;
import com.mojang.authlib.GameProfile;
+import com.mojang.authlib.properties.Property;
+import de.steamwar.Reflection;
import de.steamwar.core.BountifulWrapper;
import de.steamwar.core.Core;
import de.steamwar.core.FlatteningWrapper;
import de.steamwar.core.ProtocolWrapper;
+import de.steamwar.network.NetworkSender;
+import de.steamwar.network.packets.common.PlayerSkinRequestPacket;
import lombok.Getter;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.UUID;
import java.util.function.Consumer;
@@ -61,17 +65,40 @@ public class RPlayer extends REntity {
private static final Object skinPartsDataWatcher = BountifulWrapper.impl.getDataWatcherObject(skinPartsIndex(), Byte.class);
+ private final UUID actualUUID;
private final String name;
public RPlayer(REntityServer server, UUID uuid, String name, Location location) {
- super(server, EntityType.PLAYER, uuid, location,0);
+ super(server, EntityType.PLAYER, UUID.randomUUID(), location,0);
+ this.actualUUID = uuid;
this.name = name;
server.addEntity(this);
}
+ public static final Map SKIN_DATA_PROMISES = new LinkedHashMap() {
+ @Override
+ protected boolean removeEldestEntry(Map.Entry eldest) {
+ return size() > 100;
+ }
+ };
+
+ private GameProfile getGameProfile() {
+ Property skinData = SKIN_DATA_PROMISES.computeIfAbsent(uuid, __ -> {
+ NetworkSender.sendOrQueue(new PlayerSkinRequestPacket(uuid));
+ return new Property("textures", null, null);
+ });
+ if (skinData.getValue() != null) {
+ GameProfile gameProfile = new GameProfile(uuid, name);
+ gameProfile.getProperties().put("textures", skinData);
+ return gameProfile;
+ } else {
+ return new GameProfile(actualUUID, name);
+ }
+ }
+
@Override
void list(Consumer