Skip to content

Commit

Permalink
Fix zero-timestamp error
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Aug 28, 2021
1 parent 55321fd commit e200bd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
Expand Down

0 comments on commit e200bd6

Please sign in to comment.