Jump to content

Combine FML's IPlayerTracker and IConnectionHandler into forge events


Recommended Posts

Posted

As 1.7 is nearly upon us it also gives us the opportunity to refactor some packages. I propose to combine FML's network handlers into forge events along with the addition of a ServerListPingEvent. Below I have outlined what I hope to put in my pull request, depending on how much 1.7 changes things. If you think these handlers should remain in FML, I could just convert IPlayerTracker to events and add the extra data shown below along with the ServerListPingEvent.

 

 

(Client) net.minecraftforge.client.event.network.ClientConnectionOpenedRemoteEvent

- Was IConnectionHandler.connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager)

- Event would have access to:

  - NetClientHandler, was NetHandler. No longer need to cast to NetClientHandler.

  - Server IP address as string

  - Server Port as integer

  - INetworkManager

 

(Client) net.minecraftforge.client.event.network.ClientConnectionOpenedIntegratedEvent

- Was IConnectionHandler.connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager)

- Event would have access to:

  - NetClientHandler, was NetHandler. No longer need to cast to NetClientHandler.

  - Server as IntegratedServer, was MinecraftServer. No longer need to cast to IntegratedServer.

  - INetworkManager

 

(Server) net.minecraftforge.common.event.network.ServerReceiveConnectionEvent

- Was IConnectionHandler.connectionReceived(NetLoginHandler netHandler, INetworkManager manager)

- Cancellable event, a custom kick message could be assigned

- Event would have access to:

  - NetLoginHandler

  - TcpConnection (INetworkManager is an interface of TcpConnection, any reason to not use TcpConnection?)

 

 

(Server) net.minecraftforge.common.event.network.PlayerLoginEvent

- Was IConnectionHandler.playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager)

- Can be combined with IPlayerTracker.onPlayerLogin(EntityPlayer player)

- Event would have access to:

  - EntityPlayerMP

  - NetServerHandler, was NetHandler. No longer need to cast to NetServerHandler.

  - INetworkManager

  - MinecraftServer

 

(Client) net.minecraftforge.client.event.network.ClientLoginEvent

- Was IConnectionHandler.clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login)

- Event would have access to:

  - NetClientHandler, was NetHandler. No longer need to cast to NetClientHandler.

  - INetworkManager

  - Packet1Login

 

(Server) net.minecraftforge.common.event.network.PlayerLogoutEvent

- Was IPlayerTracker.onPlayerLogout(EntityPlayer player)

- Event would have access to:

  - NetClientHandler, was NetHandler. No longer need to cast to NetClientHandler.

  - INetworkManager

  - MinecraftServer

 

(Both) net.minecraftforge.common.event.network.ConnectionClosedEvent

- Was IConnectionHandler.connectionClosed(INetworkManager manager)

- Event would have access to:

  - INetworkManager

 

(Server) net.minecraftforge.common.event.network.PlayerChangedDimensionEvent

- Was IPlayerTracker.onPlayerChangedDimension(EntityPlayer player)

- Event would have access to:

  - EntityPlayerMP

  - MinecraftServer

  - Teleporter

  - Old dimension id

  - New dimension id

 

(Server) net.minecraftforge.common.event.network.PlayerRespawnEvent

- Was IPlayerTracker.onPlayerRespawn(EntityPlayer player)

- Event would have access to:

  - EntityPlayerMP

  - MinecraftServer

  - world the player is being respawned into.

  - boolean for if the player beat the game.

 

 

(Server) net.minecraftforge.common.event.network.ServerChatRecievedEvent

- Was ServerChatEvent,changed the name to match the client event and move to network package

 

 

(Client) net.minecraftforge.client.event.network.ClientChatRecievedEvent

- Move to network package

 

 

(Server) net.minecraftforge.common.event.network.ServerListPingEvent

- Event would have access to:

  - Pinger's address

  - Able to send back a custom MOTD

  - Able to send back a custom number of current players

  - Able to send back a custom number of maximum players

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Update: I stand corrected as I was able to dig up a relevant log from my earlier testing which highlights the overall issue but does not explain how to solve it. See, Diagnostic Logs for pack.mcmeta not found: https://pastebin.com/LXS8Rtna
    • Which mod was this? What are all the mods that were in use? It will help if enough information to replicate the problem is available.
    • I have been attempting to create a supplementary resource pack with Patchouli in order to add back the guidebook for Better End but unfortunately in every prototype I have made pack.mcmeta and my resource pack are not recognized. I have tested both zipped and unzipped and either way curseforge does not recognize my resource pack as existing. For testing I stripped my pack down to just the pack.mcmeta file and two empty folders labelled data and assets and I know the data folder is not the problem as firstly my first attempts just had an assets folder following Patchouli instructions and data came later in my flailing attempts to make anything in my pack work. The mcmeta file is not recognized whether or not I use this:  { "pack": { "pack_format": 15, "description": "A replacement for the BetterEnd Guide Book." } "language": { "en_US": { "name": "English", "region": "United States" } } } ,or this:  { "pack": { "pack_format": 15, "description": "A replacement for the BetterEnd Guide Book." } } I have made sure to only use lowercase and the pack folder is named better-end-guide. Is this some magic nonsense from me doing this manually instead of using an IDE or similar tool? Could it be because my files are by default in UTF-8 even though ANSI gives the same results? Is there a specific community secret tool I am supposed to use for zipping or specific settings? I am pulling my hair in distress. Unfortunately as there are no errors involved I lack logs to offer, if that disqualifies this thread please do not be harsh and instead if you can then please direct me to a forum with different rules and sufficiently respectful but knowledgeable as to be of assistance. Most of my experience with the programming community has been poor and so naturally I find myself wary.
    • I never picked up a tier 0 dragon skull to my knowledge. One of my other skulls must have bugged out and randomly became one. I was confused on what the heck it was and tried placing it, now the game will only crash because it can't render in whatever the heck the tier 0 skull is. This is on a server and it crashes anyone within render distance.
    • After setting up forge, making sure my drivers are updated, and downloading the create mod i tried to run forge and it said it crashed while trying to render the overlay, i heard about deleting a file called forge-client.toml, but when i looked at the config files(and all the files on my computer) it was nowhere to be found. https://pastebin.com/raw/TTyWWyeS
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.