Jump to content

Recommended Posts

Posted

Hello,

Looks like IConnectionHandler is dissapeared in 1.7 and i still need something like that.

I searched but didn't find anything same like that.

Whats the new IConnectonHandler in 1.7.10?

How can i register that class? Because NetworkRegistry.instance().registerConnectionHandler is also dissapeared.

Thanks!

 

Posted

Okey, thanks!

So far i made:

package com.fluffy.amnesia.handler;

import com.fluffy.amnesia.Amnesia;
import com.fluffy.amnesia.pakets.SettingsMessageHandler;

import net.minecraft.network.INetHandler;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.INetHandlerPlayClient;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.FMLNetworkEvent;

public class ConnectionHandler extends FMLNetworkEvent
{   
public ConnectionHandler(INetHandler thing, Class type, NetworkManager manager) {

	super(thing, type, manager);
}

@SubscribeEvent
public void onClientConnection(ClientConnectedToServerEvent event){
	Amnesia.snw.sendToAll(new SettingsMessageHandler());
}
}

 

There is a problem with the constructer because FMLNetworkEvent(stuffs...) is not visible.

Also i can use FMLCommonHandler to register it or there is something special for that?

Thanks!

Posted

Ohhhhh my bad....

This shoud work now.

New code:

public class ConnectionHandler
{   
@SubscribeEvent
public void onClientConnection(ClientConnectedToServerEvent event){
	Amnesia.snw.sendToAll(new SettingsMessageHandler());
}
}

 

Im just using this for registering:

FMLCommonHandler.instance().bus().register(new ConnectionHandler());

Thanks for opening my eyes!

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



×
×
  • Create New...

Important Information

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