fix missed break statement and enum check on dupe uuid resolve

This commit is contained in:
Aikar 2018-08-03 01:32:00 -04:00
parent 38af7610e3
commit f4f8a3be2d
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE

View File

@ -1,4 +1,4 @@
From 81b0946c56f4368fb81c2ee241cd3c244e34b689 Mon Sep 17 00:00:00 2001 From af75c184b955299758aaf93c63af5910425309ae Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sat, 21 Jul 2018 14:27:34 -0400 Date: Sat, 21 Jul 2018 14:27:34 -0400
Subject: [PATCH] Duplicate UUID Resolve Option Subject: [PATCH] Duplicate UUID Resolve Option
@ -33,10 +33,10 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA
It is recommended you regenerate the entities, as these were legit entities, and deserve your love. It is recommended you regenerate the entities, as these were legit entities, and deserve your love.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 14c8edeffc..46ec852b6c 100644 index 14c8edeffc..b373bba864 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -541,4 +541,44 @@ public class PaperWorldConfig { @@ -541,4 +541,45 @@ public class PaperWorldConfig {
log("Bed Search Radius: " + bedSearchRadius); log("Bed Search Radius: " + bedSearchRadius);
} }
} }
@ -52,6 +52,7 @@ index 14c8edeffc..46ec852b6c 100644
+ case "saferegenerate": + case "saferegenerate":
+ duplicateUUIDMode = DuplicateUUIDMode.SAFE_REGEN; + duplicateUUIDMode = DuplicateUUIDMode.SAFE_REGEN;
+ log("Duplicate UUID Resolve: Safer Regenerate New UUID (Delete likely duplicates)"); + log("Duplicate UUID Resolve: Safer Regenerate New UUID (Delete likely duplicates)");
+ break;
+ case "regen": + case "regen":
+ case "regenerate": + case "regenerate":
+ duplicateUUIDMode = DuplicateUUIDMode.REGEN; + duplicateUUIDMode = DuplicateUUIDMode.REGEN;
@ -82,7 +83,7 @@ index 14c8edeffc..46ec852b6c 100644
+ } + }
} }
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 4757081090..4018410485 100644 index 4757081090..8cd2ed85bc 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1,5 +1,10 @@ @@ -1,5 +1,10 @@
@ -118,7 +119,7 @@ index 4757081090..4018410485 100644
List entityslice = aentityslice[j]; // Spigot List entityslice = aentityslice[j]; // Spigot
+ // Paper start + // Paper start
+ DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode; + DuplicateUUIDMode mode = world.paperConfig.duplicateUUIDMode;
+ if (mode == DuplicateUUIDMode.WARN | mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.REGEN) { + if (mode == DuplicateUUIDMode.WARN | mode == DuplicateUUIDMode.DELETE || mode == DuplicateUUIDMode.REGEN || mode == DuplicateUUIDMode.SAFE_REGEN) {
+ Map<UUID, Entity> thisChunk = new HashMap<>(); + Map<UUID, Entity> thisChunk = new HashMap<>();
+ for (Iterator<Entity> iterator = ((List<Entity>) entityslice).iterator(); iterator.hasNext(); ) { + for (Iterator<Entity> iterator = ((List<Entity>) entityslice).iterator(); iterator.hasNext(); ) {
+ Entity entity = iterator.next(); + Entity entity = iterator.next();
@ -176,7 +177,7 @@ index 7b856cad91..eb8904a728 100644
this.uniqueID = uuid; this.uniqueID = uuid;
this.ar = this.uniqueID.toString(); this.ar = this.uniqueID.toString();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index d5cd289c21..57217bec2b 100644 index a01488e985..3012768cb9 100644
--- a/src/main/java/net/minecraft/server/World.java --- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java
@@ -70,7 +70,7 @@ public abstract class World implements IBlockAccess { @@ -70,7 +70,7 @@ public abstract class World implements IBlockAccess {