5zig / The-5zig-API

The official client API of The 5zig Mod.
Apache License 2.0
11 stars 2 forks source link

Communication with the API in 1.13? #32

Closed DoNotSpamPls closed 4 years ago

DoNotSpamPls commented 5 years ago

@5zig I've currently implemented a feature that disables 5-Zig features using the mod's integrated API, and that works well for 1.12 and below. The problem is that, on 1.13, I don't think the API is coded correctly.

public void onServerJoin(ServerJoinEvent event) {
    PayloadUtils.sendPayload(eu.the5zig.util.Utils.versionCompare(eu.the5zig.mod.Version.MCVERSION, "1.13").intValue() >= 0 ? "minecraft:register" : "REGISTER", PayloadUtils.writeString(io.netty.buffer.Unpooled.buffer(), "5zig_Set"));
    PayloadUtils.sendPayload("5zig_Set", io.netty.buffer.Unpooled.buffer().writeByte(4));
}

As we can see in the code, the new 1.13 register channel is used. However, the channel name 1) doesn't have a namespace (for example it should be 5zig:set, not 5Zig_Set) 2) includes capital letters

Both of these are violations of the requirements for the new 1.13 channels, and as so, I am unable to register a channel with such channel name in my Bukkit plugin (and even if I could, the channel name is violating the requirements anyway)

Could that get fixed in the next 5Zig 1.13+ version. Thanks!

5zig commented 5 years ago

Hi, thanks for the note - I will definitely fix this in the next (beta) version!

DoNotSpamPls commented 5 years ago

Hey @5zig, is there any progress on the issue? Sorry for bothering.