Skip to content

Commit f20085d

Browse files
authored
Try to reduce serverlag a bit (#718)
1 parent 8e218e2 commit f20085d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/main/java/com/ldtteam/structurize/util/BlockUtils.java

+15
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import net.minecraft.world.item.Items;
3333
import net.minecraft.world.item.context.BlockPlaceContext;
3434
import net.minecraft.world.item.context.UseOnContext;
35+
import net.minecraft.world.level.ChunkPos;
3536
import net.minecraft.world.level.Level;
3637
import net.minecraft.world.level.LevelReader;
3738
import net.minecraft.world.level.block.*;
@@ -767,6 +768,20 @@ public boolean hasChunk(int p_9574_, int p_9575_)
767768
{
768769
return level.hasChunk(p_9574_, p_9575_);
769770
}
771+
772+
@Override
773+
public boolean isOldChunkAround(ChunkPos pos, int radius)
774+
{
775+
final int minX = pos.x - radius;
776+
final int maxX = pos.x + radius;
777+
final int minZ = pos.z - radius;
778+
final int maxZ = pos.z + radius;
779+
780+
return chunks.contains(minX, minZ) &&
781+
chunks.contains(minX, maxZ) &&
782+
chunks.contains(maxX, minZ) &&
783+
chunks.contains(maxX, maxZ);
784+
}
770785
}
771786

772787
/**

0 commit comments

Comments
 (0)