Skip to content

Commit

Permalink
One more creeper beam (#583)
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin <92656833+kevinthegreat1@users.noreply.github.com>
  • Loading branch information
Fluboxer and kevinthegreat1 authored Mar 13, 2024
1 parent 26cf371 commit e93179a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class CreeperBeams extends DungeonPuzzle {
DyeColor.LIME.getColorComponents(),
DyeColor.YELLOW.getColorComponents(),
DyeColor.MAGENTA.getColorComponents(),
DyeColor.PINK.getColorComponents(),
};
private static final float[] GREEN_COLOR_COMPONENTS = DyeColor.GREEN.getColorComponents();

Expand Down Expand Up @@ -155,7 +156,7 @@ private static ArrayList<Beam> findLines(Vec3d creeperPos, ArrayList<BlockPos> t
ArrayList<Beam> result = new ArrayList<>();
allLines.sort(Comparator.comparingDouble(ObjectDoublePair::rightDouble));

while (result.size() < 4 && !allLines.isEmpty()) {
while (result.size() < 5 && !allLines.isEmpty()) {
Beam solution = allLines.get(0).left();
result.add(solution);

Expand All @@ -165,7 +166,7 @@ private static ArrayList<Beam> findLines(Vec3d creeperPos, ArrayList<BlockPos> t
allLines.removeIf(beam -> solution.containsComponentOf(beam.left()));
}

if (result.size() != 4) {
if (result.size() < 5) {
LOGGER.error("Not enough solutions found. This is bad...");
}

Expand Down

0 comments on commit e93179a

Please sign in to comment.