1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-16 10:09:55 +00:00

Allow configuring max monitor render distance

64 blocks out to be enough for anyone. But just in case. Closes #494
This commit is contained in:
SquidDev 2020-07-18 10:25:21 +01:00
parent 8f069a9b72
commit 89c1b2771d
3 changed files with 13 additions and 0 deletions

View File

@ -82,6 +82,7 @@ public final class ComputerCraft
public static int modemHighAltitudeRangeDuringStorm = 384;
public static int maxNotesPerTick = 8;
public static MonitorRenderer monitorRenderer = MonitorRenderer.BEST;
public static double monitorDistanceSq = 4096;
public static long monitorBandwidth = 1_000_000;
public static boolean turtlesNeedFuel = true;

View File

@ -85,6 +85,7 @@ public final class Config
private static final ConfigValue<Boolean> genericPeripheral;
private static final ConfigValue<MonitorRenderer> monitorRenderer;
private static final ConfigValue<Integer> monitorDistance;
private static final ForgeConfigSpec serverSpec;
private static final ForgeConfigSpec clientSpec;
@ -311,6 +312,10 @@ private Config() {}
.comment( "The renderer to use for monitors. Generally this should be kept at \"best\" - if " +
"monitors have performance issues, you may wish to experiment with alternative renderers." )
.defineEnum( "monitor_renderer", MonitorRenderer.BEST );
monitorDistance = clientBuilder
.comment( "The maximum distance monitors will render at. This defaults to the standard tile entity limit, " +
"but may be extended if you wish to build larger monitors." )
.defineInRange( "monitor_distance", 64, 16, 1024 );
clientSpec = clientBuilder.build();
}
@ -379,6 +384,7 @@ public static void sync()
// Client
ComputerCraft.monitorRenderer = monitorRenderer.get();
ComputerCraft.monitorDistanceSq = monitorDistance.get() * monitorDistance.get();
}
@SubscribeEvent

View File

@ -688,4 +688,10 @@ public AxisAlignedBB getRenderBoundingBox()
return new AxisAlignedBB( pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1, pos.getY() + 1, pos.getZ() + 1 );
}
}
@Override
public double getMaxRenderDistanceSquared()
{
return ComputerCraft.monitorDistanceSq;
}
}