add Spotless plugin: enforce code formatting
This commit is contained in:
1 parent
dce7804fed
commit
7063d27fb4
72 files changed
+1335
-816
No files matched your search
@@ -1,13 +1,12 @@
|
||||
package eu.mhsl.minecraft.pixelpics.utils;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.map.MapCanvas;
|
||||
import org.bukkit.map.MapRenderer;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* Draws precomputed map palette indices onto the canvas. Supports a Polaroid-style "developing"
|
||||
* animation: the picture dissolves in over {@link #DEVELOP_MILLIS} once the render is ready, like an
|
||||
@@ -24,9 +23,9 @@ public class ImageMapRenderer extends MapRenderer {
|
||||
private static byte filmIndex = 0;
|
||||
private static boolean filmResolved = false;
|
||||
|
||||
private volatile byte[] indices; // MAP_SIZE*MAP_SIZE, null while still rendering
|
||||
private volatile byte[] indices; // MAP_SIZE*MAP_SIZE, null while still rendering
|
||||
private final boolean animate;
|
||||
private volatile long developStart = 0; // 0 until indices are available
|
||||
private volatile long developStart = 0; // 0 until indices are available
|
||||
private boolean finished = false;
|
||||
private boolean blankDrawn = false;
|
||||
|
||||
@@ -88,8 +87,7 @@ public class ImageMapRenderer extends MapRenderer {
|
||||
byte film = film();
|
||||
for (int y = 0; y < MAP_SIZE; y++) {
|
||||
for (int x = 0; x < MAP_SIZE; x++) {
|
||||
byte value = (progress >= 1.0 || revealThreshold(x, y) <= progress)
|
||||
? data[y * MAP_SIZE + x] : film;
|
||||
byte value = (progress >= 1.0 || revealThreshold(x, y) <= progress) ? data[y * MAP_SIZE + x] : film;
|
||||
canvas.setPixel(x, y, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
package eu.mhsl.minecraft.pixelpics.utils;
|
||||
|
||||
import eu.mhsl.minecraft.pixelpics.render.util.ColorUtil;
|
||||
import org.bukkit.map.MapPalette;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.bukkit.map.MapPalette;
|
||||
|
||||
/**
|
||||
* The set of usable Minecraft map colors, with nearest-color matching in CIELAB (perceptual) space.
|
||||
@@ -92,7 +91,7 @@ public final class MapColorPalette {
|
||||
double fx = pivotXyz(x / 0.95047);
|
||||
double fy = pivotXyz(y);
|
||||
double fz = pivotXyz(z / 1.08883);
|
||||
return new double[]{116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)};
|
||||
return new double[] {116 * fy - 16, 500 * (fx - fy), 200 * (fy - fz)};
|
||||
}
|
||||
|
||||
private static double pivotXyz(double t) {
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
package eu.mhsl.minecraft.pixelpics.utils;
|
||||
|
||||
import eu.mhsl.minecraft.pixelpics.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.MapMeta;
|
||||
import org.bukkit.map.MapView;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -19,6 +9,15 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.imageio.ImageIO;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.MapMeta;
|
||||
import org.bukkit.map.MapView;
|
||||
|
||||
/**
|
||||
* Persists rendered images (PNG, source of truth) and their dithered map-color indices (cache) to
|
||||
|
||||
Reference in new issue
Block a user