diff options
Diffstat (limited to 'src/main/java')
3 files changed, 10 insertions, 16 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java index ee6d4307..77f5fe38 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java @@ -73,11 +73,11 @@ public class CrystalsHud { //if enabled add waypoint locations to map if (SkyblockerConfigManager.get().locations.dwarvenMines.crystalsHud.showLocations) { - Map<String,CrystalsWaypoint> ActiveWaypoints= CrystalsLocationsManager.activeWaypoints; + Map<String,CrystalsWaypoint> ActiveWaypoints = CrystalsLocationsManager.activeWaypoints; for (CrystalsWaypoint waypoint : ActiveWaypoints.values()) { Color waypointColor = waypoint.category.color; - IntIntPair renderPos = transformLocation(waypoint.pos.getX(),waypoint.pos.getZ()); + IntIntPair renderPos = transformLocation(waypoint.pos.getX(), waypoint.pos.getZ()); int locationSize = SkyblockerConfigManager.get().locations.dwarvenMines.crystalsHud.locationSize; if (Arrays.asList(SMALL_LOCATIONS).contains(waypoint.name.getString())) {//if small location half the location size @@ -124,12 +124,12 @@ public class CrystalsHud { */ protected static IntIntPair transformLocation(double x, double z) { //converts an x and z to a location on the map - int transformedX = (int)((x - 202) / 621 * 62); - int transformedY = (int)((z - 202) / 621 * 62); + int transformedX = (int) ((x - 202) / 621 * 62); + int transformedY = (int) ((z - 202) / 621 * 62); transformedX = MathHelper.clamp(transformedX, 0, 62); transformedY = MathHelper.clamp(transformedY, 0, 62); - return IntIntPair.of(transformedX,transformedY); + return IntIntPair.of(transformedX, transformedY); } /** @@ -140,7 +140,7 @@ public class CrystalsHud { */ private static float yaw2Cardinal(float yaw) { yaw += + 180; //flip direction - byte clipped = (byte)((yaw += yaw < 0.0 ? -8.0 : 8.0) * 16.0 / 360.0); + byte clipped = (byte) ((yaw += yaw < 0.0 ? -8.0 : 8.0) * 16.0 / 360.0); return (clipped * 360f) / 16f; } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java index 36220da9..24b031f8 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java @@ -119,7 +119,7 @@ public class CrystalsLocationsManager { .then(literal("crystalWaypoints") .then(argument("pos", BlockPosArgumentType.blockPos()) .then(argument("place", StringArgumentType.greedyString()) - .executes(context -> addWaypointFromCommand(context.getSource(), getString(context, "place"),context.getArgument("pos", PosArgument.class))) + .executes(context -> addWaypointFromCommand(context.getSource(), getString(context, "place"), context.getArgument("pos", PosArgument.class))) ) ) ) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java index 38a3d741..ab971ec4 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java @@ -32,7 +32,7 @@ public class CrystalsWaypoint extends Waypoint { final Text name; private final Vec3d centerPos; - CrystalsWaypoint( Category category, Text name, BlockPos pos) { + CrystalsWaypoint(Category category, Text name, BlockPos pos) { super(pos, TYPE_SUPPLIER, category.colorComponents); this.category = category; this.name = name; @@ -64,7 +64,6 @@ public class CrystalsWaypoint extends Waypoint { public void render(WorldRenderContext context) { super.render(context); - Vec3d posUp = centerPos.add(0, 1, 0); RenderHelper.renderText(context, name, posUp, true); double distance = context.camera().getPos().distanceTo(centerPos); @@ -72,7 +71,6 @@ public class CrystalsWaypoint extends Waypoint { } - /** * enum for the different waypoints used int the crystals hud each with a {@link Category#name} and associated {@link Category#color} */ @@ -89,18 +87,15 @@ public class CrystalsWaypoint extends Waypoint { DEFAULT("Default", Color.BLACK); - public final Color color; private static final Codec<Category> CODEC = StringIdentifiable.createCodec(Category::values); + public final Color color; private final String name; - private final float[] colorComponents; Category(String name,Color color) { this.name = name; this.color = color; - colorComponents = color.getColorComponents(null); - - + this.colorComponents = color.getColorComponents(null); } static Category get(JsonObject waypointJson) { @@ -116,6 +111,5 @@ public class CrystalsWaypoint extends Waypoint { public String asString() { return name; } - } } |