Limit the light

This commit is contained in:
grimmauld 2021-07-09 23:38:28 +02:00
parent c785fe5705
commit e56da570e8
3 changed files with 13 additions and 2 deletions

View file

@ -62,4 +62,8 @@ public abstract class ContraptionLighter<C extends Contraption> implements ILigh
return bounds; return bounds;
} }
public GridAlignedBB getBounds() {
return bounds;
}
} }

View file

@ -13,6 +13,9 @@ import static org.lwjgl.opengl.GL20.glUseProgram;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter;
import com.simibubi.create.foundation.config.AllConfigs;
import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Pair;
import com.jozufozu.flywheel.backend.Backend; import com.jozufozu.flywheel.backend.Backend;
@ -79,7 +82,9 @@ public class ContraptionRenderDispatcher {
if (Minecraft.getInstance().isGamePaused()) return; if (Minecraft.getInstance().isGamePaused()) return;
for (RenderedContraption contraption : RENDERERS.values()) { for (RenderedContraption contraption : RENDERERS.values()) {
contraption.getLighter().tick(contraption); ContraptionLighter<?> lighter = contraption.getLighter();
if (lighter.getBounds().volume() < AllConfigs.CLIENT.maxContraptionLightVolume.get())
lighter.tick(contraption);
contraption.kinetics.tick(); contraption.kinetics.tick();
} }

View file

@ -14,6 +14,8 @@ public class CClient extends ConfigBase {
b(true, "enableRainbowDebug", "Show colourful debug information while the F3-Menu is open."); b(true, "enableRainbowDebug", "Show colourful debug information while the F3-Menu is open.");
public ConfigBool experimentalRendering = public ConfigBool experimentalRendering =
b(true, "experimentalRendering", "Use modern OpenGL features to drastically increase performance."); b(true, "experimentalRendering", "Use modern OpenGL features to drastically increase performance.");
public ConfigInt maxContraptionLightVolume = i(16384, 0, Integer.MAX_VALUE, "maximumContraptionLightVolume",
"The maximum amount of blocks for which to try and calculate dynamic contraption lighting. Decrease if large contraption cause too much lag");
public ConfigInt overlayOffsetX = i(20, Integer.MIN_VALUE, Integer.MAX_VALUE, "overlayOffsetX", public ConfigInt overlayOffsetX = i(20, Integer.MIN_VALUE, Integer.MAX_VALUE, "overlayOffsetX",
"Offset the overlay from goggle- and hover- information by this many pixels on the X axis; Use /create overlay"); "Offset the overlay from goggle- and hover- information by this many pixels on the X axis; Use /create overlay");
public ConfigInt overlayOffsetY = i(0, Integer.MIN_VALUE, Integer.MAX_VALUE, "overlayOffsetY", public ConfigInt overlayOffsetY = i(0, Integer.MIN_VALUE, Integer.MAX_VALUE, "overlayOffsetY",
@ -47,7 +49,7 @@ public class CClient extends ConfigBase {
public ConfigGroup ponder = group(1, "ponder", "Ponder settings"); public ConfigGroup ponder = group(1, "ponder", "Ponder settings");
public ConfigBool comfyReading = public ConfigBool comfyReading =
b(false, "comfyReading", "Slow down a ponder scene whenever there is text on screen."); b(false, "comfyReading", "Slow down a ponder scene whenever there is text on screen.");
public ConfigGroup sound = group(1, "sound", "Sound settings"); public ConfigGroup sound = group(1, "sound", "Sound settings");
public ConfigBool enableAmbientSounds = b(true, "enableAmbientSounds", "Make cogs rumble and machines clatter."); public ConfigBool enableAmbientSounds = b(true, "enableAmbientSounds", "Make cogs rumble and machines clatter.");
public ConfigFloat ambientVolumeCap = f(.1f, 0, 1, "ambientVolumeCap", "Maximum volume modifier of Ambient noise"); public ConfigFloat ambientVolumeCap = f(.1f, 0, 1, "ambientVolumeCap", "Maximum volume modifier of Ambient noise");