Jump to content

Recommended Posts

Posted

Hello i was having issues with that Netty packet handler it leaks and it shows like "mhfc:100" which is one reason why i tried diesieben's tutorial on SimpleMessage but i dont see any handleClientSide in there which probably will be an issue for my PacketAI's

 

Heres my progress so far

 

Packet

package mhfc.heltrato.common.network.message;

import io.netty.buffer.ByteBuf;
import mhfc.heltrato.common.entity.mob.EntityRathalos;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;

public class PacketAIMessageTest implements IMessage {

private static byte animID;
private static int entityID;
public PacketAIMessageTest() {

}

public PacketAIMessageTest(byte anim, EntityRathalos e){
	animID = anim;
	entityID = e.getEntityId();
}

@Override
public void fromBytes(ByteBuf buf) {
	animID = buf.readByte();
	entityID = buf.readInt();

}

@Override
public void toBytes(ByteBuf buf) {
	buf.writeByte(animID);
	buf.writeInt(entityID);
}

public static void handleTheClient(EntityPlayer player) {
	EntityRathalos entity = (EntityRathalos)player.worldObj.getEntityByID(entityID);
	if(entity != null && animID != -1){
		entity.setAnimID(animID);
		if(animID == 0) entity.setAnimTick(0);
	}
}

public static class PacketAIRathalosHandler implements IMessageHandler<PacketAIMessageTest, IMessage> {
	private EntityPlayer player;

	public IMessage onMessage(PacketAIMessageTest message,MessageContext ctx) {
		handleTheClient(player);
		return null;
	}

}
}



 

My entity packet sender

public void sendAttackPacket(int id) {
	if(MHFCMain.isEffectiveClient()) return;
	currentAttackID = id;
//	MHFCMain.packetPipeline.sendToAll(new PacketAIRathalos((byte)id, this));
	MHFCMain.network.sendToAll(new PacketAIMessageTest((byte)id, this));
}

public boolean attackEntityAsMob(Entity entity){
	if(!worldObj.isRemote) {
		if(currentAttackID == 0){
			sendAttackPacket(1);
		}
		if(currentAttackID == 0 && rand.nextInt(4) == 0){
			sendAttackPacket(2);
		}
	}
	return true;
}

Posted

When you register your packet, the Side argument is which side you're sending the message to. So you should handle the client side in your on onMessage method.

Kain

Posted

ok i think i only have a few problem how do i make an instances for EntityPlayer

well it always says i cant instantiate entityplayer

 

it sends java.lang.nullpointexception

 

crash

[00:37:51] [Client thread/ERROR]: There was a critical exception handling a packet on channel mhfcs
java.lang.NullPointerException
at mhfc.heltrato.common.network.message.PacketAIMessageTest.handleTheClient(PacketAIMessageTest.java:37) ~[PacketAIMessageTest.class:?]
at mhfc.heltrato.common.network.message.PacketAIMessageTest$PacketAIRathalosHandler.onMessage(PacketAIMessageTest.java:48) ~[PacketAIMessageTest$PacketAIRathalosHandler.class:?]
at mhfc.heltrato.common.network.message.PacketAIMessageTest$PacketAIRathalosHandler.onMessage(PacketAIMessageTest.java:1) ~[PacketAIMessageTest$PacketAIRathalosHandler.class:?]
at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:34) ~[simpleChannelHandlerWrapper.class:?]
at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:14) ~[simpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) [NetworkManager.class:?]
at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:321) [PlayerControllerMP.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1649) [Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:912) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]

 

I register it here btw

here my main mod

@Mod.EventHandler
public void load(FMLInitializationEvent event){

network = NetworkRegistry.INSTANCE.newSimpleChannel("mhfcs");
network.registerMessage(PacketAIMessageTest.PacketAIRathalosHandler.class, PacketAIMessageTest.class, 0, Side.CLIENT);

}

Posted

Ok i think i got it work but during my test it suddenly crashes

 

Jul 13, 2014 1:05:14 AM io.netty.channel.embedded.EmbeddedChannel recordException
WARNING: More than one exception was raised. Will report only the first one and log others.
java.lang.RuntimeException: Timeout waiting for client thread to catch up!
at cpw.mods.fml.client.FMLClientHandler.waitForPlayClient(FMLClientHandler.java:843)
at cpw.mods.fml.client.FMLClientHandler.fireNetRegistrationEvent(FMLClientHandler.java:852)
at cpw.mods.fml.common.FMLCommonHandler.fireNetRegistrationEvent(FMLCommonHandler.java:589)
at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:28)
at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169)
at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:257)
at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:185)
at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:43)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:313)
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:43)
at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:299)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
at java.lang.Thread.run(Unknown Source)

