From 3faef5a11e803027208bdd3af17562f245f18deb Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 20:31:58 +0200
Subject: [PATCH 01/14] refactor(src): Start using external library for
projection conversions.
---
build.gradle.kts | 2 +
settings.gradle.kts | 5 +
.../components/bluemap/BluemapComponent.java | 29 +-
.../components/warps/WarpsComponent.java | 55 ++-
.../components/warps/menu/WarpEditMenu.java | 75 +--
.../buildteamtools/utils/GeometricUtils.java | 54 ++-
.../utils/geo/CoordinateConversion.java | 119 -----
.../geo/projection/GeographicProjection.java | 147 ------
.../geo/projection/InvertableVectorField.java | 108 -----
.../projection/OffsetProjectionTransform.java | 45 --
.../OutOfProjectionBoundsException.java | 19 -
.../geo/projection/ProjectionTransform.java | 27 --
.../projection/ScaleProjectionTransform.java | 60 ---
...UprightOrientationProjectionTransform.java | 38 --
.../geo/projection/airocean/Airocean.java | 434 ------------------
.../airocean/ConformalEstimate.java | 103 -----
.../projection/airocean/ModifiedAirocean.java | 124 -----
17 files changed, 127 insertions(+), 1317 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java
diff --git a/build.gradle.kts b/build.gradle.kts
index 9ce10cc8..68253e87 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -24,6 +24,8 @@ dependencies {
implementation(libs.com.googlecode.json.simple)
implementation(libs.bstats.bukkit)
implementation(platform(libs.fawe.bom))
+ implementation("net.buildtheearth:projection:1.0.2")
+
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false }
compileOnly(libs.io.papermc.paper.paper.api)
diff --git a/settings.gradle.kts b/settings.gradle.kts
index c6b80f74..f273cb5d 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -9,6 +9,11 @@ dependencyResolutionManagement {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
+ // BTE REPO! :)
+ maven {
+ url = uri("https://maven.buildtheearth.net/releases")
+ }
+
maven {
url = uri("https://maven.buildtheearth.net/releases")
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java
index bd488fc0..694a28e3 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java
@@ -5,14 +5,17 @@
import de.bluecolored.bluemap.api.BlueMapMap;
import de.bluecolored.bluemap.api.markers.MarkerSet;
import de.bluecolored.bluemap.api.markers.POIMarker;
+import net.buildtheearth.OutOfProjectionBoundsException;
+import net.buildtheearth.Projection;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.ModuleComponent;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
-import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion;
import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
import net.buildtheearth.buildteamtools.utils.io.ConfigUtil;
+import net.buildtheearth.model.GeographicalCoordinate;
+import net.buildtheearth.model.MinecraftCoordinate;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Bukkit;
@@ -145,16 +148,20 @@ private void registerWarpsForWorld(BlueMapAPI api, @NotNull WarpGroup warpGroup,
*/
private void addWarpMarker(@NotNull MarkerSet markerSet, @NotNull Warp warp) {
// Convert geographic coordinates to Minecraft world coordinates
- double[] xz = CoordinateConversion.convertFromGeo(warp.getLat(), warp.getLon());
-
- // Create a POI marker for the warp
- POIMarker marker = POIMarker.builder()
- .label(warp.getName())
- .position(new Vector3d(xz[0], warp.getY(), xz[1]))
- .build();
-
- // Add marker to the marker set
- markerSet.getMarkers().put(warp.getId().toString(), marker);
+ try {
+ MinecraftCoordinate coordinate = Projection.toMinecraft(new GeographicalCoordinate(warp.getLat(), warp.getLon()));
+
+ // Create a POI marker for the warp
+ POIMarker marker = POIMarker.builder()
+ .label(warp.getName())
+ .position(new Vector3d(coordinate.x(), warp.getY(), coordinate.z()))
+ .build();
+
+ // Add marker to the marker set
+ markerSet.getMarkers().put(warp.getId().toString(), marker);
+ } catch (OutOfProjectionBoundsException e) {
+ throw new RuntimeException(e);
+ }
}
/**
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java
index b00a579d..d93ce8bb 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/WarpsComponent.java
@@ -4,6 +4,8 @@
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
+import net.buildtheearth.OutOfProjectionBoundsException;
+import net.buildtheearth.Projection;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.ModuleComponent;
import net.buildtheearth.buildteamtools.modules.navigation.NavUtils;
@@ -17,8 +19,9 @@
import net.buildtheearth.buildteamtools.modules.network.api.OpenStreetMapAPI;
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
import net.buildtheearth.buildteamtools.utils.GeometricUtils;
-import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
+import net.buildtheearth.model.GeographicalCoordinate;
+import net.buildtheearth.model.MinecraftCoordinate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
@@ -156,37 +159,41 @@ public static void createWarp(Player creator) {
public static void createWarp(@NonNull Player creator, WarpGroup group) {
// Get the geographic coordinates of the player's location.
Location location = creator.getLocation();
- double[] coordinates = CoordinateConversion.convertToGeo(location.getX(), location.getZ());
+ try {
+ GeographicalCoordinate coordinate = Projection.toGeo(new MinecraftCoordinate(location.getX(), location.getZ()));
- //Get the country belonging to the coordinates
- CompletableFuture future = OpenStreetMapAPI.getCountryFromLocationAsync(coordinates);
+ //Get the country belonging to the coordinates
+ CompletableFuture future = OpenStreetMapAPI.getCountryFromLocationAsync(new double[] { coordinate.latitude(), coordinate.longitude() });
- future.thenAccept(result -> {
- String regionName = result[0];
- String countryCodeCCA2 = result[1].toUpperCase();
+ future.thenAccept(result -> {
+ String regionName = result[0];
+ String countryCodeCCA2 = result[1].toUpperCase();
- //Check if the team owns this region/country
- boolean ownsRegion = NetworkModule.getInstance().ownsRegion(regionName, countryCodeCCA2);
+ //Check if the team owns this region/country
+ boolean ownsRegion = NetworkModule.getInstance().ownsRegion(regionName, countryCodeCCA2);
- if(!ownsRegion) {
- creator.sendMessage(ChatHelper.getErrorString("This team does not own the country %s!", result[0]));
- return;
- }
+ if(!ownsRegion) {
+ creator.sendMessage(ChatHelper.getErrorString("This team does not own the country %s!", result[0]));
+ return;
+ }
- // Create a default name for the warp
- String name = creator.getName() + "'s Warp";
+ // Create a default name for the warp
+ String name = creator.getName() + "'s Warp";
- // Create an instance of the warp POJO
- Warp warp = new Warp(group, name, countryCodeCCA2, "cca2", null, null, null, location.getWorld().getName(), coordinates[0], coordinates[1], location.getY(), location.getYaw(), location.getPitch(), false);
+ // Create an instance of the warp POJO
+ Warp warp = new Warp(group, name, countryCodeCCA2, "cca2", null, null, null, location.getWorld().getName(), coordinate.latitude(), coordinate.longitude(), location.getY(), location.getYaw(), location.getPitch(), false);
- Bukkit.getScheduler().runTask(BuildTeamTools.getInstance(), () ->
- new WarpEditMenu(creator, warp, false, true));
+ Bukkit.getScheduler().runTask(BuildTeamTools.getInstance(), () ->
+ new WarpEditMenu(creator, warp, false, true));
- }).exceptionally(e -> {
- creator.sendMessage(ChatHelper.getErrorString("An error occurred while creating the warp! %s", e.getMessage()));
- BuildTeamTools.getInstance().getComponentLogger().error("An error occurred while creating the warp!", e);
- return null;
- });
+ }).exceptionally(e -> {
+ creator.sendMessage(ChatHelper.getErrorString("An error occurred while creating the warp! %s", e.getMessage()));
+ BuildTeamTools.getInstance().getComponentLogger().error("An error occurred while creating the warp!", e);
+ return null;
+ });
+ } catch (OutOfProjectionBoundsException e) {
+ ChatHelper.sendErrorMessage(creator, e.getMessage());
+ }
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
index 7f5de25c..68420630 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
@@ -3,6 +3,8 @@
import com.alpsbte.alpslib.utils.ChatHelper;
import com.alpsbte.alpslib.utils.item.Item;
import com.cryptomorin.xseries.XMaterial;
+import net.buildtheearth.OutOfProjectionBoundsException;
+import net.buildtheearth.Projection;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
@@ -11,8 +13,9 @@
import net.buildtheearth.buildteamtools.utils.CustomHeads;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
-import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
+import net.buildtheearth.model.GeographicalCoordinate;
+import net.buildtheearth.model.MinecraftCoordinate;
import net.wesjd.anvilgui.AnvilGUI;
import org.bukkit.Location;
import org.bukkit.Sound;
@@ -129,39 +132,43 @@ protected void setItemClickEventsAsync() {
// Get the geographic coordinates of the player's location.
Location location = clickPlayer.getLocation();
- double[] coordinates = CoordinateConversion.convertToGeo(location.getX(), location.getZ());
-
- //Get the country belonging to the coordinates
- CompletableFuture future = OpenStreetMapAPI.getCountryFromLocationAsync(coordinates);
-
- future.thenAccept(result -> {
- String regionName = result[0];
- String countryCodeCCA2 = result[1].toUpperCase();
-
- //Check if the team owns this region/country
- boolean ownsRegion = NetworkModule.getInstance().ownsRegion(regionName, countryCodeCCA2);
-
- if(!ownsRegion) {
- clickPlayer.sendMessage(ChatHelper.getErrorString("This team does not own the country %s!", result[0]));
- return;
- }
-
- warp.setCountryCode(countryCodeCCA2);
- warp.setWorldName(location.getWorld().getName());
- warp.setY(location.getY());
- warp.setLat(coordinates[0]);
- warp.setLon(coordinates[1]);
- warp.setYaw(location.getYaw());
- warp.setPitch(location.getPitch());
-
- clickPlayer.playSound(clickPlayer.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 1.0F);
-
- new WarpEditMenu(clickPlayer, warp, alreadyExists, true);
- }).exceptionally(e -> {
- clickPlayer.sendMessage(ChatHelper.getErrorString("An error occurred while changing the location of the warp!"));
- e.printStackTrace();
- return null;
- });
+ try {
+ GeographicalCoordinate coordinate = Projection.toGeo(new MinecraftCoordinate(location.getX(), location.getZ()));
+
+ //Get the country belonging to the coordinates
+ CompletableFuture future = OpenStreetMapAPI.getCountryFromLocationAsync(new double[] {coordinate.latitude(), coordinate.longitude()} );
+
+ future.thenAccept(result -> {
+ String regionName = result[0];
+ String countryCodeCCA2 = result[1].toUpperCase();
+
+ //Check if the team owns this region/country
+ boolean ownsRegion = NetworkModule.getInstance().ownsRegion(regionName, countryCodeCCA2);
+
+ if(!ownsRegion) {
+ clickPlayer.sendMessage(ChatHelper.getErrorString("This team does not own the country %s!", result[0]));
+ return;
+ }
+
+ warp.setCountryCode(countryCodeCCA2);
+ warp.setWorldName(location.getWorld().getName());
+ warp.setY(location.getY());
+ warp.setLat(coordinate.latitude());
+ warp.setLon(coordinate.longitude());
+ warp.setYaw(location.getYaw());
+ warp.setPitch(location.getPitch());
+
+ clickPlayer.playSound(clickPlayer.getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 1.0F, 1.0F);
+
+ new WarpEditMenu(clickPlayer, warp, alreadyExists, true);
+ }).exceptionally(e -> {
+ clickPlayer.sendMessage(ChatHelper.getErrorString("An error occurred while changing the location of the warp!"));
+ e.printStackTrace();
+ return null;
+ });
+ } catch (OutOfProjectionBoundsException e) {
+ throw new RuntimeException(e);
+ }
});
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java
index ee2e3c48..a7916e91 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java
@@ -1,8 +1,11 @@
package net.buildtheearth.buildteamtools.utils;
+import net.buildtheearth.OutOfProjectionBoundsException;
+import net.buildtheearth.Projection;
import net.buildtheearth.buildteamtools.BuildTeamTools;
-import net.buildtheearth.buildteamtools.utils.geo.CoordinateConversion;
import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
+import net.buildtheearth.model.GeographicalCoordinate;
+import net.buildtheearth.model.MinecraftCoordinate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
@@ -25,20 +28,21 @@ public class GeometricUtils {
* @return A bukkit location matching the coordinates, yaw and pitch specified. Height is terrain elevation +2.
*/
public static Location getLocationFromCoordinatesYawPitch(double[] coordinates, float yaw, float pitch) {
- double[] xz = CoordinateConversion.convertFromGeo(coordinates[0], coordinates[1]);
+ try {
+ MinecraftCoordinate coordinate = Projection.toMinecraft(new GeographicalCoordinate(coordinates[0], coordinates[1]));
- double x = xz[0];
- double z = xz[1];
+ //Creates the location
+ Location location;
+ World tpWorld = Bukkit.getWorld(BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD));
+ if (tpWorld == null)
+ location = new Location(null, coordinate.x(), 64, coordinate.z(), yaw, pitch);
+ else
+ location = new Location(tpWorld, coordinate.x(), (tpWorld.getHighestBlockYAt((int) coordinate.x(), (int) coordinate.z()) + 1), coordinate.z(), yaw, pitch);
- //Creates the location
- Location location;
- World tpWorld = Bukkit.getWorld(BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD));
- if (tpWorld == null)
- location = new Location(null, x, 64, z, yaw, pitch);
- else
- location = new Location(tpWorld, x, (tpWorld.getHighestBlockYAt((int) x, (int) z) + 1), z, yaw, pitch);
-
- return location;
+ return location;
+ } catch (OutOfProjectionBoundsException e) {
+ throw new RuntimeException(e);
+ }
}
/**
@@ -56,20 +60,22 @@ public static Location getLocationFromCoordinatesYawPitch(double[] coordinates,
* @return A bukkit location matching the coordinates. Height is terrain elevation +2.
*/
public static Location getLocationFromCoordinates(double[] coordinates) {
- double[] xz = CoordinateConversion.convertFromGeo(coordinates[0], coordinates[1]);
+ try {
+ MinecraftCoordinate coordinate = Projection.toMinecraft(new GeographicalCoordinate(coordinates[0], coordinates[1]));
- double x = xz[0];
- double z = xz[1];
+ //Creates the location
+ Location location;
+ World tpWorld = Bukkit.getWorld(BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD));
- //Creates the location
- Location location;
- World tpWorld = Bukkit.getWorld(BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD));
+ if (tpWorld == null)
+ location = new Location(null, coordinate.x(), 64, coordinate.z());
+ else
+ location = new Location(tpWorld, coordinate.x(), (tpWorld.getHighestBlockYAt((int) coordinate.x(), (int) coordinate.z()) + 1), coordinate.z());
- if (tpWorld == null)
- location = new Location(null, x, 64, z);
- else
- location = new Location(tpWorld, x, (tpWorld.getHighestBlockYAt((int) x, (int) z) + 1), z);
+ return location;
+ } catch (OutOfProjectionBoundsException e) {
+ throw new RuntimeException(e);
+ }
- return location;
}
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java
deleted file mode 100644
index c725b53e..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/CoordinateConversion.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * The MIT License (MIT)
- *
- * Copyright © 2021, Alps BTE
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package net.buildtheearth.buildteamtools.utils.geo;
-
-import net.buildtheearth.buildteamtools.utils.geo.projection.GeographicProjection;
-import net.buildtheearth.buildteamtools.utils.geo.projection.OffsetProjectionTransform;
-import net.buildtheearth.buildteamtools.utils.geo.projection.OutOfProjectionBoundsException;
-import net.buildtheearth.buildteamtools.utils.geo.projection.ScaleProjectionTransform;
-
-import java.text.DecimalFormat;
-import java.text.DecimalFormatSymbols;
-import java.util.Locale;
-
-public class CoordinateConversion {
-
- private static GeographicProjection projection;
-
- private static final DecimalFormat decFormat1 = new DecimalFormat();
-
- static {
- decFormat1.setMaximumFractionDigits(1);
- DecimalFormatSymbols usSymbols = new DecimalFormatSymbols(Locale.US);
- decFormat1.setDecimalFormatSymbols(usSymbols);
-
- projection = GeographicProjection.projections.get("bteairocean");
- projection = GeographicProjection.orientProjection(projection, GeographicProjection.Orientation.upright);
- projection = new ScaleProjectionTransform(projection, 7318261.522857145, 7318261.522857145);
- projection = new OffsetProjectionTransform(projection, 0, 0);
- }
-
- /**
- * Converts Minecraft coordinates to geographic coordinates
- *
- * @param xCords - Minecraft player x-axis coordinates
- * @param yCords - Minecraft player y-axis coordinates
- * @return - WG84 EPSG:4979 coordinates as double array {lon,lat} in degrees
- */
- public static double[] convertToGeo(double xCords, double yCords) {
- try {
- double[] res = projection.toGeo(xCords, yCords);
- return new double[]{res[1], res[0]};
- } catch (OutOfProjectionBoundsException e) {
- return new double[]{0., 0.};
- }
- }
-
- /**
- * Gets in-game coordinates from geographical location
- *
- * @param lon Geographical Longitude
- * @param lat Geographic Latitude
- * @return The in-game coordinates (x, z)
- */
- public static double[] convertFromGeo(double lat, double lon) {
- try {
- return projection.fromGeo(lon, lat);
- } catch (OutOfProjectionBoundsException e) {
- return new double[]{0., 0.};
- }
- }
-
- /**
- * Get formatted numeric geographic coordinates
- *
- * @param coordinates - WG84 EPSG:4979 coordinates as double array
- * @return - Formatted numeric coordinates as String
- */
- public static String formatGeoCoordinatesNumeric(double[] coordinates) {
- return coordinates[1] + "," + coordinates[0];
- }
-
- /**
- * Get formatted NSEW geographic coordinates
- *
- * @param coordinates - WG84 EPSG:4979 coordinates as double array
- * @return - Formatted NSEW coordinates as String
- */
- public static String formatGeoCoordinatesNSEW(double[] coordinates) {
- double fixedLon = coordinates[0];
- double fixedLat = coordinates[1];
- String eo = fixedLon < 0 ? "W": "E";
- String ns = fixedLat < 0 ? "S" : "N";
- double absLon = Math.abs(fixedLon);
- double absLat = Math.abs(fixedLat);
- int longitudeDegrees = (int) absLon;
- int latitudeDegrees = (int) absLat;
- double minLon = absLon * 60 - longitudeDegrees * 60;
- double minLat = absLat * 60 - latitudeDegrees * 60;
- int longitudeMinutes = (int) minLon;
- int latitudeMinutes = (int) minLat;
- double secLon = minLon * 60 - longitudeMinutes * 60;
- double secLat = minLat * 60 - latitudeMinutes * 60;
- String formattedLongitude = "" + longitudeDegrees + "°" + longitudeMinutes + "'" + decFormat1.format(secLon) + "\"" + eo;
- String formattedLatitude = "" + latitudeDegrees + "°" + latitudeMinutes + "'" + decFormat1.format(secLat) + "\"" + ns;
- return formattedLatitude + " " + formattedLongitude;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java
deleted file mode 100644
index 06ec5ce6..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/GeographicProjection.java
+++ /dev/null
@@ -1,147 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-
-import net.buildtheearth.buildteamtools.utils.geo.projection.airocean.Airocean;
-import net.buildtheearth.buildteamtools.utils.geo.projection.airocean.ConformalEstimate;
-import net.buildtheearth.buildteamtools.utils.geo.projection.airocean.ModifiedAirocean;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Support for various projection types.
- *
- * The geographic space is the surface of the earth, parameterized by the usual spherical coordinates system of latitude and longitude.
- * The projected space is a plane on to which the geographic space is being projected, and is parameterized by a 2D Cartesian coordinate system (x and y).
- *
- * A projection as defined here is something that projects a point in the geographic space to a point of the projected space (and vice versa).
- *
- * All geographic coordinates are in degrees.
- *
- *
- * @see Wikipedia's article on the equirectangular projection
- */
-public abstract class GeographicProjection {
-
- /**
- * Contains the various projections implemented in Terra121,
- * identified by a String key.
- */
- public static final Map projections;
-
- static {
- projections = new HashMap<>();
- projections.put("airocean", new Airocean());
- projections.put("conformal", new ConformalEstimate());
- projections.put("bteairocean", new ModifiedAirocean());
- }
-
- /**
- * Orients a projection
- *
- * @param base - the projection to orient
- * @param orientation - the orientation to use
- *
- * @return a projection that warps the base projection but applies the transformation described by the given orientation
- */
- public static GeographicProjection orientProjection(GeographicProjection base, Orientation orientation) {
- if (base.upright()) {
- if (orientation == Orientation.upright) {
- return base;
- }
- base = new UprightOrientationProjectionTransform(base);
- }
-
- if (orientation == Orientation.swapped) {
- return null;
- } else if (orientation == Orientation.upright) {
- base = new UprightOrientationProjectionTransform(base);
- }
-
- return base;
- }
-
-
- /**
- * Converts map coordinates to geographic coordinates
- *
- * @param x - x map coordinate
- * @param y - y map coordinate
- *
- * @return {longitude, latitude} in degrees
- * @throws OutOfProjectionBoundsException if the specified point on the projected space cannot be mapped to a point of the geographic space
- */
- public abstract double[] toGeo(double x, double y) throws OutOfProjectionBoundsException;
-
- /**
- * Converts geographic coordinates to map coordinates
- *
- * @param longitude - longitude, in degrees
- * @param latitude - latitude, in degrees
- *
- * @return {x, y} map coordinates
- * @throws OutOfProjectionBoundsException if the specified point on the geographic space cannot be mapped to a point of the projected space
- */
- public abstract double[] fromGeo(double longitude, double latitude) throws OutOfProjectionBoundsException;
-
- /**
- * Gives an estimation of the scale of this projection.
- * This is just an estimation, as distortion is inevitable when projecting a sphere onto a flat surface,
- * so this value varies from places to places in reality.
- *
- * @return an estimation of the scale of this projection
- */
- public abstract double metersPerUnit();
-
- /**
- * Indicates the minimum and maximum X and Y coordinates on the projected space.
- *
- * @return {minimum X, minimum Y, maximum X, maximum Y}
- */
- public double[] bounds() {
-
- try {
- //get max in by using extreme coordinates
- double[] bounds = {
- this.fromGeo(-180, 0)[0],
- this.fromGeo(0, -90)[1],
- this.fromGeo(180, 0)[0],
- this.fromGeo(0, 90)[1]
- };
-
- if (bounds[0] > bounds[2]) {
- double t = bounds[0];
- bounds[0] = bounds[2];
- bounds[2] = t;
- }
-
- if (bounds[1] > bounds[3]) {
- double t = bounds[1];
- bounds[1] = bounds[3];
- bounds[3] = t;
- }
-
- return bounds;
- } catch (OutOfProjectionBoundsException e) {
- return new double[] {0, 0, 1, 1};
- }
- }
-
- /**
- * Indicates whether or not the north pole is projected to the north of the south pole on the projected space,
- * assuming Minecraft's coordinate system cardinal directions for the projected space (north is negative Z).
- *
- * @return north pole Z <= south pole Z
- */
- public boolean upright() {
- try {
- return this.fromGeo(0, 90)[1] <= this.fromGeo(0, -90)[1];
- } catch (OutOfProjectionBoundsException e) {
- return false;
- }
- }
-
- public enum Orientation {
- none, upright, swapped
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java
deleted file mode 100644
index caf88399..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/InvertableVectorField.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-
-import net.buildtheearth.buildteamtools.utils.MathUtils;
-
-public class InvertableVectorField {
-
- private double[][] VECTOR_X;
- private double[][] VECTOR_Y;
- private int sideLength;
-
- public InvertableVectorField(double[][] vx, double[][] vy) {
- this.sideLength = vx.length - 1;
- this.VECTOR_X = vx;
- this.VECTOR_Y = vy;
- }
-
-
- public double[] getInterpolatedVector(double x, double y) {
- //scale up triangle to be triangleSize across
- x *= this.sideLength;
- y *= this.sideLength;
-
- //convert to triangle units
- double v = 2 * y / MathUtils.ROOT3;
- double u = x - v * 0.5;
-
- int u1 = (int) u;
- int v1 = (int) v;
-
- if (u1 < 0) {
- u1 = 0;
- } else if (u1 >= this.sideLength) {
- u1 = this.sideLength - 1;
- }
-
- if (v1 < 0) {
- v1 = 0;
- } else if (v1 >= this.sideLength - u1) {
- v1 = this.sideLength - u1 - 1;
- }
-
- double valx1;
- double valy1;
- double valx2;
- double valy2;
- double valx3;
- double valy3;
- double y3;
- double x3;
-
- double flip = 1;
-
- if (y < -MathUtils.ROOT3 * (x - u1 - v1 - 1) || v1 == this.sideLength - u1 - 1) {
- valx1 = this.VECTOR_X[u1][v1];
- valy1 = this.VECTOR_Y[u1][v1];
- valx2 = this.VECTOR_X[u1][v1 + 1];
- valy2 = this.VECTOR_Y[u1][v1 + 1];
- valx3 = this.VECTOR_X[u1 + 1][v1];
- valy3 = this.VECTOR_Y[u1 + 1][v1];
-
- y3 = 0.5 * MathUtils.ROOT3 * v1;
- x3 = (u1 + 1) + 0.5 * v1;
- } else {
- valx1 = this.VECTOR_X[u1][v1 + 1];
- valy1 = this.VECTOR_Y[u1][v1 + 1];
- valx2 = this.VECTOR_X[u1 + 1][v1];
- valy2 = this.VECTOR_Y[u1 + 1][v1];
- valx3 = this.VECTOR_X[u1 + 1][v1 + 1];
- valy3 = this.VECTOR_Y[u1 + 1][v1 + 1];
-
- flip = -1;
- y = -y;
-
- y3 = -(0.5 * MathUtils.ROOT3 * (v1 + 1));
- x3 = (u1 + 1) + 0.5 * (v1 + 1);
- }
-
- //TODO: not sure if weights are right (but weirdly mirrors stuff so there may be simplifcation yet)
- double w1 = -(y - y3) / MathUtils.ROOT3 - (x - x3);
- double w2 = 2 * (y - y3) / MathUtils.ROOT3;
- double w3 = 1 - w1 - w2;
-
- return new double[]{ valx1 * w1 + valx2 * w2 + valx3 * w3, valy1 * w1 + valy2 * w2 + valy3 * w3,
- (valx3 - valx1) * this.sideLength, this.sideLength * flip * (2 * valx2 - valx1 - valx3) / MathUtils.ROOT3,
- (valy3 - valy1) * this.sideLength, this.sideLength * flip * (2 * valy2 - valy1 - valy3) / MathUtils.ROOT3 };
- }
-
- public double[] applyNewtonsMethod(double expectedf, double expectedg, double xest, double yest, int iter) {
- for (int i = 0; i < iter; i++) {
- double[] c = this.getInterpolatedVector(xest, yest);
-
- double f = c[0] - expectedf;
- double g = c[1] - expectedg;
- double dfdx = c[2];
- double dfdy = c[3];
- double dgdx = c[4];
- double dgdy = c[5];
-
- double determinant = 1 / (dfdx * dgdy - dfdy * dgdx);
-
- xest -= determinant * (dgdy * f - dfdy * g);
- yest -= determinant * (-dgdx * f + dfdx * g);
- }
-
- return new double[]{ xest, yest };
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java
deleted file mode 100644
index 28ac4d19..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OffsetProjectionTransform.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Applies a simple translation to the projected space, such that:
- * x' = x + offsetX and y' = y + offsetY
- */
-public class OffsetProjectionTransform extends ProjectionTransform {
-
- private final double deltaX, deltaY;
-
- /**
- * @param input - Input projection
- * @param deltaX - how much to move along the X axis
- * @param deltaY - how much to move along the Y axis
- */
- public OffsetProjectionTransform(GeographicProjection input, double deltaX, double deltaY) {
- super(input);
- Preconditions.checkArgument(Double.isFinite(deltaX) && Double.isFinite(deltaY), "Projection offsets have to be finite doubles");
- this.deltaX = deltaX;
- this.deltaY = deltaY;
- }
-
- @Override
- public double[] bounds() {
- double[] b = this.input.bounds();
- b[0] += this.deltaX;
- b[1] += this.deltaY;
- return b;
- }
-
- @Override
- public double[] toGeo(double x, double y) throws OutOfProjectionBoundsException {
- return this.input.toGeo(x - this.deltaX, y - this.deltaY);
- }
-
- @Override
- public double[] fromGeo(double longitude, double latitude) throws OutOfProjectionBoundsException {
- double[] pos = this.input.fromGeo(longitude, latitude);
- pos[0] += this.deltaX;
- pos[1] += this.deltaY;
- return pos;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java
deleted file mode 100644
index fc5e8ef9..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/OutOfProjectionBoundsException.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-public final class OutOfProjectionBoundsException extends Exception {
- private static final OutOfProjectionBoundsException INSTANCE = new OutOfProjectionBoundsException(false);
-
- private static final boolean FAST = Boolean.parseBoolean(System.getProperty("terraplusplus.fastExcept", "true"));
-
- public static OutOfProjectionBoundsException get() {
- if (FAST) {
- return INSTANCE;
- } else {
- return new OutOfProjectionBoundsException(true);
- }
- }
-
- private OutOfProjectionBoundsException(boolean flag) {
- super(null, null, flag, flag);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java
deleted file mode 100644
index 9a1dd0aa..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ProjectionTransform.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-public abstract class ProjectionTransform extends GeographicProjection {
- protected final GeographicProjection input;
-
- /**
- * @param input - projection to transform
- */
- public ProjectionTransform(GeographicProjection input) {
- this.input = input;
- }
-
- @Override
- public boolean upright() {
- return this.input.upright();
- }
-
- @Override
- public double[] bounds() {
- return this.input.bounds();
- }
-
- @Override
- public double metersPerUnit() {
- return this.input.metersPerUnit();
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java
deleted file mode 100644
index 50ca09b6..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/ScaleProjectionTransform.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-import com.google.common.base.Preconditions;
-
-/**
- * Scales the warps projection's projected space up or down.
- * More specifically, it multiplies x and y by there respective scale factors.
- */
-public class ScaleProjectionTransform extends ProjectionTransform {
- private final double scaleX;
- private final double scaleY;
-
- /**
- * Creates a new ScaleProjection with different scale factors for the x and y axis.
- *
- * @param input - projection to transform
- * @param scaleX - scaling to apply along the x axis
- * @param scaleY - scaling to apply along the y axis
- */
- public ScaleProjectionTransform(GeographicProjection input, double scaleX, double scaleY) {
- super(input);
- Preconditions.checkArgument(Double.isFinite(scaleX) && Double.isFinite(scaleY), "Projection scales should be finite");
- Preconditions.checkArgument(scaleX != 0 && scaleY != 0, "Projection scale cannot be 0!");
- this.scaleX = scaleX;
- this.scaleY = scaleY;
- }
-
- @Override
- public double[] toGeo(double x, double y) throws OutOfProjectionBoundsException {
- return this.input.toGeo(x / this.scaleX, y / this.scaleY);
- }
-
- @Override
- public double[] fromGeo(double lon, double lat) throws OutOfProjectionBoundsException {
- double[] p = this.input.fromGeo(lon, lat);
- p[0] *= this.scaleX;
- p[1] *= this.scaleY;
- return p;
- }
-
- @Override
- public boolean upright() {
- return (this.scaleY < 0) ^ this.input.upright();
- }
-
- @Override
- public double[] bounds() {
- double[] b = this.input.bounds();
- b[0] *= this.scaleX;
- b[1] *= this.scaleY;
- b[2] *= this.scaleX;
- b[3] *= this.scaleY;
- return b;
- }
-
- @Override
- public double metersPerUnit() {
- return this.input.metersPerUnit() / Math.sqrt((this.scaleX * this.scaleX + this.scaleY * this.scaleY) / 2); //TODO: better transform
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java
deleted file mode 100644
index 05701260..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/UprightOrientationProjectionTransform.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection;
-
-/**
- * Mirrors the warped projection vertically.
- * I.E. x' = x and y' = -y
- */
-public class UprightOrientationProjectionTransform extends ProjectionTransform {
-
- /**
- * @param input - projection to transform
- */
- public UprightOrientationProjectionTransform(GeographicProjection input) {
- super(input);
- }
-
- @Override
- public double[] toGeo(double x, double y) throws OutOfProjectionBoundsException {
- return this.input.toGeo(x, -y);
- }
-
- @Override
- public double[] fromGeo(double longitude, double latitude) throws OutOfProjectionBoundsException {
- double[] p = this.input.fromGeo(longitude, latitude);
- p[1] = -p[1];
- return p;
- }
-
- @Override
- public boolean upright() {
- return !this.input.upright();
- }
-
- @Override
- public double[] bounds() {
- double[] b = this.input.bounds();
- return new double[]{ b[0], -b[3], b[2], -b[1] };
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java
deleted file mode 100644
index a8e636da..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/Airocean.java
+++ /dev/null
@@ -1,434 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection.airocean;
-
-import net.buildtheearth.buildteamtools.utils.MathUtils;
-import net.buildtheearth.buildteamtools.utils.geo.projection.GeographicProjection;
-import net.buildtheearth.buildteamtools.utils.geo.projection.OutOfProjectionBoundsException;
-
-/**
- * Implementation of the Dynmaxion projection.
- * Also known as Airocean or Fuller projection.
- *
- * @see Wikipedia's article on the Dynmaxion projection
- */
-public class Airocean extends GeographicProjection {
-
- protected static final double ARC = 2 * Math.asin(Math.sqrt(5 - Math.sqrt(5)) / Math.sqrt(10));
- protected static final double Z = Math.sqrt(5 + 2 * Math.sqrt(5)) / Math.sqrt(15);
- protected static final double EL = Math.sqrt(8) / Math.sqrt(5 + Math.sqrt(5));
- protected static final double EL6 = EL / 6;
- protected static final double DVE = Math.sqrt(3 + Math.sqrt(5)) / Math.sqrt(5 + Math.sqrt(5));
- protected static final double R = -3 * EL6 / DVE;
-
- /**
- * Number of iterations for Newton's method
- */
- private static final int NEWTON = 5;
-
- /**
- * This contains the vertices of the icosahedron,
- * identified by their geographic longitude and latitude in degrees.
- * When the class is loaded, a static block below converts all these coordinates
- * to the equivalent spherical coordinates (longitude and colatitude), in radians.
- *
- * @see Wikipedia
- */
- protected static final double[][] VERTICES = new double[][] {
- {10.536199, 64.700000},
- {-5.245390, 2.300882},
- {58.157706, 10.447378},
- {122.300000, 39.100000},
- {-143.478490, 50.103201},
- {-67.132330, 23.717925},
- {36.521510, -50.103200},
- {112.867673, -23.717930},
- {174.754610, -2.300882},
- {-121.842290, -10.447350},
- {-57.700000, -39.100000},
- {-169.463800, -64.700000},
- };
-
- /**
- * Indicates the vertices forming each face of the icosahedron.
- * Each entry refers to the index of a vertex in {@link #VERTICES}
- */
- protected static final int[][] ISO = new int[][] {
- {2, 1, 6},
- {1, 0, 2},
- {0, 1, 5},
- {1, 5, 10},
- {1, 6, 10},
- {7, 2, 6},
- {2, 3, 7},
- {3, 0, 2},
- {0, 3, 4},
- {4, 0, 5}, //9, qubec
- {5, 4, 9},
- {9, 5, 10},
- {10, 9, 11},
- {11, 6, 10},
- {6, 7, 11},
- {8, 3, 7},
- {8, 3, 4},
- {8, 4, 9},
- {9, 8, 11},
- {7, 8, 11},
- {11, 6, 7}, //child of 14
- {3, 7, 8} //child of 15
- };
-
- protected static final double[][] CENTER_MAP = {
- {-3, 7},
- {-2, 5},
- {-1, 7},
- {2, 5},
- {4, 5},
- {-4, 1},
- {-3, -1},
- {-2, 1},
- {-1, -1},
- {0, 1},
- {1, -1},
- {2, 1},
- {3, -1},
- {4, 1},
- {5, -1}, //14, left side, right to be cut
- {-3, -5},
- {-1, -5},
- {1, -5},
- {2, -7},
- {-4, -7},
- {-5, -5}, //20, pseudo triangle, child of 14
- {-2, -7} //21 , pseudo triangle, child of 15
- };
-
- /**
- * Indicates for each face if it needs to be flipped after projecting
- */
- protected static final boolean[] FLIP_TRIANGLE = new boolean[] {
- true, false, true, false , false,
- true, false, true, false, true, false, true, false, true, false,
- true, true, true , false, false,
- true, false
- };
-
- /**
- * This contains the Cartesian coordinates the centroid
- * of each face of the icosahedron.
- */
- protected static final double[][] CENTROIDS = new double[22][3];
-
- /**
- * Rotation matrices to move the triangles to the reference coordinates from the original positions.
- * Indexed by the face's indices.
- */
- protected static final double[][][] ROTATION_MATRICES = new double[22][3][3];
-
- /**
- * Rotation matrices to move the triangles from the reference coordinates to their original positions.
- * Indexed by the face's indices.
- */
- protected static final double[][][] INVERSE_ROTATION_MATRICES = new double[22][3][3];
-
- protected static final int[] FACE_ON_GRID = {
- -1, -1, 0, 1, 2, -1, -1, 3, -1, 4, -1,
- -1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 20, 19, 15, 21, 16, -1, 17, 18, -1, -1, -1,
- };
-
- static {
-
- for (int i = 0; i < 22; i++) {
- CENTER_MAP[i][0] *= 0.5 * ARC;
- CENTER_MAP[i][1] *= ARC * MathUtils.ROOT3 / 12;
- }
-
- // Will contain the list of vertices in Cartesian coordinates
- double[][] verticesCartesian = new double[VERTICES.length][3];
-
- // Convert the geographic vertices to spherical in radians
- for(int i=0; i < VERTICES.length; i++) {
- double[] vertexSpherical = MathUtils.geo2Spherical(VERTICES[i]);
- double[] vertex = MathUtils.spherical2Cartesian(vertexSpherical);
- verticesCartesian[i] = vertex;
- VERTICES[i] = vertexSpherical;
- }
-
- for(int i = 0; i < 22; i++) {
-
- // Vertices of the current face
- double[] vec1 = verticesCartesian[ISO[i][0]];
- double[] vec2 = verticesCartesian[ISO[i][1]];
- double[] vec3 = verticesCartesian[ISO[i][2]];
-
- // Find the centroid's projection onto the sphere
- double xsum = vec1[0] + vec2[0] + vec3[0];
- double ysum = vec1[1] + vec2[1] + vec3[1];
- double zsum = vec1[2] + vec2[2] + vec3[2];
- double mag = Math.sqrt(xsum * xsum + ysum * ysum + zsum * zsum);
- CENTROIDS[i] = new double[] {xsum / mag, ysum / mag, zsum / mag};
-
- double[] centroidSpherical = MathUtils.cartesian2Spherical(CENTROIDS[i]);
- double centroidLambda = centroidSpherical[0];
- double centroidPhi = centroidSpherical[1];
-
- double vertex[] = VERTICES[ISO[i][0]];
- double v[] = new double[] {vertex[0] - centroidLambda, vertex[1]};
- v = yRot(v, -centroidPhi);
-
- ROTATION_MATRICES[i] = MathUtils.produceZYZRotationMatrix(-centroidLambda, -centroidPhi, (Math.PI/2) - v[0]);
- INVERSE_ROTATION_MATRICES[i] = MathUtils.produceZYZRotationMatrix(v[0] - (Math.PI/2), centroidPhi, centroidLambda);
-
- }
- }
-
- /**
- * Finds the face of the icosahedron on which to project a point.
- * In practice, it works by finding the face with the closest centroid to the point.
- *
- * @param vector - position vector as double array of length 3, using Cartesian coordinates
- * @return an integer identifying the face on which to project the point
- */
- protected int findTriangle(double[] vector) {
-
- double min = Double.MAX_VALUE;
- int face = 0;
-
- for (int i = 0; i < 20; i++) {
- double xd = CENTROIDS[i][0] - vector[0];
- double yd = CENTROIDS[i][1] - vector[1];
- double zd = CENTROIDS[i][2] - vector[2];
-
- double dissq = xd * xd + yd * yd + zd * zd;
- if (dissq < min) {
-
- if (dissq < 0.1) //TODO: enlarge radius
- {
- return i;
- }
-
- face = i;
- min = dissq;
- }
- }
-
- return face;
- }
-
- protected static int findTriangleGrid(double x, double y) {
-
- //cast equilateral triangles to 45 degrees right triangles (side length of root2)
- double xp = x / ARC;
- double yp = y / (ARC * MathUtils.ROOT3);
-
- int row;
- if (yp > -0.25) {
- if (yp < 0.25) { //middle
- row = 1;
- } else if (yp <= 0.75) { //top
- row = 0;
- yp = 0.5 - yp; //translate to middle and flip
- } else {
- return -1;
- }
- } else if (yp >= -0.75) { //bottom
- row = 2;
- yp = -yp - 0.5; //translate to middle and flip
- } else {
- return -1;
- }
-
- yp += 0.25; //change origin to vertex 4, to allow grids to align
-
- //rotate coords 45 degrees so left and right sides of the triangle become the x/y axies (also side lengths are now 1)
- double xr = xp - yp;
- double yr = xp + yp;
-
- //assign a order to what grid along the y=x line it is
- int gx = (int) Math.floor(xr);
- int gy = (int) Math.floor(yr);
-
- int col = 2 * gx + (gy != gx ? 1 : 0) + 6;
-
- //out of bounds
- if (col < 0 || col >= 11) {
- return -1;
- }
-
- return FACE_ON_GRID[row * 11 + col]; //get face at this position
- }
-
- protected static double[] yRot(double[] spherical, double rot) {
- double[] c = MathUtils.spherical2Cartesian(spherical);
-
- double x = c[0];
- c[0] = c[2] * Math.sin(rot) + x * Math.cos(rot);
- c[2] = c[2] * Math.cos(rot) - x * Math.sin(rot);
-
- double mag = Math.sqrt(c[0] * c[0] + c[1] * c[1] + c[2] * c[2]);
- c[0] /= mag;
- c[1] /= mag;
- c[2] /= mag;
-
- return new double[]{
- Math.atan2(c[1], c[0]),
- Math.atan2(Math.sqrt(c[0] * c[0] + c[1] * c[1]), c[2])
- };
- }
-
- protected double[] triangleTransform(double[] vec) {
-
- double S = Z / vec[2];
-
- double xp = S * vec[0];
- double yp = S * vec[1];
-
- double a = Math.atan((2 * yp / MathUtils.ROOT3 - EL6) / DVE); //ARC/2 terms cancel
- double b = Math.atan((xp - yp / MathUtils.ROOT3 - EL6) / DVE);
- double c = Math.atan((-xp - yp / MathUtils.ROOT3 - EL6) / DVE);
-
- return new double[]{ 0.5 * (b - c), (2 * a - b - c) / (2 * MathUtils.ROOT3) };
- }
-
- protected double[] inverseTriangleTransformNewton(double xpp, double ypp) {
-
- //a & b are linearly related to c, so using the tan of sum formula we know: tan(c+off) = (tanc + tanoff)/(1-tanc*tanoff)
- double tanaoff = Math.tan(MathUtils.ROOT3 * ypp + xpp); // a = c + root3*y'' + x''
- double tanboff = Math.tan(2 * xpp); // b = c + 2x''
-
- double anumer = tanaoff * tanaoff + 1;
- double bnumer = tanboff * tanboff + 1;
-
- //we will be solving for tanc, starting at t=0, tan(0) = 0
- double tana = tanaoff;
- double tanb = tanboff;
- double tanc = 0;
-
- double adenom = 1;
- double bdenom = 1;
-
- //double fp = anumer + bnumer + 1; //derivative relative to tanc
-
- //int i = newton;
- for (int i = 0; i < NEWTON; i++) {
- double f = tana + tanb + tanc - R; //R = tana + tanb + tanc
- double fp = anumer * adenom * adenom + bnumer * bdenom * bdenom + 1; //derivative relative to tanc
-
- //TODO: fp could be simplified on first loop: 1 + anumer + bnumer
-
- tanc -= f / fp;
-
- adenom = 1 / (1 - tanc * tanaoff);
- bdenom = 1 / (1 - tanc * tanboff);
-
- tana = (tanc + tanaoff) * adenom;
- tanb = (tanc + tanboff) * bdenom;
- }
-
- //simple reversal algebra based on tan values
- double yp = MathUtils.ROOT3 * (DVE * tana + EL6) / 2;
- double xp = DVE * tanb + yp / MathUtils.ROOT3 + EL6;
-
- //x = z*xp/Z, y = z*yp/Z, x^2 + y^2 + z^2 = 1
- double xpoZ = xp / Z;
- double ypoZ = yp / Z;
-
- double z = 1 / Math.sqrt(1 + xpoZ * xpoZ + ypoZ * ypoZ);
-
- return new double[]{ z * xpoZ, z * ypoZ, z };
- }
-
- protected double[] inverseTriangleTransform(double x, double y) {
- return this.inverseTriangleTransformNewton(x, y);
- }
-
- @Override
- public double[] fromGeo(double longitude, double latitude) {
-
- double[] vector = MathUtils.spherical2Cartesian(MathUtils.geo2Spherical(new double[] {longitude, latitude}));
-
- int face = findTriangle(vector);
-
- //apply rotation matrix (move triangle onto template triangle)
- double[] pvec = MathUtils.matVecProdD(ROTATION_MATRICES[face], vector);
- double[] projectedVec = this.triangleTransform(pvec);
-
- //flip triangle to correct orientation
- if (FLIP_TRIANGLE[face]) {
- projectedVec[0] = -projectedVec[0];
- projectedVec[1] = -projectedVec[1];
- }
-
- vector[0] = projectedVec[0];
- //deal with special snowflakes (child faces 20, 21)
- if (((face == 15 && vector[0] > projectedVec[1] * MathUtils.ROOT3) || face == 14) && vector[0] > 0) {
- projectedVec[0] = 0.5 * vector[0] - 0.5 * MathUtils.ROOT3 * projectedVec[1];
- projectedVec[1] = 0.5 * MathUtils.ROOT3 * vector[0] + 0.5 * projectedVec[1];
- face += 6; //shift 14->20 & 15->21
- }
-
- projectedVec[0] += CENTER_MAP[face][0];
- projectedVec[1] += CENTER_MAP[face][1];
-
- return projectedVec;
- }
-
- @Override
- public double[] toGeo(double x, double y) throws OutOfProjectionBoundsException {
- int face = findTriangleGrid(x, y);
-
- if (face == -1) throw OutOfProjectionBoundsException.get();
-
- x -= CENTER_MAP[face][0];
- y -= CENTER_MAP[face][1];
-
- //deal with bounds of special snowflakes
- switch (face) {
- case 14:
- if (x > 0) throw OutOfProjectionBoundsException.get();
- break;
- case 20:
- if (-y * MathUtils.ROOT3 > x) throw OutOfProjectionBoundsException.get();
- break;
- case 15:
- if (x > 0 && x > y * MathUtils.ROOT3) throw OutOfProjectionBoundsException.get();
- break;
- case 21:
- if (x < 0 || -y * MathUtils.ROOT3 > x) throw OutOfProjectionBoundsException.get();
- break;
- }
-
- //flip triangle to upright orientation (if not already)
- if (FLIP_TRIANGLE[face]) {
- x = -x;
- y = -y;
- }
-
- //invert triangle transform
- double[] c = this.inverseTriangleTransform(x, y);
- x = c[0];
- y = c[1];
- double z = c[2];
-
- double[] vec = new double[] {x, y, z};
- //apply inverse rotation matrix (move triangle from template triangle to correct position on globe)
- double[] vecp = MathUtils.matVecProdD(INVERSE_ROTATION_MATRICES[face], vec);
-
- //convert back to geo coordinates
- return MathUtils.spherical2Geo(MathUtils.cartesian2Spherical(vecp));
- }
-
- @Override
- public double[] bounds() {
- return new double[]{ -3 * ARC, -0.75 * ARC * MathUtils.ROOT3, 2.5 * ARC, 0.75 * ARC * MathUtils.ROOT3 };
- }
-
- @Override
- public boolean upright() {
- return false;
- }
-
- @Override
- public double metersPerUnit() {
- return Math.sqrt(510100000000000.0 / (20 * MathUtils.ROOT3 * ARC * ARC / 4));
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java
deleted file mode 100644
index b868ad55..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ConformalEstimate.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection.airocean;
-
-import net.buildtheearth.buildteamtools.utils.MathUtils;
-import net.buildtheearth.buildteamtools.utils.geo.projection.InvertableVectorField;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Scanner;
-
-/**
- * Implementation of the Dynmaxion like conformal projection.
- * Slightly modifies the Dynmaxion projection to make it conformal.
- *
- * @see Airocean
- */
-public class ConformalEstimate extends Airocean {
-
- private final InvertableVectorField inverse;
-
- private final double VECTOR_SCALE_FACTOR = 1 / 1.1473979730192934;
-
- public ConformalEstimate() {
-
- int sideLength = 256;
-
- double[][] xs = new double[sideLength + 1][];
- double[][] ys = new double[xs.length][];
-
- try(InputStream is = this.getClass().getClassLoader().getResourceAsStream("conformal.txt") ; Scanner sc = new Scanner(is)) {
-
- for (int u = 0; u < xs.length; u++) {
- double[] px = new double[xs.length - u];
- double[] py = new double[xs.length - u];
- xs[u] = px;
- ys[u] = py;
- }
-
- for (int v = 0; v < xs.length; v++) {
- for (int u = 0; u < xs.length - v; u++) {
- String line = sc.nextLine();
- line = line.substring(1, line.length() - 3);
- String[] split = line.split(", ");
- xs[u][v] = Double.parseDouble(split[0]) * this.VECTOR_SCALE_FACTOR;
- ys[u][v] = Double.parseDouble(split[1]) * this.VECTOR_SCALE_FACTOR;
- }
- }
-
- sc.close();
- } catch (IOException e) {
- System.err.println("Can't load conformal: " + e);
- }
-
- this.inverse = new InvertableVectorField(xs, ys);
- }
-
- @Override
- protected double[] triangleTransform(double[] vec) {
- double[] c = super.triangleTransform(vec);
-
- double x = c[0];
- double y = c[1];
-
- c[0] /= ARC;
- c[1] /= ARC;
-
- c[0] += 0.5;
- c[1] += MathUtils.ROOT3 / 6;
-
- //use another interpolated vector to have a really good guess before using Newton's method
- //Note: foward was removed for now, will need to be added back if this improvement is ever re-implemented
- //c = forward.getInterpolatedVector(c[0], c[1]);
- //c = inverse.applyNewtonsMethod(x, y, c[0]/ARC + 0.5, c[1]/ARC + ROOT3/6, 1);
-
- //just use newtons method: slower
- c = this.inverse.applyNewtonsMethod(x, y, c[0], c[1], 5);//c[0]/ARC + 0.5, c[1]/ARC + ROOT3/6
-
- c[0] -= 0.5;
- c[1] -= MathUtils.ROOT3 / 6;
-
- c[0] *= ARC;
- c[1] *= ARC;
-
- return c;
- }
-
- @Override
- protected double[] inverseTriangleTransform(double x, double y) {
-
- x /= ARC;
- y /= ARC;
-
- x += 0.5;
- y += MathUtils.ROOT3 / 6;
-
- double[] c = this.inverse.getInterpolatedVector(x, y);
- return super.inverseTriangleTransform(c[0], c[1]);
- }
-
- @Override
- public double metersPerUnit() {
- return (40075017 / (2 * Math.PI)) / this.VECTOR_SCALE_FACTOR;
- }
-}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java b/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java
deleted file mode 100644
index 0f224892..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/geo/projection/airocean/ModifiedAirocean.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.geo.projection.airocean;
-
-
-import net.buildtheearth.buildteamtools.utils.MathUtils;
-import net.buildtheearth.buildteamtools.utils.geo.projection.OutOfProjectionBoundsException;
-
-/**
- * Implementation of the BTE modified Dynmaxion projection.
- *
- * @see Airocean
- * @see ConformalEstimate
- */
-public class ModifiedAirocean extends ConformalEstimate {
-
- protected static final double THETA = Math.toRadians(-150);
- protected static final double SIN_THETA = Math.sin(THETA);
- protected static final double COS_THETA = Math.cos(THETA);
- protected static final double BERING_X = -0.3420420960118339;//-0.3282152608138795;
- protected static final double BERING_Y = -0.322211064085279;//-0.3281491467713469;
- protected static final double ARCTIC_Y = -0.2;//-0.3281491467713469;
- protected static final double ARCTIC_M = (ARCTIC_Y - MathUtils.ROOT3 * ARC / 4) / (BERING_X - -0.5 * ARC);
- protected static final double ARCTIC_B = ARCTIC_Y - ARCTIC_M * BERING_X;
- protected static final double ALEUTIAN_Y = -0.5000446805492526;//-0.5127463765943157;
- protected static final double ALEUTIAN_XL = -0.5149231279757507;//-0.4957832938238718;
- protected static final double ALEUTIAN_XR = -0.45;
- protected static final double ALEUTIAN_M = (BERING_Y - ALEUTIAN_Y) / (BERING_X - ALEUTIAN_XR);
- protected static final double ALEUTIAN_B = BERING_Y - ALEUTIAN_M * BERING_X;
-
- @Override
- public double[] fromGeo(double longitude, double latitude) {
- double[] c = super.fromGeo(longitude, latitude);
- double x = c[0];
- double y = c[1];
-
- boolean easia = this.isEurasianPart(x, y);
-
- y -= 0.75 * ARC * MathUtils.ROOT3;
-
- if (easia) {
- x += ARC;
-
- double t = x;
- x = COS_THETA * x - SIN_THETA * y;
- y = SIN_THETA * t + COS_THETA * y;
-
- } else {
- x -= ARC;
- }
-
- c[0] = y;
- c[1] = -x;
- return c;
- }
-
- @Override
- public double[] toGeo(double x, double y) throws OutOfProjectionBoundsException {
- boolean easia;
- if (y < 0) {
- easia = x > 0;
- } else if (y > ARC / 2) {
- easia = x > -MathUtils.ROOT3 * ARC / 2;
- } else {
- easia = y * -MathUtils.ROOT3 < x;
- }
-
- double t = x;
- x = -y;
- y = t;
-
- if (easia) {
- t = x;
- x = COS_THETA * x + SIN_THETA * y;
- y = COS_THETA * y - SIN_THETA * t;
- x -= ARC;
-
- } else {
- x += ARC;
- }
-
- y += 0.75 * ARC * MathUtils.ROOT3;
-
- //check to make sure still in right part
- if (easia != this.isEurasianPart(x, y)) throw OutOfProjectionBoundsException.get();
-
- return super.toGeo(x, y);
- }
-
- protected boolean isEurasianPart(double x, double y) {
-
- //catch vast majority of cases in not near boundary
- if (x > 0) {
- return false;
- }
- if (x < -0.5 * ARC) {
- return true;
- }
-
- if (y > MathUtils.ROOT3 * ARC / 4) //above arctic ocean
- {
- return x < 0;
- }
-
- if (y < ALEUTIAN_Y) //below bering sea
- {
- return y < (ALEUTIAN_Y + ALEUTIAN_XL) - x;
- }
-
- if (y > BERING_Y) { //boundary across arctic ocean
-
- if (y < ARCTIC_Y) {
- return x < BERING_X; //in strait
- }
-
- return y < ARCTIC_M * x + ARCTIC_B; //above strait
- }
-
- return y > ALEUTIAN_M * x + ALEUTIAN_B;
- }
-
- @Override
- public double[] bounds() {
- return new double[]{ -1.5 * ARC * MathUtils.ROOT3, -1.5 * ARC, 3 * ARC, MathUtils.ROOT3 * ARC }; //TODO: 3*ARC is prly to high
- }
-}
\ No newline at end of file
From 4d139e08a24e0cf93782855509eae3a993b738aa Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 20:34:10 +0200
Subject: [PATCH 02/14] refactor(utils): Remove obsolete MathUtils.java
---
.../buildteamtools/utils/MathUtils.java | 122 ------------------
1 file changed, 122 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java
deleted file mode 100644
index 85ab6bd1..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/MathUtils.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package net.buildtheearth.buildteamtools.utils;
-
-public class MathUtils {
- /**
- * Square root of 3
- */
- public static final double ROOT3 = Math.sqrt(3);
-
- /**
- * Two times pi
- */
- public static final double TAU = 2 * Math.PI;
-
-
- /**
- * Converts geographic latitude and longitude coordinates to spherical coordinates on a sphere of radius 1.
- *
- * @param geo - geographic coordinates as a double array of length 2, {longitude, latitude}, in degrees
- * @return the corresponding spherical coordinates in radians: {longitude, colatitude}
- */
- public static double[] geo2Spherical(double[] geo) {
- double lambda = Math.toRadians(geo[0]);
- double phi = Math.toRadians(90 - geo[1]);
- return new double[]{ lambda, phi };
- }
-
-
- /**
- * Converts spherical coordinates to geographic coordinates on a sphere of radius 1.
- *
- * @param spherical - spherical coordinates in radians as a double array of length 2: {longitude, colatitude}
- * @return the corresponding geographic coordinates in degrees: {longitude, latitude}
- */
- public static double[] spherical2Geo(double[] spherical) {
- double lon = Math.toDegrees(spherical[0]);
- double lat = 90 - Math.toDegrees(spherical[1]);
- return new double[]{ lon, lat };
- }
-
-
- /**
- * Converts spherical coordinates to Cartesian coordinates on a sphere of radius 1.
- *
- * @param spherical - spherical coordinates in radians as a double array of length 2: {longitude, colatitude}
- * @return the corresponding Cartesian coordinates: {x, y, z}
- */
- public static double[] spherical2Cartesian(double[] spherical) {
- double sinphi = Math.sin(spherical[1]);
- double x = sinphi * Math.cos(spherical[0]);
- double y = sinphi * Math.sin(spherical[0]);
- double z = Math.cos(spherical[1]);
- return new double[]{ x, y, z };
- }
-
- /**
- * Converts Cartesian coordinates to spherical coordinates on a sphere of radius 1.
- *
- * @param cartesian - Cartesian coordinates as double array of length 3: {x, y, z}
- * @return the spherical coordinates of the corresponding normalized vector
- */
- public static double[] cartesian2Spherical(double[] cartesian) {
- double lambda = Math.atan2(cartesian[1], cartesian[0]);
- double phi = Math.atan2(Math.sqrt(cartesian[0] * cartesian[0] + cartesian[1] * cartesian[1]), cartesian[2]);
- return new double[]{ lambda, phi };
- }
-
-
- /**
- * TODO produceZYZRotationMatrix javadoc
- *
- * @param a
- * @param b
- * @param c
- * @return
- */
- public static double[][] produceZYZRotationMatrix(double a, double b, double c) {
-
- double sina = Math.sin(a);
- double cosa = Math.cos(a);
- double sinb = Math.sin(b);
- double cosb = Math.cos(b);
- double sinc = Math.sin(c);
- double cosc = Math.cos(c);
-
- double[][] mat = new double[3][3];
- mat[0][0] = cosa * cosb * cosc - sinc * sina;
- mat[0][1] = -sina * cosb * cosc - sinc * cosa;
- mat[0][2] = cosc * sinb;
-
- mat[1][0] = sinc * cosb * cosa + cosc * sina;
- mat[1][1] = cosc * cosa - sinc * cosb * sina;
- mat[1][2] = sinc * sinb;
-
- mat[2][0] = -sinb * cosa;
- mat[2][1] = sinb * sina;
- mat[2][2] = cosb;
-
- return mat;
- }
-
- /**
- * Multiples the given matrix with the given vector.
- * The matrix is assumed to be square and the vector is assumed to be of the same dimension as the matrix.
- *
- * @param matrix - the matrix as a n*n double array
- * @param vector - the vector as double array of length n
- * @return the result of the multiplication as an array of double on length n
- */
- public static double[] matVecProdD(double[][] matrix, double[] vector) {
- double[] result = new double[vector.length];
- for (int i = 0; i < result.length; i++) {
- for (int j = 0; j < matrix[i].length; j++) {
- result[i] += matrix[i][j] * vector[j];
- }
- }
- return result;
- }
-
- public static double roundTo2Decimals(double val) {
- return Math.round(val * 100.) / 100.;
- }
-}
From d9efa7259dfea061e4b1a7a87fad8ea339336892 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 21:02:54 +0200
Subject: [PATCH 03/14] refactor(utils): Move GeometricUtils to other file and
clean up code.
---
build.gradle.kts | 2 +-
.../buildteamtools/BuildTeamTools.java | 16 ++++
.../generator/components/kml/KmlCommand.java | 7 +-
.../modules/navigation/NavUtils.java | 56 +++++++++++++
.../components/tpll/TpllComponent.java | 6 +-
.../components/warps/WarpsComponent.java | 5 +-
.../buildteamtools/utils/Config.java | 1 -
.../buildteamtools/utils/GeometricUtils.java | 81 -------------------
8 files changed, 82 insertions(+), 92 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/GeometricUtils.java
diff --git a/build.gradle.kts b/build.gradle.kts
index 68253e87..d375a3d5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -24,7 +24,7 @@ dependencies {
implementation(libs.com.googlecode.json.simple)
implementation(libs.bstats.bukkit)
implementation(platform(libs.fawe.bom))
- implementation("net.buildtheearth:projection:1.0.2")
+ implementation("net.buildtheearth:projection:1.0.3")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Core")
compileOnly("com.fastasyncworldedit:FastAsyncWorldEdit-Bukkit") { isTransitive = false }
diff --git a/src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java b/src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java
index a1314bc8..f223d0e4 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/BuildTeamTools.java
@@ -10,7 +10,10 @@
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.plotsystem.PlotSystemModule;
import net.buildtheearth.buildteamtools.modules.stats.StatsModule;
+import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
import net.buildtheearth.buildteamtools.utils.io.ConfigUtil;
+import org.bukkit.Bukkit;
+import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
@@ -32,6 +35,7 @@ public class BuildTeamTools extends JavaPlugin {
@Getter
private static BuildTeamTools instance = null;
+ private World earthWorld;
@Override
public void onEnable() {
@@ -88,4 +92,16 @@ public void setDebug(boolean debug) {
this.debug = debug;
ChatHelper.DEBUG = debug;
}
+
+ public World getEarthWorld() {
+ if (earthWorld != null)
+ return earthWorld;
+
+ String worldName = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.EARTH_WORLD);
+ if (worldName == null || worldName.isEmpty())
+ return null;
+
+ earthWorld = Bukkit.getWorld(worldName);
+ return earthWorld;
+ }
}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java
index 78520890..13de3b33 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/kml/KmlCommand.java
@@ -4,10 +4,11 @@
import com.cryptomorin.xseries.XMaterial;
import de.micromata.opengis.kml.v_2_2_0.Coordinate;
import net.buildtheearth.buildteamtools.BuildTeamTools;
+import net.buildtheearth.buildteamtools.modules.navigation.NavUtils;
import net.buildtheearth.buildteamtools.utils.BlockLocation;
-import net.buildtheearth.buildteamtools.utils.GeometricUtils;
import net.buildtheearth.buildteamtools.utils.LineRasterization;
import net.buildtheearth.buildteamtools.utils.PolygonTools;
+import net.buildtheearth.model.GeographicalCoordinate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
@@ -516,7 +517,7 @@ public boolean undoCommand(Player player) {
*
* This method:
*
- * - Converts lat/lon to Minecraft X/Z using {@link GeometricUtils#getLocationFromCoordinates(double[])}
+ * - Converts lat/lon to Minecraft X/Z using
* - Applies the KML altitude offset (Google Earth altitudes are relative to ground)
*
*
@@ -527,7 +528,7 @@ public boolean undoCommand(Player player) {
* @return A Bukkit Location with X/Z from projection and Y adjusted for altitude
*/
private @NonNull Location getLocationFromCoordinates(double[] coordinates, double altitudeFromKML) {
- Location mcLocation = GeometricUtils.getLocationFromCoordinates(coordinates);
+ Location mcLocation = NavUtils.getLocationFromCoordinates(new GeographicalCoordinate(coordinates[0], coordinates[1]));
//add altitude from kml (altitude from Google Earth is always relative to ground)
//note: the "-2" is only neccesary because
// getLocationFromCoordinates returns terrain altitude + 2
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java
index 83c575c8..137fe791 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java
@@ -4,16 +4,22 @@
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import lombok.experimental.UtilityClass;
+import net.buildtheearth.OutOfProjectionBoundsException;
+import net.buildtheearth.Projection;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
+import net.buildtheearth.model.GeographicalCoordinate;
+import net.buildtheearth.model.MinecraftCoordinate;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
+import org.bukkit.Location;
import org.bukkit.UnsafeValues;
+import org.bukkit.World;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -117,4 +123,54 @@ public static void switchToTeam(BuildTeam team, Player clickPlayer) {
// Create an "other" Warp Group for warps that don't belong to a warp group
return new WarpGroup(team, "Other", "Other warps", -1, null);
}
+
+ /**
+ * Creates a minecraft location object for the specified coordinates, yaw and pitch from the BTE projection.
+ * Height is extracted from the world.
+ *
+ * Note: Height returned is actually terrain elevation +2. This is because this method internally uses
+ * Bukkits @see World::getHighestBlockYAt() already returns elevation+1, and this method deliberately
+ * adds one to the location elevation on top.
+ *
+ * Note: Height returned is actually terrain elevation +2. This is because this method internally uses
+ * Bukkits @see World::getHighestBlockYAt() already returns elevation+1, and this method deliberately
+ * adds one to the location elevation on top.
+ *
- * Note: Height returned is actually terrain elevation +2. This is because this method internally uses
- * Bukkits @see World::getHighestBlockYAt() already returns elevation+1, and this method deliberately
- * adds one to the location elevation on top.
- *
- * Note: Height returned is actually terrain elevation +2. This is because this method internally uses
- * Bukkits @see World::getHighestBlockYAt() already returns elevation+1, and this method deliberately
- * adds one to the location elevation on top.
- *
Date: Tue, 28 Apr 2026 21:07:11 +0200
Subject: [PATCH 04/14] refactor(utils): Remove unused JsonUtils.java
---
.../buildteamtools/utils/JsonUtils.java | 143 ------------------
1 file changed, 143 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java b/src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java
deleted file mode 100644
index b9dff456..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/JsonUtils.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * MIT License
- *
- * Copyright 2020-2021 noahhusby
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
- * is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package net.buildtheearth.buildteamtools.utils;
-
-import com.google.gson.*;
-import com.google.gson.internal.Streams;
-import com.google.gson.stream.JsonReader;
-import com.google.gson.stream.JsonToken;
-import com.google.gson.stream.MalformedJsonException;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-public class JsonUtils {
- /**
- * Parses the specified JSON string into a parse tree
- *
- * @param json JSON text
- * @return a parse tree of {@link JsonElement}s corresponding to the specified JSON
- */
- public static JsonElement parseString(String json) throws JsonSyntaxException {
- return parseReader(new StringReader(json));
- }
-
- /**
- * Parses the specified JSON string into a parse tree
- *
- * @param reader JSON text
- * @return a parse tree of {@link JsonElement}s corresponding to the specified JSON
- */
- public static JsonElement parseReader(Reader reader) throws JsonIOException, JsonSyntaxException {
- try {
- JsonReader jsonReader = new JsonReader(reader);
- JsonElement element = parseReader(jsonReader);
- if (!element.isJsonNull() && jsonReader.peek() != JsonToken.END_DOCUMENT) {
- throw new JsonSyntaxException("Did not consume the entire document.");
- }
- return element;
- } catch (MalformedJsonException | NumberFormatException e) {
- throw new JsonSyntaxException(e);
- } catch (IOException e) {
- throw new JsonIOException(e);
- }
- }
-
- /**
- * Returns the next value from the JSON stream as a parse tree.
- *
- * @throws JsonParseException if there is an IOException or if the specified
- * text is not valid JSON
- */
- public static JsonElement parseReader(JsonReader reader)
- throws JsonIOException, JsonSyntaxException {
- boolean lenient = reader.isLenient();
- reader.setLenient(true);
- try {
- return Streams.parse(reader);
- } catch (StackOverflowError | OutOfMemoryError e) {
- throw new JsonParseException("Failed parsing JSON source: " + reader + " to Json", e);
- } finally {
- reader.setLenient(lenient);
- }
- }
-
- public static Set keySet(JsonObject object) {
- Set result = new HashSet<>();
- for (Map.Entry es : object.entrySet()) {
- result.add(es.getKey());
- }
- return result;
- }
-
- public static boolean isJsonValid(final String json) throws IOException {
- try {
- return isJsonValid(new StringReader(json));
- } catch (EOFException e) {
- return false;
- }
- }
-
- public static boolean isJsonValid(final Reader reader) throws IOException {
- return isJsonValid(new JsonReader(reader));
- }
-
- public static boolean isJsonValid(final JsonReader jsonReader) throws IOException {
- try {
- JsonToken token;
- while ((token = jsonReader.peek()) != JsonToken.END_DOCUMENT && token != null) {
- switch (token) {
- case BEGIN_ARRAY:
- jsonReader.beginArray();
- break;
- case END_ARRAY:
- jsonReader.endArray();
- break;
- case BEGIN_OBJECT:
- jsonReader.beginObject();
- break;
- case END_OBJECT:
- jsonReader.endObject();
- break;
- case NAME:
- jsonReader.nextName();
- break;
- case STRING:
- case NUMBER:
- case BOOLEAN:
- case NULL:
- jsonReader.skipValue();
- break;
- default:
- throw new AssertionError(token);
- }
- }
- return true;
- } catch (final MalformedJsonException ignored) {
- return false;
- }
- }
-}
\ No newline at end of file
From ef92b47f65a59000849055d8c357ece68349e6d3 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 22:20:56 +0200
Subject: [PATCH 05/14] refactor(utils): Refactor head utilities (WIP).
---
.../house/menu/AdvancedSettingsMenu.java | 17 +-
.../road/menu/AdvancedSettingsMenu.java | 21 +-
.../warps/menu/MaterialSelectionMenu.java | 6 +-
.../components/warps/menu/WarpEditMenu.java | 12 +-
.../warps/menu/WarpGroupEditMenu.java | 12 +-
.../components/warps/menu/WarpGroupMenu.java | 5 +-
.../components/warps/menu/WarpMenu.java | 5 +-
.../components/warps/model/Warp.java | 16 +-
.../components/warps/model/WarpGroup.java | 16 +-
.../modules/stats/menu/StatsMenu.java | 7 +-
.../buildteamtools/utils/CustomHeads.java | 550 ------------------
.../buildteamtools/utils/HeadUtil.java | 86 +++
.../utils/heads/HeadColorScheme.java | 6 +
.../utils/heads/HeadTexture.java | 277 +++++++++
.../utils/heads/LetterType.java | 6 +
.../utils/menus/AbstractMenu.java | 24 +-
.../utils/menus/AbstractPaginatedMenu.java | 38 +-
.../utils/menus/BlockListMenu.java | 4 +-
.../utils/menus/NameListMenu.java | 4 +-
19 files changed, 492 insertions(+), 620 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java
create mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
create mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java
create mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
create mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
index 69dd70a7..d93b5d38 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
@@ -5,8 +5,9 @@
import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag;
import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings;
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@@ -47,15 +48,15 @@ protected void setPreviewItems() {
this.windowHeight = (int) house.getPlayerSettings().get(uuid).getValues().get(HouseFlag.WINDOW_HEIGHT);
this.windowDistance = (int) house.getPlayerSettings().get(uuid).getValues().get(HouseFlag.WINDOW_DISTANCE);
- createCounter(CustomHeads.SliderColor.WHITE, FLOOR_COUNT_SLOT, "Number of Floors", floorCount, 1, 10, "Floors");
- createCounter(CustomHeads.SliderColor.LIGHT_GRAY, FLOOR_HEIGHT_SLOT, "Floors Height", floorHeight, 1, 10, "Blocks");
- createCounter(CustomHeads.SliderColor.WHITE, BASE_HEIGHT_SLOT, "Basement Height", baseHeight, 0, 10, "Blocks");
- createCounter(CustomHeads.SliderColor.WHITE, WINDOW_WIDTH_SLOT, "Window Width", windowWidth, 1, 5, "Blocks");
- createCounter(CustomHeads.SliderColor.LIGHT_GRAY, WINDOW_HEIGHT_SLOT, "Window Height", windowHeight, 1, 5, "Blocks");
- createCounter(CustomHeads.SliderColor.WHITE, WINDOW_DISTANCE_SLOT, "Window Distance", windowDistance, 1, 6, "Blocks");
+ createCounter(HeadColorScheme.WHITE, FLOOR_COUNT_SLOT, "Number of Floors", floorCount, 1, 10, "Floors");
+ createCounter(HeadColorScheme.LIGHT_GRAY, FLOOR_HEIGHT_SLOT, "Floors Height", floorHeight, 1, 10, "Blocks");
+ createCounter(HeadColorScheme.WHITE, BASE_HEIGHT_SLOT, "Basement Height", baseHeight, 0, 10, "Blocks");
+ createCounter(HeadColorScheme.WHITE, WINDOW_WIDTH_SLOT, "Window Width", windowWidth, 1, 5, "Blocks");
+ createCounter(HeadColorScheme.LIGHT_GRAY, WINDOW_HEIGHT_SLOT, "Window Height", windowHeight, 1, 5, "Blocks");
+ createCounter(HeadColorScheme.WHITE, WINDOW_DISTANCE_SLOT, "Window Distance", windowDistance, 1, 6, "Blocks");
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(CustomHeads.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
setBackItem(BACK_ITEM_SLOT, new BaseColorMenu(getMenuPlayer(), false));
super.setPreviewItems();
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
index 40334242..9f455a40 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
@@ -7,9 +7,10 @@
import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag;
import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings;
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@@ -63,17 +64,17 @@ protected void setPreviewItems() {
if (roadSlab.length == 0)
roadSlab = new XMaterial[]{XMaterial.BARRIER};
- createCounter(CustomHeads.SliderColor.WHITE, LANE_COUNT_SLOT, "Number of Lanes", laneCount, 1, 10, "Lanes");
- createCounter(CustomHeads.SliderColor.LIGHT_GRAY, LANE_WIDTH_SLOT, "Lane Width", laneWidth, 1, 30, "Blocks");
- createCounter(CustomHeads.SliderColor.WHITE, SIDEWALK_WIDTH_SLOT, "Sidewalk Width", sidewalkWidth, 1, 30, "Blocks");
- createCounter(CustomHeads.SliderColor.LIGHT_GRAY, STREET_LAMP_DISTANCE_SLOT, "Street Lamp Distance", streetLampDistance, 5, 500, "Blocks");
+ createCounter(HeadColorScheme.WHITE, LANE_COUNT_SLOT, "Number of Lanes", laneCount, 1, 10, "Lanes");
+ createCounter(HeadColorScheme.LIGHT_GRAY, LANE_WIDTH_SLOT, "Lane Width", laneWidth, 1, 30, "Blocks");
+ createCounter(HeadColorScheme.WHITE, SIDEWALK_WIDTH_SLOT, "Sidewalk Width", sidewalkWidth, 1, 30, "Blocks");
+ createCounter(HeadColorScheme.LIGHT_GRAY, STREET_LAMP_DISTANCE_SLOT, "Street Lamp Distance", streetLampDistance, 5, 500, "Blocks");
- setChoiceItems(CustomHeads.SliderColor.WHITE, MARKINGS_MATERIAL_SLOT, "Line Markings Color", markingsMaterial.parseItem());
- setChoiceItems(CustomHeads.SliderColor.LIGHT_GRAY, ROAD_SLAB_SLOT, "Road Elevation Slab", roadSlab[0].parseItem());
- setChoiceItems(CustomHeads.SliderColor.WHITE, SIDEWALK_SLAB_SLOT, "Sidewalk Elevation Slab", sidewalkSlab[0].parseItem());
- setChoiceItems(CustomHeads.SliderColor.LIGHT_GRAY, STREET_LAMP_TYPE_SLOT, "Street Lamp Type", streetLampType);
+ setChoiceItems(HeadColorScheme.WHITE, MARKINGS_MATERIAL_SLOT, "Line Markings Color", markingsMaterial.parseItem());
+ setChoiceItems(HeadColorScheme.LIGHT_GRAY, ROAD_SLAB_SLOT, "Road Elevation Slab", roadSlab[0].parseItem());
+ setChoiceItems(HeadColorScheme.WHITE, SIDEWALK_SLAB_SLOT, "Sidewalk Elevation Slab", sidewalkSlab[0].parseItem());
+ setChoiceItems(HeadColorScheme.LIGHT_GRAY, STREET_LAMP_TYPE_SLOT, "Street Lamp Type", streetLampType);
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(CustomHeads.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
setBackItem(BACK_ITEM_SLOT, new SidewalkColorMenu(getMenuPlayer(), false));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
index 9e45e8f2..58d7c928 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
@@ -6,9 +6,11 @@
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import net.buildtheearth.buildteamtools.utils.menus.BookMenu;
import net.wesjd.anvilgui.AnvilGUI;
@@ -48,7 +50,7 @@ public MaterialSelectionMenu(Player menuPlayer, Object object, boolean alreadyEx
@Override
protected void setMenuItemsAsync() {
getMenu().getSlot(MATERIAL_SLOT).setItem(Item.create(XMaterial.STONE.get(), "§6§lItem", ListUtil.createList("", "Change the material of the warp", "to a minecraft item.", "", "§eExample:", "Stone")));
- getMenu().getSlot(CUSTOM_HEAD_SLOT).setItem(CustomHeads.getLetterHead("?", CustomHeads.LetterType.WOODEN, "§6§lCustom Head", ListUtil.createList("", "Change the material of the warp", "to a custom head texture URL.", "", "§eExample:", "https://textures.minecraft.net/texture/...")));
+ getMenu().getSlot(CUSTOM_HEAD_SLOT).setItem(HeadTexture.getLetterHead('?', LetterType.WOODEN, "§6§lCustom Head", ListUtil.createList("", "Change the material of the warp", "to a custom head texture URL.", "", "§eExample:", "https://textures.minecraft.net/texture/...")));
if(object instanceof Warp)
setBackItem(BACK_ITEM_SLOT, new WarpEditMenu(getMenuPlayer(), (Warp) object, alreadyExists, false));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
index 68420630..2caf9eb5 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
@@ -10,9 +10,11 @@
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.api.OpenStreetMapAPI;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import net.buildtheearth.model.GeographicalCoordinate;
import net.buildtheearth.model.MinecraftCoordinate;
@@ -71,7 +73,7 @@ public WarpEditMenu(Player player, Warp warp, boolean alreadyExists, boolean aut
@Override
protected void setMenuItemsAsync() {
// Set the confirmation item
- getMenu().getSlot(CONFIRM_SLOT).setItem(CustomHeads.getCheckmarkItem(alreadyExists ? "§aUpdate" : "§aCreate"));
+ getMenu().getSlot(CONFIRM_SLOT).setItem(HeadUtil.getCheckmarkItem(alreadyExists ? "§aUpdate" : "§aCreate"));
// Set the warp item
getMenu().getSlot(WARP_SLOT).setItem(warp.getMaterialItem());
@@ -89,9 +91,9 @@ protected void setMenuItemsAsync() {
// Set the group item
ArrayList groupLore = ListUtil.createList("", "§eCurrent Group: ", warp.getWarpGroup().getName());
- getMenu().getSlot(GROUP_SLOT).setItem(CustomHeads.getLetterHead(
- warp.getWarpGroup().getName().substring(0, 1),
- CustomHeads.LetterType.WOODEN,
+ getMenu().getSlot(GROUP_SLOT).setItem(HeadTexture.getLetterHead(
+ warp.getWarpGroup().getName().charAt(0),
+ LetterType.WOODEN,
"§6§lChange Warp Group",
groupLore
));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
index b2ba0a6a..8b6cdd61 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
@@ -8,9 +8,11 @@
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import net.buildtheearth.buildteamtools.utils.menus.BookMenu;
import net.wesjd.anvilgui.AnvilGUI;
@@ -60,13 +62,13 @@ public WarpGroupEditMenu(Player player, WarpGroup warpGroup, boolean alreadyExis
@Override
protected void setMenuItemsAsync() {
// Set the confirmation item
- getMenu().getSlot(CONFIRM_SLOT).setItem(CustomHeads.getCheckmarkItem(alreadyExists ? "§aUpdate" : "§aCreate"));
+ getMenu().getSlot(CONFIRM_SLOT).setItem(HeadUtil.getCheckmarkItem(alreadyExists ? "§aUpdate" : "§aCreate"));
// Set the warp group item
getMenu().getSlot(WARP_GROUP).setItem(
- CustomHeads.getLetterHead(
- warpGroup.getName().substring(0, 1),
- CustomHeads.LetterType.WOODEN,
+ HeadTexture.getLetterHead(
+ warpGroup.getName().charAt(0),
+ LetterType.WOODEN,
"§6§l" + warpGroup.getName(),
warpGroup.getDescriptionLore()
)
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
index 4df504ad..b6996a4b 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
@@ -9,9 +9,10 @@
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
import net.buildtheearth.buildteamtools.utils.io.ConfigUtil;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
@@ -84,7 +85,7 @@ protected void setPaginatedPreviewItems(@NotNull List> source) {
if (showPlusItem) {
getMenu().getSlot(ALTERNATE_PLUS_SLOT).setItem(
Item.createCustomHeadBase64(
- CustomHeads.GREEN_PLUS, "§a§lCreate a new Warp Group",
+ HeadTexture.GREEN_PLUS.getBase64(), "§a§lCreate a new Warp Group",
ListUtil.createList("§8Click to create a new warp group.")
)
);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
index 8b5d85bd..7438a9ee 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
@@ -6,9 +6,10 @@
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu;
import org.bukkit.entity.Player;
import org.ipvp.canvas.mask.BinaryMask;
@@ -82,7 +83,7 @@ protected void setPaginatedPreviewItems(@NotNull List> source) {
// Create a "create warp" item if the player has permission
if(warp.getName().equals("%create-warp%") && getMenuPlayer().hasPermission(Permissions.WARP_CREATE) && slot == warps.size() - 1){
- getMenu().getSlot(slot).setItem(Item.createCustomHeadBase64(CustomHeads.GREEN_PLUS, "§a§lCreate a new Warp", ListUtil.createList("§8Click to create a new warp.")));
+ getMenu().getSlot(slot).setItem(Item.createCustomHeadBase64(HeadTexture.GREEN_PLUS.getBase64(), "§a§lCreate a new Warp", ListUtil.createList("§8Click to create a new warp.")));
slot++;
continue;
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
index 456753c6..14abea47 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
@@ -4,9 +4,11 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.Utils;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.json.JSONObject;
@@ -78,9 +80,9 @@ public ItemStack getMaterialItem() {
}
if(material == null)
- return CustomHeads.getLetterHead(
- name.substring(0, 1),
- CustomHeads.LetterType.STONE,
+ return HeadTexture.getLetterHead(
+ name.charAt(0),
+ LetterType.STONE,
itemName,
lore
);
@@ -90,9 +92,9 @@ else if(material.startsWith("http://textures.minecraft.net/texture/"))
Material material = Material.matchMaterial(this.material.split(":")[0]);
if(material == null)
- return CustomHeads.getLetterHead(
- name.substring(0, 1),
- CustomHeads.LetterType.STONE,
+ return HeadTexture.getLetterHead(
+ name.charAt(0),
+ LetterType.STONE,
itemName,
lore
);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
index 833a9f48..f9f0c38a 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
@@ -4,8 +4,10 @@
import lombok.Getter;
import lombok.Setter;
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.json.JSONObject;
@@ -77,9 +79,9 @@ public ItemStack getMaterialItem() {
ArrayList lore = getDescriptionLore();
if(material == null)
- return CustomHeads.getLetterHead(
- name.substring(0, 1),
- CustomHeads.LetterType.WOODEN,
+ return HeadTexture.getLetterHead(
+ name.charAt(0),
+ LetterType.WOODEN,
itemName,
lore
);
@@ -89,9 +91,9 @@ else if(material.startsWith("http://textures.minecraft.net/texture/"))
Material matchedMaterial = Material.matchMaterial(this.material.split(":")[0]);
if(matchedMaterial == null)
- return CustomHeads.getLetterHead(
- name.substring(0, 1),
- CustomHeads.LetterType.STONE,
+ return HeadTexture.getLetterHead(
+ name.charAt(0),
+ LetterType.STONE,
itemName,
lore
);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java
index 60a778fa..52682e19 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java
@@ -5,9 +5,10 @@
import net.buildtheearth.buildteamtools.modules.stats.StatsModule;
import net.buildtheearth.buildteamtools.modules.stats.model.StatsPlayer;
import net.buildtheearth.buildteamtools.modules.stats.model.StatsServer;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@@ -20,8 +21,8 @@
public class StatsMenu extends AbstractMenu {
- private final static ItemStack GLOBAL_HEAD = Item.createCustomHeadBase64(CustomHeads.EARTH, "§eGlobal Statistics", ListUtil.createList("error"));
- private final static ItemStack ACHIEVEMENTS_HEAD = Item.createCustomHeadBase64(CustomHeads.GOLDEN_CUP, "§eAchievements", ListUtil.createList("error"));
+ private final static ItemStack GLOBAL_HEAD = Item.createCustomHeadBase64(HeadTexture.EARTH.getBase64(), "§eGlobal Statistics", ListUtil.createList("error"));
+ private final static ItemStack ACHIEVEMENTS_HEAD = Item.createCustomHeadBase64(HeadTexture.GOLDEN_CUP.getBase64(), "§eAchievements", ListUtil.createList("error"));
private final byte PLAYER_HEAD_SLOT = 4;
private final byte TEAM_HEAD_SLOT = 20;
private final byte GLOBAL_HEAD_SLOT = 22;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java b/src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java
deleted file mode 100644
index c56c9076..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/CustomHeads.java
+++ /dev/null
@@ -1,550 +0,0 @@
-package net.buildtheearth.buildteamtools.utils;
-
-import com.alpsbte.alpslib.utils.item.Item;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.ArrayList;
-
-public class CustomHeads {
- public static final String WHITE_BACKWARD = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWQ3M2NmNjZkMzFiODNjZDhiODY0NGMxNTk1OGMxYjczYzhkOTczMjNiODAxMTcwYzFkODg2NGJiNmE4NDZkIn19fQ==";
- public static String EARTH = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjFkZDRmZTRhNDI5YWJkNjY1ZGZkYjNlMjEzMjFkNmVmYTZhNmI1ZTdiOTU2ZGI5YzVkNTljOWVmYWIyNSJ9fX0=";
- public static String GOLDEN_CUP = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTAyN2Q0YTg2NDVlYzc4YWZhNjIzZmU0MjkwN2YyZGI2NjQxYmZlZjFiNDk5ZmU3N2IzNjBhMWQwYjlhNjMzYyJ9fX0=";
- public static String WHITE_PLUS = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjBiNTVmNzQ2ODFjNjgyODNhMWMxY2U1MWYxYzgzYjUyZTI5NzFjOTFlZTM0ZWZjYjU5OGRmMzk5MGE3ZTcifX19";
- public static String WHITE_MINUS = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzNlNGI1MzNlNGJhMmRmZjdjMGZhOTBmNjdlOGJlZjM2NDI4YjZjYjA2YzQ1MjYyNjMxYjBiMjVkYjg1YiJ9fX0=";
- public static String WHITE_BLANK = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTdjMjE0NGZkY2I1NWMzZmMxYmYxZGU1MWNhYmRmNTJjMzg4M2JjYjU3ODkyMzIyNmJlYjBkODVjYjJkOTgwIn19fQ==";
- public static String WHITE_X = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWQxYTNjOTY1NjIzNDg1MjdkNTc5OGYyOTE2MDkyODFmNzJlMTZkNjExZjFhNzZjMGZhN2FiZTA0MzY2NSJ9fX0=";
- public static String WHITE_0_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2YwOTAxOGY0NmYzNDllNTUzNDQ2OTQ2YTM4NjQ5ZmNmY2Y5ZmRmZDYyOTE2YWVjMzNlYmNhOTZiYjIxYjUifX19";
- public static String WHITE_1_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2E1MTZmYmFlMTYwNThmMjUxYWVmOWE2OGQzMDc4NTQ5ZjQ4ZjZkNWI2ODNmMTljZjVhMTc0NTIxN2Q3MmNjIn19fQ==";
- public static String WHITE_2_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDY5OGFkZDM5Y2Y5ZTRlYTkyZDQyZmFkZWZkZWMzYmU4YTdkYWZhMTFmYjM1OWRlNzUyZTlmNTRhZWNlZGM5YSJ9fX0=";
- public static String WHITE_3_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmQ5ZTRjZDVlMWI5ZjNjOGQ2Y2E1YTFiZjQ1ZDg2ZWRkMWQ1MWU1MzVkYmY4NTVmZTlkMmY1ZDRjZmZjZDIifX19";
- public static String WHITE_4_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjJhM2Q1Mzg5ODE0MWM1OGQ1YWNiY2ZjODc0NjlhODdkNDhjNWMxZmM4MmZiNGU3MmY3MDE1YTM2NDgwNTgifX19";
- public static String WHITE_5_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDFmZTM2YzQxMDQyNDdjODdlYmZkMzU4YWU2Y2E3ODA5YjYxYWZmZDYyNDVmYTk4NDA2OTI3NWQxY2JhNzYzIn19fQ==";
- public static String WHITE_6_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2FiNGRhMjM1OGI3YjBlODk4MGQwM2JkYjY0Mzk5ZWZiNDQxODc2M2FhZjg5YWZiMDQzNDUzNTYzN2YwYTEifX19";
- public static String WHITE_7_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjk3NzEyYmEzMjQ5NmM5ZTgyYjIwY2M3ZDE2ZTE2OGIwMzViNmY4OWYzZGYwMTQzMjRlNGQ3YzM2NWRiM2ZiIn19fQ==";
- public static String WHITE_8_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWJjMGZkYTlmYTFkOTg0N2EzYjE0NjQ1NGFkNjczN2FkMWJlNDhiZGFhOTQzMjQ0MjZlY2EwOTE4NTEyZCJ9fX0=";
- public static String WHITE_9_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDZhYmM2MWRjYWVmYmQ1MmQ5Njg5YzA2OTdjMjRjN2VjNGJjMWFmYjU2YjhiMzc1NWU2MTU0YjI0YTVkOGJhIn19fQ==";
- public static String WHITE_10_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2FmM2ZkNDczYTY0OGI4NDdjY2RhMWQyMDc0NDc5YmI3NjcyNzcxZGM0MzUyMjM0NjhlZDlmZjdiNzZjYjMifX19";
- public static String WHITE_11_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDhjYWI1M2IwMjA5OGU2ODFhNDZkMWQ3ZjVmZjY5MTc0NmFkZjRlMWZiM2FmZTM1MTZkZDJhZjk0NDU2OSJ9fX0=";
- public static String WHITE_12_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmZkODNiNWJhYWU0Y2I4NTY5NGExNGQ2ZDEzMzQxZWY3MWFhM2Q5MmQzN2RlMDdiZWE3N2IyYzlkYzUzZSJ9fX0=";
- public static String WHITE_13_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjFlNTk4NWJlNDg4NmY5ZjE2ZTI0NDdjM2Y0NjEwNTNiNDUxMzQyZDRmYjAxNjZmYjJmODhkZjc0MjIxMzZiNCJ9fX0=";
- public static String WHITE_14_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTY4MTQ1NjQzOGFlOWIyZDRkMmJmYWI5Y2YzZmZhOTM1NGVlYmRiM2YwMmNlMjk1NzkyOTM0OGU1Yjg1ZmY5NSJ9fX0=";
- public static String WHITE_15_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzE5YzRkYjczNjViMWI4OGIxMjllNzA0MTg0MjEzZmUwNzhkODhiYzNkNGFlM2Q1MjI5MGY2MWQ5NTVkNTEifX19";
- public static String WHITE_16_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWY1ZGQwNzliOThmZGFjNDNhMTlhNzk1YmE0NmZkOTdmMjNlYTc3NTdkOTJhZDBhNjlhZGM5NzMyODllNWEifX19";
- public static String WHITE_17_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmU1MWJmZThlYmZhYTU4NWE3ODdlMWNiNzcyYzdmZDdkOWE5Mjg2ZDk1ZWZhNTRkNjZmYTgyNzRmMTg4ZiJ9fX0=";
- public static String WHITE_18_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjZkZTlhNWEyZDhhMjM3MDcwMTliOWVmNjFkMTY2Mjg2MGUwYjE2NTNkZjZjMjc2MTZiZTJjNzZmY2QxODc1In19fQ==";
- public static String WHITE_19_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGJkNDU5MDRkMzRiNjM2YjJmNjQyNjFiM2Q4YmNlZDI1ODI4YzJiOGM0ODIzYjdlMTgzZWU4YTZmMWEyODRkIn19fQ==";
- public static String WHITE_20_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzRiOTNjNzIxNTE5ZTE0OTY0OWI3ZTRhZmI2ZDc2Y2ZjODE0NjA4YWU5Yzk1ZTdjM2RiNGJmNGJkYWFjZjMxZSJ9fX0=";
- public static String WHITE_ARROW_LEFT = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2RjOWU0ZGNmYTQyMjFhMWZhZGMxYjViMmIxMWQ4YmVlYjU3ODc5YWYxYzQyMzYyMTQyYmFlMWVkZDUifX19";
- public static String WHITE_ARROW_RIGHT = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTU2YTM2MTg0NTllNDNiMjg3YjIyYjdlMjM1ZWM2OTk1OTQ1NDZjNmZjZDZkYzg0YmZjYTRjZjMwYWI5MzExIn19fQ==";
- public static String LIGHT_GRAY_PLUS = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjMyZmZmMTYzZTIzNTYzMmY0MDQ3ZjQ4NDE1OTJkNDZmODVjYmJmZGU4OWZjM2RmNjg3NzFiZmY2OWE2NjIifX19";
- public static String LIGHT_GRAY_MINUS = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGE1NmRhYjUzZDRlYTFhNzlhOGU1ZWQ2MzIyYzJkNTZjYjcxNGRkMzVlZGY0Nzg3NjNhZDFhODRhODMxMCJ9fX0=";
- public static String LIGHT_GRAY_BLANK = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODFmYjhjZTY0MDhhNTg1MTM4NGUxYzJlZjc1Mzg1MWVhYzE4YmE0MDE4MjY2Y2RkNjY5ZGM5NDQ4NzNkNDIifX19";
- public static String LIGHT_GRAY_X = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjVmM2VhN2M3YjI2YTA1NGE5ZmJiYjI4Yjk3YTYwODk5OWMyYzczZGY3NWJmNmIyMzQ4ZDdmYjFlNTllODU1In19fQ==";
- public static String LIGHT_GRAY_0_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmZhNDU5MTFiMTYyOThjZmNhNGIyMjkxZWVkYTY2NjExM2JjNmYyYTM3ZGNiMmVjZDhjMjc1NGQyNGVmNiJ9fX0=";
- public static String LIGHT_GRAY_1_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2FmMWIyODBjYWI1OWY0NDY5ZGFiOWYxYTJhZjc5MjdlZDk2YTgxZGYxZTI0ZDUwYThlMzk4NGFiZmU0MDQ0In19fQ==";
- public static String LIGHT_GRAY_2_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTRiMWUxZDQyNjEyM2NlNDBjZDZhNTRiMGY4NzZhZDMwYzA4NTM5Y2Y1YTZlYTYzZTg0N2RjNTA3OTUwZmYifX19";
- public static String LIGHT_GRAY_3_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA0Y2NmOGI1MzMyYzE5NmM5ZWEwMmIyMmIzOWI5OWZhY2QxY2M4MmJmZTNmN2Q3YWVlZGMzYzMzMjkwMzkifX19";
- public static String LIGHT_GRAY_4_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmI0ZmMxOGU5NzVmNGYyMjJkODg1MjE2ZTM2M2FkYzllNmQ0NTZhYTI5MDgwZTQ4ZWI0NzE0NGRkYTQzNmY3In19fQ==";
- public static String LIGHT_GRAY_5_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWQ4YjIyMjM5NzEyZTBhZDU3OWE2MmFlNGMxMTUxMDNlNzcyODgyNWUxNzUwOGFjZDZjYzg5MTc0ZWU4MzgifX19";
- public static String LIGHT_GRAY_6_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWVlZmJhZDE2NzEyYTA1Zjk4ZTRmMGRlNWI0NDg2YWYzOTg3YjQ2ZWE2YWI0ZTNiZTkzZDE0YTgzMmM1NmUifX19";
- public static String LIGHT_GRAY_7_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTNlNjlmYTk0MmRmM2Q1ZWE1M2EzYTk3NDkxNjE3NTEwOTI0YzZiOGQ3YzQzNzExOTczNzhhMWNmMmRlZjI3In19fQ==";
- public static String LIGHT_GRAY_8_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2QxODRmZDRhYjUxZDQ2MjJmNDliNTRjZTdhMTM5NWMyOWYwMmFkMzVjZTVhYmQ1ZDNjMjU2MzhmM2E4MiJ9fX0=";
- public static String LIGHT_GRAY_9_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWIyNDU0YTVmYWEyNWY3YzRmNTc3MWQ1MmJiNGY1NWRlYjE5MzlmNzVlZmQ4ZTBhYzQyMTgxMmJhM2RjNyJ9fX0=";
- public static String LIGHT_GRAY_10_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzZiYWY3ODZjYmI2NmZkOTQzY2I0NWIxZmE1MmYzNjI4OWEzOWYyZDk4NThkOWJlYmUxZTFhMzcwZDdkZmNjIn19fQ==";
- public static String LIGHT_GRAY_11_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmRlNDI5YmM3MmIyY2M3ZmY3MGMxZDZjOWYxMTE2ZWMwNzExMmYxZjY0YzU4YmQ4YjljNDgwODNmZTIwMSJ9fX0=";
- public static String LIGHT_GRAY_12_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWNlMDg0MWYwNjExZDg1NWQ1MGUxNmRkYzNkODM0MDZhN2MwNjRhZDYyNzFkNWM2MzE3M2MwNWQzZDNjYjAifX19";
- public static String LIGHT_GRAY_13_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2ViYTZlOTBkZDg4MTYyNjE2MWRlYjllMWE4NzY1YTFhMzRiZjc3MTE3OTMxYWJlYjU3NzhiNTQ5ZmQyYiJ9fX0=";
- public static String LIGHT_GRAY_14_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDdjYjU4MjAxNGM2YTFhOTYwYjE3MDQ5NDliMTYyYTk4ZDdmNjU1ZmI2NmM2ZjE4MTU0ZWNjZGE2YTVmYTY1In19fQ==";
- public static String LIGHT_GRAY_15_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGM0OTYwMWVmNjlkNjNkY2YxZDlmOGVkMThhMzhiNGI3ZjM0NGY3Njc4YjM2NTU1OWE0NzM5ZmNmYmZkOTYyIn19fQ==";
- public static String LIGHT_GRAY_16_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjkwZmVmY2YyZGNhMTlhNjcyYzYxNTllMjg3YzRlZGVmNGU5MWY0NTllODNmZmRhZjYxNmI4ZTg4Y2QyYTgifX19";
- public static String LIGHT_GRAY_17_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTRlZTU4MTg5ODMyOGMzMTZkMjY2ZWQ2NjRiY2M0ZDI5MzNkOTNiZTc5Mjk4Yzc5OGI3ODlkODNkMzRiM2FlIn19fQ==";
- public static String LIGHT_GRAY_18_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjhkOTc3ODhiOTRjMzU2YzJmZjQ0NWY0NGY5NTM0ZmU0OGNiNWQyMTU0N2Q2NGZkYmI5OGFjYzFjNWRlZmUifX19";
- public static String LIGHT_GRAY_19_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmM1YjU5ZDk4YzkyNzRmOWI4NDMzNmNmMWFjYWUxNWIxYmU2OWY0MzQ4OGQ2NDI2YzhlMzQzZWMzN2FiMTI2In19fQ==";
- public static String LIGHT_GRAY_20_B64 = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTRhOTJlZGVkY2FmMTlmYmRjYjUwNWIyMGQ2NzQ3MmJkYTc4MWYyZGQzY2Y3MzcyZmFmOTcyOWQ5NzMxYiJ9fX0=";
- public static String WOODEN_LETTER_A = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTY3ZDgxM2FlN2ZmZTViZTk1MWE0ZjQxZjJhYTYxOWE1ZTM4OTRlODVlYTVkNDk4NmY4NDk0OWM2M2Q3NjcyZSJ9fX0=";
- public static String WOODEN_LETTER_B = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTBjMWI1ODRmMTM5ODdiNDY2MTM5Mjg1YjJmM2YyOGRmNjc4NzEyM2QwYjMyMjgzZDg3OTRlMzM3NGUyMyJ9fX0=";
- public static String WOODEN_LETTER_C = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWJlOTgzZWM0NzgwMjRlYzZmZDA0NmZjZGZhNDg0MjY3NjkzOTU1MWI0NzM1MDQ0N2M3N2MxM2FmMThlNmYifX19";
- public static String WOODEN_LETTER_D = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzE5M2RjMGQ0YzVlODBmZjlhOGEwNWQyZmNmZTI2OTUzOWNiMzkyNzE5MGJhYzE5ZGEyZmNlNjFkNzEifX19";
- public static String WOODEN_LETTER_E = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGJiMjczN2VjYmY5MTBlZmUzYjI2N2RiN2Q0YjMyN2YzNjBhYmM3MzJjNzdiZDBlNGVmZjFkNTEwY2RlZiJ9fX0=";
- public static String WOODEN_LETTER_F = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjE4M2JhYjUwYTMyMjQwMjQ4ODZmMjUyNTFkMjRiNmRiOTNkNzNjMjQzMjU1OWZmNDllNDU5YjRjZDZhIn19fQ==";
- public static String WOODEN_LETTER_G = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWNhM2YzMjRiZWVlZmI2YTBlMmM1YjNjNDZhYmM5MWNhOTFjMTRlYmE0MTlmYTQ3NjhhYzMwMjNkYmI0YjIifX19";
- public static String WOODEN_LETTER_H = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzFmMzQ2MmE0NzM1NDlmMTQ2OWY4OTdmODRhOGQ0MTE5YmM3MWQ0YTVkODUyZTg1YzI2YjU4OGE1YzBjNzJmIn19fQ==";
- public static String WOODEN_LETTER_I = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDYxNzhhZDUxZmQ1MmIxOWQwYTM4ODg3MTBiZDkyMDY4ZTkzMzI1MmFhYzZiMTNjNzZlN2U2ZWE1ZDMyMjYifX19";
- public static String WOODEN_LETTER_J = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2E3OWRiOTkyMzg2N2U2OWMxZGJmMTcxNTFlNmY0YWQ5MmNlNjgxYmNlZGQzOTc3ZWViYmM0NGMyMDZmNDkifX19";
- public static String WOODEN_LETTER_K = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTQ2MWIzOGM4ZTQ1NzgyYWRhNTlkMTYxMzJhNDIyMmMxOTM3NzhlN2Q3MGM0NTQyYzk1MzYzNzZmMzdiZTQyIn19fQ==";
- public static String WOODEN_LETTER_L = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzE5ZjUwYjQzMmQ4NjhhZTM1OGUxNmY2MmVjMjZmMzU0MzdhZWI5NDkyYmNlMTM1NmM5YWE2YmIxOWEzODYifX19";
- public static String WOODEN_LETTER_M = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDljNDVhMjRhYWFiZjQ5ZTIxN2MxNTQ4MzIwNDg0OGE3MzU4MmFiYTdmYWUxMGVlMmM1N2JkYjc2NDgyZiJ9fX0=";
- public static String WOODEN_LETTER_N = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzViOGIzZDhjNzdkZmI4ZmJkMjQ5NWM4NDJlYWM5NGZmZmE2ZjU5M2JmMTVhMjU3NGQ4NTRkZmYzOTI4In19fQ==";
- public static String WOODEN_LETTER_O = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDExZGUxY2FkYjJhZGU2MTE0OWU1ZGVkMWJkODg1ZWRmMGRmNjI1OTI1NWIzM2I1ODdhOTZmOTgzYjJhMSJ9fX0=";
- public static String WOODEN_LETTER_P = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTBhNzk4OWI1ZDZlNjIxYTEyMWVlZGFlNmY0NzZkMzUxOTNjOTdjMWE3Y2I4ZWNkNDM2MjJhNDg1ZGMyZTkxMiJ9fX0=";
- public static String WOODEN_LETTER_Q = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDM2MDlmMWZhZjgxZWQ0OWM1ODk0YWMxNGM5NGJhNTI5ODlmZGE0ZTFkMmE1MmZkOTQ1YTU1ZWQ3MTllZDQifX19";
- public static String WOODEN_LETTER_R = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTVjZWQ5OTMxYWNlMjNhZmMzNTEzNzEzNzliZjA1YzYzNWFkMTg2OTQzYmMxMzY0NzRlNGU1MTU2YzRjMzcifX19";
- public static String WOODEN_LETTER_S = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2U0MWM2MDU3MmM1MzNlOTNjYTQyMTIyODkyOWU1NGQ2Yzg1NjUyOTQ1OTI0OWMyNWMzMmJhMzNhMWIxNTE3In19fQ==";
- public static String WOODEN_LETTER_T = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTU2MmU4YzFkNjZiMjFlNDU5YmU5YTI0ZTVjMDI3YTM0ZDI2OWJkY2U0ZmJlZTJmNzY3OGQyZDNlZTQ3MTgifX19";
- public static String WOODEN_LETTER_U = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjA3ZmJjMzM5ZmYyNDFhYzNkNjYxOWJjYjY4MjUzZGZjM2M5ODc4MmJhZjNmMWY0ZWZkYjk1NGY5YzI2In19fQ==";
- public static String WOODEN_LETTER_V = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2M5YTEzODYzOGZlZGI1MzRkNzk5Mjg4NzZiYWJhMjYxYzdhNjRiYTc5YzQyNGRjYmFmY2M5YmFjNzAxMGI4In19fQ==";
- public static String WOODEN_LETTER_W = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMjY5YWQxYTg4ZWQyYjA3NGUxMzAzYTEyOWY5NGU0YjcxMGNmM2U1YjRkOTk1MTYzNTY3ZjY4NzE5YzNkOTc5MiJ9fX0=";
- public static String WOODEN_LETTER_X = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWE2Nzg3YmEzMjU2NGU3YzJmM2EwY2U2NDQ5OGVjYmIyM2I4OTg0NWU1YTY2YjVjZWM3NzM2ZjcyOWVkMzcifX19";
- public static String WOODEN_LETTER_Y = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzUyZmIzODhlMzMyMTJhMjQ3OGI1ZTE1YTk2ZjI3YWNhNmM2MmFjNzE5ZTFlNWY4N2ExY2YwZGU3YjE1ZTkxOCJ9fX0=";
- public static String WOODEN_LETTER_Z = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTA1ODJiOWI1ZDk3OTc0YjExNDYxZDYzZWNlZDg1ZjQzOGEzZWVmNWRjMzI3OWY5YzQ3ZTFlMzhlYTU0YWU4ZCJ9fX0=";
- public static String WOODEN_LETTER_QUESTION_MARK = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYmFkYzA0OGE3Y2U3OGY3ZGFkNzJhMDdkYTI3ZDg1YzA5MTY4ODFlNTUyMmVlZWQxZTNkYWYyMTdhMzhjMWEifX19";
- public static String STONE_LETTER_A = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMmFjNThiMWEzYjUzYjk0ODFlMzE3YTFlYTRmYzVlZWQ2YmFmY2E3YTI1ZTc0MWEzMmU0ZTNjMjg0MTI3OGMifX19";
- public static String STONE_LETTER_B = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDRjNzExNTcxZTdlMjE0ZWU3OGRmZTRlZTBlMTI2M2I5MjUxNmU0MThkZThmYzhmMzI1N2FlMDkwMTQzMSJ9fX0=";
- public static String STONE_LETTER_C = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmZmNWFhYmVhZDZmZWFmYWFlY2Y0NDIyY2RkNzgzN2NiYjM2YjAzYzk4NDFkZDFiMWQyZDNlZGI3ODI1ZTg1MSJ9fX0=";
- public static String STONE_LETTER_D = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODkzZTYyMmI1ODE5NzU3OTJmN2MxMTllYzZmNDBhNGYxNmU1NTJiYjk4Nzc2YjBjN2FlMmJkZmQ0MTU0ZmU3In19fQ==";
- public static String STONE_LETTER_E = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTE1N2Q2NWIxOTkyMWM3NjBmZjQ5MTBiMzQwNDQ1NWI5YzJlZTM2YWZjMjAyZDg1MzhiYWVmZWM2NzY5NTMifX19";
- public static String STONE_LETTER_F = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzU0Y2YyNjFiMmNkNmFiNTRiMGM2MjRmOGY2ZmY1NjVhN2I2M2UyOGUzYjUwYzZkYmZiNTJiNWYwZDdjZjlmIn19fQ==";
- public static String STONE_LETTER_G = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDNjOWY4YTc0Y2EwMWJhOGM1NGRlMWVkYzgyZTFmYzA3YTgzOTIzZTY2NTc0YjZmZmU2MDY5MTkyNDBjNiJ9fX0=";
- public static String STONE_LETTER_H = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjhjNThjNTA5MDM0NjE3YmY4MWVlMGRiOWJlMGJhM2U4NWNhMTU1NjgxNjM5MTRjODc2NjllZGIyZmQ3In19fQ==";
- public static String STONE_LETTER_I = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDI0NjMyM2M5ZmIzMTkzMjZlZTJiZjNmNWI2M2VjM2Q5OWRmNzZhMTI0MzliZjBiNGMzYWIzMmQxM2ZkOSJ9fX0=";
- public static String STONE_LETTER_J = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzU4NDU2Y2Q5YmI4YTdlOTc4NTkxYWUwY2IyNmFmMWFhZGFkNGZhN2ExNjcyNWIyOTUxNDVlMDliZWQ4MDY0In19fQ==";
- public static String STONE_LETTER_K = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYWY0OWZiNzA4MzY5ZTdiYzI5NDRhZDcwNjk2M2ZiNmFjNmNlNmQ0YzY3MDgxZGRhZGVjZmU1ZGE1MSJ9fX0=";
- public static String STONE_LETTER_L = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGM4NGY3NTQxNmU4NTNhNzRmNmM3MGZjN2UxMDkzZDUzOTYxODc5OTU1YjQzM2JkOGM3YzZkNWE2ZGYifX19";
- public static String STONE_LETTER_M = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzFmZGU5MWIxOWI5MzA5OTEzNzI0ZmVhOWU4NTMxMTI3MWM2N2JjYjc4NTc4ZDQ2MWJmNjVkOTYxMzA3NCJ9fX0=";
- public static String STONE_LETTER_N = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWM3Yzk3MmU2Nzg1ZDZiMGFjZWI3NzlhYmRkNzcwMmQ5ODM0MWMyNGMyYTcxZTcwMjkzMGVjYTU4MDU1In19fQ==";
- public static String STONE_LETTER_O = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODA3M2JiNDRmOTM0NWY5YmIzMWE2NzkwMjdlNzkzOWU0NjE4NDJhOGMyNzQ4NmQ3YTZiODQyYzM5ZWIzOGM0ZSJ9fX0=";
- public static String STONE_LETTER_P = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjRiMjMxYThkNTU4NzBjZmI1YTlmNGU2NWRiMDZkZDdmOGUzNDI4MmYxNDE2Zjk1ODc4YjE5YWNjMzRhYzk1In19fQ==";
- public static String STONE_LETTER_Q = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmZlZGQ2ZjllZmRiMTU2Yjg2OTM1Njk5YjJiNDgzNGRmMGY1ZDIxNDUxM2MwMWQzOGFmM2JkMDMxY2JjYzkyIn19fQ==";
- public static String STONE_LETTER_R = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAzYTFjZDU4M2NiYmZmZGUwOGY5NDNlNTZhYzNlM2FmYWZlY2FlZGU4MzQyMjFhODFlNmRiNmM2NDY2N2Y3ZCJ9fX0=";
- public static String STONE_LETTER_S = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjY1NzJlNjU1NzI1ZDc4Mzc1YTk4MTdlYjllZThiMzc4MjljYTFmZWE5M2I2MDk1Y2M3YWExOWU1ZWFjIn19fQ==";
- public static String STONE_LETTER_T = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzA4YzllZjNhMzc1MWUyNTRlMmFmMWFkOGI1ZDY2OGNjZjVjNmVjM2VhMjY0MTg3N2NiYTU3NTgwN2QzOSJ9fX0=";
- public static String STONE_LETTER_U = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTVhNmUzYWU1YWU2MjU5MjM1MjQ4MzhmYWM5ZmVmNWI0MjUyN2Y1MDI3YzljYTE0OWU2YzIwNzc5MmViIn19fQ==";
- public static String STONE_LETTER_V = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTc1MTIxZjdkOWM2OGRhMGU1YjZhOTZhYzYxNTI5OGIxMmIyZWU1YmQxOTk4OTQzNmVlNjQ3ODc5ZGE1YiJ9fX0=";
- public static String STONE_LETTER_W = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjdlMTY1YzNlZGM1NTQxZDQ2NTRjNDcyODg3MWU2OTA4ZjYxM2ZjMGVjNDZlODIzYzk2ZWFjODJhYzYyZTYyIn19fQ==";
- public static String STONE_LETTER_X = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTkxOWQxNTk0YmY4MDlkYjdiNDRiMzc4MmJmOTBhNjlmNDQ5YTg3Y2U1ZDE4Y2I0MGViNjUzZmRlYzI3MjIifX19";
- public static String STONE_LETTER_Y = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTM1NDI0YmI4NjMwNWQ3NzQ3NjA0YjEzZTkyNGQ3NGYxZWZlMzg5MDZlNGU0NThkZDE4ZGNjNjdiNmNhNDgifX19";
- public static String STONE_LETTER_Z = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNGU5MTIwMGRmMWNhZTUxYWNjMDcxZjg1YzdmN2Y1Yjg0NDlkMzliYjMyZjM2M2IwYWE1MWRiYzg1ZDEzM2UifX19";
- public static String STONE_QUESTION_MARK = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDIzZWFlZmJkNTgxMTU5Mzg0Mjc0Y2RiYmQ1NzZjZWQ4MmViNzI0MjNmMmVhODg3MTI0ZjllZDMzYTY4NzJjIn19fQ==";
- public static String CHECKMARK = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTkyZTMxZmZiNTljOTBhYjA4ZmM5ZGMxZmUyNjgwMjAzNWEzYTQ3YzQyZmVlNjM0MjNiY2RiNDI2MmVjYjliNiJ9fX0=";
- public static String GREEN_PLUS = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjA1NmJjMTI0NGZjZmY5OTM0NGYxMmFiYTQyYWMyM2ZlZTZlZjZlMzM1MWQyN2QyNzNjMTU3MjUzMWYifX19";
-
- public static ItemStack getCurrentPageItem(int currentPage) {
- return getWhiteNumberHead(currentPage, "§eCurrent Page §7- §f" + (currentPage), null);
- }
-
- public static ItemStack getPreviousPageItem(int currentPage) {
- if (currentPage <= 1)
- return Item.createCustomHeadBase64(WHITE_BLANK, " ", null);
-
- return Item.createCustomHeadBase64(WHITE_ARROW_LEFT, "§ePrevious Page §7- §f" + (currentPage - 1), null);
- }
-
- public static ItemStack getNextPageItem(int currentPage, boolean hasNextPage) {
- if (!hasNextPage)
- return Item.createCustomHeadBase64(WHITE_BLANK, " ", null);
-
- return Item.createCustomHeadBase64(WHITE_ARROW_RIGHT, "§eNext Page §7- §f" + (currentPage + 1), null);
- }
-
- public static ItemStack getBackItem(){
- return Item.createCustomHeadBase64(WHITE_BACKWARD, "§eBack", null);
- }
-
- public static ItemStack getCounterCurrentValueItem(SliderColor sliderColor, String name, int value, String valueType) {
- String sliderName = "§e" + name + ": §7§l" + value;
- if (valueType != null)
- sliderName += " " + valueType;
-
- switch (sliderColor) {
- default:
- case WHITE:
- return getWhiteNumberHead(value, sliderName, null);
- case LIGHT_GRAY:
- return getLightGrayNumberHead(value, sliderName, null);
- }
- }
-
- public static ItemStack getCounterPlusItem(SliderColor sliderColor, String name, int value, int maxValue) {
- if (value >= maxValue)
- switch (sliderColor) {
- case WHITE:
- return Item.createCustomHeadBase64(WHITE_BLANK, " ", null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(LIGHT_GRAY_BLANK, " ", null);
- }
-
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(WHITE_PLUS, "§a§l+ §e" + name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(LIGHT_GRAY_PLUS, "§a§l+ §e" + name, null);
- }
- }
-
- public static ItemStack getCounterMinusItem(SliderColor sliderColor, String name, int value, int minValue) {
- if (value <= minValue)
- switch (sliderColor) {
- case WHITE:
- return Item.createCustomHeadBase64(WHITE_BLANK, " ", null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(LIGHT_GRAY_BLANK, " ", null);
- }
-
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(WHITE_MINUS, "§c§l- §e" + name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(LIGHT_GRAY_MINUS, "§c§l- §e" + name, null);
- }
- }
-
- public static ItemStack getXItem(SliderColor sliderColor, String name) {
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(WHITE_X, name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(LIGHT_GRAY_X, name, null);
- }
- }
-
- public static ItemStack getBlankItem(SliderColor sliderColor, String name) {
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(WHITE_BLANK, name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(LIGHT_GRAY_BLANK, name, null);
- }
- }
-
- public static ItemStack getCheckmarkItem(String name) {
- return Item.createCustomHeadBase64(CHECKMARK, name, null);
- }
-
- public static ItemStack getWhiteNumberHead(int number, String headName, ArrayList lore) {
- String b64;
- switch (number) {
- case 0:
- b64 = WHITE_0_B64;
- break;
- case 1:
- b64 = WHITE_1_B64;
- break;
- case 2:
- b64 = WHITE_2_B64;
- break;
- case 3:
- b64 = WHITE_3_B64;
- break;
- case 4:
- b64 = WHITE_4_B64;
- break;
- case 5:
- b64 = WHITE_5_B64;
- break;
- case 6:
- b64 = WHITE_6_B64;
- break;
- case 7:
- b64 = WHITE_7_B64;
- break;
- case 8:
- b64 = WHITE_8_B64;
- break;
- case 9:
- b64 = WHITE_9_B64;
- break;
- case 10:
- b64 = WHITE_10_B64;
- break;
- case 11:
- b64 = WHITE_11_B64;
- break;
- case 12:
- b64 = WHITE_12_B64;
- break;
- case 13:
- b64 = WHITE_13_B64;
- break;
- case 14:
- b64 = WHITE_14_B64;
- break;
- case 15:
- b64 = WHITE_15_B64;
- break;
- case 16:
- b64 = WHITE_16_B64;
- break;
- case 17:
- b64 = WHITE_17_B64;
- break;
- case 18:
- b64 = WHITE_18_B64;
- break;
- case 19:
- b64 = WHITE_19_B64;
- break;
- case 20:
- b64 = WHITE_20_B64;
- break;
-
- default:
- b64 = WHITE_BLANK;
- break;
- }
- return Item.createCustomHeadBase64(b64, headName, lore);
- }
-
- public static ItemStack getLightGrayNumberHead(int number, String headName, ArrayList lore) {
- String b64;
- switch (number) {
- case 0:
- b64 = LIGHT_GRAY_0_B64;
- break;
- case 1:
- b64 = LIGHT_GRAY_1_B64;
- break;
- case 2:
- b64 = LIGHT_GRAY_2_B64;
- break;
- case 3:
- b64 = LIGHT_GRAY_3_B64;
- break;
- case 4:
- b64 = LIGHT_GRAY_4_B64;
- break;
- case 5:
- b64 = LIGHT_GRAY_5_B64;
- break;
- case 6:
- b64 = LIGHT_GRAY_6_B64;
- break;
- case 7:
- b64 = LIGHT_GRAY_7_B64;
- break;
- case 8:
- b64 = LIGHT_GRAY_8_B64;
- break;
- case 9:
- b64 = LIGHT_GRAY_9_B64;
- break;
- case 10:
- b64 = LIGHT_GRAY_10_B64;
- break;
- case 11:
- b64 = LIGHT_GRAY_11_B64;
- break;
- case 12:
- b64 = LIGHT_GRAY_12_B64;
- break;
- case 13:
- b64 = LIGHT_GRAY_13_B64;
- break;
- case 14:
- b64 = LIGHT_GRAY_14_B64;
- break;
- case 15:
- b64 = LIGHT_GRAY_15_B64;
- break;
- case 16:
- b64 = LIGHT_GRAY_16_B64;
- break;
- case 17:
- b64 = LIGHT_GRAY_17_B64;
- break;
- case 18:
- b64 = LIGHT_GRAY_18_B64;
- break;
- case 19:
- b64 = LIGHT_GRAY_19_B64;
- break;
- case 20:
- b64 = LIGHT_GRAY_20_B64;
- break;
-
- default:
- b64 = LIGHT_GRAY_BLANK;
- break;
- }
- return Item.createCustomHeadBase64(b64, headName, lore);
- }
-
- public static ItemStack getLetterHead(String letter, LetterType letterType, String headName, ArrayList lore) {
- letter = letter.toUpperCase();
-
- String b64;
-
- if(letterType == LetterType.WOODEN) {
- switch (letter) {
- case "A":
- b64 = WOODEN_LETTER_A;
- break;
- case "B":
- b64 = WOODEN_LETTER_B;
- break;
- case "C":
- b64 = WOODEN_LETTER_C;
- break;
- case "D":
- b64 = WOODEN_LETTER_D;
- break;
- case "E":
- b64 = WOODEN_LETTER_E;
- break;
- case "F":
- b64 = WOODEN_LETTER_F;
- break;
- case "G":
- b64 = WOODEN_LETTER_G;
- break;
- case "H":
- b64 = WOODEN_LETTER_H;
- break;
- case "I":
- b64 = WOODEN_LETTER_I;
- break;
- case "J":
- b64 = WOODEN_LETTER_J;
- break;
- case "K":
- b64 = WOODEN_LETTER_K;
- break;
- case "L":
- b64 = WOODEN_LETTER_L;
- break;
- case "M":
- b64 = WOODEN_LETTER_M;
- break;
- case "N":
- b64 = WOODEN_LETTER_N;
- break;
- case "O":
- b64 = WOODEN_LETTER_O;
- break;
- case "P":
- b64 = WOODEN_LETTER_P;
- break;
- case "Q":
- b64 = WOODEN_LETTER_Q;
- break;
- case "R":
- b64 = WOODEN_LETTER_R;
- break;
- case "S":
- b64 = WOODEN_LETTER_S;
- break;
- case "T":
- b64 = WOODEN_LETTER_T;
- break;
- case "U":
- b64 = WOODEN_LETTER_U;
- break;
- case "V":
- b64 = WOODEN_LETTER_V;
- break;
- case "W":
- b64 = WOODEN_LETTER_W;
- break;
- case "X":
- b64 = WOODEN_LETTER_X;
- break;
- case "Y":
- b64 = WOODEN_LETTER_Y;
- break;
- case "Z":
- b64 = WOODEN_LETTER_Z;
- break;
- default:
- b64 = WOODEN_LETTER_QUESTION_MARK;
- break;
- }
- } else {
- switch (letter) {
- case "A":
- b64 = STONE_LETTER_A;
- break;
- case "B":
- b64 = STONE_LETTER_B;
- break;
- case "C":
- b64 = STONE_LETTER_C;
- break;
- case "D":
- b64 = STONE_LETTER_D;
- break;
- case "E":
- b64 = STONE_LETTER_E;
- break;
- case "F":
- b64 = STONE_LETTER_F;
- break;
- case "G":
- b64 = STONE_LETTER_G;
- break;
- case "H":
- b64 = STONE_LETTER_H;
- break;
- case "I":
- b64 = STONE_LETTER_I;
- break;
- case "J":
- b64 = STONE_LETTER_J;
- break;
- case "K":
- b64 = STONE_LETTER_K;
- break;
- case "L":
- b64 = STONE_LETTER_L;
- break;
- case "M":
- b64 = STONE_LETTER_M;
- break;
- case "N":
- b64 = STONE_LETTER_N;
- break;
- case "O":
- b64 = STONE_LETTER_O;
- break;
- case "P":
- b64 = STONE_LETTER_P;
- break;
- case "Q":
- b64 = STONE_LETTER_Q;
- break;
- case "R":
- b64 = STONE_LETTER_R;
- break;
- case "S":
- b64 = STONE_LETTER_S;
- break;
- case "T":
- b64 = STONE_LETTER_T;
- break;
- case "U":
- b64 = STONE_LETTER_U;
- break;
- case "V":
- b64 = STONE_LETTER_V;
- break;
- case "W":
- b64 = STONE_LETTER_W;
- break;
- case "X":
- b64 = STONE_LETTER_X;
- break;
- case "Y":
- b64 = STONE_LETTER_Y;
- break;
- case "Z":
- b64 = STONE_LETTER_Z;
- break;
- default:
- b64 = STONE_QUESTION_MARK;
- break;
- }
- }
-
- return Item.createCustomHeadBase64(b64, headName, lore);
- }
-
- public enum SliderColor {
- WHITE, LIGHT_GRAY
- }
-
- public enum LetterType {
- WOODEN, STONE;
- }
-}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java b/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
new file mode 100644
index 00000000..8c93c27f
--- /dev/null
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
@@ -0,0 +1,86 @@
+package net.buildtheearth.buildteamtools.utils;
+
+import com.alpsbte.alpslib.utils.item.Item;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import org.bukkit.inventory.ItemStack;
+
+import java.util.ArrayList;
+
+public class HeadUtil {
+
+ public static ItemStack getCounterCurrentValueItem(HeadColorScheme sliderColor, String name, int value, String valueType) {
+ String sliderName = "§e" + name + ": §7§l" + value;
+ if (valueType != null)
+ sliderName += " " + valueType;
+
+ switch (sliderColor) {
+ default:
+ case WHITE:
+ return HeadTexture.getWhiteNumberHead(value, sliderName, null);
+ case LIGHT_GRAY:
+ return HeadTexture.getLightGrayNumberHead(value, sliderName, null);
+ }
+ }
+
+ public static ItemStack getCounterPlusItem(HeadColorScheme sliderColor, String name, int value, int maxValue) {
+ if (value >= maxValue)
+ switch (sliderColor) {
+ case WHITE:
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
+ case LIGHT_GRAY:
+ return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), " ", null);
+ }
+
+ switch (sliderColor) {
+ default:
+ case WHITE:
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_PLUS.getBase64(), "§a§l+ §e" + name, null);
+ case LIGHT_GRAY:
+ return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_PLUS.getBase64(), "§a§l+ §e" + name, null);
+ }
+ }
+
+ public static ItemStack getCounterMinusItem(HeadColorScheme sliderColor, String name, int value, int minValue) {
+ if (value <= minValue)
+ switch (sliderColor) {
+ case WHITE:
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
+ case LIGHT_GRAY:
+ return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), " ", null);
+ }
+
+ switch (sliderColor) {
+ default:
+ case WHITE:
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_MINUS.getBase64(), "§c§l- §e" + name, null);
+ case LIGHT_GRAY:
+ return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_MINUS.getBase64(), "§c§l- §e" + name, null);
+ }
+ }
+
+ public static ItemStack getXItem(HeadColorScheme sliderColor, String name) {
+ switch (sliderColor) {
+ default:
+ case WHITE:
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_X.getBase64(), name, null);
+ case LIGHT_GRAY:
+ return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_X.getBase64(), name, null);
+ }
+ }
+
+ public static ItemStack getBlankItem(HeadColorScheme sliderColor, String name) {
+ switch (sliderColor) {
+ default:
+ case WHITE:
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), name, null);
+ case LIGHT_GRAY:
+ return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), name, null);
+ }
+ }
+
+ public static ItemStack getCheckmarkItem(String name) {
+ return Item.createCustomHeadBase64(HeadTexture.CHECKMARK.getBase64(), name, null);
+ }
+
+}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java
new file mode 100644
index 00000000..31fb4d0f
--- /dev/null
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java
@@ -0,0 +1,6 @@
+package net.buildtheearth.buildteamtools.utils.heads;
+
+public enum HeadColorScheme {
+ WHITE,
+ LIGHT_GRAY;
+}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
new file mode 100644
index 00000000..b9962551
--- /dev/null
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
@@ -0,0 +1,277 @@
+package net.buildtheearth.buildteamtools.utils.heads;
+
+import com.alpsbte.alpslib.utils.item.Item;
+import lombok.Getter;
+import org.bukkit.inventory.ItemStack;
+
+import java.util.ArrayList;
+
+@Getter
+public enum HeadTexture {
+ EARTH("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjFkZDRmZTRhNDI5YWJkNjY1ZGZkYjNlMjEzMjFkNmVmYTZhNmI1ZTdiOTU2ZGI5YzVkNTljOWVmYWIyNSJ9fX0="),
+ GOLDEN_CUP("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTAyN2Q0YTg2NDVlYzc4YWZhNjIzZmU0MjkwN2YyZGI2NjQxYmZlZjFiNDk5ZmU3N2IzNjBhMWQwYjlhNjMzYyJ9fX0="),
+
+ CHECKMARK("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTkyZTMxZmZiNTljOTBhYjA4ZmM5ZGMxZmUyNjgwMjAzNWEzYTQ3YzQyZmVlNjM0MjNiY2RiNDI2MmVjYjliNiJ9fX0="),
+ GREEN_PLUS("eyJ0ZX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NGU5MTIwMGRmMWNhZTUxYWNjMDcxZjg1YzdmN2Y1Yjg0NDlkMzliYjMyZjM2M2IwYWE1MWRiYzg1ZDEzM2UifX19"),
+
+ STONE_LETTER_QUESTION_MARK("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDIzZWFlZmJkNTgxMTU5Mzg0Mjc0Y2RiYmQ1NzZjZWQ4MmViNzI0MjNmMmVhODg3MTI0ZjllZDMzYTY4NzJjIn19fQ==");
+
+ private final String base64;
+
+ HeadTexture(String base64) {
+ this.base64 = base64;
+ }
+
+ public static ItemStack getWhiteNumberHead(int number, String headName, ArrayList lore) {
+ HeadTexture texture = switch (number) {
+ case 0 -> HeadTexture.WHITE_0;
+ case 1 -> HeadTexture.WHITE_1;
+ case 2 -> HeadTexture.WHITE_2;
+ case 3 -> HeadTexture.WHITE_3;
+ case 4 -> HeadTexture.WHITE_4;
+ case 5 -> HeadTexture.WHITE_5;
+ case 6 -> HeadTexture.WHITE_6;
+ case 7 -> HeadTexture.WHITE_7;
+ case 8 -> HeadTexture.WHITE_8;
+ case 9 -> HeadTexture.WHITE_9;
+ case 10 -> HeadTexture.WHITE_10;
+ case 11 -> HeadTexture.WHITE_11;
+ case 12 -> HeadTexture.WHITE_12;
+ case 13 -> HeadTexture.WHITE_13;
+ case 14 -> HeadTexture.WHITE_14;
+ case 15 -> HeadTexture.WHITE_15;
+ case 16 -> HeadTexture.WHITE_16;
+ case 17 -> HeadTexture.WHITE_17;
+ case 18 -> HeadTexture.WHITE_18;
+ case 19 -> HeadTexture.WHITE_19;
+ case 20 -> HeadTexture.WHITE_20;
+ default -> HeadTexture.WHITE_BLANK;
+ };
+
+ return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
+ }
+
+ public static ItemStack getLightGrayNumberHead(int number, String headName, ArrayList lore) {
+ HeadTexture texture = switch (number) {
+ case 0 -> HeadTexture.LIGHT_GRAY_0;
+ case 1 -> HeadTexture.LIGHT_GRAY_1;
+ case 2 -> HeadTexture.LIGHT_GRAY_2;
+ case 3 -> HeadTexture.LIGHT_GRAY_3;
+ case 4 -> HeadTexture.LIGHT_GRAY_4;
+ case 5 -> HeadTexture.LIGHT_GRAY_5;
+ case 6 -> HeadTexture.LIGHT_GRAY_6;
+ case 7 -> HeadTexture.LIGHT_GRAY_7;
+ case 8 -> HeadTexture.LIGHT_GRAY_8;
+ case 9 -> HeadTexture.LIGHT_GRAY_9;
+ case 10 -> HeadTexture.LIGHT_GRAY_10;
+ case 11 -> HeadTexture.LIGHT_GRAY_11;
+ case 12 -> HeadTexture.LIGHT_GRAY_12;
+ case 13 -> HeadTexture.LIGHT_GRAY_13;
+ case 14 -> HeadTexture.LIGHT_GRAY_14;
+ case 15 -> HeadTexture.LIGHT_GRAY_15;
+ case 16 -> HeadTexture.LIGHT_GRAY_16;
+ case 17 -> HeadTexture.LIGHT_GRAY_17;
+ case 18 -> HeadTexture.LIGHT_GRAY_18;
+ case 19 -> HeadTexture.LIGHT_GRAY_19;
+ case 20 -> HeadTexture.LIGHT_GRAY_20;
+ default -> HeadTexture.LIGHT_GRAY_BLANK;
+ };
+
+ return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
+ }
+
+ public static ItemStack getLetterHead(char letter, LetterType letterType, String headName, ArrayList lore) {
+ letter = Character.toUpperCase(letter);
+
+ return switch (letterType) {
+ case WOODEN -> getWoodenLetterHead(letter, headName, lore);
+ case STONE -> getStoneLetterHead(letter, headName, lore);
+ };
+ }
+
+ public static ItemStack getWoodenLetterHead(char letter, String headName, ArrayList lore) {
+ HeadTexture texture = switch (letter) {
+ case 'A' -> HeadTexture.WOODEN_LETTER_A;
+ case 'B' -> HeadTexture.WOODEN_LETTER_B;
+ case 'C' -> HeadTexture.WOODEN_LETTER_C;
+ case 'D' -> HeadTexture.WOODEN_LETTER_D;
+ case 'E' -> HeadTexture.WOODEN_LETTER_E;
+ case 'F' -> HeadTexture.WOODEN_LETTER_F;
+ case 'G' -> HeadTexture.WOODEN_LETTER_G;
+ case 'H' -> HeadTexture.WOODEN_LETTER_H;
+ case 'I' -> HeadTexture.WOODEN_LETTER_I;
+ case 'J' -> HeadTexture.WOODEN_LETTER_J;
+ case 'K' -> HeadTexture.WOODEN_LETTER_K;
+ case 'L' -> HeadTexture.WOODEN_LETTER_L;
+ case 'M' -> HeadTexture.WOODEN_LETTER_M;
+ case 'N' -> HeadTexture.WOODEN_LETTER_N;
+ case 'O' -> HeadTexture.WOODEN_LETTER_O;
+ case 'P' -> HeadTexture.WOODEN_LETTER_P;
+ case 'Q' -> HeadTexture.WOODEN_LETTER_Q;
+ case 'R' -> HeadTexture.WOODEN_LETTER_R;
+ case 'S' -> HeadTexture.WOODEN_LETTER_S;
+ case 'T' -> HeadTexture.WOODEN_LETTER_T;
+ case 'U' -> HeadTexture.WOODEN_LETTER_U;
+ case 'V' -> HeadTexture.WOODEN_LETTER_V;
+ case 'W' -> HeadTexture.WOODEN_LETTER_W;
+ case 'X' -> HeadTexture.WOODEN_LETTER_X;
+ case 'Y' -> HeadTexture.WOODEN_LETTER_Y;
+ case 'Z' -> HeadTexture.WOODEN_LETTER_Z;
+ default -> HeadTexture.WOODEN_LETTER_QUESTION_MARK;
+ };
+
+ return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
+ }
+
+ public static ItemStack getStoneLetterHead(char letter, String headName, ArrayList lore) {
+ HeadTexture texture = switch (letter) {
+ case 'A' -> HeadTexture.STONE_LETTER_A;
+ case 'B' -> HeadTexture.STONE_LETTER_B;
+ case 'C' -> HeadTexture.STONE_LETTER_C;
+ case 'D' -> HeadTexture.STONE_LETTER_D;
+ case 'E' -> HeadTexture.STONE_LETTER_E;
+ case 'F' -> HeadTexture.STONE_LETTER_F;
+ case 'G' -> HeadTexture.STONE_LETTER_G;
+ case 'H' -> HeadTexture.STONE_LETTER_H;
+ case 'I' -> HeadTexture.STONE_LETTER_I;
+ case 'J' -> HeadTexture.STONE_LETTER_J;
+ case 'K' -> HeadTexture.STONE_LETTER_K;
+ case 'L' -> HeadTexture.STONE_LETTER_L;
+ case 'M' -> HeadTexture.STONE_LETTER_M;
+ case 'N' -> HeadTexture.STONE_LETTER_N;
+ case 'O' -> HeadTexture.STONE_LETTER_O;
+ case 'P' -> HeadTexture.STONE_LETTER_P;
+ case 'Q' -> HeadTexture.STONE_LETTER_Q;
+ case 'R' -> HeadTexture.STONE_LETTER_R;
+ case 'S' -> HeadTexture.STONE_LETTER_S;
+ case 'T' -> HeadTexture.STONE_LETTER_T;
+ case 'U' -> HeadTexture.STONE_LETTER_U;
+ case 'V' -> HeadTexture.STONE_LETTER_V;
+ case 'W' -> HeadTexture.STONE_LETTER_W;
+ case 'X' -> HeadTexture.STONE_LETTER_X;
+ case 'Y' -> HeadTexture.STONE_LETTER_Y;
+ case 'Z' -> HeadTexture.STONE_LETTER_Z;
+ default -> HeadTexture.STONE_LETTER_QUESTION_MARK;
+ };
+
+ return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
+ }
+
+
+}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java
new file mode 100644
index 00000000..4b489729
--- /dev/null
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java
@@ -0,0 +1,6 @@
+package net.buildtheearth.buildteamtools.utils.heads;
+
+public enum LetterType {
+ WOODEN,
+ STONE;
+}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
index 94d30121..0e5f6b6b 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
@@ -3,7 +3,9 @@
import com.alpsbte.alpslib.utils.item.Item;
import com.cryptomorin.xseries.XMaterial;
import net.buildtheearth.buildteamtools.BuildTeamTools;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
@@ -105,15 +107,15 @@ protected Player getMenuPlayer() {
* @param maxValue Maximum value of the slider
* @param valueType Type of the value (e.g. "m", "°C", "°F", "blocks", "chunks", "seconds", "minutes", "hours", "days", "weeks", "months", "years", ...)
*/
- protected void createCounter(CustomHeads.SliderColor sliderColor, int sliderItemSlot, String sliderName, int value, int minValue, int maxValue, String valueType){
+ protected void createCounter(HeadColorScheme sliderColor, int sliderItemSlot, String sliderName, int value, int minValue, int maxValue, String valueType){
// Set previous page item
- getMenu().getSlot(sliderItemSlot - 1).setItem(CustomHeads.getCounterMinusItem(sliderColor, sliderName, value, minValue));
+ getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getCounterMinusItem(sliderColor, sliderName, value, minValue));
// Set current page item
- getMenu().getSlot(sliderItemSlot).setItem(CustomHeads.getCounterCurrentValueItem(sliderColor, sliderName, value, valueType));
+ getMenu().getSlot(sliderItemSlot).setItem(HeadUtil.getCounterCurrentValueItem(sliderColor, sliderName, value, valueType));
// Set next page item
- getMenu().getSlot(sliderItemSlot + 1).setItem(CustomHeads.getCounterPlusItem(sliderColor, sliderName, value, maxValue));
+ getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getCounterPlusItem(sliderColor, sliderName, value, maxValue));
}
/**
@@ -126,31 +128,31 @@ protected void createCounter(CustomHeads.SliderColor sliderColor, int sliderItem
* @param sliderName Name of the slider
* @param current Current block item
*/
- protected void setChoiceItems(CustomHeads.SliderColor sliderColor, int sliderItemSlot, String sliderName, ItemStack current){
+ protected void setChoiceItems(HeadColorScheme sliderColor, int sliderItemSlot, String sliderName, ItemStack current){
sliderName = "§e" + sliderName;
if(current == null) {
// Set previous page item
- getMenu().getSlot(sliderItemSlot - 1).setItem(CustomHeads.getBlankItem(sliderColor, sliderName + ": §c§lOFF"));
+ getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getBlankItem(sliderColor, sliderName + ": §c§lOFF"));
// Set current page item
getMenu().getSlot(sliderItemSlot).setItem(Item.create(XMaterial.BARRIER.parseMaterial(), sliderName + ": §c§lOFF"));
// Set next page item
- getMenu().getSlot(sliderItemSlot + 1).setItem(CustomHeads.getBlankItem(sliderColor, sliderName + ": §c§lOFF"));
+ getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getBlankItem(sliderColor, sliderName + ": §c§lOFF"));
}else{
ItemMeta meta = current.getItemMeta();
meta.setDisplayName(sliderName);
current.setItemMeta(meta);
// Set previous page item
- getMenu().getSlot(sliderItemSlot - 1).setItem(CustomHeads.getXItem(sliderColor, "§cDisable " + sliderName));
+ getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getXItem(sliderColor, "§cDisable " + sliderName));
// Set current page item
getMenu().getSlot(sliderItemSlot).setItem(current);
// Set next page item
- getMenu().getSlot(sliderItemSlot + 1).setItem(CustomHeads.getXItem(sliderColor, "§cDisable " + sliderName));
+ getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getXItem(sliderColor, "§cDisable " + sliderName));
}
}
@@ -159,7 +161,7 @@ protected void setChoiceItems(CustomHeads.SliderColor sliderColor, int sliderIte
* @param slot Slot of the back item
*/
protected void setBackItem(int slot, AbstractMenu backMenu){
- getMenu().getSlot(slot).setItem(CustomHeads.getBackItem());
+ getMenu().getSlot(slot).setItem(Item.createCustomHeadBase64(HeadTexture.WHITE_BACKWARD.getBase64(), "§eBack", null));
getMenu().getSlot(slot).setClickHandler((clickPlayer, clickInformation) -> Bukkit.getScheduler().scheduleSyncDelayedTask(BuildTeamTools.getInstance(), () -> {
clickPlayer.closeInventory();
backMenu.reloadMenuAsync();
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
index b6eb6ae1..42246644 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
@@ -1,10 +1,12 @@
package net.buildtheearth.buildteamtools.utils.menus;
+import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.BuildTeamTools;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
+import org.bukkit.inventory.ItemStack;
import java.util.List;
@@ -122,6 +124,33 @@ private int getMaxIndex() {
return (currentPage + 1) * maxItemsPerPage;
}
+ /**
+ * @return The current page item.
+ */
+ private ItemStack getCurrentPageItem() {
+ return HeadTexture.getWhiteNumberHead(currentPage, "§eCurrent Page §7- §f" + (currentPage), null);
+ }
+
+ /**
+ * @return The previous page item.
+ */
+ private ItemStack getPreviousPageItem() {
+ if (currentPage <= 1)
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
+
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_ARROW_LEFT.getBase64(), "§ePrevious Page §7- §f" + (currentPage - 1), null);
+ }
+
+ /**
+ * @return The next page item.
+ */
+ private ItemStack getNextPageItem() {
+ if (!hasNextPage())
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
+
+ return Item.createCustomHeadBase64(HeadTexture.WHITE_ARROW_RIGHT.getBase64(), "§eNext Page §7- §f" + (currentPage + 1), null);
+ }
+
/**
* @param reloadSources if true, reload the source collection for the inventory items
@@ -152,13 +181,13 @@ protected void setSwitchPageItems(int switchPageItemSlot){
int currentPage = getPage();
// Set previous page item
- getMenu().getSlot(switchPageItemSlot - 1).setItem(CustomHeads.getPreviousPageItem(currentPage));
+ getMenu().getSlot(switchPageItemSlot - 1).setItem(getPreviousPageItem());
// Set current page item
- getMenu().getSlot(switchPageItemSlot).setItem(CustomHeads.getCurrentPageItem(currentPage));
+ getMenu().getSlot(switchPageItemSlot).setItem(getCurrentPageItem());
// Set next page item
- getMenu().getSlot(switchPageItemSlot + 1).setItem(CustomHeads.getNextPageItem(currentPage, hasNextPage()));
+ getMenu().getSlot(switchPageItemSlot + 1).setItem(getNextPageItem());
}
protected void setSwitchPageItemClickEvents(int switchPageItemSlot){
@@ -178,4 +207,5 @@ protected void setSwitchPageItemClickEvents(int switchPageItemSlot){
}
});
}
+
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
index ab11dd81..9390204e 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
@@ -1,7 +1,7 @@
package net.buildtheearth.buildteamtools.utils.menus;
import com.alpsbte.alpslib.utils.item.Item;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -45,7 +45,7 @@ protected void setPreviewItems() {
setSwitchPageItems(SWITCH_PAGE_ITEM_SLOT);
if(canProceed())
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(CustomHeads.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
else
getMenu().getSlot(NEXT_ITEM_SLOT).setItem(MenuItems.ITEM_BACKGROUND);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
index 195b74bd..951243c3 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
@@ -1,7 +1,7 @@
package net.buildtheearth.buildteamtools.utils.menus;
import com.alpsbte.alpslib.utils.item.Item;
-import net.buildtheearth.buildteamtools.utils.CustomHeads;
+import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import org.apache.commons.lang3.tuple.MutablePair;
import org.bukkit.enchantments.Enchantment;
@@ -47,7 +47,7 @@ protected void setPreviewItems() {
setSwitchPageItems(SWITCH_PAGE_ITEM_SLOT);
if (canProceed())
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(CustomHeads.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
else
getMenu().getSlot(NEXT_ITEM_SLOT).setItem(MenuItems.ITEM_BACKGROUND);
From 4436d18a72babe568278e537ba9bdf0d0205edb6 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 22:23:14 +0200
Subject: [PATCH 06/14] refactor(utils): Remove unused raycasting code.
---
.../buildteamtools/utils/raycast/Raycast.java | 262 ------------------
.../utils/raycast/RaycastAPIMath.java | 73 -----
2 files changed, 335 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java b/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java
deleted file mode 100644
index bd68a22c..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/Raycast.java
+++ /dev/null
@@ -1,262 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.raycast;
-
-import com.cryptomorin.xseries.XMaterial;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.Particle;
-import org.bukkit.World;
-import org.bukkit.block.Block;
-import org.bukkit.entity.Entity;
-import org.bukkit.util.Vector;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class Raycast {
- private final double divider = 100.0D;
-
- private ArrayList passthroughMaterials = new ArrayList<>();
-
- private final ArrayList testedLocations = new ArrayList<>();
-
- private World world;
-
- private double x;
-
- private double y;
-
- private double z;
-
- private double yaw;
-
- private double pitch;
-
- private double size;
-
- private RaycastType rayCastType;
-
- private Entity hurtEntity;
-
- private Block hurtBlock;
-
- private Location hurtLocation;
-
- private boolean showRayCast = false;
-
- private Entity owner;
-
- private Location rayCastLocation;
-
- public Raycast(Location loc, double size) {
- this(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), size);
- }
-
- public Raycast(World world, double x, double y, double z, double yaw, double pitch, double size) {
- addPassthroughMaterial(XMaterial.AIR.parseMaterial());
- this.world = world;
- this.x = x;
- this.y = y;
- this.z = z;
- this.yaw = yaw;
- this.pitch = pitch;
- this.size = size;
- }
-
- public boolean compute(RaycastType rayCastType) {
- this.testedLocations.clear();
- int length = 0;
- computeLocation(new Vector(0.0D, 0.0D, length + 50.0D));
- if (rayCastType == RaycastType.BLOCK) {
- this.rayCastType = RaycastType.BLOCK;
- while (this.passthroughMaterials.contains(this.rayCastLocation.getBlock().getType()) && length <= this.size * 100.0D) {
- this.testedLocations.add(this.rayCastLocation);
- length++;
- computeLocation(new Vector(0.0D, 0.0D, length + 50.0D));
- if (this.showRayCast)
- this.world.spawnParticle(Particle.CLOUD, this.rayCastLocation.getX(), this.rayCastLocation.getY(), this.rayCastLocation.getZ(), 0, 0.0D, 0.0D, 0.0D);
- }
- if (!this.passthroughMaterials.contains(this.rayCastLocation.getBlock().getType())) {
- this.hurtBlock = this.rayCastLocation.getBlock();
- this.hurtLocation = this.rayCastLocation;
- return true;
- }
- } else if (rayCastType == RaycastType.ENTITY) {
- this.rayCastType = RaycastType.ENTITY;
- Collection entities = this.world.getNearbyEntities(this.rayCastLocation, 0.01D, 0.01D, 0.01D);
- while ((entities.size() <= 0 || entities.contains(this.owner)) && length <= this.size * 100.0D) {
- this.testedLocations.add(this.rayCastLocation);
- length++;
- computeLocation(new Vector(0.0D, 0.0D, length + 50.0D));
- entities = this.world.getNearbyEntities(this.rayCastLocation, 0.01D, 0.01D, 0.01D);
- if (this.showRayCast)
- this.world.spawnParticle(Particle.CLOUD, this.rayCastLocation.getX(), this.rayCastLocation.getY(), this.rayCastLocation.getZ(), 0, 0.0D, 0.0D, 0.0D);
- }
- if (!entities.isEmpty()) {
- for (Entity entity : entities) {
- this.hurtEntity = entity;
- this.hurtLocation = this.rayCastLocation;
- }
- return true;
- }
- } else if (rayCastType == RaycastType.ENTITY_AND_BLOCK) {
- Collection entities = this.world.getNearbyEntities(this.rayCastLocation, 0.01D, 0.01D, 0.01D);
- while (this.passthroughMaterials.contains(this.rayCastLocation.getBlock().getType()) && (entities.size() <= 0 || entities.contains(this.owner)) && length <= this.size * 100.0D) {
- this.testedLocations.add(this.rayCastLocation);
- length++;
- computeLocation(new Vector(0.0D, 0.0D, length + 50.0D));
- entities = this.world.getNearbyEntities(this.rayCastLocation, 0.01D, 0.01D, 0.01D);
- if (this.showRayCast)
- this.world.spawnParticle(Particle.CLOUD, this.rayCastLocation.getX(), this.rayCastLocation.getY(), this.rayCastLocation.getZ(), 0, 0.0D, 0.0D, 0.0D);
- }
- if (!this.passthroughMaterials.contains(this.rayCastLocation.getBlock().getType())) {
- this.rayCastType = RaycastType.BLOCK;
- this.hurtBlock = this.rayCastLocation.getBlock();
- this.hurtLocation = this.rayCastLocation;
- return true;
- }
- if (!entities.isEmpty()) {
- this.rayCastType = RaycastType.ENTITY;
- for (Entity entity : entities) {
- this.hurtEntity = entity;
- this.hurtLocation = this.rayCastLocation;
- }
- return true;
- }
- }
- return false;
- }
-
- private void computeLocation(Vector rayCastPos) {
- rayCastPos = RaycastAPIMath.rotate(rayCastPos, this.yaw, this.pitch);
- this.rayCastLocation = (new Location(this.world, this.x, this.y, this.z)).clone().add(rayCastPos.getX() / 100.0D, rayCastPos.getY() / 100.0D, rayCastPos.getZ() / 100.0D);
- }
-
- public ArrayList getPassthroughMaterials() {
- return this.passthroughMaterials;
- }
-
- public void setPassthroughMaterials(ArrayList passthroughMaterials) {
- this.passthroughMaterials = passthroughMaterials;
- }
-
- public void addPassthroughMaterial(Material mat) {
- if (!this.passthroughMaterials.contains(mat))
- this.passthroughMaterials.add(mat);
- }
-
- public ArrayList getTestedLocations() {
- return this.testedLocations;
- }
-
- public World getWorld() {
- return this.world;
- }
-
- public void setWorld(World world) {
- this.world = world;
- }
-
- public double getX() {
- return this.x;
- }
-
- public void setX(double x) {
- this.x = x;
- }
-
- public double getY() {
- return this.y;
- }
-
- public void setY(double y) {
- this.y = y;
- }
-
- public double getZ() {
- return this.z;
- }
-
- public void setZ(double z) {
- this.z = z;
- }
-
- public double getYaw() {
- return this.yaw;
- }
-
- public void setYaw(double yaw) {
- this.yaw = yaw;
- }
-
- public double getPitch() {
- return this.pitch;
- }
-
- public void setPitch(double pitch) {
- this.pitch = pitch;
- }
-
- public double getSize() {
- return this.size;
- }
-
- public void setSize(double size) {
- this.size = size;
- }
-
- public RaycastType getRayCastType() {
- return this.rayCastType;
- }
-
- public void setRayCastType(RaycastType rayCastType) {
- this.rayCastType = rayCastType;
- }
-
- public Entity getHurtEntity() {
- return this.hurtEntity;
- }
-
- public void setHurtEntity(Entity hurtEntity) {
- this.hurtEntity = hurtEntity;
- }
-
- public Block getHurtBlock() {
- return this.hurtBlock;
- }
-
- public void setHurtBlock(Block hurtBlock) {
- this.hurtBlock = hurtBlock;
- }
-
- public Location getHurtLocation() {
- return this.hurtLocation;
- }
-
- public void setHurtLocation(Location hurtLocation) {
- this.hurtLocation = hurtLocation;
- }
-
- public boolean isShowRayCast() {
- return this.showRayCast;
- }
-
- public void setShowRayCast(boolean showRayCast) {
- this.showRayCast = showRayCast;
- }
-
- public double getDivider() {
- return 100.0D;
- }
-
- public Entity getOwner() {
- return this.owner;
- }
-
- public void setOwner(Entity owner) {
- this.owner = owner;
- }
-
- public enum RaycastType {
- ENTITY_AND_BLOCK, ENTITY, BLOCK
- }
-}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java b/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java
deleted file mode 100644
index 17f2c3a9..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/raycast/RaycastAPIMath.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.raycast;
-
-import org.bukkit.util.Vector;
-
-public class RaycastAPIMath {
- public static double cos(double a) {
- return Math.cos(a);
- }
-
- public static double sin(double a) {
- return Math.sin(a);
- }
-
- public static double tan(double a) {
- return Math.tan(a);
- }
-
- public static double arccos(double a) {
- return Math.acos(a);
- }
-
- public static double arcsin(double a) {
- return Math.asin(a);
- }
-
- public static double arctan(double a) {
- return Math.atan(a);
- }
-
- public static double toRadians(double angdeg) {
- return Math.toRadians(angdeg);
- }
-
- public static double toDeg(double angrad) {
- return Math.toDegrees(angrad);
- }
-
- public static double getAngle(double width, double height) {
- if (width < 0.0D)
- width *= -1.0D;
- if (height < 0.0D)
- height *= -1.0D;
- if (width == 0.0D || height == 0.0D)
- return 0.0D;
- return arctan(height / width);
- }
-
- public static Vector rotate(Vector vect, double yaw, double pitch) {
- yaw = toRadians(yaw);
- pitch = toRadians(pitch);
- vect = rotateX(vect, pitch);
- vect = rotateY(vect, -yaw);
- return vect;
- }
-
- public static Vector rotateX(Vector vect, double a) {
- double y = cos(a) * vect.getY() - sin(a) * vect.getZ();
- double z = sin(a) * vect.getY() + cos(a) * vect.getZ();
- return vect.setY(y).setZ(z);
- }
-
- public static Vector rotateY(Vector vect, double b) {
- double x = cos(b) * vect.getX() + sin(b) * vect.getZ();
- double z = -sin(b) * vect.getX() + cos(b) * vect.getZ();
- return vect.setX(x).setZ(z);
- }
-
- public static Vector rotateZ(Vector vect, double c) {
- double x = cos(c) * vect.getX() - sin(c) * vect.getY();
- double y = sin(c) * vect.getX() + cos(c) * vect.getY();
- return vect.setX(x).setY(y);
- }
-}
From 2352c8b2206718b2ef92e59d5ec183e98485cc04 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 23:15:35 +0200
Subject: [PATCH 07/14] refactor(utils): Introduce HeadFactory.java
---
.../house/menu/AdvancedSettingsMenu.java | 4 +-
.../road/menu/AdvancedSettingsMenu.java | 4 +-
.../warps/menu/MaterialSelectionMenu.java | 3 +-
.../components/warps/menu/WarpEditMenu.java | 7 +-
.../warps/menu/WarpGroupEditMenu.java | 7 +-
.../components/warps/model/Warp.java | 9 +-
.../components/warps/model/WarpGroup.java | 9 +-
.../buildteamtools/utils/HeadUtil.java | 19 ---
.../utils/heads/HeadFactory.java | 49 +++++++
.../utils/heads/HeadTexture.java | 136 ------------------
.../utils/menus/AbstractMenu.java | 7 +-
.../utils/menus/AbstractPaginatedMenu.java | 4 +-
.../utils/menus/BlockListMenu.java | 4 +-
.../utils/menus/NameListMenu.java | 4 +-
14 files changed, 89 insertions(+), 177 deletions(-)
create mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
index d93b5d38..8c5a843f 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
@@ -8,6 +8,8 @@
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@@ -56,7 +58,7 @@ protected void setPreviewItems() {
createCounter(HeadColorScheme.WHITE, WINDOW_DISTANCE_SLOT, "Window Distance", windowDistance, 1, 6, "Blocks");
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, "§eNext"));
setBackItem(BACK_ITEM_SLOT, new BaseColorMenu(getMenuPlayer(), false));
super.setPreviewItems();
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
index 9f455a40..1425d833 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
@@ -11,6 +11,8 @@
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@@ -74,7 +76,7 @@ protected void setPreviewItems() {
setChoiceItems(HeadColorScheme.WHITE, SIDEWALK_SLAB_SLOT, "Sidewalk Elevation Slab", sidewalkSlab[0].parseItem());
setChoiceItems(HeadColorScheme.LIGHT_GRAY, STREET_LAMP_TYPE_SLOT, "Street Lamp Type", streetLampType);
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, "§eNext"));
setBackItem(BACK_ITEM_SLOT, new SidewalkColorMenu(getMenuPlayer(), false));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
index 58d7c928..f8f53714 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
@@ -9,6 +9,7 @@
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
@@ -50,7 +51,7 @@ public MaterialSelectionMenu(Player menuPlayer, Object object, boolean alreadyEx
@Override
protected void setMenuItemsAsync() {
getMenu().getSlot(MATERIAL_SLOT).setItem(Item.create(XMaterial.STONE.get(), "§6§lItem", ListUtil.createList("", "Change the material of the warp", "to a minecraft item.", "", "§eExample:", "Stone")));
- getMenu().getSlot(CUSTOM_HEAD_SLOT).setItem(HeadTexture.getLetterHead('?', LetterType.WOODEN, "§6§lCustom Head", ListUtil.createList("", "Change the material of the warp", "to a custom head texture URL.", "", "§eExample:", "https://textures.minecraft.net/texture/...")));
+ getMenu().getSlot(CUSTOM_HEAD_SLOT).setItem(HeadFactory.letter(LetterType.WOODEN, '?', "§6§lCustom Head", ListUtil.createList("", "Change the material of the warp", "to a custom head texture URL.", "", "§eExample:", "https://textures.minecraft.net/texture/...")));
if(object instanceof Warp)
setBackItem(BACK_ITEM_SLOT, new WarpEditMenu(getMenuPlayer(), (Warp) object, alreadyExists, false));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
index 2caf9eb5..499ecb7b 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
@@ -13,6 +13,7 @@
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
@@ -73,7 +74,7 @@ public WarpEditMenu(Player player, Warp warp, boolean alreadyExists, boolean aut
@Override
protected void setMenuItemsAsync() {
// Set the confirmation item
- getMenu().getSlot(CONFIRM_SLOT).setItem(HeadUtil.getCheckmarkItem(alreadyExists ? "§aUpdate" : "§aCreate"));
+ getMenu().getSlot(CONFIRM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, alreadyExists ? "§aUpdate" : "§aCreate"));
// Set the warp item
getMenu().getSlot(WARP_SLOT).setItem(warp.getMaterialItem());
@@ -91,9 +92,9 @@ protected void setMenuItemsAsync() {
// Set the group item
ArrayList groupLore = ListUtil.createList("", "§eCurrent Group: ", warp.getWarpGroup().getName());
- getMenu().getSlot(GROUP_SLOT).setItem(HeadTexture.getLetterHead(
- warp.getWarpGroup().getName().charAt(0),
+ getMenu().getSlot(GROUP_SLOT).setItem(HeadFactory.letter(
LetterType.WOODEN,
+ warp.getWarpGroup().getName().charAt(0),
"§6§lChange Warp Group",
groupLore
));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
index 8b6cdd61..65f3e13b 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
@@ -11,6 +11,7 @@
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
@@ -62,13 +63,13 @@ public WarpGroupEditMenu(Player player, WarpGroup warpGroup, boolean alreadyExis
@Override
protected void setMenuItemsAsync() {
// Set the confirmation item
- getMenu().getSlot(CONFIRM_SLOT).setItem(HeadUtil.getCheckmarkItem(alreadyExists ? "§aUpdate" : "§aCreate"));
+ getMenu().getSlot(CONFIRM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, alreadyExists ? "§aUpdate" : "§aCreate"));
// Set the warp group item
getMenu().getSlot(WARP_GROUP).setItem(
- HeadTexture.getLetterHead(
- warpGroup.getName().charAt(0),
+ HeadFactory.letter(
LetterType.WOODEN,
+ warpGroup.getName().charAt(0),
"§6§l" + warpGroup.getName(),
warpGroup.getDescriptionLore()
)
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
index 14abea47..243142b5 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
@@ -7,6 +7,7 @@
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.Utils;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import org.bukkit.Material;
@@ -80,9 +81,9 @@ public ItemStack getMaterialItem() {
}
if(material == null)
- return HeadTexture.getLetterHead(
- name.charAt(0),
+ return HeadFactory.letter(
LetterType.STONE,
+ name.charAt(0),
itemName,
lore
);
@@ -92,9 +93,9 @@ else if(material.startsWith("http://textures.minecraft.net/texture/"))
Material material = Material.matchMaterial(this.material.split(":")[0]);
if(material == null)
- return HeadTexture.getLetterHead(
- name.charAt(0),
+ return HeadFactory.letter(
LetterType.STONE,
+ name.charAt(0),
itemName,
lore
);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
index f9f0c38a..ea07380a 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
@@ -6,6 +6,7 @@
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import org.bukkit.Material;
@@ -79,9 +80,9 @@ public ItemStack getMaterialItem() {
ArrayList lore = getDescriptionLore();
if(material == null)
- return HeadTexture.getLetterHead(
- name.charAt(0),
+ return HeadFactory.letter(
LetterType.WOODEN,
+ name.charAt(0),
itemName,
lore
);
@@ -91,9 +92,9 @@ else if(material.startsWith("http://textures.minecraft.net/texture/"))
Material matchedMaterial = Material.matchMaterial(this.material.split(":")[0]);
if(matchedMaterial == null)
- return HeadTexture.getLetterHead(
- name.charAt(0),
+ return HeadFactory.letter(
LetterType.STONE,
+ name.charAt(0),
itemName,
lore
);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java b/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
index 8c93c27f..fed2fec7 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
@@ -9,20 +9,6 @@
public class HeadUtil {
- public static ItemStack getCounterCurrentValueItem(HeadColorScheme sliderColor, String name, int value, String valueType) {
- String sliderName = "§e" + name + ": §7§l" + value;
- if (valueType != null)
- sliderName += " " + valueType;
-
- switch (sliderColor) {
- default:
- case WHITE:
- return HeadTexture.getWhiteNumberHead(value, sliderName, null);
- case LIGHT_GRAY:
- return HeadTexture.getLightGrayNumberHead(value, sliderName, null);
- }
- }
-
public static ItemStack getCounterPlusItem(HeadColorScheme sliderColor, String name, int value, int maxValue) {
if (value >= maxValue)
switch (sliderColor) {
@@ -78,9 +64,4 @@ public static ItemStack getBlankItem(HeadColorScheme sliderColor, String name) {
return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), name, null);
}
}
-
- public static ItemStack getCheckmarkItem(String name) {
- return Item.createCustomHeadBase64(HeadTexture.CHECKMARK.getBase64(), name, null);
- }
-
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
new file mode 100644
index 00000000..f5120873
--- /dev/null
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
@@ -0,0 +1,49 @@
+package net.buildtheearth.buildteamtools.utils.heads;
+
+import com.alpsbte.alpslib.utils.item.Item;
+import org.bukkit.inventory.ItemStack;
+
+import java.util.ArrayList;
+
+public class HeadFactory {
+
+ public static ItemStack head(HeadTexture headTexture, String name, ArrayList lore) {
+ return Item.createCustomHeadBase64(headTexture.getBase64(), name, lore);
+ }
+
+ public static ItemStack head(HeadTexture headTexture, String name) {
+ return Item.createCustomHeadBase64(headTexture.getBase64(), name, null);
+ }
+
+ public static ItemStack number(HeadColorScheme color, int value, String name, ArrayList lore) {
+ String key = color.name() + "_" + value;
+ HeadTexture texture;
+
+ try {
+ texture = HeadTexture.valueOf(key);
+ } catch (IllegalArgumentException e) {
+ texture = HeadTexture.valueOf(color.name() + "_BLANK");
+ }
+ return Item.createCustomHeadBase64(texture.getBase64(), name, lore);
+ }
+
+ public static ItemStack number(HeadColorScheme color, int value, String name) {
+ return number(color, value, name, null);
+ }
+
+ public static ItemStack letter(LetterType type, char letter, String name, ArrayList lore) {
+ String key = type.name() + "_LETTER_" + Character.toUpperCase(letter);
+ HeadTexture texture;
+
+ try {
+ texture = HeadTexture.valueOf(key);
+ } catch (Exception e) {
+ texture = HeadTexture.valueOf(type.name() + "_LETTER_QUESTION_MARK");
+ }
+ return Item.createCustomHeadBase64(texture.getBase64(), name, lore);
+ }
+
+ public static ItemStack letter(LetterType type, char letter, String name) {
+ return letter(type, letter, name, null);
+ }
+}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
index b9962551..02531267 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
@@ -138,140 +138,4 @@ public enum HeadTexture {
this.base64 = base64;
}
- public static ItemStack getWhiteNumberHead(int number, String headName, ArrayList lore) {
- HeadTexture texture = switch (number) {
- case 0 -> HeadTexture.WHITE_0;
- case 1 -> HeadTexture.WHITE_1;
- case 2 -> HeadTexture.WHITE_2;
- case 3 -> HeadTexture.WHITE_3;
- case 4 -> HeadTexture.WHITE_4;
- case 5 -> HeadTexture.WHITE_5;
- case 6 -> HeadTexture.WHITE_6;
- case 7 -> HeadTexture.WHITE_7;
- case 8 -> HeadTexture.WHITE_8;
- case 9 -> HeadTexture.WHITE_9;
- case 10 -> HeadTexture.WHITE_10;
- case 11 -> HeadTexture.WHITE_11;
- case 12 -> HeadTexture.WHITE_12;
- case 13 -> HeadTexture.WHITE_13;
- case 14 -> HeadTexture.WHITE_14;
- case 15 -> HeadTexture.WHITE_15;
- case 16 -> HeadTexture.WHITE_16;
- case 17 -> HeadTexture.WHITE_17;
- case 18 -> HeadTexture.WHITE_18;
- case 19 -> HeadTexture.WHITE_19;
- case 20 -> HeadTexture.WHITE_20;
- default -> HeadTexture.WHITE_BLANK;
- };
-
- return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
- }
-
- public static ItemStack getLightGrayNumberHead(int number, String headName, ArrayList lore) {
- HeadTexture texture = switch (number) {
- case 0 -> HeadTexture.LIGHT_GRAY_0;
- case 1 -> HeadTexture.LIGHT_GRAY_1;
- case 2 -> HeadTexture.LIGHT_GRAY_2;
- case 3 -> HeadTexture.LIGHT_GRAY_3;
- case 4 -> HeadTexture.LIGHT_GRAY_4;
- case 5 -> HeadTexture.LIGHT_GRAY_5;
- case 6 -> HeadTexture.LIGHT_GRAY_6;
- case 7 -> HeadTexture.LIGHT_GRAY_7;
- case 8 -> HeadTexture.LIGHT_GRAY_8;
- case 9 -> HeadTexture.LIGHT_GRAY_9;
- case 10 -> HeadTexture.LIGHT_GRAY_10;
- case 11 -> HeadTexture.LIGHT_GRAY_11;
- case 12 -> HeadTexture.LIGHT_GRAY_12;
- case 13 -> HeadTexture.LIGHT_GRAY_13;
- case 14 -> HeadTexture.LIGHT_GRAY_14;
- case 15 -> HeadTexture.LIGHT_GRAY_15;
- case 16 -> HeadTexture.LIGHT_GRAY_16;
- case 17 -> HeadTexture.LIGHT_GRAY_17;
- case 18 -> HeadTexture.LIGHT_GRAY_18;
- case 19 -> HeadTexture.LIGHT_GRAY_19;
- case 20 -> HeadTexture.LIGHT_GRAY_20;
- default -> HeadTexture.LIGHT_GRAY_BLANK;
- };
-
- return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
- }
-
- public static ItemStack getLetterHead(char letter, LetterType letterType, String headName, ArrayList lore) {
- letter = Character.toUpperCase(letter);
-
- return switch (letterType) {
- case WOODEN -> getWoodenLetterHead(letter, headName, lore);
- case STONE -> getStoneLetterHead(letter, headName, lore);
- };
- }
-
- public static ItemStack getWoodenLetterHead(char letter, String headName, ArrayList lore) {
- HeadTexture texture = switch (letter) {
- case 'A' -> HeadTexture.WOODEN_LETTER_A;
- case 'B' -> HeadTexture.WOODEN_LETTER_B;
- case 'C' -> HeadTexture.WOODEN_LETTER_C;
- case 'D' -> HeadTexture.WOODEN_LETTER_D;
- case 'E' -> HeadTexture.WOODEN_LETTER_E;
- case 'F' -> HeadTexture.WOODEN_LETTER_F;
- case 'G' -> HeadTexture.WOODEN_LETTER_G;
- case 'H' -> HeadTexture.WOODEN_LETTER_H;
- case 'I' -> HeadTexture.WOODEN_LETTER_I;
- case 'J' -> HeadTexture.WOODEN_LETTER_J;
- case 'K' -> HeadTexture.WOODEN_LETTER_K;
- case 'L' -> HeadTexture.WOODEN_LETTER_L;
- case 'M' -> HeadTexture.WOODEN_LETTER_M;
- case 'N' -> HeadTexture.WOODEN_LETTER_N;
- case 'O' -> HeadTexture.WOODEN_LETTER_O;
- case 'P' -> HeadTexture.WOODEN_LETTER_P;
- case 'Q' -> HeadTexture.WOODEN_LETTER_Q;
- case 'R' -> HeadTexture.WOODEN_LETTER_R;
- case 'S' -> HeadTexture.WOODEN_LETTER_S;
- case 'T' -> HeadTexture.WOODEN_LETTER_T;
- case 'U' -> HeadTexture.WOODEN_LETTER_U;
- case 'V' -> HeadTexture.WOODEN_LETTER_V;
- case 'W' -> HeadTexture.WOODEN_LETTER_W;
- case 'X' -> HeadTexture.WOODEN_LETTER_X;
- case 'Y' -> HeadTexture.WOODEN_LETTER_Y;
- case 'Z' -> HeadTexture.WOODEN_LETTER_Z;
- default -> HeadTexture.WOODEN_LETTER_QUESTION_MARK;
- };
-
- return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
- }
-
- public static ItemStack getStoneLetterHead(char letter, String headName, ArrayList lore) {
- HeadTexture texture = switch (letter) {
- case 'A' -> HeadTexture.STONE_LETTER_A;
- case 'B' -> HeadTexture.STONE_LETTER_B;
- case 'C' -> HeadTexture.STONE_LETTER_C;
- case 'D' -> HeadTexture.STONE_LETTER_D;
- case 'E' -> HeadTexture.STONE_LETTER_E;
- case 'F' -> HeadTexture.STONE_LETTER_F;
- case 'G' -> HeadTexture.STONE_LETTER_G;
- case 'H' -> HeadTexture.STONE_LETTER_H;
- case 'I' -> HeadTexture.STONE_LETTER_I;
- case 'J' -> HeadTexture.STONE_LETTER_J;
- case 'K' -> HeadTexture.STONE_LETTER_K;
- case 'L' -> HeadTexture.STONE_LETTER_L;
- case 'M' -> HeadTexture.STONE_LETTER_M;
- case 'N' -> HeadTexture.STONE_LETTER_N;
- case 'O' -> HeadTexture.STONE_LETTER_O;
- case 'P' -> HeadTexture.STONE_LETTER_P;
- case 'Q' -> HeadTexture.STONE_LETTER_Q;
- case 'R' -> HeadTexture.STONE_LETTER_R;
- case 'S' -> HeadTexture.STONE_LETTER_S;
- case 'T' -> HeadTexture.STONE_LETTER_T;
- case 'U' -> HeadTexture.STONE_LETTER_U;
- case 'V' -> HeadTexture.STONE_LETTER_V;
- case 'W' -> HeadTexture.STONE_LETTER_W;
- case 'X' -> HeadTexture.STONE_LETTER_X;
- case 'Y' -> HeadTexture.STONE_LETTER_Y;
- case 'Z' -> HeadTexture.STONE_LETTER_Z;
- default -> HeadTexture.STONE_LETTER_QUESTION_MARK;
- };
-
- return Item.createCustomHeadBase64(texture.getBase64(), headName, lore);
- }
-
-
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
index 0e5f6b6b..c3eb3335 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
@@ -4,6 +4,7 @@
import com.cryptomorin.xseries.XMaterial;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.kyori.adventure.text.Component;
@@ -112,8 +113,10 @@ protected void createCounter(HeadColorScheme sliderColor, int sliderItemSlot, St
getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getCounterMinusItem(sliderColor, sliderName, value, minValue));
// Set current page item
- getMenu().getSlot(sliderItemSlot).setItem(HeadUtil.getCounterCurrentValueItem(sliderColor, sliderName, value, valueType));
-
+ String currentCounterName = "§e" + sliderName + ": §7§l" + value;
+ if (valueType != null)
+ currentCounterName += " " + valueType;
+ getMenu().getSlot(sliderItemSlot).setItem(HeadFactory.number(sliderColor, value, currentCounterName));
// Set next page item
getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getCounterPlusItem(sliderColor, sliderName, value, maxValue));
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
index 42246644..13b5f2c9 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
@@ -2,6 +2,8 @@
import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.BuildTeamTools;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
@@ -128,7 +130,7 @@ private int getMaxIndex() {
* @return The current page item.
*/
private ItemStack getCurrentPageItem() {
- return HeadTexture.getWhiteNumberHead(currentPage, "§eCurrent Page §7- §f" + (currentPage), null);
+ return HeadFactory.number(HeadColorScheme.WHITE, currentPage, "§eCurrent Page §7- §f" + (currentPage));
}
/**
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
index 9390204e..95a56106 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
@@ -3,6 +3,8 @@
import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@@ -45,7 +47,7 @@ protected void setPreviewItems() {
setSwitchPageItems(SWITCH_PAGE_ITEM_SLOT);
if(canProceed())
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, "§eNext"));
else
getMenu().getSlot(NEXT_ITEM_SLOT).setItem(MenuItems.ITEM_BACKGROUND);
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
index 951243c3..b459e530 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
@@ -3,6 +3,8 @@
import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
+import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import org.apache.commons.lang3.tuple.MutablePair;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
@@ -47,7 +49,7 @@ protected void setPreviewItems() {
setSwitchPageItems(SWITCH_PAGE_ITEM_SLOT);
if (canProceed())
- getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadUtil.getCheckmarkItem("§eNext"));
+ getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, "§eNext"));
else
getMenu().getSlot(NEXT_ITEM_SLOT).setItem(MenuItems.ITEM_BACKGROUND);
From 4bf3af2b5e6e4e61c08426f12b5161b88b8a5ca3 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 23:50:25 +0200
Subject: [PATCH 08/14] refactor(utils): Finish reworking head code.
---
.../house/menu/AdvancedSettingsMenu.java | 15 +-
.../road/menu/AdvancedSettingsMenu.java | 19 +--
.../warps/menu/MaterialSelectionMenu.java | 2 -
.../components/warps/menu/WarpEditMenu.java | 1 -
.../warps/menu/WarpGroupEditMenu.java | 1 -
.../components/warps/menu/WarpGroupMenu.java | 7 +-
.../components/warps/menu/WarpMenu.java | 4 +-
.../components/warps/model/Warp.java | 2 -
.../components/warps/model/WarpGroup.java | 2 -
.../modules/stats/menu/StatsMenu.java | 6 +-
.../buildteamtools/utils/HeadUtil.java | 67 --------
.../{HeadColorScheme.java => HeadColor.java} | 2 +-
.../utils/heads/HeadFactory.java | 157 +++++++++++++++++-
.../utils/menus/AbstractMenu.java | 21 ++-
.../utils/menus/AbstractPaginatedMenu.java | 12 +-
.../utils/menus/BlockListMenu.java | 1 -
.../utils/menus/NameListMenu.java | 1 -
17 files changed, 194 insertions(+), 126 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
rename src/main/java/net/buildtheearth/buildteamtools/utils/heads/{HeadColorScheme.java => HeadColor.java} (73%)
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
index 8c5a843f..658d5167 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/house/menu/AdvancedSettingsMenu.java
@@ -5,9 +5,8 @@
import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseFlag;
import net.buildtheearth.buildteamtools.modules.generator.components.house.HouseSettings;
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
-import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColor;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
@@ -50,12 +49,12 @@ protected void setPreviewItems() {
this.windowHeight = (int) house.getPlayerSettings().get(uuid).getValues().get(HouseFlag.WINDOW_HEIGHT);
this.windowDistance = (int) house.getPlayerSettings().get(uuid).getValues().get(HouseFlag.WINDOW_DISTANCE);
- createCounter(HeadColorScheme.WHITE, FLOOR_COUNT_SLOT, "Number of Floors", floorCount, 1, 10, "Floors");
- createCounter(HeadColorScheme.LIGHT_GRAY, FLOOR_HEIGHT_SLOT, "Floors Height", floorHeight, 1, 10, "Blocks");
- createCounter(HeadColorScheme.WHITE, BASE_HEIGHT_SLOT, "Basement Height", baseHeight, 0, 10, "Blocks");
- createCounter(HeadColorScheme.WHITE, WINDOW_WIDTH_SLOT, "Window Width", windowWidth, 1, 5, "Blocks");
- createCounter(HeadColorScheme.LIGHT_GRAY, WINDOW_HEIGHT_SLOT, "Window Height", windowHeight, 1, 5, "Blocks");
- createCounter(HeadColorScheme.WHITE, WINDOW_DISTANCE_SLOT, "Window Distance", windowDistance, 1, 6, "Blocks");
+ createCounter(HeadColor.WHITE, FLOOR_COUNT_SLOT, "Number of Floors", floorCount, 1, 10, "Floors");
+ createCounter(HeadColor.LIGHT_GRAY, FLOOR_HEIGHT_SLOT, "Floors Height", floorHeight, 1, 10, "Blocks");
+ createCounter(HeadColor.WHITE, BASE_HEIGHT_SLOT, "Basement Height", baseHeight, 0, 10, "Blocks");
+ createCounter(HeadColor.WHITE, WINDOW_WIDTH_SLOT, "Window Width", windowWidth, 1, 5, "Blocks");
+ createCounter(HeadColor.LIGHT_GRAY, WINDOW_HEIGHT_SLOT, "Window Height", windowHeight, 1, 5, "Blocks");
+ createCounter(HeadColor.WHITE, WINDOW_DISTANCE_SLOT, "Window Distance", windowDistance, 1, 6, "Blocks");
getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, "§eNext"));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
index 1425d833..4c61812d 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/generator/components/road/menu/AdvancedSettingsMenu.java
@@ -7,10 +7,9 @@
import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadFlag;
import net.buildtheearth.buildteamtools.modules.generator.components.road.RoadSettings;
import net.buildtheearth.buildteamtools.modules.generator.model.Settings;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
-import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColor;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
@@ -66,15 +65,15 @@ protected void setPreviewItems() {
if (roadSlab.length == 0)
roadSlab = new XMaterial[]{XMaterial.BARRIER};
- createCounter(HeadColorScheme.WHITE, LANE_COUNT_SLOT, "Number of Lanes", laneCount, 1, 10, "Lanes");
- createCounter(HeadColorScheme.LIGHT_GRAY, LANE_WIDTH_SLOT, "Lane Width", laneWidth, 1, 30, "Blocks");
- createCounter(HeadColorScheme.WHITE, SIDEWALK_WIDTH_SLOT, "Sidewalk Width", sidewalkWidth, 1, 30, "Blocks");
- createCounter(HeadColorScheme.LIGHT_GRAY, STREET_LAMP_DISTANCE_SLOT, "Street Lamp Distance", streetLampDistance, 5, 500, "Blocks");
+ createCounter(HeadColor.WHITE, LANE_COUNT_SLOT, "Number of Lanes", laneCount, 1, 10, "Lanes");
+ createCounter(HeadColor.LIGHT_GRAY, LANE_WIDTH_SLOT, "Lane Width", laneWidth, 1, 30, "Blocks");
+ createCounter(HeadColor.WHITE, SIDEWALK_WIDTH_SLOT, "Sidewalk Width", sidewalkWidth, 1, 30, "Blocks");
+ createCounter(HeadColor.LIGHT_GRAY, STREET_LAMP_DISTANCE_SLOT, "Street Lamp Distance", streetLampDistance, 5, 500, "Blocks");
- setChoiceItems(HeadColorScheme.WHITE, MARKINGS_MATERIAL_SLOT, "Line Markings Color", markingsMaterial.parseItem());
- setChoiceItems(HeadColorScheme.LIGHT_GRAY, ROAD_SLAB_SLOT, "Road Elevation Slab", roadSlab[0].parseItem());
- setChoiceItems(HeadColorScheme.WHITE, SIDEWALK_SLAB_SLOT, "Sidewalk Elevation Slab", sidewalkSlab[0].parseItem());
- setChoiceItems(HeadColorScheme.LIGHT_GRAY, STREET_LAMP_TYPE_SLOT, "Street Lamp Type", streetLampType);
+ setChoiceItems(HeadColor.WHITE, MARKINGS_MATERIAL_SLOT, "Line Markings Color", markingsMaterial.parseItem());
+ setChoiceItems(HeadColor.LIGHT_GRAY, ROAD_SLAB_SLOT, "Road Elevation Slab", roadSlab[0].parseItem());
+ setChoiceItems(HeadColor.WHITE, SIDEWALK_SLAB_SLOT, "Sidewalk Elevation Slab", sidewalkSlab[0].parseItem());
+ setChoiceItems(HeadColor.LIGHT_GRAY, STREET_LAMP_TYPE_SLOT, "Street Lamp Type", streetLampType);
getMenu().getSlot(NEXT_ITEM_SLOT).setItem(HeadFactory.head(HeadTexture.CHECKMARK, "§eNext"));
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
index f8f53714..54e501ca 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/MaterialSelectionMenu.java
@@ -6,11 +6,9 @@
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
-import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import net.buildtheearth.buildteamtools.utils.menus.BookMenu;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
index 499ecb7b..a01a9ea7 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
@@ -10,7 +10,6 @@
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.api.OpenStreetMapAPI;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
index 65f3e13b..ce3310dc 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupEditMenu.java
@@ -8,7 +8,6 @@
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
index b6996a4b..90ded29f 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
@@ -9,9 +9,9 @@
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
import net.buildtheearth.buildteamtools.utils.io.ConfigUtil;
@@ -84,10 +84,7 @@ protected void setPaginatedPreviewItems(@NotNull List> source) {
// Create a create warp group item if the player has permission
if (showPlusItem) {
getMenu().getSlot(ALTERNATE_PLUS_SLOT).setItem(
- Item.createCustomHeadBase64(
- HeadTexture.GREEN_PLUS.getBase64(), "§a§lCreate a new Warp Group",
- ListUtil.createList("§8Click to create a new warp group.")
- )
+ HeadFactory.head(HeadTexture.GREEN_PLUS, "§a§lCreate a new Warp Group", ListUtil.createList("§8Click to create a new warp group."))
);
}
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
index 7438a9ee..43e8b1d2 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
@@ -6,9 +6,9 @@
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
import net.buildtheearth.buildteamtools.modules.network.NetworkModule;
import net.buildtheearth.buildteamtools.modules.network.model.Permissions;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractPaginatedMenu;
import org.bukkit.entity.Player;
@@ -83,7 +83,7 @@ protected void setPaginatedPreviewItems(@NotNull List> source) {
// Create a "create warp" item if the player has permission
if(warp.getName().equals("%create-warp%") && getMenuPlayer().hasPermission(Permissions.WARP_CREATE) && slot == warps.size() - 1){
- getMenu().getSlot(slot).setItem(Item.createCustomHeadBase64(HeadTexture.GREEN_PLUS.getBase64(), "§a§lCreate a new Warp", ListUtil.createList("§8Click to create a new warp.")));
+ getMenu().getSlot(slot).setItem(HeadFactory.head(HeadTexture.GREEN_PLUS, "§a§lCreate a new Warp", ListUtil.createList("§8Click to create a new warp.")));
slot++;
continue;
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
index 243142b5..f25a9eb9 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/Warp.java
@@ -4,11 +4,9 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.Utils;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
-import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
index ea07380a..8c5003c9 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/model/WarpGroup.java
@@ -4,10 +4,8 @@
import lombok.Getter;
import lombok.Setter;
import net.buildtheearth.buildteamtools.modules.network.model.BuildTeam;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
-import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.heads.LetterType;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java
index 52682e19..322cd752 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/stats/menu/StatsMenu.java
@@ -5,9 +5,9 @@
import net.buildtheearth.buildteamtools.modules.stats.StatsModule;
import net.buildtheearth.buildteamtools.modules.stats.model.StatsPlayer;
import net.buildtheearth.buildteamtools.modules.stats.model.StatsServer;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.ListUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
+import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import net.buildtheearth.buildteamtools.utils.menus.AbstractMenu;
import org.bukkit.entity.Player;
@@ -21,8 +21,8 @@
public class StatsMenu extends AbstractMenu {
- private final static ItemStack GLOBAL_HEAD = Item.createCustomHeadBase64(HeadTexture.EARTH.getBase64(), "§eGlobal Statistics", ListUtil.createList("error"));
- private final static ItemStack ACHIEVEMENTS_HEAD = Item.createCustomHeadBase64(HeadTexture.GOLDEN_CUP.getBase64(), "§eAchievements", ListUtil.createList("error"));
+ private final static ItemStack GLOBAL_HEAD = HeadFactory.head(HeadTexture.EARTH, "§eGlobal Statistics", ListUtil.createList("error"));
+ private final static ItemStack ACHIEVEMENTS_HEAD = HeadFactory.head(HeadTexture.GOLDEN_CUP, "§eAchievements", ListUtil.createList("error"));
private final byte PLAYER_HEAD_SLOT = 4;
private final byte TEAM_HEAD_SLOT = 20;
private final byte GLOBAL_HEAD_SLOT = 22;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java b/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
deleted file mode 100644
index fed2fec7..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/HeadUtil.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package net.buildtheearth.buildteamtools.utils;
-
-import com.alpsbte.alpslib.utils.item.Item;
-import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
-import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.ArrayList;
-
-public class HeadUtil {
-
- public static ItemStack getCounterPlusItem(HeadColorScheme sliderColor, String name, int value, int maxValue) {
- if (value >= maxValue)
- switch (sliderColor) {
- case WHITE:
- return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), " ", null);
- }
-
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(HeadTexture.WHITE_PLUS.getBase64(), "§a§l+ §e" + name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_PLUS.getBase64(), "§a§l+ §e" + name, null);
- }
- }
-
- public static ItemStack getCounterMinusItem(HeadColorScheme sliderColor, String name, int value, int minValue) {
- if (value <= minValue)
- switch (sliderColor) {
- case WHITE:
- return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), " ", null);
- }
-
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(HeadTexture.WHITE_MINUS.getBase64(), "§c§l- §e" + name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_MINUS.getBase64(), "§c§l- §e" + name, null);
- }
- }
-
- public static ItemStack getXItem(HeadColorScheme sliderColor, String name) {
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(HeadTexture.WHITE_X.getBase64(), name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_X.getBase64(), name, null);
- }
- }
-
- public static ItemStack getBlankItem(HeadColorScheme sliderColor, String name) {
- switch (sliderColor) {
- default:
- case WHITE:
- return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), name, null);
- case LIGHT_GRAY:
- return Item.createCustomHeadBase64(HeadTexture.LIGHT_GRAY_BLANK.getBase64(), name, null);
- }
- }
-}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java
similarity index 73%
rename from src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java
rename to src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java
index 31fb4d0f..1d92f83d 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColorScheme.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java
@@ -1,6 +1,6 @@
package net.buildtheearth.buildteamtools.utils.heads;
-public enum HeadColorScheme {
+public enum HeadColor {
WHITE,
LIGHT_GRAY;
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
index f5120873..6d3a7a5c 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
@@ -5,17 +5,99 @@
import java.util.ArrayList;
+/**
+ * Factory utility class for creating custom textured player heads.
+ *
+ * This class provides a centralized API for generating {@link ItemStack} instances
+ * based on predefined {@link HeadTexture} values. It supports:
+ *
+ * - Direct texture-based head creation
+ * - Colorized variants of heads (based on {@link HeadColor})
+ * - Number-based heads
+ * - Letter-based heads
+ * - UI helper heads (plus/minus counters)
+ *
+ *
+ * All methods delegate to {@link Item#createCustomHeadBase64(String, String, java.util.List)}
+ * using base64 texture data stored in {@link HeadTexture}.
+ */
public class HeadFactory {
+ /**
+ * Creates a custom head using a raw {@link HeadTexture}.
+ *
+ * @param headTexture the texture to use
+ * @param name display name of the item
+ * @param lore optional lore (can be null)
+ * @return the created {@link ItemStack}
+ */
public static ItemStack head(HeadTexture headTexture, String name, ArrayList lore) {
return Item.createCustomHeadBase64(headTexture.getBase64(), name, lore);
}
+ /**
+ * Creates a custom head using a raw {@link HeadTexture} without lore.
+ *
+ * @param headTexture the texture to use
+ * @param name display name of the item
+ * @return the created {@link ItemStack}
+ */
public static ItemStack head(HeadTexture headTexture, String name) {
return Item.createCustomHeadBase64(headTexture.getBase64(), name, null);
}
- public static ItemStack number(HeadColorScheme color, int value, String name, ArrayList lore) {
+ /**
+ * Creates a colorized variant of a head texture.
+ *
+ * This method attempts to resolve a texture by combining the provided
+ * {@link HeadColor} and the base texture name. If the resolved texture
+ * does not exist, it falls back to the corresponding BLANK texture.
+ *
+ * @param color color scheme to apply
+ * @param headTexture base texture to colorize
+ * @param name display name
+ * @param lore optional lore (can be null)
+ * @return the created {@link ItemStack}
+ */
+ public static ItemStack colorizedHead(HeadColor color, HeadTexture headTexture, String name, ArrayList lore) {
+ String key = color.name() + "_" + headTexture.name().substring(color.name().length());
+ HeadTexture texture;
+
+ try {
+ texture = HeadTexture.valueOf(key);
+ } catch (IllegalArgumentException e) {
+ texture = HeadTexture.valueOf(color.name() + "_BLANK");
+ }
+
+ return Item.createCustomHeadBase64(texture.getBase64(), name, lore);
+ }
+
+ /**
+ * Creates a colorized head without lore.
+ *
+ * @param color color scheme
+ * @param headTexture base texture
+ * @param name display name
+ * @return the created {@link ItemStack}
+ */
+ public static ItemStack colorizedHead(HeadColor color, HeadTexture headTexture, String name) {
+ return colorizedHead(color, headTexture, name, null);
+ }
+
+ /**
+ * Creates a numbered head based on a color scheme.
+ *
+ * Resolves a texture using the pattern:
+ * {@code COLOR_VALUE} (e.g. WHITE_5).
+ * Falls back to a blank texture if the value is invalid.
+ *
+ * @param color color scheme
+ * @param value numeric value (e.g. 0–20)
+ * @param name display name
+ * @param lore optional lore (can be null)
+ * @return the created {@link ItemStack}
+ */
+ public static ItemStack number(HeadColor color, int value, String name, ArrayList lore) {
String key = color.name() + "_" + value;
HeadTexture texture;
@@ -24,13 +106,35 @@ public static ItemStack number(HeadColorScheme color, int value, String name, Ar
} catch (IllegalArgumentException e) {
texture = HeadTexture.valueOf(color.name() + "_BLANK");
}
+
return Item.createCustomHeadBase64(texture.getBase64(), name, lore);
}
- public static ItemStack number(HeadColorScheme color, int value, String name) {
+ /**
+ * Creates a numbered head without lore.
+ *
+ * @param color color scheme
+ * @param value numeric value
+ * @param name display name
+ * @return the created {@link ItemStack}
+ */
+ public static ItemStack number(HeadColor color, int value, String name) {
return number(color, value, name, null);
}
+ /**
+ * Creates a letter-based head (A–Z) using a given style.
+ *
+ * Resolves textures using the pattern:
+ * {@code TYPE_LETTER_X}. If the letter is invalid,
+ * a QUESTION_MARK fallback texture is used.
+ *
+ * @param type letter style/type (e.g. WOODEN, STONE)
+ * @param letter character input (A–Z)
+ * @param name display name
+ * @param lore optional lore (can be null)
+ * @return the created {@link ItemStack}
+ */
public static ItemStack letter(LetterType type, char letter, String name, ArrayList lore) {
String key = type.name() + "_LETTER_" + Character.toUpperCase(letter);
HeadTexture texture;
@@ -40,10 +144,57 @@ public static ItemStack letter(LetterType type, char letter, String name, ArrayL
} catch (Exception e) {
texture = HeadTexture.valueOf(type.name() + "_LETTER_QUESTION_MARK");
}
+
return Item.createCustomHeadBase64(texture.getBase64(), name, lore);
}
+ /**
+ * Creates a letter-based head without lore.
+ *
+ * @param type letter style/type
+ * @param letter character input
+ * @param name display name
+ * @return the created {@link ItemStack}
+ */
public static ItemStack letter(LetterType type, char letter, String name) {
return letter(type, letter, name, null);
}
-}
+
+ /**
+ * Creates a "+" counter button item.
+ *
+ * If the value is already at or above the maximum,
+ * a blank head is returned instead.
+ *
+ * @param sliderColor color scheme
+ * @param name display name base
+ * @param value current value
+ * @param maxValue maximum allowed value
+ * @return plus button or blank item
+ */
+ public static ItemStack getCounterPlusItem(HeadColor sliderColor, String name, int value, int maxValue) {
+ if (value >= maxValue)
+ return colorizedHead(sliderColor, HeadTexture.WHITE_BLANK, " ");
+
+ return colorizedHead(sliderColor, HeadTexture.WHITE_PLUS, "§a§l+ §e" + name);
+ }
+
+ /**
+ * Creates a "-" counter button item.
+ *
+ *
If the value is already at or below the minimum,
+ * a blank head is returned instead.
+ *
+ * @param sliderColor color scheme
+ * @param name display name base
+ * @param value current value
+ * @param minValue minimum allowed value
+ * @return minus button or blank item
+ */
+ public static ItemStack getCounterMinusItem(HeadColor sliderColor, String name, int value, int minValue) {
+ if (value <= minValue)
+ return colorizedHead(sliderColor, HeadTexture.WHITE_BLANK, " ");
+
+ return colorizedHead(sliderColor, HeadTexture.WHITE_MINUS, "§c§l- §e" + name);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
index c3eb3335..6572cbb0 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractMenu.java
@@ -3,10 +3,9 @@
import com.alpsbte.alpslib.utils.item.Item;
import com.cryptomorin.xseries.XMaterial;
import net.buildtheearth.buildteamtools.BuildTeamTools;
-import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColor;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
@@ -108,9 +107,9 @@ protected Player getMenuPlayer() {
* @param maxValue Maximum value of the slider
* @param valueType Type of the value (e.g. "m", "°C", "°F", "blocks", "chunks", "seconds", "minutes", "hours", "days", "weeks", "months", "years", ...)
*/
- protected void createCounter(HeadColorScheme sliderColor, int sliderItemSlot, String sliderName, int value, int minValue, int maxValue, String valueType){
+ protected void createCounter(HeadColor sliderColor, int sliderItemSlot, String sliderName, int value, int minValue, int maxValue, String valueType){
// Set previous page item
- getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getCounterMinusItem(sliderColor, sliderName, value, minValue));
+ getMenu().getSlot(sliderItemSlot - 1).setItem(HeadFactory.getCounterMinusItem(sliderColor, sliderName, value, minValue));
// Set current page item
String currentCounterName = "§e" + sliderName + ": §7§l" + value;
@@ -118,7 +117,7 @@ protected void createCounter(HeadColorScheme sliderColor, int sliderItemSlot, St
currentCounterName += " " + valueType;
getMenu().getSlot(sliderItemSlot).setItem(HeadFactory.number(sliderColor, value, currentCounterName));
// Set next page item
- getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getCounterPlusItem(sliderColor, sliderName, value, maxValue));
+ getMenu().getSlot(sliderItemSlot + 1).setItem(HeadFactory.getCounterPlusItem(sliderColor, sliderName, value, maxValue));
}
/**
@@ -131,31 +130,31 @@ protected void createCounter(HeadColorScheme sliderColor, int sliderItemSlot, St
* @param sliderName Name of the slider
* @param current Current block item
*/
- protected void setChoiceItems(HeadColorScheme sliderColor, int sliderItemSlot, String sliderName, ItemStack current){
+ protected void setChoiceItems(HeadColor sliderColor, int sliderItemSlot, String sliderName, ItemStack current){
sliderName = "§e" + sliderName;
if(current == null) {
// Set previous page item
- getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getBlankItem(sliderColor, sliderName + ": §c§lOFF"));
+ getMenu().getSlot(sliderItemSlot - 1).setItem(HeadFactory.colorizedHead(sliderColor, HeadTexture.WHITE_BLANK, sliderName + ": §c§lOFF"));
// Set current page item
getMenu().getSlot(sliderItemSlot).setItem(Item.create(XMaterial.BARRIER.parseMaterial(), sliderName + ": §c§lOFF"));
// Set next page item
- getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getBlankItem(sliderColor, sliderName + ": §c§lOFF"));
+ getMenu().getSlot(sliderItemSlot + 1).setItem(HeadFactory.colorizedHead(sliderColor, HeadTexture.WHITE_BLANK, sliderName + ": §c§lOFF"));
}else{
ItemMeta meta = current.getItemMeta();
meta.setDisplayName(sliderName);
current.setItemMeta(meta);
// Set previous page item
- getMenu().getSlot(sliderItemSlot - 1).setItem(HeadUtil.getXItem(sliderColor, "§cDisable " + sliderName));
+ getMenu().getSlot(sliderItemSlot - 1).setItem(HeadFactory.colorizedHead(sliderColor, HeadTexture.WHITE_X, "§cDisable " + sliderName));
// Set current page item
getMenu().getSlot(sliderItemSlot).setItem(current);
// Set next page item
- getMenu().getSlot(sliderItemSlot + 1).setItem(HeadUtil.getXItem(sliderColor, "§cDisable " + sliderName));
+ getMenu().getSlot(sliderItemSlot + 1).setItem(HeadFactory.colorizedHead(sliderColor, HeadTexture.WHITE_X, "§cDisable " + sliderName));
}
}
@@ -164,7 +163,7 @@ protected void setChoiceItems(HeadColorScheme sliderColor, int sliderItemSlot, S
* @param slot Slot of the back item
*/
protected void setBackItem(int slot, AbstractMenu backMenu){
- getMenu().getSlot(slot).setItem(Item.createCustomHeadBase64(HeadTexture.WHITE_BACKWARD.getBase64(), "§eBack", null));
+ getMenu().getSlot(slot).setItem(HeadFactory.head(HeadTexture.WHITE_BACKWARD, "§eBack"));
getMenu().getSlot(slot).setClickHandler((clickPlayer, clickInformation) -> Bukkit.getScheduler().scheduleSyncDelayedTask(BuildTeamTools.getInstance(), () -> {
clickPlayer.closeInventory();
backMenu.reloadMenuAsync();
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
index 13b5f2c9..376923d6 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
@@ -2,7 +2,7 @@
import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.BuildTeamTools;
-import net.buildtheearth.buildteamtools.utils.heads.HeadColorScheme;
+import net.buildtheearth.buildteamtools.utils.heads.HeadColor;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
import org.bukkit.Bukkit;
@@ -130,7 +130,7 @@ private int getMaxIndex() {
* @return The current page item.
*/
private ItemStack getCurrentPageItem() {
- return HeadFactory.number(HeadColorScheme.WHITE, currentPage, "§eCurrent Page §7- §f" + (currentPage));
+ return HeadFactory.number(HeadColor.WHITE, currentPage, "§eCurrent Page §7- §f" + (currentPage));
}
/**
@@ -138,9 +138,9 @@ private ItemStack getCurrentPageItem() {
*/
private ItemStack getPreviousPageItem() {
if (currentPage <= 1)
- return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
+ return HeadFactory.head(HeadTexture.WHITE_BLANK, " ");
- return Item.createCustomHeadBase64(HeadTexture.WHITE_ARROW_LEFT.getBase64(), "§ePrevious Page §7- §f" + (currentPage - 1), null);
+ return HeadFactory.head(HeadTexture.WHITE_ARROW_LEFT, "§ePrevious Page §7- §f" + (currentPage - 1));
}
/**
@@ -148,9 +148,9 @@ private ItemStack getPreviousPageItem() {
*/
private ItemStack getNextPageItem() {
if (!hasNextPage())
- return Item.createCustomHeadBase64(HeadTexture.WHITE_BLANK.getBase64(), " ", null);
+ return HeadFactory.head(HeadTexture.WHITE_BLANK, " ");
- return Item.createCustomHeadBase64(HeadTexture.WHITE_ARROW_RIGHT.getBase64(), "§eNext Page §7- §f" + (currentPage + 1), null);
+ return HeadFactory.head(HeadTexture.WHITE_ARROW_RIGHT, "§eNext Page §7- §f" + (currentPage + 1));
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
index 95a56106..92143629 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/BlockListMenu.java
@@ -1,7 +1,6 @@
package net.buildtheearth.buildteamtools.utils.menus;
import com.alpsbte.alpslib.utils.item.Item;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
index b459e530..fcc2f846 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/NameListMenu.java
@@ -1,7 +1,6 @@
package net.buildtheearth.buildteamtools.utils.menus;
import com.alpsbte.alpslib.utils.item.Item;
-import net.buildtheearth.buildteamtools.utils.HeadUtil;
import net.buildtheearth.buildteamtools.utils.MenuItems;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
import net.buildtheearth.buildteamtools.utils.heads.HeadTexture;
From 4dffd11c9d3a9c84779a5cb42519a7cdda0e7568 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Tue, 28 Apr 2026 23:59:21 +0200
Subject: [PATCH 09/14] refactor(utils): Removed nearly unused Constants.java
---
.../modules/network/NetworkModule.java | 4 ++--
.../buildteamtools/utils/io/Constants.java | 14 --------------
2 files changed, 2 insertions(+), 16 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java
index 0c98218e..c037cbca 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java
@@ -14,7 +14,6 @@
import net.buildtheearth.buildteamtools.modules.network.model.RegionType;
import net.buildtheearth.buildteamtools.utils.WikiLinks;
import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
-import net.buildtheearth.buildteamtools.utils.io.Constants;
import net.buildtheearth.buildteamtools.utils.io.Errors;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -31,6 +30,7 @@
public class NetworkModule extends Module {
public static final int CACHE_UPLOAD_SPEED = 20 * 60 * 10 + 20;
+ private static final String DEFAULT_API_KEY = "00000000-0000-0000-0000-000000000000";
/**
* Information about the build team of this server
@@ -67,7 +67,7 @@ public static NetworkModule getInstance() {
@Override
public void enable() {
String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY);
- if (apiKey == null || apiKey.isEmpty() || apiKey.equals(Constants.DEFAULT_API_KEY)) {
+ if (apiKey == null || apiKey.isEmpty() || apiKey.equals(DEFAULT_API_KEY)) {
shutdown(Errors.API_KEY_NOT_CONFIGURED);
return;
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java
deleted file mode 100644
index a1e85fa2..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/io/Constants.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.io;
-
-public class Constants {
-
- public static final String API_URL = "https://nwapi.buildtheearth.net";
- public static final int API_PORT = 8080;
-
- public static final String CONFIG_FILE = "config.yml";
- public static final String MODULES_FOLDER = "/modules";
-
- public static final String PLOTSYSTEM_FOLDER = MODULES_FOLDER + "/plotsystem";
-
- public static final String DEFAULT_API_KEY = "00000000-0000-0000-0000-000000000000";
-}
From 0658e38b43b7bc08c8d83c1cdacc3e5fd65d35c9 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Wed, 29 Apr 2026 00:01:42 +0200
Subject: [PATCH 10/14] refactor(utils): Removed Errors.java because it only
contained 2 errors.
---
.../modules/network/NetworkModule.java | 7 +++----
.../buildteamtools/utils/io/Errors.java | 12 ------------
2 files changed, 3 insertions(+), 16 deletions(-)
delete mode 100644 src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java b/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java
index c037cbca..f39d8df9 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/network/NetworkModule.java
@@ -14,7 +14,6 @@
import net.buildtheearth.buildteamtools.modules.network.model.RegionType;
import net.buildtheearth.buildteamtools.utils.WikiLinks;
import net.buildtheearth.buildteamtools.utils.io.ConfigPaths;
-import net.buildtheearth.buildteamtools.utils.io.Errors;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@@ -68,7 +67,7 @@ public static NetworkModule getInstance() {
public void enable() {
String apiKey = BuildTeamTools.getInstance().getConfig().getString(ConfigPaths.API_KEY);
if (apiKey == null || apiKey.isEmpty() || apiKey.equals(DEFAULT_API_KEY)) {
- shutdown(Errors.API_KEY_NOT_CONFIGURED);
+ shutdown("The API Key was not configured in the config.yml file.");
return;
}
@@ -80,11 +79,11 @@ public void enable() {
// After completion check if the build team is loaded
if (getBuildTeam() == null) {
- shutdown(Errors.BUILD_TEAM_NOT_LOADED);
+ shutdown("Failed to load the Build Team!");
return;
}
} catch (CompletionException e) {
- shutdown(Errors.BUILD_TEAM_NOT_LOADED + " " + e.getCause().getMessage());
+ shutdown("Failed to load the Build Team!" + " " + e.getCause().getMessage());
}
super.enable();
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java b/src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java
deleted file mode 100644
index 823f0e9d..00000000
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/io/Errors.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package net.buildtheearth.buildteamtools.utils.io;
-
-public class Errors {
-
- public static final String WORLD_EDIT_NOT_INSTALLED = "WorldEdit is not installed.";
- public static final String HEAD_DATABASE_NOT_INSTALLED = "HeadDatabase is not installed.";
- public static final String API_KEY_NOT_CONFIGURED = "The API Key was not configured in the config.yml file.";
- public static final String PLOT_SYSTEM_TERRA_ALREADY_ENABLED = "The PlotSystem-Terra plugin is already loaded.";
-
- public static final String BUILD_TEAM_NOT_LOADED = "Failed to load the Build Team!";
- public static final String WORLD_NOT_LOADED = "Failed to load the world from the config.yml file!";
-}
From 57ebaf6b40c8a0ef75d9862e861b0b360b68c7b1 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Wed, 29 Apr 2026 12:39:50 +0200
Subject: [PATCH 11/14] fix(utils): Fix some small bugs discovered during code
review.
---
settings.gradle.kts | 4 ----
.../buildteamtools/modules/navigation/NavUtils.java | 6 +++---
.../navigation/components/bluemap/BluemapComponent.java | 5 ++++-
.../navigation/components/warps/menu/WarpEditMenu.java | 2 +-
.../buildteamtools/utils/heads/HeadFactory.java | 2 +-
.../buildteamtools/utils/heads/HeadTexture.java | 4 ----
.../buildteamtools/utils/menus/AbstractPaginatedMenu.java | 7 ++++---
7 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/settings.gradle.kts b/settings.gradle.kts
index f273cb5d..a10a5de3 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -14,10 +14,6 @@ dependencyResolutionManagement {
url = uri("https://maven.buildtheearth.net/releases")
}
- maven {
- url = uri("https://maven.buildtheearth.net/releases")
- }
-
maven {
url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java
index 137fe791..04030a1d 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/NavUtils.java
@@ -131,7 +131,7 @@ public static void switchToTeam(BuildTeam team, Player clickPlayer) {
* Note: Height returned is actually terrain elevation +2. This is because this method internally uses
* Bukkits @see World::getHighestBlockYAt() already returns elevation+1, and this method deliberately
* adds one to the location elevation on top.
- *
* The world is extracted from the server config's "earth world". If no earth world is specified then the height defaults to 64
* and the world is nullified.
*
@@ -148,7 +148,7 @@ public static Location getLocationFromCoordinatesYawPitch(GeographicalCoordinate
int y = 64;
if (earthWorld != null)
- y = earthWorld.getHighestBlockYAt(mcCoord.blockX(), mcCoord.blockZ() + 1);
+ y = earthWorld.getHighestBlockYAt(mcCoord.blockX(), mcCoord.blockZ()) + 1;
return new Location(earthWorld, mcCoord.x(), y, mcCoord.z(), yaw, pitch);
} catch (OutOfProjectionBoundsException e) {
@@ -163,7 +163,7 @@ public static Location getLocationFromCoordinatesYawPitch(GeographicalCoordinate
* Note: Height returned is actually terrain elevation +2. This is because this method internally uses
* Bukkits @see World::getHighestBlockYAt() already returns elevation+1, and this method deliberately
* adds one to the location elevation on top.
- *
* The world is extracted from the server config's "earth world". If no earth world is specified then the height defaults to 64
* and the world is nullified.
*
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java
index 694a28e3..21ea994a 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/bluemap/BluemapComponent.java
@@ -160,7 +160,10 @@ private void addWarpMarker(@NotNull MarkerSet markerSet, @NotNull Warp warp) {
// Add marker to the marker set
markerSet.getMarkers().put(warp.getId().toString(), marker);
} catch (OutOfProjectionBoundsException e) {
- throw new RuntimeException(e);
+ BuildTeamTools.getInstance().getComponentLogger().warn(Component.text(
+ "Warp '" + warp.getName() + "' (" + warp.getId() + ") is out of projection bounds. Skipping BlueMap marker registration for this warp.",
+ NamedTextColor.YELLOW
+ ));
}
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
index a01a9ea7..0230cd55 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpEditMenu.java
@@ -169,7 +169,7 @@ protected void setItemClickEventsAsync() {
return null;
});
} catch (OutOfProjectionBoundsException e) {
- throw new RuntimeException(e);
+ clickPlayer.sendMessage(ChatHelper.getErrorString("An error occurred while changing the location of the warp!"));
}
});
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
index 6d3a7a5c..49f1ce64 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
@@ -60,7 +60,7 @@ public static ItemStack head(HeadTexture headTexture, String name) {
* @return the created {@link ItemStack}
*/
public static ItemStack colorizedHead(HeadColor color, HeadTexture headTexture, String name, ArrayList lore) {
- String key = color.name() + "_" + headTexture.name().substring(color.name().length());
+ String key = color.name() + "_" + headTexture.name().substring(color.name().length() + 1);
HeadTexture texture;
try {
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
index 02531267..5a613aed 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadTexture.java
@@ -1,10 +1,6 @@
package net.buildtheearth.buildteamtools.utils.heads;
-import com.alpsbte.alpslib.utils.item.Item;
import lombok.Getter;
-import org.bukkit.inventory.ItemStack;
-
-import java.util.ArrayList;
@Getter
public enum HeadTexture {
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
index 376923d6..371a1898 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
@@ -130,7 +130,7 @@ private int getMaxIndex() {
* @return The current page item.
*/
private ItemStack getCurrentPageItem() {
- return HeadFactory.number(HeadColor.WHITE, currentPage, "§eCurrent Page §7- §f" + (currentPage));
+ return HeadFactory.number(HeadColor.WHITE, getPage(), "§eCurrent Page §7- §f" + getPage());
}
/**
@@ -140,7 +140,7 @@ private ItemStack getPreviousPageItem() {
if (currentPage <= 1)
return HeadFactory.head(HeadTexture.WHITE_BLANK, " ");
- return HeadFactory.head(HeadTexture.WHITE_ARROW_LEFT, "§ePrevious Page §7- §f" + (currentPage - 1));
+ return HeadFactory.head(HeadTexture.WHITE_ARROW_LEFT, "§ePrevious Page §7- §f" + (getPage() - 1));
}
/**
@@ -150,8 +150,9 @@ private ItemStack getNextPageItem() {
if (!hasNextPage())
return HeadFactory.head(HeadTexture.WHITE_BLANK, " ");
- return HeadFactory.head(HeadTexture.WHITE_ARROW_RIGHT, "§eNext Page §7- §f" + (currentPage + 1));
+ return HeadFactory.head(HeadTexture.WHITE_ARROW_RIGHT, "§eNext Page §7- §f" + (getPage() + 1));
}
+
/**
From 6aefacb3df9cf9bb5f29c17b4a710d7824e4c22b Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Wed, 29 Apr 2026 13:22:26 +0200
Subject: [PATCH 12/14] fix(utils): Fix colorizedHead incorrectly calculating
the required HeadTexture
---
.../utils/heads/HeadFactory.java | 28 +++++++++++++------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
index 49f1ce64..50824fb9 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadFactory.java
@@ -60,16 +60,28 @@ public static ItemStack head(HeadTexture headTexture, String name) {
* @return the created {@link ItemStack}
*/
public static ItemStack colorizedHead(HeadColor color, HeadTexture headTexture, String name, ArrayList lore) {
- String key = color.name() + "_" + headTexture.name().substring(color.name().length() + 1);
- HeadTexture texture;
-
- try {
- texture = HeadTexture.valueOf(key);
- } catch (IllegalArgumentException e) {
- texture = HeadTexture.valueOf(color.name() + "_BLANK");
+ String textureName = headTexture.name();
+
+ String suffix;
+ for (HeadColor c : HeadColor.values()) {
+ String prefix = c.name() + "_";
+ if (textureName.startsWith(prefix)) {
+ suffix = textureName.substring(prefix.length());
+
+ String key = color.name() + "_" + suffix;
+
+ try {
+ HeadTexture texture = HeadTexture.valueOf(key);
+ return head(texture, name, lore);
+ } catch (IllegalArgumentException ignored) {
+ break;
+ }
+ }
}
- return Item.createCustomHeadBase64(texture.getBase64(), name, lore);
+ // fallback
+ HeadTexture fallback = HeadTexture.valueOf(color.name() + "_BLANK");
+ return head(fallback, name, lore);
}
/**
From c4fa553e945d7b9a92c92b1af49764877cbcf06e Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Wed, 29 Apr 2026 19:46:38 +0200
Subject: [PATCH 13/14] fix(utils): Remove unused imports
---
.../modules/navigation/components/warps/menu/WarpGroupMenu.java | 1 -
.../modules/navigation/components/warps/menu/WarpMenu.java | 1 -
.../net/buildtheearth/buildteamtools/utils/heads/HeadColor.java | 2 +-
.../buildtheearth/buildteamtools/utils/heads/LetterType.java | 2 +-
.../buildteamtools/utils/menus/AbstractPaginatedMenu.java | 1 -
5 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
index 90ded29f..e76fa41a 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpGroupMenu.java
@@ -1,7 +1,6 @@
package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu;
import com.alpsbte.alpslib.utils.ChatHelper;
-import com.alpsbte.alpslib.utils.item.Item;
import com.google.gson.Gson;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
index 43e8b1d2..a2c89792 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/modules/navigation/components/warps/menu/WarpMenu.java
@@ -1,6 +1,5 @@
package net.buildtheearth.buildteamtools.modules.navigation.components.warps.menu;
-import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.modules.navigation.NavigationModule;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.Warp;
import net.buildtheearth.buildteamtools.modules.navigation.components.warps.model.WarpGroup;
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java
index 1d92f83d..22fb4104 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/HeadColor.java
@@ -2,5 +2,5 @@
public enum HeadColor {
WHITE,
- LIGHT_GRAY;
+ LIGHT_GRAY
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java
index 4b489729..1354105d 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/heads/LetterType.java
@@ -2,5 +2,5 @@
public enum LetterType {
WOODEN,
- STONE;
+ STONE
}
diff --git a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
index 371a1898..f493cfb6 100644
--- a/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
+++ b/src/main/java/net/buildtheearth/buildteamtools/utils/menus/AbstractPaginatedMenu.java
@@ -1,6 +1,5 @@
package net.buildtheearth.buildteamtools.utils.menus;
-import com.alpsbte.alpslib.utils.item.Item;
import net.buildtheearth.buildteamtools.BuildTeamTools;
import net.buildtheearth.buildteamtools.utils.heads.HeadColor;
import net.buildtheearth.buildteamtools.utils.heads.HeadFactory;
From e506934f79dbc18761a22120b4ff0d618392b492 Mon Sep 17 00:00:00 2001
From: Kyan Van den Eynde <66461508+kyanvde@users.noreply.github.com>
Date: Wed, 29 Apr 2026 20:21:58 +0200
Subject: [PATCH 14/14] Update settings.gradle.kts
Co-authored-by: Nudesuppe42 <67996941+Nudelsuppe42@users.noreply.github.com>
---
settings.gradle.kts | 1 -
1 file changed, 1 deletion(-)
diff --git a/settings.gradle.kts b/settings.gradle.kts
index a10a5de3..c6b80f74 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -9,7 +9,6 @@ dependencyResolutionManagement {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
- // BTE REPO! :)
maven {
url = uri("https://maven.buildtheearth.net/releases")
}