Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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-

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-

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-

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-

can you send a packet

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

-hydroflame, author of the forge revolution-

  • Author

i managed to successfully SEND a packet, but the receiving didnt seem to work. i put a system print where the packet sends and it was fine, but where it's supposed to receive, nothing. unless im mistaken as to where the packet gets received.

 

-sorash67 || Skorpio

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-

  • Author

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

You need to build a packet with some data, make sure it uses your channel and send it ;)

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.