diff --git a/src/main/java/io/github/crucible/CrucibleConfigs.java b/src/main/java/io/github/crucible/CrucibleConfigs.java index bc9fbefb..d9fed4ae 100644 --- a/src/main/java/io/github/crucible/CrucibleConfigs.java +++ b/src/main/java/io/github/crucible/CrucibleConfigs.java @@ -2,10 +2,7 @@ import co.aikar.timings.Timings; import co.aikar.timings.TimingsManager; -import net.cubespace.Yamler.Config.Comment; -import net.cubespace.Yamler.Config.ConfigMode; -import net.cubespace.Yamler.Config.InvalidConfigurationException; -import net.cubespace.Yamler.Config.YamlConfig; +import net.cubespace.Yamler.Config.*; import net.minecraft.server.MinecraftServer; import net.minecraft.world.WorldServer; @@ -160,6 +157,12 @@ public class CrucibleConfigs extends YamlConfig { @Comment("Sets the server max tick time, experimental, can cause problems!") public int crucible_tickHandler_serverTickTime = 1000000000; + @Comments({"Removes some restrictions and safety checks, we will not offer support for this setting and it may cause problems.", + "Use it at your own risk!", + "Currently disabled checks by this:", + " * Server Icon max size check"}) + public boolean crucible_unsafe = false; + @Comment("Let timings be turned on since the server statup!") public boolean timings_enabledSinceServerStartup = false; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index c28c080f..e7c9c8df 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -9,6 +9,7 @@ import com.google.common.collect.MapMaker; import com.mojang.authlib.GameProfile; import cpw.mods.fml.common.FMLLog; +import io.github.crucible.CrucibleConfigs; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; @@ -259,8 +260,10 @@ static CraftIconCache loadServerIcon0(File file) throws Exception { 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"); + if (!CrucibleConfigs.configs.crucible_unsafe) { + 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);