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

@ -537,7 +537,7 @@ public class Client implements IThreadListener {
private IntHashMap<Entity> entityIds;
@Variable(name = "chunk_view_distance", category = CVarCategory.RENDER, min = 2, max = 16, callback = DistanceFunction.class, display = "Sichtweite", unit = "Chunks")
@Variable(name = "chunk_view_distance", category = CVarCategory.RENDER, min = 2, max = 64, callback = DistanceFunction.class, display = "Sichtweite", unit = "Chunks")
public int renderDistance = 8;
@Variable(name = "chunk_build_time", category = CVarCategory.RENDER, min = 1, max = 100, display = "Zeit für Chunk-Bau", unit = "ms")
public int maxBuildTime = 8;

View file

@ -265,7 +265,7 @@ public abstract class Vars {
public static int spawnMoreZombie = 25;
@Var(name = "explosionBlocksPerTick", min = 100, max = 10000000)
public static int maxExplosionIters = 1000000;
@Var(name = "viewDistance", min = 2, max = 16)
@Var(name = "viewDistance", min = 2, max = 64)
public static int distance = 8;
@Var(name = "timeFlow", min = 0)
public static int timeFlow = 1;

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,8 +1048,15 @@ public class Player extends User implements Executor, IPlayer
}
else
{
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;