Skip to content

Util cleanup#84

Merged
kyanvde merged 14 commits intomainfrom
util-cleanup
Apr 30, 2026
Merged

Util cleanup#84
kyanvde merged 14 commits intomainfrom
util-cleanup

Conversation

@kyanvde
Copy link
Copy Markdown
Contributor

@kyanvde kyanvde commented Apr 28, 2026

This pull request aims to clean up the old code under /utils a bit.
Main changes:

  • Switch to using https://github.com/BuildTheEarth/projection for projection based conversion instead of keeping a duplicate of the t-- code inside of our source code.
  • Rewrite of the head code to make it cleaner
  • Removal of lots of unused code

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Cleans up /utils by removing legacy/unused utility code, migrating custom head creation to a new HeadFactory API, and switching geo/projection conversions to the external net.buildtheearth:projection library.

Changes:

  • Remove legacy raycast, JSON, geo/projection, constants/errors, and custom-head utilities.
  • Introduce utils.heads (HeadFactory, HeadTexture, HeadColor, LetterType) and update menus/models to use it.
  • Replace internal coordinate conversion/projection stack with net.buildtheearth:projection:1.0.3 and new helpers in NavUtils / BuildTeamTools#getEarthWorld().

Reviewed changes

Copilot reviewed 46 out of 47 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java Removes legacy raycast math utility.
src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java Removes legacy raycast implementation.
src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java Switches “Next” item to HeadFactory checkmark head.
src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java Switches “Next” item to HeadFactory checkmark head.
src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java Reworks pagination UI items to use HeadFactory.
src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java Migrates counters/choice items/back item to HeadFactory/HeadColor.
src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java Removes centralized error-string constants.
src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java Removes centralized constants (API url, default key, etc.).
src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java Adds letter-style enum for head generation.
src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java Adds centralized base64 texture enum for heads.
src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java Adds new factory for generating textured heads (numbers/letters/counters).
src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java Adds color enum to support colorized head variants.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java Removes internal modified Airocean projection code.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java Removes internal conformal projection implementation.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java Removes internal Airocean projection implementation.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java Removes internal projection transform utility.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java Removes internal projection scaling transform.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java Removes internal base transform type.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java Removes internal projection bounds exception type.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java Removes internal projection offset transform.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java Removes internal vector-field inversion utility.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java Removes internal projection registry/abstraction.
src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java Removes internal Minecraft↔geo conversion helper.
src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java Removes internal math helpers used by old projection code.
src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java Removes JSON parsing utility.
src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java Removes old geo→Bukkit Location helpers (replaced by NavUtils).
src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java Removes legacy custom head constants/helpers (replaced by HeadFactory).
src/main/java/net/buildtheearth/buildteamtools/utils/Config.java Minor formatting cleanup.
src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java Migrates menu icons to HeadFactory textures.
src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java Inlines removed constants/errors and keeps API-key validation.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java Migrates letter-head fallback to HeadFactory.letter.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java Migrates letter-head fallback to HeadFactory.letter.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java Migrates “create warp” icon to HeadFactory green plus.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java Migrates “create warp group” icon to HeadFactory green plus.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java Migrates confirm + group icon heads to HeadFactory.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java Migrates confirm/group heads + switches to external projection conversion.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java Migrates “custom head” icon to HeadFactory.letter.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java Switches teleport/creation flows to external projection + new NavUtils location helpers.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/tpll/TpllComponent.java Uses NavUtils for geo→location conversion.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java Uses external projection to place BlueMap warp markers.
src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java Adds geo→Bukkit location helpers based on external projection + earth-world lookup.
src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java Migrates counters/next button to HeadFactory/HeadColor.
src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java Uses NavUtils for coordinate→location conversion (doc updated partially).
src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java Migrates counters/next button to HeadFactory/HeadColor.
src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java Adds cached earthWorld getter based on config.
settings.gradle.kts Adds BTE Maven repo (now duplicated).
build.gradle.kts Adds dependency on net.buildtheearth:projection:1.0.3.
Comments suppressed due to low confidence (1)

src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java:525

  • This Javadoc is now inconsistent after moving from GeometricUtils to NavUtils: it has an empty <li> (“using
  • ”) and still refers to GeometricUtils in the note. Please update it to reference NavUtils.getLocationFromCoordinates(...) and clarify the actual Y offset behavior (especially if the +2 terrain offset is still intended).
     * Converts geographic coordinates (latitude/longitude) to a Minecraft Location.
     * <p>
     * This method:
     * <ol>
     *   <li>Converts lat/lon to Minecraft X/Z using </li>
     *   <li>Applies the KML altitude offset (Google Earth altitudes are relative to ground)</li>
     * </ol>
     * <p>
     * Note: GeometricUtils already adds +2 to terrain elevation, so we don't subtract it here anymore.
     *

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread settings.gradle.kts Outdated
Comment thread src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java Outdated
Comment thread src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java Outdated
@kyanvde kyanvde self-assigned this Apr 29, 2026
Comment thread settings.gradle.kts Outdated
Copy link
Copy Markdown
Contributor

@Nudelsuppe42 Nudelsuppe42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but dont trust me

Co-authored-by: Nudesuppe42 <67996941+Nudelsuppe42@users.noreply.github.com>
@kyanvde kyanvde requested a review from Jasupa April 30, 2026 07:29
@kyanvde kyanvde merged commit c087234 into main Apr 30, 2026
4 checks passed
@kyanvde kyanvde deleted the util-cleanup branch April 30, 2026 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants