Skip to content

Commit

Permalink
Forgot to fix highlight flicker in VacuumSolver
Browse files Browse the repository at this point in the history
  • Loading branch information
WannaBeIan committed Jan 6, 2025
1 parent aa270bf commit 8d85dfb
Showing 1 changed file with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private static void reset() {
}

public static void onParticle(ParticleS2CPacket packet) {
if (!Utils.isOnGarden() || SkyblockerConfigManager.get().farming.garden.vacuumSolver || !ParticleTypes.ANGRY_VILLAGER.equals(packet.getParameters().getType())) {
if (!Utils.isOnGarden() || !SkyblockerConfigManager.get().farming.garden.vacuumSolver || !ParticleTypes.ANGRY_VILLAGER.equals(packet.getParameters().getType())) {
return;
}

Expand Down Expand Up @@ -102,21 +102,30 @@ private static void linkMarkerWithDestination() {
}

private static void renderTrail(WorldRenderContext context) {
if (fixedDestination == null) return;
if (fixedDestination == null) {
return;
}

float[] color = {1f, 0f, 0f};

RenderHelper.renderFilled(context, new BlockPos((int) fixedDestination.getX(), (int) fixedDestination.getY(), (int) fixedDestination.getZ()), color, 2.0f, false);
RenderHelper.renderFilled(context, new BlockPos(
(int) fixedDestination.getX(),
(int) fixedDestination.getY(),
(int) fixedDestination.getZ()
), color, 2.0f, false);

linkedMarkers.entrySet().removeIf(entry -> entry.getKey().isRemoved());

for (BlockPos pos : linkedMarkers.values()) {
RenderHelper.renderFilled(context, pos, color, 2.0f, false);
}

if (linkedMarkers.isEmpty()) {
fixedDestination = null;
if (linkedMarkers.isEmpty() && fixedDestination != null) {
RenderHelper.renderFilled(context, new BlockPos(
(int) fixedDestination.getX(),
(int) fixedDestination.getY(),
(int) fixedDestination.getZ()
), color, 2.0f, false);
}
}

}

0 comments on commit 8d85dfb

Please sign in to comment.