Skip to content

Commit

Permalink
Some Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterCheezeCake committed Aug 27, 2024
1 parent 2633d3a commit 4b465e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
3 changes: 2 additions & 1 deletion src/main/java/wtf/cheeze/sbt/utils/NumberUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public static int parseIntWithKorM(String text) {
public static float parseFloatWithKorM(String text) {
text = text.toLowerCase();
text = text.replaceAll(",", "");
var v = Float.parseFloat(text.substring(0, text.length() - 1));
if (text.endsWith("k")) {
var v = Float.parseFloat(text.substring(0, text.length() - 1));
return v * 1000;
} else if (text.endsWith("m")) {
var v = Float.parseFloat(text.substring(0, text.length() - 1));
return v * 1000000;
} else {
return Float.parseFloat(text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import wtf.cheeze.sbt.utils.NumberUtils;
import wtf.cheeze.sbt.utils.TextUtils;

import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -174,8 +175,7 @@ public static ActionBarData extractDataAndRunTransformation(String actionBarText
data.transformedText = newText;
return data;
} catch (Exception e) {
SkyblockTweaks.LOGGER.error("Error parsing action bar text: " + actionBarText);
e.printStackTrace();
SkyblockTweaks.LOGGER.error("Error parsing action bar text: {}", actionBarText, e);
SkyblockTweaks.LOGGER.warn("Some features may not work correctly. Please report this to MisterCheezeCake immediately.");
return new ActionBarData();
}
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/wtf/cheeze/sbt/utils/render/RenderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,36 +87,4 @@ public static ScreenBounds getScreenBounds() {
return new ScreenBounds();
}

// public static class Color4f extends Color3f {
// public float alpha;
//
// private Color4f(int color) {
// super(color);
// this.alpha = (float) (color >> 24 & 255) / 255.0F;
// }
// }
// public static Color4f getColor4f(int color) {
// return new Color4f(color);
// }
// Adapted from Skyblocker
// private static void renderFilledInternal(WorldRenderContext context, Vec3d pos, Vec3d dimensions, Color3f color, float alpha, boolean throughWalls) {
// var matrices = context.matrixStack();
// var camera = context.camera().getPos();
// matrices.push();
// matrices.translate(-camera.x, -camera.y, -camera.z);
// var consumers = context.consumers();
// var buffer = consumers.getBuffer(throughWalls ? SkyblockerRenderLayers.FILLED_THROUGH_WALLS : SkyblockerRenderLayers.FILLED);
// WorldRenderer.renderFilledBox(matrices, buffer, pos.x, pos.y, pos.z, pos.x + dimensions.x, pos.y + dimensions.y, pos.z + dimensions.z, color.red, color.green, color.blue, alpha);
// matrices.pop();
// }
//
//
// public static final RenderLayer.MultiPhase FILLED = RenderLayer.of("filled", VertexFormats.POSITION_COLOR, VertexFormat.DrawMode.TRIANGLE_STRIP, RenderLayer.CUTOUT_BUFFER_SIZE, false, true, RenderLayer.MultiPhaseParameters.builder()
// .program(RenderPhase.COLOR_PROGRAM)
// .cull(RenderPhase.Cull.DISABLE_CULLING)
// .layering(RenderPhase.POLYGON_OFFSET_LAYERING)
// .transparency(DEFAULT_TRANSPARENCY)
// .depthTest(RenderPhase.DepthTest.LEQUAL_DEPTH_TEST)
// .build(false));

}

0 comments on commit 4b465e4

Please sign in to comment.