aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2021-10-09 18:57:39 +0900
committersyeyoung <cyoung06@naver.com>2021-10-09 18:59:15 +0900
commit37fcd4b717a50ec5991f87781174b2699c732747 (patch)
treeb6c9f35cbf1b04f409da04572fe5511e6c329e2f /src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle
parent0b1a144b3847df60e78c79a6fe66ed99732e11d5 (diff)
downloadSkyblock-Dungeons-Guide-37fcd4b717a50ec5991f87781174b2699c732747.tar.gz
Skyblock-Dungeons-Guide-37fcd4b717a50ec5991f87781174b2699c732747.tar.bz2
Skyblock-Dungeons-Guide-37fcd4b717a50ec5991f87781174b2699c732747.zip
- Precise color control for solvers
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java
index a34861c9..bf81bf72 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/boxpuzzle/RoomProcessorBoxSolver.java
@@ -31,10 +31,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.init.Blocks;
-import net.minecraft.util.BlockPos;
-import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.IChatComponent;
-import net.minecraft.util.MathHelper;
+import net.minecraft.util.*;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
@@ -332,7 +329,7 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor {
public void drawScreen(float partialTicks) {
super.drawScreen(partialTicks);
if (!FeatureRegistry.SOLVER_BOX.isEnabled()) return;
- if (FeatureRegistry.SOLVER_BOX_DISABLE_TEXT.isEnabled()) return;
+ if (FeatureRegistry.SOLVER_BOX.disableText()) return;
FontRenderer fr = Minecraft.getMinecraft().fontRendererObj;
GlStateManager.enableBlend();
GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -359,21 +356,23 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor {
dir = new BlockPos(MathHelper.clamp_int(dir.getX(), -1, 1), 0, MathHelper.clamp_double(dir.getZ(), -1, 1));
BlockPos highlight = pos2.add(dir);
- RenderUtils.highlightBlock(highlight, new Color(0, 255, 0, MathHelper.clamp_int((int) (Minecraft.getMinecraft().thePlayer.getPosition().distanceSq(highlight)), 50, 150)), partialTicks, false);
+ AColor color = FeatureRegistry.SOLVER_BOX.getTargetColor().multiplyAlpha(MathHelper.clamp_double(Minecraft.getMinecraft().thePlayer.getPosition().distanceSq(highlight), 100, 255) / 255);
+ RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(highlight.getX(), highlight.getY(), highlight.getZ(), highlight.getX()+1, highlight.getY() + 1, highlight.getZ() + 1), color, partialTicks, false);
}
if (pathFound != null) {
- RenderUtils.drawLines(pathFound, new AColor(0, 255, 0, 255),1, partialTicks, true);
+ RenderUtils.drawLines(pathFound, FeatureRegistry.SOLVER_BOX.getLineColor(),FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, true);
}
} else {
if (totalPath != null) {
- RenderUtils.drawLines(totalPath, new AColor(0, 255, 0, 255),1, partialTicks, false);
+ RenderUtils.drawLines(totalPath, FeatureRegistry.SOLVER_BOX.getLineColor(),FeatureRegistry.SOLVER_BOX.getLineWidth(), partialTicks, false);
}
if (totalPushedBlocks != null) {
for (int i = 0; i < totalPushedBlocks.size(); i++) {
BlockPos pos = totalPushedBlocks.get(i);
- RenderUtils.highlightBlock(pos, new Color(0, 255, 255, 50), partialTicks, false);
- RenderUtils.drawTextAtWorld("#"+i, pos.getX()+0.5f, pos.getY() +0.5f, pos.getZ() + 0.5f, i != step ?0xFF000000 : 0xFF00FF00, 0.1f, false, false, partialTicks);
+ RenderUtils.highlightBoxAColor(AxisAlignedBB.fromBounds(pos.getX(), pos.getY(), pos.getZ(), pos.getX()+1, pos.getY() + 1, pos.getZ() + 1), FeatureRegistry.SOLVER_BOX.getTargetColor(), partialTicks, false);
+ RenderUtils.drawTextAtWorld("#"+i, pos.getX()+0.5f, pos.getY() +0.5f, pos.getZ() + 0.5f, i != step ?
+ RenderUtils.getColorAt(pos.getX(), pos.getY(), pos.getZ(), FeatureRegistry.SOLVER_BOX.getTextColor2()) : RenderUtils.getColorAt(pos.getX(), pos.getY(), pos.getZ(), FeatureRegistry.SOLVER_BOX.getTextColor()), 0.1f, false, false, partialTicks);
}
}
}