Trim performance (#451)

* Increase performance slightly when trimming.
If the chunk section is all one blocks (common in plotworlds) it'll be a nice little boost.

* Cache whether blocks are ticking or not. Greatly reduces the time required to create a palette

* collapse 5 lines to 2.

* Also apply to 14 and 15 for the numpties

* Cleanup
Actually ignore the exception - remove my debug print.
Remove double semi-colon

* Apparently 1.14/15 matter too still.
This commit is contained in:
dordsor21
2020-05-07 23:00:13 +01:00
committed by GitHub
parent a2b0a5e622
commit 56972ee40b
16 changed files with 171 additions and 10 deletions

View File

@ -549,6 +549,11 @@ public class MCAChunk implements IChunk {
return isEmpty();
}
@Override
public boolean trim(boolean aggressive, int layer) {
return hasSection(layer);
}
@Override
public CompoundTag getEntity(UUID uuid) {
return this.entities.get(uuid);