1
0
Fork 0

bump max render distance to 64

This commit is contained in:
Sen 2025-08-27 23:02:21 +02:00
parent de04a844ff
commit 0873e0aab0
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
6 changed files with 20 additions and 5 deletions

View file

@ -1014,7 +1014,7 @@ public class Player extends User implements Executor, IPlayer
List<TileEntity> list1 = Lists.<TileEntity>newArrayList();
WorldServer world = this.getEntityWorld();
int n = 10; // TODO: this.local ? 1024 : 10;
int n = SVars.chunksPerTick;
while (iterator1.hasNext() && ((List)list).size() < n)
{
@ -1048,7 +1048,14 @@ public class Player extends User implements Executor, IPlayer
}
else
{
this.sendPacket(getPacket(world, list));
if(list.size() <= 10) {
this.sendPacket(getPacket(world, list));
}
else {
for(int h = 0; h < list.size(); h += 10) {
this.sendPacket(getPacket(world, list.subList(h, h + 10 > list.size() ? list.size() : h + 10)));
}
}
}
for (TileEntity tileentity : list1)

View file

@ -79,6 +79,10 @@ public abstract class SVars {
public static int port = -1;
@Var(name = "spawnDungeonMobs")
public static int spawnDungeonMobs = 4;
@Var(name = "chunksPerTick", min = 5, max = 1024)
public static int chunksPerTick = 10;
@Var(name = "updateDistance", min = 2, max = 64)
public static int updateDistance = 8;
@Var(name = "password", nonDefault = true)
public static String password = "";

View file

@ -20,6 +20,8 @@ public class ChunkServer extends Chunk {
public ChunkServer(WorldServer world, int x, int z) {
super(world, x, z);
this.lightInit = true;
this.updated = true;
}
public ChunkServer(WorldServer world, char[] data, int height, boolean base, boolean ceil, Random rand, int x, int z) {
@ -82,6 +84,8 @@ public class ChunkServer extends Chunk {
}
if(!ceil)
this.genSky();
this.lightInit = true;
this.updated = true;
}
public int getTopSegment() {

View file

@ -452,7 +452,7 @@ public final class WorldServer extends AWorldServer {
}
protected void updateBlocks() {
this.setActivePlayerChunksAndCheckLight(Vars.distance);
this.setActivePlayerChunksAndCheckLight(SVars.updateDistance);
int dtics = 0;
int rtics = 0;