aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java12
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java4
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java2
-rw-r--r--src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabels.java60
4 files changed, 32 insertions, 46 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java
index f3e8e935..24b91780 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CommissionLabels.java
@@ -16,12 +16,10 @@ public class CommissionLabels {
private static final Map<String, MiningLocationLabels.dwarvenCategory> DWARVEN_LOCATIONS = Arrays.stream(MiningLocationLabels.dwarvenCategory.values()).collect(Collectors.toMap(MiningLocationLabels.dwarvenCategory::toString, Function.identity()));
private static final Map<String, MiningLocationLabels.glaciteCategory> GLACITE_LOCATIONS = Arrays.stream(MiningLocationLabels.glaciteCategory.values()).collect(Collectors.toMap(MiningLocationLabels.glaciteCategory::toString, Function.identity()));
-
protected static List<MiningLocationLabels> activeWaypoints = new ArrayList<>();
public static void init() {
WorldRenderEvents.AFTER_TRANSLUCENT.register(CommissionLabels::render);
- ClientPlayConnectionEvents.JOIN.register((_handler, _sender, _client) -> reset());
}
protected static void update(List<String> newCommissions) {
@@ -35,7 +33,7 @@ public class CommissionLabels {
if (commission.contains(glaciteLocation.getKey())) {
MiningLocationLabels.glaciteCategory category = glaciteLocation.getValue();
for (BlockPos gemstoneLocation : category.getLocations()) {
- activeWaypoints.add(new MiningLocationLabels(category, Text.of(category.getName()), gemstoneLocation));
+ activeWaypoints.add(new MiningLocationLabels(category, gemstoneLocation));
}
}
}
@@ -47,7 +45,8 @@ public class CommissionLabels {
for (Map.Entry<String, MiningLocationLabels.dwarvenCategory> dwarvenLocation : DWARVEN_LOCATIONS.entrySet()) {
if (commission.contains(dwarvenLocation.getKey())) {
MiningLocationLabels.dwarvenCategory category = dwarvenLocation.getValue();
- activeWaypoints.add(new MiningLocationLabels(category, Text.of(category.getName()), category.getLocation()));
+ category.isTitanium = commission.contains("Titanium");
+ activeWaypoints.add(new MiningLocationLabels(category, category.getLocation()));
}
}
}
@@ -60,10 +59,5 @@ public class CommissionLabels {
for (MiningLocationLabels MiningLocationLabels : activeWaypoints) {
MiningLocationLabels.render(context);
}
-
- }
-
- private static void reset() {
-
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java
index 053f3536..dc40f82c 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsWaypoint.java
@@ -42,7 +42,7 @@ public class CrystalsWaypoint extends Waypoint {
@Override
public boolean shouldRender() {
- return super.shouldRender() ;
+ return super.shouldRender();
}
@Override
@@ -84,7 +84,7 @@ public class CrystalsWaypoint extends Waypoint {
private final String name;
private final float[] colorComponents;
- Category(String name,Color color) {
+ Category(String name, Color color) {
this.name = name;
this.color = color;
this.colorComponents = color.getColorComponents(null);
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java
index 1d7a4db8..dd97e5d1 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MetalDetector.java
@@ -249,7 +249,7 @@ public class MetalDetector {
}
for (Vec3i block : possibleBlocks) {
- MiningWaypoints waypoint = new MiningWaypoints(MiningWaypoints.crystalCategory.CORLEONE, Text.translatable("skyblocker.dwarvenMines.metalDetectorHelper.possible"), new BlockPos(block.getX(), block.getY(), block.getZ()));
+ CrystalsWaypoint waypoint = new CrystalsWaypoint(CrystalsWaypoint.Category.CORLEONE, Text.translatable("skyblocker.dwarvenMines.metalDetectorHelper.possible"), new BlockPos(block.getX(), block.getY(), block.getZ()));
waypoint.render(context);
}
}
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabels.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabels.java
index 7808bec3..4b0e2d7b 100644
--- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabels.java
+++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabels.java
@@ -15,8 +15,8 @@ public class MiningLocationLabels {
final Category category;
private final Vec3d centerPos;
- MiningLocationLabels(Category category, Text name, BlockPos pos) {
- this.name = name;
+ MiningLocationLabels(Category category, BlockPos pos) {
+ this.name = Text.literal(category.getName()).withColor(category.getColor());
this.category = category;
this.centerPos = pos.toCenterPos();
}
@@ -27,37 +27,30 @@ public class MiningLocationLabels {
float scale = (float) (1 * (distance / 10));
RenderHelper.renderText(context, name, posUp, scale, true);
RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, scale, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true);
-
}
-
interface Category {
String getName();
- float[] getColorComponents();
-
+ int getColor(); //all the color codes are the color of the block the waypoint is for
}
enum dwarvenCategory implements Category {
- LAVA_SPRINGS("Lava Springs", Color.CYAN, new BlockPos(60, 197, -15)),
- CLIFFSIDE_VEINS("Cliffside Veins", Color.CYAN, new BlockPos(40, 128, 40)),
- RAMPARTS_QUARRY("Rampart's Quarry", Color.CYAN, new BlockPos(-100, 150, -20)),
- UPPER_MINES("Upper Mines", Color.CYAN, new BlockPos(-130, 174, -50)),
- ROYAL_MINES("Royal Mines", Color.CYAN, new BlockPos(130, 154, 30)),
- GLACITE_WALKER("Glacite Walker", Color.CYAN, new BlockPos(0, 128, 150));
+ LAVA_SPRINGS("Lava Springs", new BlockPos(60, 197, -15)),
+ CLIFFSIDE_VEINS("Cliffside Veins", new BlockPos(40, 128, 40)),
+ RAMPARTS_QUARRY("Rampart's Quarry", new BlockPos(-100, 150, -20)),
+ UPPER_MINES("Upper Mines", new BlockPos(-130, 174, -50)),
+ ROYAL_MINES("Royal Mines", new BlockPos(130, 154, 30)),
+ GLACITE_WALKER("Glacite Walker", new BlockPos(0, 128, 150));
- public final Color color;
+ boolean isTitanium;
private final String name;
- private final float[] colorComponents;
private final BlockPos location;
- dwarvenCategory(String name, Color color, BlockPos location) {
+ dwarvenCategory(String name, BlockPos location) {
this.name = name;
- this.color = color;
- this.colorComponents = color.getColorComponents(null);
this.location = location;
-
}
public BlockPos getLocation() {
@@ -69,38 +62,38 @@ public class MiningLocationLabels {
return name;
}
-
@Override
public String getName() {
return name;
}
@Override
- public float[] getColorComponents() {
- return colorComponents;
+ public int getColor() {
+ if (isTitanium) {
+ return 0xd8d6d8;
+ }
+ return 0x45bde0;
}
-
}
enum glaciteCategory implements Category {
- AQUAMARINE("Aquamarine", Color.BLUE, new BlockPos[]{new BlockPos(-1, 139, 437), new BlockPos(90, 151, 229), new BlockPos(56, 151, 400), new BlockPos(51, 117, 303)}),
- ONYX("Onyx", Color.BLACK, new BlockPos[]{new BlockPos(79, 119, 411), new BlockPos(-14, 132, 386), new BlockPos(18, 136, 370), new BlockPos(16, 138, 411), new BlockPos(-68, 130, 408)}),
- PERIDOT("Peridot", Color.GREEN, new BlockPos[]{new BlockPos(-61, 147, 302), new BlockPos(91, 122, 397),new BlockPos(-73, 122, 458), new BlockPos(-77, 120, 282)}),
- CITRINE("Citrine", Color.YELLOW, new BlockPos[]{new BlockPos(-104, 144, 244), new BlockPos(39, 119, 386), new BlockPos(-57, 144, 421), new BlockPos(-47, 126, 418) });
+ AQUAMARINE("Aquamarine", 0x334cb1, new BlockPos[]{new BlockPos(-1, 139, 437), new BlockPos(90, 151, 229), new BlockPos(56, 151, 400), new BlockPos(51, 117, 303)}),
+ ONYX("Onyx", 0x191919, new BlockPos[]{new BlockPos(79, 119, 411), new BlockPos(-14, 132, 386), new BlockPos(18, 136, 370), new BlockPos(16, 138, 411), new BlockPos(-68, 130, 408)}),
+ PERIDOT("Peridot", 0x667f33, new BlockPos[]{new BlockPos(-61, 147, 302), new BlockPos(91, 122, 397), new BlockPos(-73, 122, 458), new BlockPos(-77, 120, 282)}),
+ CITRINE("Citrine", 0x664c33, new BlockPos[]{new BlockPos(-104, 144, 244), new BlockPos(39, 119, 386), new BlockPos(-57, 144, 421), new BlockPos(-47, 126, 418)});
- public final Color color;
private final String name;
- private final float[] colorComponents;
+ private final int color;
private final BlockPos[] location;
- glaciteCategory(String name, Color color, BlockPos[] location) {
+ glaciteCategory(String name, int color, BlockPos[] location) {
this.name = name;
this.color = color;
- this.colorComponents = color.getColorComponents(null);
this.location = location;
-
}
+
+
public BlockPos[] getLocations() {
return location;
}
@@ -116,9 +109,8 @@ public class MiningLocationLabels {
}
@Override
- public float[] getColorComponents() {
- return colorComponents;
+ public int getColor() {
+ return color;
}
-
}
}