🐛 Fixed viewing issue

This commit is contained in:
SBDeveloper 2022-06-30 20:46:22 +02:00
parent bfaa99e5dd
commit a4f60fd01e
19 changed files with 71 additions and 74 deletions

View file

@ -34,13 +34,6 @@
<artifactId>MapReflectionAPI-API</artifactId>
<distributionManagement>
<repository>
<id>nexus-snapshots</id>
<url>https://repo.sbdevelopment.tech/repository/maven-snapshots/</url>
</repository>
</distributionManagement>
<properties>
<jdk.version>11</jdk.version>
</properties>
@ -55,35 +48,6 @@
<release>${jdk.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<serverId>nexus-snapshots</serverId>
<nexusUrl>https://repo.sbdevelopment.tech/</nexusUrl>
<skipStaging>true</skipStaging>
</configuration>
</plugin>
</plugins>
<resources>
<resource>

View file

@ -27,6 +27,8 @@ import com.bergerkiller.bukkit.common.map.MapColorPalette;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.util.Arrays;
import java.util.Objects;
public class ArrayImage {
public byte[] array;
@ -53,7 +55,7 @@ public class ArrayImage {
this.width = image.getWidth();
this.height = image.getHeight();
BufferedImage temp = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB);
BufferedImage temp = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = temp.createGraphics();
graphics.drawImage(image, 0, 0, null);
graphics.dispose();
@ -68,4 +70,33 @@ public class ArrayImage {
this.array = result;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ArrayImage)) return false;
ArrayImage that = (ArrayImage) o;
return width == that.width && height == that.height && imageType == that.imageType && Arrays.equals(array, that.array);
}
@Override
public int hashCode() {
int result = Objects.hash(width, height, imageType);
result = 31 * result + Arrays.hashCode(array);
return result;
}
@Override
public String toString() {
return "ArrayImage{" +
"array=" + Arrays.toString(array) +
", minX=" + minX +
", minY=" + minY +
", maxX=" + maxX +
", maxY=" + maxY +
", width=" + width +
", height=" + height +
", imageType=" + imageType +
'}';
}
}

View file

@ -80,6 +80,7 @@ public class MapManager {
return wrapper;
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
InvocationTargetException e) {
e.printStackTrace();
return null;
}
}