mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-26 10:29:13 +00:00
fix SlopeDistanceNodeDeque memory leak
This commit is contained in:
@@ -24,10 +24,10 @@ index d21ae1a6ce307c186bc7e218b947dd1879d93b00..7f823e7f282e52b7cf918b117a5059ab
|
||||
BlockState blockState = this.getBlockState(pos);
|
||||
FluidState fluidState = blockState.getFluidState();
|
||||
diff --git a/net/minecraft/world/level/material/FlowingFluid.java b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..cf8fd5df3472c3212fd3cf9536761c998aff26d4 100644
|
||||
index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..01ba0756789fcc61905bbaf1be88b526b76f2490 100644
|
||||
--- a/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -341,32 +341,117 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -341,32 +341,123 @@ public abstract class FlowingFluid extends Fluid {
|
||||
protected void beforeDestroyingBlock(LevelAccessor level, BlockPos pos, BlockState state, BlockPos source) { beforeDestroyingBlock(level, pos, state); } // Paper - Add BlockBreakBlockEvent
|
||||
protected abstract void beforeDestroyingBlock(LevelAccessor level, BlockPos pos, BlockState state);
|
||||
|
||||
@@ -38,6 +38,7 @@ index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..cf8fd5df3472c3212fd3cf9536761c99
|
||||
+ it.unimi.dsi.fastutil.longs.LongSet visited = ((ServerLevel) level).slopeDistanceCacheVisited;
|
||||
+ SlopeDistanceNodeDeque queue = ((ServerLevel) level).slopeDistanceCacheQueue;
|
||||
+ visited.clear();
|
||||
+ queue.clear();
|
||||
+
|
||||
+ for (Direction dir : Direction.Plane.HORIZONTAL) {
|
||||
+ if (dir == excludedDirection) continue;
|
||||
@@ -130,6 +131,11 @@ index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..cf8fd5df3472c3212fd3cf9536761c99
|
||||
+ }
|
||||
+ */
|
||||
+
|
||||
+ private void clear() {
|
||||
+ start = 0;
|
||||
+ end = 0;
|
||||
+ }
|
||||
+
|
||||
+ private boolean isEmpty() {
|
||||
+ return end == start || (end <= start && length == start - end);
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user