Multitude of changes to attempt to fix #1199

This commit is contained in:
Aikar
2018-07-12 16:42:56 -04:00
parent 7754b35d8f
commit eb1140acce
12 changed files with 42 additions and 23 deletions

View File

@@ -96,7 +96,7 @@ index e5b5e9887..e3781f3a8 100644
}
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index b79bf70f0..b1536e1c5 100644
index b79bf70f0..33ae73890 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -0,0 +0,0 @@ import net.minecraft.server.EntityFireball;
@@ -141,11 +141,25 @@ index b79bf70f0..b1536e1c5 100644
{
EntityAnimal animal = (EntityAnimal) entity;
@@ -0,0 +0,0 @@ public class ActivationRange
int x = MathHelper.floor( entity.locX );
int z = MathHelper.floor( entity.locZ );
{
// Never safe to skip fireworks or entities not yet added to chunk
// PAIL: inChunk - boolean under datawatchers
- if ( !entity.aa || entity instanceof EntityFireworks ) {
+ if ( !entity.isAddedToChunk() || entity instanceof EntityFireworks ) { // Paper (use obf helper)
return true;
}
@@ -0,0 +0,0 @@ public class ActivationRange
{
isActive = false;
}
- int x = MathHelper.floor( entity.locX );
- int z = MathHelper.floor( entity.locZ );
+ //int x = MathHelper.floor( entity.locX ); // Paper
+ //int z = MathHelper.floor( entity.locZ ); // Paper
// Make sure not on edge of unloaded chunk
- Chunk chunk = entity.world.getChunkIfLoaded( x >> 4, z >> 4 );
+ Chunk chunk = entity.getCurrentChunk(); // Paper
+ Chunk chunk = entity.getChunkAtLocation(); // Paper
if ( isActive && !( chunk != null && chunk.areNeighborsLoaded( 1 ) ) )
{
isActive = false;