Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Use different Server-Icon.png sizes #38

Closed
KAMKEEL opened this issue Oct 18, 2020 · 4 comments
Closed

Can't Use different Server-Icon.png sizes #38

KAMKEEL opened this issue Oct 18, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@KAMKEEL
Copy link

KAMKEEL commented Oct 18, 2020

When you have a server-icon.png that is of different size from 64 pixels. This occurs. It doesn't seem to happen on KCauldron or UraniumMC

java.lang.IllegalArgumentException: Must be 64 pixels wide
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[Validate.class:2.6]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:262) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:256) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadIcon(CraftServer.java:824) [CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.(CraftServer.java:236) [CraftServer.class:1.7.10-4.1]
at net.minecraft.server.management.ServerConfigurationManager.(ServerConfigurationManager.java:130) [oi.class:?]
at net.minecraft.server.dedicated.DedicatedPlayerList.(SourceFile:14) [ls.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:234) [lt.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:641) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
[18:55:12 WARN]: Couldn't load server icon
java.lang.IllegalArgumentException: Must be 64 pixels wide
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[Validate.class:2.6]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:262) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:256) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadIcon(CraftServer.java:824) [CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.(CraftServer.java:240) [CraftServer.class:1.7.10-4.1]
at net.minecraft.server.management.ServerConfigurationManager.(ServerConfigurationManager.java:130) [oi.class:?]
at net.minecraft.server.dedicated.DedicatedPlayerList.(SourceFile:14) [ls.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:234) [lt.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:641) [MinecraftServer.class:?]

@juanmuscaria juanmuscaria added the bug Something isn't working label Oct 18, 2020
@juanmuscaria juanmuscaria self-assigned this Oct 18, 2020
@EverNife
Copy link
Member

Crucible code:

static CraftIconCache loadServerIcon0(BufferedImage image) throws Exception {
ByteBuf bytebuf = Unpooled.buffer();
Validate.isTrue(image.getWidth() == 64, "Must be 64 pixels wide");
Validate.isTrue(image.getHeight() == 64, "Must be 64 pixels high");
ImageIO.write(image, "PNG", new ByteBufOutputStream(bytebuf));
ByteBuf bytebuf1 = Base64.encode(bytebuf);
return new CraftIconCache("data:image/png;base64," + bytebuf1.toString(Charsets.UTF_8));
}

Uranium code:
https://github.com/UraniumMC/Uranium/blob/7686a6bd7781d69a17832dc2b0c5dcd0a4c9980a/src/main/java/org/bukkit/craftbukkit/CraftServer.java#L1746-L1755

Codes are the same for both Uranium and Crucible, i will test it soon on other version.

@KAMKEEL
Copy link
Author

KAMKEEL commented Oct 18, 2020

I know for a fact that server-icons of different sizes for both the Dev and Stable versions of Uranium, so it must be another line somewhere else. The png file I was using was 600x600 pixels if you were wondering.

@EverNife
Copy link
Member

Ok, tested it on other platforms. Its not a bug, its an intended behavior.

Not even on 1.12.2 this is allowed (tested on Mohist).

But this is something we may be able to get done.

@EverNife EverNife added enhancement New feature or request and removed bug Something isn't working labels Oct 18, 2020
juanmuscaria added a commit that referenced this issue Feb 12, 2021
@juanmuscaria
Copy link
Member

You can disable this check by enabling crucible.unsafe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants