Jump to content

Recommended Posts

Posted

start by looking at the tutorials, play around with things and THEN ill help, someone spent time making a tutorial about it so dont make his effort be wasted

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

we told you what you need earlier

 

 

look at the wiki,

look at other people code

 

 

were NOT going to make it for you

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

how come everyone else was able to figure it out except you?

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

have you even coded something about all this yet, do you have a packet handler class yet ??

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

your packet isnt received, we can then conclude that you didnt register your packet handler correctly

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

i wonder if youd say this is incorrect:

@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = { "MoreOresMod" }, packetHandler = PacketHandlerMoreOres.class)

 

packet handler:

package moreores;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;

import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;

public class PacketHandlerMoreOres implements IPacketHandler{

@Override
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
	if(packet.channel.equals("MoreOresMod")){
		handlePacket(packet);
	}

}

public void handlePacket(Packet250CustomPayload packet){
	DataInputStream inputStream = new DataInputStream(new ByteArrayInputStream(packet.data));

	int randomInt1;
	int randomInt2;

	try{
		randomInt1 = inputStream.readInt();
		randomInt2 = inputStream.readInt();
	}catch(IOException e){
		e.printStackTrace();
		return;
	}

	System.out.println(randomInt1 + "" + randomInt2);
}

}

 

-sorash67 || Skorpio

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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