private static File configDir;
public static Setting<Boolean> fill;
+ public static Setting<Integer> lineWidthModifier;
public static Setting<Boolean> drawVillages;
public static Setting<Boolean> drawDesertTemples;
public static Setting<Boolean> drawJungleTemples;
invertBoxColorPlayerInside = setup(config, "general", "invertBoxColorPlayerInside", false, "If set to true the color of any bounding box the player is inside will be inverted.");
renderSphereAsDots = setup(config, "general", "renderSphereAsDots", false, "If set to true spheres will be rendered as dots.");
buttonOnOverlay = setup(config, "general", "buttonEnabledOverlay", HexColor.from("#3000ff00"), "The color and alpha of the button overlay when a button is on.");
+ lineWidthModifier = setup(config, "general", "lineWidthModifier", 1, "");
drawBeacons = setup(config, "beacons", "drawBeacons", true, "If set to true beacon bounding boxes will be drawn.");
package com.irtimaled.bbor.client.gui;
+import com.google.common.base.Function;
+import com.google.common.base.Preconditions;
import com.irtimaled.bbor.client.config.Setting;
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
import net.minecraft.client.resource.language.I18n;
import java.util.HashMap;
import java.util.Map;
+import java.util.stream.IntStream;
class IntSettingSlider extends AbstractSlider {
private final String format;
return this;
}
+ IntSettingSlider addDisplayValueRange(int start, int end) {
+ return addDisplayValueRange(start, end, String::valueOf);
+ }
+
+ IntSettingSlider addDisplayValueRange(int start, int end, Function<Integer, String> formatter) {
+ Preconditions.checkArgument(start <= end);
+ Preconditions.checkNotNull(formatter);
+ IntStream.range(start, end).forEach(value -> addDisplayValue(value, formatter.apply(value)));
+ return this;
+ }
+
protected Integer getSettingValue() {
return minValue + getPosition();
}
}
},
width -> new BoolSettingButton(width, I18n.translate("bbor.options.outerBoxOnly"), ConfigManager.outerBoxesOnly),
- width -> new BoolSettingButton(width, I18n.translate("bbor.options.fill"), ConfigManager.fill))
+ width -> new BoolSettingButton(width, I18n.translate("bbor.options.fill"), ConfigManager.fill),
+ width -> new IntSettingSlider(width, 1, 25, I18n.translate("bbor.options.lineWidthModifier"), ConfigManager.lineWidthModifier)
+ .addDisplayValueRange(1, 25))
.section(I18n.translate("bbor.features.spawnChunks"),
width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.spawnChunks"), BoundingBoxType.WorldSpawn),
width -> new BoundingBoxTypeButton(width, I18n.translate("bbor.features.lazyChunks"), BoundingBoxType.LazySpawnChunks),
public static final double PHI_SEGMENT = TAU / 90D;
private static final double PI = TAU / 2D;
public static final double THETA_SEGMENT = PHI_SEGMENT / 2D;
- private static final float LINE_RADIUS = 0.0025f;
+ private static final float DEFAULT_LINE_WIDTH = 0.0025f;
private final VertexBuffer solidBox = new VertexBuffer();
private final VertexBuffer outlinedBox = new VertexBuffer();
RenderHelper.polygonModeFill();
matrixStack.push();
+ RenderSystem.depthMask(false);
renderCuboid0(matrixStack, nudge, color, fillOnly, fillAlpha);
+ RenderSystem.depthMask(true);
matrixStack.pop();
RenderSystem.setShaderColor(1, 1, 1, 1);
if (!fillOnly) {
RenderSystem.setShaderColor(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1F);
// outlinedBox.setShader(viewMatrix, projMatrix, shader);
- final double minXL = minX - LINE_RADIUS;
- final double minYL = minY - LINE_RADIUS;
- final double minZL = minZ - LINE_RADIUS;
- final double maxXL = maxX + LINE_RADIUS;
- final double maxYL = maxY + LINE_RADIUS;
- final double maxZL = maxZ + LINE_RADIUS;
+ final double minXL = minX - getLineWidth();
+ final double minYL = minY - getLineWidth();
+ final double minZL = minZ - getLineWidth();
+ final double maxXL = maxX + getLineWidth();
+ final double maxYL = maxY + getLineWidth();
+ final double maxZL = maxZ + getLineWidth();
stack.push();
stack.peek().getModel().load(lastStack.getModel());
stack.peek().getNormal().load(lastStack.getNormal());
nudge.getMin().getZ() < 0 && nudge.getMax().getZ() > 0;
}
+ private double getLineWidth() {
+ return DEFAULT_LINE_WIDTH * ConfigManager.lineWidthModifier.get();
+ }
+
void renderLine(MatrixStack matrixStack, OffsetPoint startPoint, OffsetPoint endPoint, Color color) {
if ((startPoint.getY() == endPoint.getY() && startPoint.getZ() == endPoint.getZ()) ||
(startPoint.getX() == endPoint.getX() && startPoint.getZ() == endPoint.getZ()) ||
(startPoint.getX() == endPoint.getX() && startPoint.getY() == endPoint.getY())) {
- renderCuboid(matrixStack, new OffsetBox(startPoint.offset(-LINE_RADIUS, -LINE_RADIUS, -LINE_RADIUS), endPoint.offset(LINE_RADIUS, LINE_RADIUS, LINE_RADIUS)), color, true, 255);
+ RenderSystem.depthMask(true);
+ renderCuboid0(matrixStack, new OffsetBox(startPoint.offset(-getLineWidth(), -getLineWidth(), -getLineWidth()), endPoint.offset(getLineWidth(), getLineWidth(), getLineWidth())), color, true, 255);
+ RenderSystem.depthMask(false);
return;
}
GL11.glEnable(GL11.GL_LINE_SMOOTH);
RenderSystem.disableCull();
enableDepthTest();
- RenderSystem.depthMask(false);
+ RenderSystem.depthMask(true);
RenderSystem.depthFunc(GL11.GL_LEQUAL);
if (ConfigManager.alwaysVisible.get()) {
@Shadow private Frustum frustum;
- @Inject(method = "render", at = @At(value = "INVOKE_STRING", target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V", args = "ldc=string", shift = At.Shift.BEFORE))
+ @Inject(method = "render", at = @At(value = "INVOKE_STRING", target = "Lnet/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V", args = "ldc=blockentities", shift = At.Shift.BEFORE))
private void onRender(MatrixStack matrixStack, float partialTicks, long ignored_2, boolean ignored_3, Camera ignored_4, GameRenderer ignored_5, LightmapTextureManager ignored_6, Matrix4f ignored_7, CallbackInfo ci) {
Preconditions.checkNotNull(this.client.player);
RenderCulling.setFrustum(frustum);
"bbor.options.active": "Active",
"bbor.options.outerBoxOnly": "Outer Box Only",
"bbor.options.fill": "Fill",
+ "bbor.options.lineWidthModifier": "Line Width Modifier",
"bbor.options.maxY": "Max Y: %s",
"bbor.options.maxY.activated": "Activated",