add Spotless plugin: enforce code formatting
This commit is contained in:
@@ -21,14 +21,13 @@ import eu.mhsl.minecraft.pixelpics.survival.CraftingListener;
|
||||
import eu.mhsl.minecraft.pixelpics.survival.JoinListener;
|
||||
import eu.mhsl.minecraft.pixelpics.survival.SurvivalRecipes;
|
||||
import eu.mhsl.minecraft.pixelpics.utils.MapColorPalette;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public final class Main extends JavaPlugin {
|
||||
|
||||
@@ -75,8 +74,9 @@ public final class Main extends JavaPlugin {
|
||||
int timeoutSeconds = Math.max(1, getConfig().getInt("render.timeout-seconds", 30));
|
||||
|
||||
this.renderManager = new RenderManager(this, threads, maxConcurrent, queueSize, timeoutSeconds);
|
||||
getLogger().info("Render pool: " + threads + " core(s), max " + maxConcurrent
|
||||
+ " concurrent, queue " + queueSize + ", timeout " + timeoutSeconds + "s.");
|
||||
getLogger()
|
||||
.info("Render pool: " + threads + " core(s), max " + maxConcurrent + " concurrent, queue " + queueSize
|
||||
+ ", timeout " + timeoutSeconds + "s.");
|
||||
}
|
||||
|
||||
private void initRenderer() {
|
||||
@@ -87,9 +87,10 @@ public final class Main extends JavaPlugin {
|
||||
|
||||
Optional<ResourcePack> pack = ResourcePackLoader.load(resourcePackDir, getLogger());
|
||||
if (pack.isEmpty()) {
|
||||
getLogger().severe("No resource pack found in " + resourcePackDir.getPath()
|
||||
+ " — place a vanilla resource pack (directory with assets/minecraft/... or a .zip) there. "
|
||||
+ "/pixelPic is disabled until a pack is available.");
|
||||
getLogger()
|
||||
.severe("No resource pack found in " + resourcePackDir.getPath()
|
||||
+ " — place a vanilla resource pack (directory with assets/minecraft/... or a .zip) there. "
|
||||
+ "/pixelPic is disabled until a pack is available.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -99,8 +100,7 @@ public final class Main extends JavaPlugin {
|
||||
BlockModelRegistry registry = new BlockModelRegistry(reader, textures);
|
||||
BiomeTintProvider tintProvider = new BiomeTintProvider(textures);
|
||||
|
||||
CemModelLoader cemLoader =
|
||||
new CemModelLoader();
|
||||
CemModelLoader cemLoader = new CemModelLoader();
|
||||
try (InputStream in = getResource("cem/cem_template_models.json")) {
|
||||
int n = in == null ? 0 : cemLoader.load(in, getLogger());
|
||||
getLogger().info("Loaded " + n + " CEM entity models.");
|
||||
@@ -108,16 +108,19 @@ public final class Main extends JavaPlugin {
|
||||
getLogger().severe("Failed to load CEM entity models: " + e.getMessage());
|
||||
}
|
||||
SkinCache skinCache = new SkinCache();
|
||||
BitmapFont font =
|
||||
FontLoader.load(resourcePack, textures, getLogger());
|
||||
BitmapFont font = FontLoader.load(resourcePack, textures, getLogger());
|
||||
getLogger().info("Loaded sign font (" + (font.isEmpty() ? "no glyphs — text disabled" : "ok") + ").");
|
||||
CemBaker entityBaker =
|
||||
new CemBaker(cemLoader, textures, skinCache);
|
||||
BlockEntityBaker blockEntityBaker =
|
||||
new BlockEntityBaker(cemLoader, textures, skinCache, font);
|
||||
CemBaker entityBaker = new CemBaker(cemLoader, textures, skinCache);
|
||||
BlockEntityBaker blockEntityBaker = new BlockEntityBaker(cemLoader, textures, skinCache, font);
|
||||
|
||||
this.screenRenderer = new DefaultScreenRenderer(registry, tintProvider, textures, entityBaker,
|
||||
blockEntityBaker, getLogger(), renderManager.tracePool());
|
||||
this.screenRenderer = new DefaultScreenRenderer(
|
||||
registry,
|
||||
tintProvider,
|
||||
textures,
|
||||
entityBaker,
|
||||
blockEntityBaker,
|
||||
getLogger(),
|
||||
renderManager.tracePool());
|
||||
// Warm the map palette on the main thread so off-thread dithering never triggers its first init.
|
||||
MapColorPalette.size();
|
||||
getLogger().info("PixelPics renderer initialized with resource pack assets.");
|
||||
|
||||
Reference in New Issue
Block a user