Skip to content

Commit

Permalink
Fix ender nodes detection
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Dec 22, 2024
1 parent bcfade2 commit 299124b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ public static void onParticle(ParticleS2CPacket packet) {

EnderNode enderNode = enderNodes.computeIfAbsent(pos, EnderNode::new);
IntIntPair particles = enderNode.particles.get(direction);
particles.left(particles.leftInt() + 1);
particles.right(particles.rightInt() + 1);
if (ParticleTypes.PORTAL.getType().equals(particleType)) {
particles.left(particles.leftInt() + 1);
} else if (ParticleTypes.WITCH.getType().equals(particleType)) {
particles.right(particles.rightInt() + 1);
}
}

private static void update() {
Expand Down Expand Up @@ -120,7 +123,7 @@ Direction.NORTH, new IntIntMutablePair(0, 0)
private long lastConfirmed;

private EnderNode(BlockPos pos) {
super(pos, () -> SkyblockerConfigManager.get().uiAndVisuals.waypoints.waypointType, ColorUtils.getFloatComponents(DyeColor.CYAN), false);
super(pos, () -> SkyblockerConfigManager.get().uiAndVisuals.waypoints.waypointType.withoutBeacon(), ColorUtils.getFloatComponents(DyeColor.CYAN), false);
}

private void updateParticles() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,13 @@ public String asString() {
public String toString() {
return I18n.translate("skyblocker.waypoints.type." + name());
}

public Type withoutBeacon() {
return switch (this) {
case WAYPOINT -> HIGHLIGHT;
case OUTLINED_WAYPOINT -> OUTLINED_HIGHLIGHT;
default -> this;
};
}
}
}

0 comments on commit 299124b

Please sign in to comment.