mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
Fix zero-timestamp error
This commit is contained in:
1 parent
55321fde1f
commit
e200bd670c
2 files changed
+6
-6
No files matched your search
@@ -28,14 +28,14 @@ public class DynMap extends Map {
|
|||||||
|
|
||||||
private static Plugin dynMap;
|
private static Plugin dynMap;
|
||||||
private static final HuskHomes plugin = HuskHomes.getInstance();
|
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) {
|
private InputStream getScaledMarkerIconStream(BufferedImage image) {
|
||||||
try {
|
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);
|
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);
|
scaleOp.filter(image, scaledImage);
|
||||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||||
ImageIO.write(scaledImage, "png", outputStream);
|
ImageIO.write(scaledImage, "png", outputStream);
|
||||||
@@ -142,7 +142,7 @@ public class DynMap extends Map {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} 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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class UpgradeDatabase {
|
|||||||
+ " ADD `creation_time` timestamp NOT NULL DEFAULT 0;")) {
|
+ " ADD `creation_time` timestamp NOT NULL DEFAULT 0;")) {
|
||||||
tableUpdateStatement.execute();
|
tableUpdateStatement.execute();
|
||||||
try (PreparedStatement timeSettingStatement = HuskHomes.getConnection().prepareStatement(
|
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();
|
timeSettingStatement.executeUpdate();
|
||||||
}
|
}
|
||||||
plugin.getLogger().info("Database upgrade in progress... (2/2)");
|
plugin.getLogger().info("Database upgrade in progress... (2/2)");
|
||||||
|
|||||||
Reference in new issue
Block a user