mkremins / fanciful

Fancy Bukkit message formatting
MIT License
95 stars 82 forks source link

Allow FancyMessages to be sent in 1.10 #71

Closed EbonJaeger closed 8 years ago

EbonJaeger commented 8 years ago

With MC 1.10, the version format is slightly different, breaking previous substring calls.

The Pull Request changes the logic slightly so that the substring method to get the minor version is only called if the server is on MC 1.8, as this is the only time the minor version actually matters; higher versions don't use it.

MiniDigger commented 8 years ago

Why would you still want to use this lib if spigot has its own api for this now?

28andrew commented 8 years ago

It does? Where are the javadocs for it.

minecrafter commented 8 years ago

@MiniDigger It's all about compatibility. Spigot is providing CraftBukkit builds still, and they don't have the API.

MiniDigger commented 8 years ago

@xXAndrew28Xx https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.Spigot.html#sendMessage(net.md_5.bungee.api.chat.BaseComponent...) https://www.spigotmc.org/wiki/the-chat-component-api/ (replace player.sendMessage with player.spigot().sendMessage there is it was written for bungee)

mkremins commented 8 years ago

Looks good to me. Thanks for contributing!

Cryptite commented 8 years ago

0.3.4-SNAPSHOT isn't showing up on the repository. With it manually installed, however, I now get this error:

[15:50:58] [Server thread/WARN]: Could not find class. java.lang.ClassNotFoundException: Can't find the ChatSerializer class at mkremins.fanciful.FancyMessage.createChatPacket(FancyMessage.java:656) ~[?:?] at mkremins.fanciful.FancyMessage.send(FancyMessage.java:617) ~[?:?] at mkremins.fanciful.FancyMessage.send(FancyMessage.java:605) ~[?:?] at com.n9works.bukkit.help.ReportHandler.lambda$onPlayerLogin$259(ReportHandler.java:81) ~[?:?] at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftTask.run(CraftTask.java:58) [patched_1.10.jar:git-Paper-777] at org.bukkit.craftbukkit.v1_10_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [patched_1.10.jar:git-Paper-777] at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:802) [patched_1.10.jar:git-Paper-777] at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:403) [patched_1.10.jar:git-Paper-777] at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:730) [patched_1.10.jar:git-Paper-777] at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:629) [patched_1.10.jar:git-Paper-777] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]

EbonJaeger commented 8 years ago

I see the issue. In the Reflection class in the util package, it also assumes that there will only ever be one character after the last '.', which is really a bad assumption to make.