2023-04-28 19:50:48 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Luna <lunahatesgogle@gmail.com>
|
|
|
|
Date: Fri, 28 Apr 2023 16:44:50 -0300
|
|
|
|
Subject: [PATCH] Prevent player banning using duplicate UUIDs
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
2023-08-22 00:30:31 +00:00
|
|
|
index 20099425babf5325005d11bf25faa783e3bc2715..cf02fc7199c893db66bebba6051bc10dbff859ac 100644
|
2023-04-28 19:50:48 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
2023-08-22 00:30:31 +00:00
|
|
|
@@ -1628,7 +1628,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
2023-04-28 19:50:48 +00:00
|
|
|
if (entity != null) {
|
|
|
|
ServerLevel.LOGGER.warn("Force-added player with duplicate UUID {}", player.getUUID().toString());
|
|
|
|
entity.unRide();
|
|
|
|
- this.removePlayerImmediately((ServerPlayer) entity, Entity.RemovalReason.DISCARDED);
|
|
|
|
+ // Scissors start - Prevent player banning using duplicate UUIDs
|
|
|
|
+ if (entity instanceof ServerPlayer serverPlayer) {
|
|
|
|
+ this.removePlayerImmediately(serverPlayer, Entity.RemovalReason.DISCARDED);
|
|
|
|
+ } else {
|
|
|
|
+ entity.discard();
|
|
|
|
+ }
|
|
|
|
+ // Scissors end
|
|
|
|
}
|
|
|
|
|
|
|
|
this.entityLookup.addNewEntity(player); // Paper - rewite chunk system
|