From e200bd670c12ead20fef6c007c96409b2d82175d Mon Sep 17 00:00:00 2001 From: William Date: Sat, 28 Aug 2021 12:46:22 +0100 Subject: [PATCH] Fix zero-timestamp error --- .../william278/huskhomes2/integrations/map/DynMap.java | 10 +++++----- .../huskhomes2/migrators/UpgradeDatabase.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/william278/huskhomes2/integrations/map/DynMap.java b/src/main/java/me/william278/huskhomes2/integrations/map/DynMap.java index bd87e2761..fd6a5ee8d 100644 --- a/src/main/java/me/william278/huskhomes2/integrations/map/DynMap.java +++ b/src/main/java/me/william278/huskhomes2/integrations/map/DynMap.java @@ -28,14 +28,14 @@ public class DynMap extends Map { private static Plugin dynMap; private static final HuskHomes plugin = HuskHomes.getInstance(); - private static final double MARKER_ICON_SCALE = 0.75; + private static final double MARKER_ICON_SCALE = 0.5; - // Returns the marker icons from the plugin resources in the correct format and scaled to look good with Dynmap + // Returns the marker icons from the plugin resources in the correct format and scaled to look good with DynMap private InputStream getScaledMarkerIconStream(BufferedImage image) { try { - BufferedImage scaledImage = new BufferedImage((int)(32 * MARKER_ICON_SCALE), (int)(32 * MARKER_ICON_SCALE), image.getType()); + BufferedImage scaledImage = new BufferedImage((int)(32 * MARKER_ICON_SCALE), (int)(32 * MARKER_ICON_SCALE), BufferedImage.TYPE_INT_ARGB); AffineTransform scaleInstance = AffineTransform.getScaleInstance(MARKER_ICON_SCALE, MARKER_ICON_SCALE); - AffineTransformOp scaleOp = new AffineTransformOp(scaleInstance, AffineTransformOp.TYPE_BILINEAR); + AffineTransformOp scaleOp = new AffineTransformOp(scaleInstance, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); scaleOp.filter(image, scaledImage); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ImageIO.write(scaledImage, "png", outputStream); @@ -142,7 +142,7 @@ public void initialize() { } } } catch (SQLException e) { - plugin.getLogger().log(Level.WARNING, "An SQL exception occurred adding homes and warps to the DynMap"); + plugin.getLogger().log(Level.WARNING, "An SQL exception occurred adding homes and warps to the DynMap", e); } }); diff --git a/src/main/java/me/william278/huskhomes2/migrators/UpgradeDatabase.java b/src/main/java/me/william278/huskhomes2/migrators/UpgradeDatabase.java index 59156e1bb..7b7db8818 100644 --- a/src/main/java/me/william278/huskhomes2/migrators/UpgradeDatabase.java +++ b/src/main/java/me/william278/huskhomes2/migrators/UpgradeDatabase.java @@ -90,7 +90,7 @@ public static void upgradeDatabase() { + " ADD `creation_time` timestamp NOT NULL DEFAULT 0;")) { tableUpdateStatement.execute(); try (PreparedStatement timeSettingStatement = HuskHomes.getConnection().prepareStatement( - "UPDATE " + HuskHomes.getSettings().getHomesDataTable() + " SET `creation_time`=CURRENT_TIMESTAMP;")) { + "UPDATE " + HuskHomes.getSettings().getWarpsDataTable() + " SET `creation_time`=CURRENT_TIMESTAMP;")) { timeSettingStatement.executeUpdate(); } plugin.getLogger().info("Database upgrade in progress... (2/2)");