[01:05:15] [server thread/INFO]: XxHeltratoxX lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null}}
[01:05:15] [server thread/INFO]: XxHeltratoxX left the game
[01:05:15] [server thread/INFO]: Stopping singleplayer server as player logged out
[01:05:15] [server thread/INFO]: Stopping server
[01:05:15] [server thread/INFO]: Saving players
[01:05:15] [server thread/INFO]: Saving worlds
[01:05:15] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[01:05:15] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[01:05:15] [server thread/INFO]: Saving chunks for level 'New World'/The End
[01:05:17] [server thread/INFO]: Unloading dimension 0
[01:05:17] [server thread/INFO]: Unloading dimension -1
[01:05:17] [server thread/INFO]: Unloading dimension 1
[01:05:17] [server thread/INFO]: Applying holder lookups
[01:05:17] [server thread/INFO]: Holder lookups applied
[01:05:18] [server thread/INFO]: Starting integrated minecraft server version 1.7.2
[01:05:18] [server thread/INFO]: Generating keypair
[01:05:19] [server thread/INFO]: Injecting existing block and item data into this server instance
[01:05:19] [server thread/INFO]: Applying holder lookups
[01:05:19] [server thread/INFO]: Holder lookups applied
[01:05:19] [server thread/INFO]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@40d82ea9)
[01:05:19] [server thread/INFO]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@40d82ea9)
[01:05:19] [server thread/INFO]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@40d82ea9)
[01:05:19] [server thread/INFO]: Preparing start region for level 0
[01:05:20] [Netty Client IO #1/INFO]: Server protocol version 1
[01:05:20] [Netty IO #3/INFO]: Client protocol version 1
[01:05:20] [Netty IO #3/INFO]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]
[01:05:20] [Netty IO #3/INFO]: Attempting connection with missing mods [] at CLIENT
[01:05:20] [Netty Client IO #1/INFO]: Attempting connection with missing mods [] at SERVER
[01:05:20] [server thread/INFO]: [server thread] Server side modded connection established
[01:05:20] [server thread/INFO]: XxHeltratoxX[local:E:091b44fb] logged in with entity id 91 at (364.5, 4.0, 13.5)
[01:05:20] [server thread/INFO]: XxHeltratoxX joined the game
[01:05:20] [Client thread/INFO]: [Client thread] Client side modded connection established
[01:05:20] [server thread/INFO]: Saving and pausing game...
[01:05:21] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[01:05:21] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[01:05:21] [server thread/INFO]: Saving chunks for level 'New World'/The End
[01:05:31] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2781ms behind, skipping 55 tick(s)
[01:05:31] [server thread/INFO]: Saving and pausing game...
[01:05:31] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[01:05:31] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[01:05:31] [server thread/INFO]: Saving chunks for level 'New World'/The End
    ERROR MESSAGE:
        SoundSystem did not load after 30 seconds.

Starting up SoundSystem...
Switching to No Sound
    (Silent Mode)

[01:05:46] [sound Library Loader/INFO]: Sound engine started
[01:05:46] [server thread/INFO]: Stopping server
[01:05:46] [server thread/INFO]: Saving players
[01:05:46] [server thread/INFO]: Saving worlds
[01:05:46] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[01:05:46] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[01:05:46] [server thread/INFO]: Saving chunks for level 'New World'/The End
[01:05:47] [server thread/INFO]: Unloading dimension 0
[01:05:47] [server thread/INFO]: Unloading dimension -1
[01:05:47] [server thread/INFO]: Unloading dimension 1
[01:05:47] [server thread/INFO]: Applying holder lookups
[01:05:47] [server thread/INFO]: Holder lookups applied
[01:05:47] [Client thread/FATAL]: Unreported exception thrown!
java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalGetSourcei(II)I
at org.lwjgl.openal.AL10.nalGetSourcei(Native Method) ~[lwjgl-2.9.0.jar:?]
at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:853) ~[lwjgl-2.9.0.jar:?]
at paulscode.sound.libraries.ChannelLWJGLOpenAL.playing(ChannelLWJGLOpenAL.java:651) ~[ChannelLWJGLOpenAL.class:?]
at paulscode.sound.Source.playing(Source.java:1213) ~[source.class:?]
at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:556) ~[soundManager$SoundSystemStarterThread.class:?]
at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:253) ~[soundManager.class:?]
at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:222) ~[soundHandler.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2071) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:912) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!

Time: 7/13/14 1:05 AM
Description: Unexpected error

