mirror of
https://github.com/seppukudevelopment/seppuku
synced 2025-03-02 18:57:33 +00:00
Update finding method for cape
This commit is contained in:
parent
9736132998
commit
8c1cf70d2b
@ -36,7 +36,7 @@ public final class CapeManager {
|
|||||||
@Listener
|
@Listener
|
||||||
public void displayCape(EventCapeLocation event) {
|
public void displayCape(EventCapeLocation event) {
|
||||||
if (Minecraft.getMinecraft().player != null && event.getPlayer() != Minecraft.getMinecraft().player) {
|
if (Minecraft.getMinecraft().player != null && event.getPlayer() != Minecraft.getMinecraft().player) {
|
||||||
String uuid = event.getPlayer().getUniqueID().toString().replace("-", "");
|
final String uuid = event.getPlayer().getUniqueID().toString().replace("-", "");
|
||||||
if (this.hasCape(uuid)) {
|
if (this.hasCape(uuid)) {
|
||||||
final ResourceLocation cape = this.getCape(event.getPlayer());
|
final ResourceLocation cape = this.getCape(event.getPlayer());
|
||||||
if (cape != null) {
|
if (cape != null) {
|
||||||
@ -69,7 +69,12 @@ public final class CapeManager {
|
|||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
if (!line.toLowerCase().startsWith("no") && line.toLowerCase().endsWith("png")) {
|
if (!line.toLowerCase().startsWith("no") && line.toLowerCase().endsWith("png")) {
|
||||||
this.capeUserList.add(new CapeUser(uuid, line));
|
final BufferedImage imageIO = ImageIO.read(httpURLConnection.getInputStream());
|
||||||
|
if (imageIO != null) {
|
||||||
|
if (imageIO.getWidth() == 512 && imageIO.getHeight() == 256) {
|
||||||
|
this.capeUserList.add(new CapeUser(uuid, line));
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user