mirror of
https://github.com/AtlasMediaGroup/Scissors.git
synced 2024-11-27 07:05:39 +00:00
871cc5653c
* Clean up command block event patch * Merge resource location patches * Merge map decoration patches * Merge Video's resource location patches * Merge large tag reset patches
27 lines
1.3 KiB
Diff
27 lines
1.3 KiB
Diff
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
|
|
index 18aac3da3c88f33b1a71a5920a8daa27e9723913..f5b59d0ab82472e1c992ffb6a8b7fbb687a2b70f 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -1610,7 +1610,14 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
|
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
|