[ci skip] Add more identifying patch comments

This commit is contained in:
Nassim Jahnke
2024-01-21 12:53:04 +01:00
parent f6609428b6
commit 0571a6438e
54 changed files with 166 additions and 206 deletions

View File

@@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
-
- if (l >= 0 && l < this.sections.length) {
- LevelChunkSection chunksection = this.sections[l];
+ // try { // Paper - remove try catch
+ // Paper start - reduce the number of ops in this call
+ // Paper start - Perf: Optimise Chunk#getFluid
+ // try { // Remove try catch
+ int index = this.getSectionIndex(y);
+ if (index >= 0 && index < this.sections.length) {
+ LevelChunkSection chunksection = this.sections[index];
@@ -29,12 +29,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!chunksection.hasOnlyAir()) {
- return chunksection.getFluidState(x & 15, y & 15, z & 15);
+ return chunksection.states.get((y & 15) << 8 | (z & 15) << 4 | x & 15).getFluidState();
+ // Paper end
+ // Paper end - Perf: Optimise Chunk#getFluid
}
}
return Fluids.EMPTY.defaultFluidState();
+ /* // Paper - remove try catch
+ /* // Paper - Perf: Optimise Chunk#getFluid
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.forThrowable(throwable, "Getting fluid state");
CrashReportCategory crashreportsystemdetails = crashreport.addCategory("Block being got");
@@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
});
throw new ReportedException(crashreport);
}
+ */ // Paper - remove try catch
+ */ // Paper - Perf: Optimise Chunk#getFluid
}
// CraftBukkit start
@@ -55,7 +55,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public FluidState getFluidState(int x, int y, int z) {
- return ((BlockState) this.states.get(x, y, z)).getFluidState();
+ return this.states.get(x, y, z).getFluidState(); // Paper - diff on change - we expect this to be effectively just getType(x, y, z).getFluid(). If this changes we need to check other patches that use IBlockData#getFluid.
+ return this.states.get(x, y, z).getFluidState(); // Paper - Perf: Optimise Chunk#getFluid; diff on change - we expect this to be effectively just getType(x, y, z).getFluid(). If this changes we need to check other patches that use IBlockData#getFluid.
}
public void acquire() {