aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/utils/waypoint/ProfileAwareWaypoint.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils/waypoint/ProfileAwareWaypoint.java')
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/waypoint/ProfileAwareWaypoint.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/waypoint/ProfileAwareWaypoint.java b/src/main/java/de/hysky/skyblocker/utils/waypoint/ProfileAwareWaypoint.java
new file mode 100644
index 00000000..7aa99d14
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/utils/waypoint/ProfileAwareWaypoint.java
@@ -0,0 +1,44 @@
+package de.hysky.skyblocker.utils.waypoint;
+
+import de.hysky.skyblocker.utils.Utils;
+import net.minecraft.util.math.BlockPos;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.function.Supplier;
+
+public class ProfileAwareWaypoint extends Waypoint {
+ public final Set<String> foundProfiles = new HashSet<>();
+ private final float[] missingColor;
+ private final float[] foundColor;
+
+ public ProfileAwareWaypoint(BlockPos pos, Supplier<Type> typeSupplier, float[] missingColor, float[] foundColor) {
+ super(pos, typeSupplier, null);
+ this.missingColor = missingColor;
+ this.foundColor = foundColor;
+ }
+
+ @Override
+ public boolean shouldRender() {
+ return !foundProfiles.contains(Utils.getProfile());
+ }
+
+ @Override
+ public void setFound() {
+ foundProfiles.add(Utils.getProfile());
+ }
+
+ public void setFound(String profile) {
+ foundProfiles.add(profile);
+ }
+
+ @Override
+ public void setMissing() {
+ foundProfiles.remove(Utils.getProfile());
+ }
+
+ @Override
+ protected float[] getColorComponents() {
+ return foundProfiles.contains(Utils.getProfile()) ? foundColor : missingColor;
+ }
+}