FountainMC / FountainAPI

A 'simple but beautiful' Minecraft Server Plugin API
https://fountainmc.org/
MIT License
5 stars 5 forks source link

Packet API #18

Open PizzaCrust opened 8 years ago

wgaylord commented 8 years ago

This is a great idea. (I wanted to do this for Dimensions.)

PizzaCrust commented 8 years ago

Its a core feature if forge mods are supported to enable plugins to interact with mods via packets.

Techcable commented 8 years ago

I say we keep the packet API as a unsafe API in a special package and as a separate maven dependency if we're going to do it at all. Sort of like sun.mic.Unsafe

PizzaCrust commented 8 years ago

just put it into a .internal.* package

Techcable commented 8 years ago

yes, and no reflection utilities or anything, just PacketMagic.registerPacketListener(Consumer<Object>) and PacketMagic.sendPacket(Player, Object)

minecrafter commented 8 years ago

Oppose, for portability's sake. Fountain can provide a few things to help, but in general I feel this is best handled outside Fountain.

wgaylord commented 8 years ago

We need to have it on foutain other wise people will be digging around with asm and reflection which is not good.

phase commented 8 years ago

Putting in the API is a bad idea. We could have it in the the implementation, so if people want to build off a specific version they get that version's Packets.

Techcable commented 8 years ago

Unless we're going to wrap all packets in a version-safe manner, plugins will have to access packet fields with reflection. Therefore we should put the PacketMagic class in the implementation, and then plugins like ProtocolLib can provide a safer and more advanced wrapper, but will have to hook into our internals to do so.

PizzaCrust commented 8 years ago

Sponge has this already implemented. (Custom Payload Packet), https://github.com/SpongePowered/SpongeAPI/pull/363/commits/e9f96b70c943d267de6756fe91dcc180a843fcdf

minecrafter commented 8 years ago

Nope. That Sponge PR refers to plugin messaging.

On Jun 16, 2016, at 12:09 AM, PizzaCrust notifications@github.com wrote:

Sponge has this already implemented. (Custom Payload Packet), SpongePowered/SpongeAPI@e9f96b7 https://github.com/SpongePowered/SpongeAPI/pull/363/commits/e9f96b70c943d267de6756fe91dcc180a843fcdf — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/FountainMC/FountainAPI/issues/18#issuecomment-226383672, or mute the thread https://github.com/notifications/unsubscribe/AA7z9EE_Vsj6LboepBpiiqoGuq67joaPks5qMMyCgaJpZM4I2Wl3.

PizzaCrust commented 8 years ago

Add ChannelBuf. ChannelBuf is an abstract interface to represent a ByteBuffer to allow plugins and the server to read and write data without depending on a specific networking library.

That are packets. Packets = Messages.

minecrafter commented 8 years ago

I have worked with this specific Sponge API. This is the standard Plugin Message packet in Minecraft. Fountain will support listening and sending messages with this specific packet.

On Jun 16, 2016, at 12:15 AM, PizzaCrust notifications@github.com wrote:

Add ChannelBuf. ChannelBuf is an abstract interface to represent a ByteBuffer to allow plugins and the server to read and write data without depending on a specific networking library.

That are packets. Packets = Messages.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/FountainMC/FountainAPI/issues/18#issuecomment-226384296, or mute the thread https://github.com/notifications/unsubscribe/AA7z9Cy6UiqOPEwfaELoB-Qm5pxX2a5sks5qMM3lgaJpZM4I2Wl3.

PizzaCrust commented 8 years ago

Oh, good.