mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-26 20:46:59 +01:00
Optimize Chunk Height Maps
Use an EnumMap for fast key access
This commit is contained in:
parent
615cd59fdc
commit
61f5cf0881
@ -0,0 +1,22 @@
|
|||||||
|
From a3fb16787b296fde8ee82cb76d3a305233d8e5cf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aikar <aikar@aikar.co>
|
||||||
|
Date: Tue, 28 Aug 2018 22:11:13 -0400
|
||||||
|
Subject: [PATCH] Use an EnumMap for Chunk Height Maps
|
||||||
|
|
||||||
|
|
||||||
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
|
index ed6d0dce33..1d301dcb70 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
||||||
|
@@ -133,7 +133,7 @@ public class Chunk implements IChunkAccess {
|
||||||
|
this.sections = new ChunkSection[16];
|
||||||
|
this.g = new boolean[256];
|
||||||
|
this.h = Maps.newHashMap();
|
||||||
|
- this.heightMap = Maps.newHashMap();
|
||||||
|
+ this.heightMap = new java.util.EnumMap<>(HeightMap.Type.class); // PAper
|
||||||
|
this.tileEntities = new TileEntityHashMap(); // Paper
|
||||||
|
this.p = Maps.newHashMap();
|
||||||
|
this.q = Maps.newHashMap();
|
||||||
|
--
|
||||||
|
2.18.0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user