mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 22:45:31 +01:00
Optimize getCubes()
This commit is contained in:
parent
0febdc8b44
commit
eaaf2c2cf3
2 changed files with 45 additions and 22 deletions
45
Spigot-Server-Patches/0064-Optimize-getCubes.patch
Normal file
45
Spigot-Server-Patches/0064-Optimize-getCubes.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
From 758c7bfd2f600e5bd2dec410a18106ef72704eee Mon Sep 17 00:00:00 2001
|
||||
From: Byteflux <byte@byteflux.net>
|
||||
Date: Tue, 14 Jul 2015 10:03:45 -0700
|
||||
Subject: [PATCH] Optimize getCubes()
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index 1fc0387..4e8ba43 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1162,11 +1162,12 @@ public abstract class World implements IBlockAccess {
|
||||
int cx = chunkx << 4;
|
||||
for ( int chunkz = ( i1 >> 4 ); chunkz <= ( ( j1 - 1 ) >> 4 ); chunkz++ )
|
||||
{
|
||||
- if ( !this.isChunkLoaded( chunkx, chunkz, true ) )
|
||||
+ Chunk chunk = this.getChunkIfLoaded( chunkx, chunkz );
|
||||
+ if ( chunk == null )
|
||||
{
|
||||
// PaperSpigot start
|
||||
if (entity.loadChunks) {
|
||||
- ((ChunkProviderServer) entity.world.chunkProvider).getChunkAt(chunkx, chunkz);
|
||||
+ chunk = ((ChunkProviderServer) entity.world.chunkProvider).getChunkAt(chunkx, chunkz);
|
||||
} else {
|
||||
entity.inUnloadedChunk = true; // PaperSpigot - Remove entities in unloaded chunks
|
||||
continue;
|
||||
@@ -1174,7 +1175,6 @@ public abstract class World implements IBlockAccess {
|
||||
// PaperSpigot end
|
||||
}
|
||||
int cz = chunkz << 4;
|
||||
- Chunk chunk = this.getChunkAt( chunkx, chunkz );
|
||||
// Compute ranges within chunk
|
||||
int xstart = ( i < cx ) ? cx : i;
|
||||
int xend = ( j < ( cx + 16 ) ) ? j : ( cx + 16 );
|
||||
@@ -1222,6 +1222,8 @@ public abstract class World implements IBlockAccess {
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
+ if (entity instanceof EntityItem) return arraylist; // PaperSpigot - Optimize item movement
|
||||
+
|
||||
double d0 = 0.25D;
|
||||
List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0));
|
||||
|
||||
--
|
||||
2.4.6.windows.1
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
From 7ea0b75ec2b73d46cffd36cc8bf2db862735b16e Mon Sep 17 00:00:00 2001
|
||||
From: Byteflux <byte@byteflux.net>
|
||||
Date: Tue, 14 Jul 2015 10:03:45 -0700
|
||||
Subject: [PATCH] Optimize item movement
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index eacd4b8..62b8b9e 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -1222,6 +1222,8 @@ public abstract class World implements IBlockAccess {
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
+ if (entity instanceof EntityItem) return arraylist; // PaperSpigot - Optimize item movement
|
||||
+
|
||||
double d0 = 0.25D;
|
||||
List list = this.getEntities(entity, axisalignedbb.grow(d0, d0, d0));
|
||||
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
Loading…
Reference in a new issue