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

Posted

i'm having a problem with the new netty system where i can send a packet in singleplayer without any problems but when i try on a local server (using ip: localhost) it seams that the client sends and encode the packet but it never run the decode or handleServerSide code's

the packet i'm trying to send

package com.dark2222.vampiremod.core.PacketHandler.packets;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;

import com.dark2222.vampiremod.core.VampireMain;
import com.dark2222.vampiremod.core.BloodCore.BloodCore;
import com.dark2222.vampiremod.core.BloodCore.TickHandler;
import com.dark2222.vampiremod.core.PacketHandler.AbstractPacket;

import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.network.ByteBufUtils;
public class FoodPack extends AbstractPacket{
int i;

public FoodPack() {}

public FoodPack(int i){
	this.i = i;
}

@Override
public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
	buffer.writeInt(i);
}

@Override
public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) {
	i = buffer.readInt();
}

@Override
public void handleClientSide(EntityPlayer player) {
		System.out.print("Running Client ");
		BloodCore props = BloodCore.get(player);

}

@Override
public void handleServerSide(EntityPlayer player) 
{	
		System.out.print("Running server ");
		BloodCore props = BloodCore.get(player);
}

}

my packetpipeline class is just "copy-paste" from the tutorial as is the abstractPacket class

 

i register the packages in the packetpipeline

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...

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.