Remove left over debug from entity slices

This commit is contained in:
Aikar 2019-03-02 18:52:16 -05:00
parent 7e3169e3de
commit 21ee8800f8
No known key found for this signature in database
GPG Key ID: 401ADFC9891FAAFE

View File

@ -1,4 +1,4 @@
From abf1bf94c272bcaf8daf2d6e5252e54a426bf936 Mon Sep 17 00:00:00 2001 From c694fb42c86f64e9cda92745dd020ac0121d470a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Mon, 23 Jul 2018 22:44:23 -0400 Date: Mon, 23 Jul 2018 22:44:23 -0400
Subject: [PATCH] Add some Debug to Chunk Entity slices Subject: [PATCH] Add some Debug to Chunk Entity slices
@ -9,7 +9,7 @@ This should hopefully avoid duplicate entities ever being created
if the entity was to end up in 2 different chunk slices if the entity was to end up in 2 different chunk slices
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 42b76b2122..1c9e2cb1ce 100644 index 42b76b2122..7dd59ee031 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
@@ -714,8 +714,27 @@ public class Chunk implements IChunkAccess { @@ -714,8 +714,27 @@ public class Chunk implements IChunkAccess {
@ -22,7 +22,7 @@ index 42b76b2122..1c9e2cb1ce 100644
+ List<Entity> entitySlice = this.entitySlices[k]; + List<Entity> entitySlice = this.entitySlices[k];
+ boolean inThis = entitySlice.contains(entity); + boolean inThis = entitySlice.contains(entity);
+ List<Entity> currentSlice = entity.entitySlice; + List<Entity> currentSlice = entity.entitySlice;
+ if ((currentSlice != null && currentSlice.contains(entity)) || inThis) { + if (inThis || (currentSlice != null && currentSlice.contains(entity))) {
+ if (currentSlice == entitySlice || inThis) { + if (currentSlice == entitySlice || inThis) {
+ return; + return;
+ } else { + } else {
@ -32,7 +32,7 @@ index 42b76b2122..1c9e2cb1ce 100644
+ } else { + } else {
+ removeEntity(entity); + removeEntity(entity);
+ } + }
+ new Throwable().printStackTrace(); + currentSlice.remove(entity); // Just incase the above did not remove from this target slice
+ } + }
+ } + }
+ entity.entitySlice = entitySlice; + entity.entitySlice = entitySlice;