java.lang.UnsatisfiedLinkError: org.lwjgl.openal.AL10.nalGetSourcei(II)I
at org.lwjgl.openal.AL10.nalGetSourcei(Native Method)
at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:853)
at paulscode.sound.libraries.ChannelLWJGLOpenAL.playing(ChannelLWJGLOpenAL.java:651)
at paulscode.sound.Source.playing(Source.java:1213)
at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:556)
at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:253)
at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:222)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:2071)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:996)
at net.minecraft.client.Minecraft.run(Minecraft.java:912)
at net.minecraft.client.main.Main.main(Main.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at org.lwjgl.openal.AL10.nalGetSourcei(Native Method)
at org.lwjgl.openal.AL10.alGetSourcei(AL10.java:853)
at paulscode.sound.libraries.ChannelLWJGLOpenAL.playing(ChannelLWJGLOpenAL.java:651)
at paulscode.sound.Source.playing(Source.java:1213)
at net.minecraft.client.audio.SoundManager$SoundSystemStarterThread.playing(SoundManager.java:556)
at net.minecraft.client.audio.SoundManager.updateAllSounds(SoundManager.java:253)
at net.minecraft.client.audio.SoundHandler.update(SoundHandler.java:222)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['XxHeltratoxX'/91, l='MpServer', x=357.71, y=8.11, z=11.37]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 
Level spawn location: World: (366,4,12), Chunk: (at 14,0,12 in 22,0; contains blocks 352,0,0 to 367,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 1572 game time, 1572 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 74 total; [EntitySlime['Slime'/88195, l='MpServer', x=385.31, y=4.00, z=-63.41], EntitySlime['Slime'/20867, l='MpServer', x=354.21, y=4.81, z=30.53], EntitySlime['Slime'/46340, l='MpServer', x=296.28, y=4.00, z=36.69], EntitySlime['Slime'/20869, l='MpServer', x=369.68, y=4.84, z=40.29], EntitySmallFireball['Small Fireball'/142469, l='MpServer', x=366.35, y=8.65, z=18.47], EntitySmallFireball['Small Fireball'/143493, l='MpServer', x=364.32, y=12.75, z=20.58], EntitySmallFireball['Small Fireball'/142865, l='MpServer', x=364.79, y=10.91, z=19.52], EntitySlime['Slime'/101782, l='MpServer', x=395.11, y=4.00, z=-66.59], EntityClientPlayerMP['XxHeltratoxX'/91, l='MpServer', x=357.71, y=8.11, z=11.37], EntityCow['Cow'/12080, l='MpServer', x=310.22, y=4.00, z=-13.78], EntityCow['Cow'/12081, l='MpServer', x=300.22, y=4.00, z=-5.81], EntityCow['Cow'/12082, l='MpServer', x=309.50, y=4.00, z=-11.78], EntityCow['Cow'/12083, l='MpServer', x=311.78, y=4.00, z=-12.22], EntityHorse['Donkey'/12084, l='MpServer', x=312.41, y=4.00, z=-18.53], EntityHorse['Donkey'/12085, l='MpServer', x=313.41, y=4.00, z=-20.19], EntityHorse['Donkey'/12087, l='MpServer', x=310.81, y=4.00, z=-16.25], EntitySheep['Sheep'/12089, l='MpServer', x=312.50, y=4.00, z=-15.50], EntitySheep['Sheep'/12090, l='MpServer', x=316.50, y=4.00, z=-17.50], EntitySheep['Sheep'/12091, l='MpServer', x=323.88, y=4.00, z=-22.25], EntitySlime['Slime'/61, l='MpServer', x=281.21, y=4.00, z=-4.31], EntitySlime['Slime'/63, l='MpServer', x=279.71, y=4.00, z=78.71], EntitySlime['Slime'/66, l='MpServer', x=352.28, y=4.00, z=81.13], EntityRathalos['Rathalos'/68, l='MpServer', x=363.75, y=11.52, z=21.28], EntityHorse['Horse'/11972, l='MpServer', x=339.16, y=4.00, z=-11.19], EntitySmallFireball['Small Fireball'/69, l='MpServer', x=366.19, y=6.38, z=21.91], EntitySmallFireball['Small Fireball'/70, l='MpServer', x=366.47, y=6.41, z=21.91], EntitySmallFireball['Small Fireball'/71, l='MpServer', x=367.63, y=6.47, z=19.78], EntityHorse['Horse'/11975, l='MpServer', x=338.50, y=4.00, z=-5.50], EntitySmallFireball['Small Fireball'/142149, l='MpServer', x=366.20, y=7.96, z=18.21], EntityHorse['Horse'/12104, l='MpServer', x=313.47, y=4.00, z=-39.50], EntitySheep['Sheep'/11977, l='MpServer', x=341.50, y=4.00, z=-9.50], EntityHorse['Horse'/12105, l='MpServer', x=314.75, y=4.00, z=-37.88], EntitySheep['Sheep'/11978, l='MpServer', x=337.50, y=4.00, z=-11.50], EntityHorse['Horse'/12106, l='MpServer', x=319.56, y=4.00, z=-39.16], EntitySheep['Sheep'/11979, l='MpServer', x=338.50, y=4.00, z=-15.50], EntityHorse['Horse'/12107, l='MpServer', x=319.84, y=4.00, z=-40.91], EntitySheep['Sheep'/11980, l='MpServer', x=333.82, y=4.00, z=-15.10], EntityPig['Pig'/12108, l='MpServer', x=318.84, y=4.00, z=-37.50], EntityPig['Pig'/12109, l='MpServer', x=305.06, y=4.00, z=-45.22], EntitySlime['Slime'/107852, l='MpServer', x=297.18, y=4.00, z=56.01], EntitySmallFireball['Small Fireball'/78, l='MpServer', x=366.97, y=6.19, z=18.94], EntitySheep['Sheep'/11982, l='MpServer', x=347.13, y=4.00, z=-12.94], EntityPig['Pig'/12110, l='MpServer', x=310.53, y=4.00, z=-41.84], EntitySmallFireball['Small Fireball'/143180, l='MpServer', x=364.32, y=12.38, z=20.52], EntitySlime['Slime'/79, l='MpServer', x=345.41, y=4.00, z=22.28], EntityPig['Pig'/12111, l='MpServer', x=311.09, y=4.00, z=-44.63], EntitySheep['Sheep'/12112, l='MpServer', x=305.97, y=4.00, z=-39.06], EntityTigrex['Tigrex'/81, l='MpServer', x=368.38, y=4.00, z=15.84], EntitySheep['Sheep'/12113, l='MpServer', x=307.53, y=4.00, z=-45.69], EntitySheep['Sheep'/12114, l='MpServer', x=310.50, y=4.00, z=-47.50], EntitySlime['Slime'/83, l='MpServer', x=402.66, y=4.00, z=17.69], EntitySheep['Sheep'/12115, l='MpServer', x=305.25, y=4.00, z=-49.66], EntitySlime['Slime'/46804, l='MpServer', x=288.78, y=4.00, z=41.63], EntitySlime['Slime'/85, l='MpServer', x=410.75, y=4.00, z=-59.51], EntitySlime['Slime'/86, l='MpServer', x=390.37, y=4.00, z=-13.81], EntitySlime['Slime'/87, l='MpServer', x=405.91, y=4.00, z=4.97], EntitySlime['Slime'/88, l='MpServer', x=401.84, y=4.17, z=-4.77], EntitySmallFireball['Small Fireball'/144218, l='MpServer', x=364.30, y=13.37, z=20.57], EntitySlime['Slime'/90, l='MpServer', x=415.94, y=4.00, z=-32.37], EntitySlime['Slime'/106088, l='MpServer', x=386.00, y=4.00, z=60.28], EntityPig['Pig'/12010, l='MpServer', x=282.50, y=4.00, z=-14.50], EntityPig['Pig'/12011, l='MpServer', x=282.50, y=4.00, z=-17.50], EntitySlime['Slime'/4332, l='MpServer', x=320.09, y=4.66, z=12.37], EntityCow['Cow'/12020, l='MpServer', x=347.16, y=4.00, z=75.19], EntityCow['Cow'/12021, l='MpServer', x=342.44, y=4.00, z=71.13], EntityCow['Cow'/12022, l='MpServer', x=343.50, y=4.00, z=68.50], EntityCow['Cow'/12023, l='MpServer', x=342.72, y=4.00, z=69.84], EntityHorse['Horse'/12024, l='MpServer', x=346.50, y=4.00, z=73.50], EntitySmallFireball['Small Fireball'/143866, l='MpServer', x=364.22, y=13.09, z=20.55], EntityHorse['Horse'/12027, l='MpServer', x=344.50, y=4.00, z=71.50], EntitySlime['Slime'/28539, l='MpServer', x=399.68, y=4.00, z=68.07], EntityChicken['Chicken'/12028, l='MpServer', x=352.50, y=4.00, z=71.50], EntityChicken['Chicken'/12029, l='MpServer', x=351.50, y=4.00, z=73.50], EntityChicken['Chicken'/12030, l='MpServer', x=353.50, y=4.00, z=75.50]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:412)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2523)
at net.minecraft.client.Minecraft.run(Minecraft.java:941)
at net.minecraft.client.main.Main.main(Main.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

So what i did is instead of in my main mod class Side.CLIENT . i make it into Side.SERVER

 

then this is what i did in my packet and handler

 

public static void handleTheClient(EntityPlayerMP player) {
	EntityRathalos entity = (EntityRathalos)player.worldObj.getEntityByID(entityID);
	if(entity != null && animID != -1){
		entity.setAnimID(animID);
		if(animID == 0) entity.setAnimTick(0);
	}
}

public static class PacketAIRathalosHandler implements IMessageHandler<PacketAIMessageTest, IMessage> {

	public IMessage onMessage(PacketAIMessageTest message,MessageContext ctx) {
		handleTheClient(ctx.getServerHandler().playerEntity);
		return null;
	}

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.