0.3.1 hotfixes, part I

This commit is contained in:
zelophed 2021-04-03 00:54:28 +02:00
parent f17a804f43
commit 7a6b1c6949
2 changed files with 25 additions and 15 deletions

View file

@ -18,8 +18,10 @@ public class CClient extends ConfigBase {
"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",
"Offset the overlay from goggle- and hover- information by this many pixels on the Y axis; Use /create overlay");
public ConfigBool smoothPlacementIndicator = b(false, "smoothPlacementIndicator",
"Use an alternative indicator when showing where the assisted placement ends up relative to your crosshair");
public ConfigGroup placementAssist = group(1, "placementAssist", "Settings for the Placement Assist");
public ConfigEnum<PlacementIndicatorSetting> placementIndicator = e(PlacementIndicatorSetting.TEXTURE, "indicatorType", "What indicator should be used when showing where the assisted placement ends up relative to your crosshair", "Choose 'NONE' to disable the Indicator altogether");
public ConfigFloat indicatorScale = f(1.0f, 0f, "indicatorScale", "Change the size of the Indicator by this multiplier");
public ConfigGroup ponder = group(1, "ponder", "Ponder settings");
public ConfigBool comfyReading =
@ -29,4 +31,8 @@ public class CClient extends ConfigBase {
public String getName() {
return "client";
}
public enum PlacementIndicatorSetting {
TEXTURE, TRIANGLE, NONE
}
}

View file

@ -1,12 +1,5 @@
package com.simibubi.create.foundation.utility.placement;
import com.mojang.blaze3d.systems.RenderSystem;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingAngle;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.BlockState;
import net.minecraft.client.MainWindow;
import net.minecraft.client.Minecraft;
@ -25,11 +18,19 @@ import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.lwjgl.opengl.GL11;
import com.mojang.blaze3d.systems.RenderSystem;
import com.simibubi.create.foundation.config.AllConfigs;
import com.simibubi.create.foundation.config.CClient;
import com.simibubi.create.foundation.gui.AllGuiTextures;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingAngle;
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
import com.simibubi.create.foundation.utility.AngleHelper;
import com.simibubi.create.foundation.utility.VecHelper;
@Mod.EventBusSubscriber
public class PlacementHelpers {
@ -205,11 +206,10 @@ public class PlacementHelpers {
float length = 10;
//TOD O if the target is off screen, use length to show a meaningful distance
boolean flag = AllConfigs.CLIENT.smoothPlacementIndicator.get();
if (flag)
CClient.PlacementIndicatorSetting mode = AllConfigs.CLIENT.placementIndicator.get();
if (mode == CClient.PlacementIndicatorSetting.TRIANGLE)
fadedArrow(centerX, centerY, r, g, b, a, length, snappedAngle);
else
else if (mode == CClient.PlacementIndicatorSetting.TEXTURE)
textured(centerX, centerY, a, snappedAngle);
}
@ -224,6 +224,8 @@ public class PlacementHelpers {
RenderSystem.translated(centerX, centerY, 0);
RenderSystem.rotatef(angle.get(0), 0, 0, 1);
//RenderSystem.rotatef(snappedAngle, 0, 0, 1);
double scale = AllConfigs.CLIENT.indicatorScale.get();
RenderSystem.scaled(scale, scale, 1);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
@ -263,7 +265,9 @@ public class PlacementHelpers {
//RenderSystem.rotatef(angle.get(0.1f), 0, 0, -1);
//RenderSystem.translated(0, 10, 0);
//RenderSystem.rotatef(angle.get(0.1f), 0, 0, 1);
RenderSystem.scaled(12, 12, 0);
double scale = AllConfigs.CLIENT.indicatorScale.get();
RenderSystem.scaled(scale, scale, 1);
RenderSystem.scaled(12, 12, 1);
float index = snappedAngle / 22.5f;
float tex_size = 16f/256f;