Jump to content

Recommended Posts

Posted

You need to create an implementation of

ICapabilitySerializable

(which is just the two interfaces

ICapabilityProvider

and

INBTSerializable

) that provides an instance of your handler (in the

ICapabilityProvider

methods) and reads it from/writes it to NBT (in the

INBTSerializable

methods).

 

You then need to subscribe to

AttachCapabilityEvent<Entity>

(

AttachCapabilityEvent.Entity

in Forge 2090 or earlier), check if the event's entity is a player and call

AttachCapabilitiesEvent#addCapability

with an instance of your

ICapabilitySerializable

implementation.

 

When you want to access a player's handler instance, use the

ICapabilityProvider

methods implemented by

EntityPlayer

.

 

I did notice some minor issues in your code:

  • You should follow Java, MCP and Forge naming conventions:
    lowercase

    for package names,

    camelCase

    for field, method, parameter and local variable names;

    PascalCase

    for type names;

    CONSTANT_CASE

    for constant names;

    IWhatever

    for interface names.

  • PlayerDataCapability

    isn't a very descriptive name, consider naming it something like

    IPlayerStats

    .

  • The
    PlayerDataCapability.Strength

    field is pointless, there's no reason for it to exist.

  • PlayerDataCapabilityFactory

    isn't a factory, so don't call it that. If you name your interface

    IPlayerStats

    , you can name the default implementation

    PlayerStats

    .

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

Posted

game crashes

 

Code:

IPlayerData.java:

package pl.minepack.gym.capabilities;

import java.util.concurrent.Callable;

import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
public interface IPlayerData {

	public int addStrength(int count);
	public int subStrength(int count);

	public void setStrength(int count);
	public int getStrength();

	public static class Storage implements Capability.IStorage<IPlayerData> {

		  @Override
		  public NBTBase writeNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side) {
			  NBTTagCompound nbt = new NBTTagCompound();
			  
			  nbt.setInteger("Strength", instance.getStrength());
			  
			  return nbt;
		  }

			@Override
			public void readNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side,
					NBTBase nbt) {

				instance.setStrength(((NBTTagCompound)nbt).getInteger("Strength"));

			}

	}

	public static class DefaultImpl implements IPlayerData {

		private int Strength = 0;

		@Override
		public int addStrength(int count) {

			return this.Strength += count;
		}

		@Override
		public int subStrength(int count) {

			return this.Strength -= count;
		}

		@Override
		public void setStrength(int count) {

			this.Strength = count;

		}

		@Override
		public int getStrength() {
			// TODO Auto-generated method stub
			return this.Strength;
		}  
	}

	public static class CapabilitySerializable implements ICapabilitySerializable {

		@Override
		public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
			// TODO Auto-generated method stub
			return true;
		}

		@Override
		public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
			// TODO Auto-generated method stub
			return (T) new DefaultImpl();
		}

		@Override
		public NBTBase serializeNBT() {
			NBTBase nbt = new NBTTagCompound();



			return nbt;
		}

		@Override
		public void deserializeNBT(NBTBase nbt) {


		}



	}

}

 

AttachCapabilities Event:

	@SubscribeEvent
public void attachCap(AttachCapabilitiesEvent.Entity e) {
	if (e.getEntity() instanceof EntityPlayer) {
		//EntityPlayer player = (EntityPlayer) e.getEntity();

		e.addCapability(new ResourceLocation(Reference.MODID, "IPlayerData"), new IPlayerData.CapabilitySerializable());

	}
}

Crash Report:

2016-09-19 16:06:39,514 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-19 16:06:39,518 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[16:06:39] [main/INFO] [GradleStart]: username: [email protected]
[16:06:39] [main/INFO] [GradleStart]: Extra: []
[16:06:39] [main/INFO] [GradleStart]: Password found, attempting login
[16:06:39] [main/INFO]: Logging in with username & password
[16:06:40] [main/INFO] [GradleStart]: Login Succesful!
[16:06:40] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, [{"name":"preferredLanguage","value":"en"},{"name":"twitch_access_token","value":"09emc4rwc7gr6saqfv8d33k7jxhi69"}], --assetsDir, C:/Users/Łukasz/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --userType, mojang, --accessToken{REDACTED}, --version, 1.10.2, --uuid, e149942f201f48db9f25b34056b86aa9, --username, lukas20056, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[16:06:40] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[16:06:40] [main/INFO] [FML]: Forge Mod Loader version 12.18.1.2042 for Minecraft 1.10.2 loading
[16:06:40] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_102, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_102
[16:06:40] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[16:06:40] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[16:06:40] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[16:06:40] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[16:06:40] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[16:06:40] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[16:06:41] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[16:06:43] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[16:06:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[16:06:43] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[16:06:44] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
2016-09-19 16:06:44,852 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-19 16:06:44,926 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-19 16:06:44,932 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[16:06:45] [main/INFO] [GradleStart]: Remapping AccessTransformer rules...
[16:06:45] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[16:06:45] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[16:06:45] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[16:06:46] [Client thread/INFO]: Setting user: lukas20056
[16:06:51] [Client thread/WARN]: Skipping bad option: lastServer:
[16:06:51] [Client thread/INFO]: LWJGL Version: 2.9.4
[16:06:53] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----
// Quite honestly, I wouldn't worry myself about that.

Time: 19.09.16 16:06
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


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

-- System Details --
Details:
Minecraft Version: 1.10.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_102, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 806312864 bytes (768 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
[16:06:53] [Client thread/INFO] [FML]: MinecraftForge v12.18.1.2042 Initialized
[16:06:54] [Client thread/INFO] [FML]: Replaced 233 ore recipes
[16:06:55] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[16:06:55] [Client thread/INFO] [FML]: Searching D:\Programy\Deweloping\Projekty\eclipse\Java\Mod Making\Gym-Mod\run\mods for mods
[16:06:56] [Client thread/WARN] [FML]: ****************************************
[16:06:56] [Client thread/WARN] [FML]: * The modid Baubles is not the same as it's lowercase version. Lowercasing will be enforced in 1.11
[16:06:56] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.sanityCheckModId(FMLModContainer.java:141)
[16:06:56] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.<init>(FMLModContainer.java:126)
[16:06:56] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[16:06:56] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[16:06:56] [Client thread/WARN] [FML]: *  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[16:06:56] [Client thread/WARN] [FML]: *  at java.lang.reflect.Constructor.newInstance(Unknown Source)...
[16:06:56] [Client thread/WARN] [FML]: ****************************************
[16:06:56] [Client thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load
[16:06:57] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at CLIENT
[16:06:57] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at SERVER
[16:06:58] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles
[16:06:58] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[16:06:58] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations
[16:06:58] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[16:06:58] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[16:06:58] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[16:06:58] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:26]: [Mine Lib] Pre Init
[16:06:58] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[16:06:58] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:26]: [Mine Lib] Pre Init
[16:06:58] [Client thread/INFO] [FML]: Applying holder lookups
[16:06:58] [Client thread/INFO] [FML]: Holder lookups applied
[16:06:58] [Client thread/INFO] [FML]: Injecting itemstacks
[16:06:58] [Client thread/INFO] [FML]: Itemstack injection complete
[16:06:58] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 12.18.1.2092
[16:07:04] [sound Library Loader/INFO]: Starting up SoundSystem...
[16:07:04] [Thread-8/INFO]: Initializing LWJGL OpenAL
[16:07:04] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[16:07:04] [Thread-8/INFO]: OpenAL initialized.
[16:07:04] [sound Library Loader/INFO]: Sound engine started
[16:07:12] [Client thread/INFO] [FML]: Max texture size: 16384
[16:07:12] [Client thread/INFO]: Created: 16x16 textures-atlas
[16:07:15] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:26]: [Mine Lib] Init
[16:07:15] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:26]: [Mine Lib] Init
[16:07:15] [Client thread/INFO] [FML]: Injecting itemstacks
[16:07:15] [Client thread/INFO] [FML]: Itemstack injection complete
[16:07:15] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:26]: [Mine Lib] Post Init
[16:07:15] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:26]: [Mine Lib] Post Init
[16:07:15] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 6 mods
[16:07:15] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles
[16:07:20] [Client thread/INFO]: SoundSystem shutting down...
[16:07:20] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[16:07:20] [sound Library Loader/INFO]: Starting up SoundSystem...
[16:07:20] [Thread-10/INFO]: Initializing LWJGL OpenAL
[16:07:20] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[16:07:20] [Thread-10/INFO]: OpenAL initialized.
[16:07:21] [sound Library Loader/INFO]: Sound engine started
[16:07:27] [Client thread/INFO] [FML]: Max texture size: 16384
[16:07:27] [Client thread/INFO]: Created: 1024x512 textures-atlas
[16:07:28] [Client thread/WARN]: Skipping bad option: lastServer:
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN blocks/blocks/gym
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]:   domain blocks/blocks/gym is missing 1 texture
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]:     domain blocks/blocks/gym is missing a resource manager - it is probably a side-effect of automatic texture processing
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain blocks/blocks/gym are:
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/particle/ParticleSztanga.png
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain blocks/blocks/gym
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[16:07:29] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[16:07:50] [server thread/INFO]: Starting integrated minecraft server version 1.10.2
[16:07:50] [server thread/INFO]: Generating keypair
[16:07:50] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[16:07:50] [server thread/INFO] [FML]: Applying holder lookups
[16:07:50] [server thread/INFO] [FML]: Holder lookups applied
[16:07:50] [server thread/INFO] [FML]: Loading dimension 0 (Test) (net.minecraft.server.integrated.IntegratedServer@1e54207)
[16:07:51] [server thread/INFO] [FML]: Loading dimension 1 (Test) (net.minecraft.server.integrated.IntegratedServer@1e54207)
[16:07:51] [server thread/INFO] [FML]: Loading dimension -1 (Test) (net.minecraft.server.integrated.IntegratedServer@1e54207)
[16:07:51] [server thread/INFO]: Preparing start region for level 0
[16:07:52] [server thread/INFO]: Preparing spawn area: 1%
[16:07:53] [server thread/INFO]: Preparing spawn area: 66%
[16:07:53] [server thread/INFO]: Changing view distance to 12, from 10
[16:07:55] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[16:07:55] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[16:07:55] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[16:07:55] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[16:07:55] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[16:07:55] [server thread/INFO]: lukas20056[local:E:d2dc2322] logged in with entity id 224 at (37.29687069455364, 97.98980494762495, 62.30000001192093)
[16:07:55] [server thread/INFO]: lukas20056 joined the game
[16:07:57] [server thread/INFO]: Saving and pausing game...
[16:07:57] [Netty Server IO #1/ERROR] [FML]: FMLIndexedMessageCodec exception caught
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:449) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:272) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [singleThreadEventExecutor.class:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:570) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:579) ~[AbstractByteBuf.class:4.0.23.Final]
at pl.minepack.gym.network.PlayerDataMessage.fromBytes(PlayerDataMessage.java:39) ~[PlayerDataMessage.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:103) ~[FMLIndexedMessageToMessageCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:40) ~[FMLIndexedMessageToMessageCodec.class:?]
at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final]
... 25 more
[16:07:57] [server thread/INFO]: Saving chunks for level 'Test'/Overworld
[16:07:57] [Netty Server IO #1/ERROR] [FML]: SimpleChannelHandlerWrapper exception
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:449) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:272) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [singleThreadEventExecutor.class:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:570) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:579) ~[AbstractByteBuf.class:4.0.23.Final]
at pl.minepack.gym.network.PlayerDataMessage.fromBytes(PlayerDataMessage.java:39) ~[PlayerDataMessage.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:103) ~[FMLIndexedMessageToMessageCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:40) ~[FMLIndexedMessageToMessageCodec.class:?]
at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final]
... 25 more
[16:07:57] [Netty Server IO #1/ERROR] [FML]: SimpleChannelHandlerWrapper exception
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:449) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:272) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [singleThreadEventExecutor.class:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:570) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:579) ~[AbstractByteBuf.class:4.0.23.Final]
at pl.minepack.gym.network.PlayerDataMessage.fromBytes(PlayerDataMessage.java:39) ~[PlayerDataMessage.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:103) ~[FMLIndexedMessageToMessageCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:40) ~[FMLIndexedMessageToMessageCodec.class:?]
at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final]
... 25 more
[16:07:57] [Netty Server IO #1/ERROR] [FML]: There was a critical exception handling a packet on channel gym
io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:449) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:272) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:380) [singleThreadEventExecutor.class:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357) [NioEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
Caused by: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))
at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:570) ~[AbstractByteBuf.class:4.0.23.Final]
at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:579) ~[AbstractByteBuf.class:4.0.23.Final]
at pl.minepack.gym.network.PlayerDataMessage.fromBytes(PlayerDataMessage.java:39) ~[PlayerDataMessage.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:36) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:26) ~[simpleIndexedCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:103) ~[FMLIndexedMessageToMessageCodec.class:?]
at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:40) ~[FMLIndexedMessageToMessageCodec.class:?]
at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final]
... 25 more
[16:07:58] [server thread/INFO]: Saving chunks for level 'Test'/Nether
[16:07:58] [server thread/INFO]: Saving chunks for level 'Test'/The End
[16:07:58] [server thread/INFO]: lukas20056 lost connection: TextComponent{text='A fatal error has occurred, this connection is terminated', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[16:07:58] [server thread/INFO]: lukas20056 left the game
[16:07:58] [server thread/INFO]: Stopping singleplayer server as player logged out
[16:07:58] [server thread/INFO]: Stopping server
[16:07:58] [server thread/INFO]: Saving players
[16:07:58] [server thread/INFO]: Saving worlds
[16:07:58] [server thread/INFO]: Saving chunks for level 'Test'/Overworld
[16:07:59] [server thread/INFO]: Saving chunks for level 'Test'/Nether
[16:07:59] [server thread/INFO]: Saving chunks for level 'Test'/The End
[16:07:59] [server thread/INFO] [FML]: Unloading dimension 0
[16:07:59] [server thread/INFO] [FML]: Unloading dimension -1
[16:07:59] [server thread/INFO] [FML]: Unloading dimension 1
[16:08:00] [server thread/INFO] [FML]: Applying holder lookups
[16:08:00] [server thread/INFO] [FML]: Holder lookups applied
[16:08:04] [Client thread/INFO]: Stopping!
[16:08:04] [Client thread/INFO]: SoundSystem shutting down...
[16:08:05] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

Posted
[16:07:57] [Netty Server IO #1/ERROR] [FML]: There was a critical exception handling a packet on channel gym

...

Caused by: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))

at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[AbstractByteBuf.class:4.0.23.Final]

at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:570) ~[AbstractByteBuf.class:4.0.23.Final]

at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:579) ~[AbstractByteBuf.class:4.0.23.Final]

at pl.minepack.gym.network.PlayerDataMessage.fromBytes(PlayerDataMessage.java:39) ~[PlayerDataMessage.class:?]

 

Your

PlayerDataMessage#fromBytes

method is trying to read more data from the byte buffer than was written to it by

PlayerDataMessage#toBytes

. You must read exactly the same number of bytes from the buffer that you write to the buffer.

 

If you post the

PlayerDataMessage

class, I may be able to tell you in more detail what you've done wrong.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

[16:07:57] [Netty Server IO #1/ERROR] [FML]: There was a critical exception handling a packet on channel gym

...

Caused by: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): SlicedByteBuf(ridx: 4, widx: 4, cap: 4/4, unwrapped: UnpooledHeapByteBuf(ridx: 0, widx: 5, cap: 256))

at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1175) ~[AbstractByteBuf.class:4.0.23.Final]

at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:570) ~[AbstractByteBuf.class:4.0.23.Final]

at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:579) ~[AbstractByteBuf.class:4.0.23.Final]

at pl.minepack.gym.network.PlayerDataMessage.fromBytes(PlayerDataMessage.java:39) ~[PlayerDataMessage.class:?]

 

Your

PlayerDataMessage#fromBytes

method is trying to read more data from the byte buffer than was written to it by

PlayerDataMessage#toBytes

. You must read exactly the same number of bytes from the buffer that you write to the buffer.

 

If you post the

PlayerDataMessage

class, I may be able to tell you in more detail what you've done wrong.

but the PlayerDataMessage is just a empty message class just prepared for later to implement data sync...

package pl.minepack.gym.network;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;

public class PlayerDataMessage implements IMessage {
private int Strength = 0;

  // A default constructor is always required
  public PlayerDataMessage(){}


  public PlayerDataMessage(int Strength) {
    this.Strength = Strength;
  }

  @Override 
  public void toBytes(ByteBuf buf) {
	  
    buf.writeInt(Strength);
    
  }

  @Override 
  public void fromBytes(ByteBuf buf) {
	  
    // Reads the int back from the buf. Note that if you have multiple values, you must read in the same order you wrote.
	  Strength = buf.readInt();
  }

// The params of the IMessageHandler are <REQ, REPLY>
// This means that the first param is the packet you are receiving, and the second is the packet you are returning.
// The returned packet can be used as a "response" from a sent packet.
public static class PlayerDataMessageHandler implements IMessageHandler<PlayerDataMessage, IMessage> {
  // Do note that the default constructor is required, but implicitly defined in this case

  @Override 
  public IMessage onMessage(PlayerDataMessage message, MessageContext ctx) {
    IThreadListener mainThread = (WorldServer) ctx.getServerHandler().playerEntity.worldObj;

    
    mainThread.addScheduledTask(new Runnable() {
	@Override
	public void run() {



	}
    });
    
    // No response packet
    return null;
  }
  
}
  
  
}

 

Posted

but the PlayerDataMessage is just a empty message class just prepared for later to implement data sync...

 

That's not the same code that caused the crash. The exception is thrown from

AbstractByteBuf#readBoolean

, but the code you posted never calls this.

 

Are you sure you posted the correct crash report and code?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

i tried to save somthing into this cap i created ModCapabilites.java:

public class ModCapabilities {

@CapabilityInject(IPlayerData.class)
public static Capability<IPlayerData> PLAYER_DATA_CAP = null;

public static void main() {

	CapabilityManager.INSTANCE.register(IPlayerData.class, new IPlayerData.Storage(), IPlayerData.DefaultImpl.class);

}

}

and in EntityJoinWorldEvent i have called

if (e.getEntity() instanceof EntityPlayer) EntityPlayer p = (EntityPlayer) e.getEntity(); IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null); d.setStrength(100)

but it dont gives me potions so i tried to implement client-server communication PlayerDataMessage:

package pl.minepack.gym.network;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import pl.minepack.gym.Reference;
import pl.minepack.gym.capabilities.IPlayerData;
import pl.minepack.gym.capabilities.ModCapabilities;
import pl.minepack.minelib.utils.utils;

public class PlayerDataMessage implements IMessage {
private int Strength = 0;

  // A default constructor is always required
  public PlayerDataMessage(){}


  public PlayerDataMessage(int Strength) {
    this.Strength = Strength;
  }

  @Override 
  public void toBytes(ByteBuf buf) {
	  
    buf.writeInt(Strength);
    
  }

  @Override 
  public void fromBytes(ByteBuf buf) {
	  
    // Reads the int back from the buf. Note that if you have multiple values, you must read in the same order you wrote.
	  Strength = buf.readInt();
  }

// The params of the IMessageHandler are <REQ, REPLY>
// This means that the first param is the packet you are receiving, and the second is the packet you are returning.
// The returned packet can be used as a "response" from a sent packet.
public static class PlayerDataMessageHandler implements IMessageHandler<PlayerDataMessage, IMessage> {
  // Do note that the default constructor is required, but implicitly defined in this case

  @Override 
  public IMessage onMessage(PlayerDataMessage message, MessageContext ctx) {
	final EntityPlayerMP p = ctx.getServerHandler().playerEntity;
    IThreadListener mainThread = (WorldServer) p.worldObj;
    final IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null);
    final int Strength = message.Strength;
    
    mainThread.addScheduledTask(new Runnable() {
	@Override
	public void run() {

		d.setStrength(Strength);
		utils.Println(d.getStrength() + " : " + p.getName().toString(), Reference.NAME);

	}
    });
    
    // No response packet
    return null;
  }
  
}
  
  
}

and it is registered like this:INSTANCE.registerMessage(PlayerDataMessageHandler.class, PlayerDataMessage.class, 0, Side.SERVER); and i am sending an update packet each time that my Strength field is modified using custom functions but it still dont works

Posted

i changed in sending packet from sendToServer to sendToAll and in register changed side to Side.CLIENT

and now game crashes:

2016-09-20 17:24:51,598 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-20 17:24:51,601 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[17:24:51] [main/INFO] [GradleStart]: username: [email protected]
[17:24:51] [main/INFO] [GradleStart]: Extra: []
[17:24:51] [main/INFO] [GradleStart]: Password found, attempting login
[17:24:51] [main/INFO]: Logging in with username & password
[17:24:52] [main/INFO] [GradleStart]: Login Succesful!
[17:24:52] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, [{"name":"preferredLanguage","value":"en"},{"name":"twitch_access_token","value":"09emc4rwc7gr6saqfv8d33k7jxhi69"}], --assetsDir, C:/Users/Łukasz/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --userType, mojang, --accessToken{REDACTED}, --version, 1.10.2, --uuid, e149942f201f48db9f25b34056b86aa9, --username, lukas20056, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[17:24:52] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[17:24:52] [main/INFO] [FML]: Forge Mod Loader version 12.18.1.2042 for Minecraft 1.10.2 loading
[17:24:52] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_102, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_102
[17:24:52] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[17:24:52] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[17:24:52] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[17:24:52] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[17:24:52] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[17:24:52] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[17:24:53] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[17:24:55] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[17:24:55] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[17:24:55] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[17:24:57] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
2016-09-20 17:24:57,972 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-20 17:24:58,061 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-09-20 17:24:58,065 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[17:24:58] [main/INFO] [GradleStart]: Remapping AccessTransformer rules...
[17:24:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[17:24:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[17:24:58] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[17:25:00] [Client thread/INFO]: Setting user: lukas20056
[17:25:06] [Client thread/WARN]: Skipping bad option: lastServer:
[17:25:06] [Client thread/INFO]: LWJGL Version: 2.9.4
[17:25:08] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----
// Surprise! Haha. Well, this is awkward.

Time: 20.09.16 17:25
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


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

-- System Details --
Details:
Minecraft Version: 1.10.2
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_102, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 840293992 bytes (801 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
[17:25:09] [Client thread/INFO] [FML]: MinecraftForge v12.18.1.2042 Initialized
[17:25:09] [Client thread/INFO] [FML]: Replaced 233 ore recipes
[17:25:09] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[17:25:09] [Client thread/INFO] [FML]: Searching D:\Programy\Deweloping\Projekty\eclipse\Java\Mod Making\Gym-Mod\run\mods for mods
[17:25:12] [Client thread/WARN] [FML]: ****************************************
[17:25:12] [Client thread/WARN] [FML]: * The modid Baubles is not the same as it's lowercase version. Lowercasing will be enforced in 1.11
[17:25:12] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.sanityCheckModId(FMLModContainer.java:141)
[17:25:12] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.<init>(FMLModContainer.java:126)
[17:25:12] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[17:25:12] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
[17:25:12] [Client thread/WARN] [FML]: *  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
[17:25:12] [Client thread/WARN] [FML]: *  at java.lang.reflect.Constructor.newInstance(Unknown Source)...
[17:25:12] [Client thread/WARN] [FML]: ****************************************
[17:25:12] [Client thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load
[17:25:13] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at CLIENT
[17:25:13] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at SERVER
[17:25:14] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles
[17:25:14] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[17:25:14] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations
[17:25:14] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[17:25:14] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[17:25:14] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[17:25:14] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[17:25:14] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:40]: [Gym Mod] Pre Init
[17:25:14] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:40]: [Mine Lib] Pre Init
[17:25:14] [Client thread/INFO] [FML]: Applying holder lookups
[17:25:14] [Client thread/INFO] [FML]: Holder lookups applied
[17:25:14] [Client thread/INFO] [FML]: Injecting itemstacks
[17:25:14] [Client thread/INFO] [FML]: Itemstack injection complete
[17:25:14] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 12.18.1.2092
[17:25:20] [sound Library Loader/INFO]: Starting up SoundSystem...
[17:25:21] [Thread-8/INFO]: Initializing LWJGL OpenAL
[17:25:21] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[17:25:21] [Thread-8/INFO]: OpenAL initialized.
[17:25:21] [sound Library Loader/INFO]: Sound engine started
[17:25:29] [Client thread/INFO] [FML]: Max texture size: 16384
[17:25:29] [Client thread/INFO]: Created: 16x16 textures-atlas
[17:25:31] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:40]: [Gym Mod] Init
[17:25:31] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:40]: [Mine Lib] Init
[17:25:31] [Client thread/INFO] [FML]: Injecting itemstacks
[17:25:31] [Client thread/INFO] [FML]: Itemstack injection complete
[17:25:31] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:40]: [Gym Mod] Post Init
[17:25:31] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:40]: [Mine Lib] Post Init
[17:25:31] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 6 mods
[17:25:31] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles
[17:25:37] [Client thread/INFO]: SoundSystem shutting down...
[17:25:37] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[17:25:37] [sound Library Loader/INFO]: Starting up SoundSystem...
[17:25:37] [Thread-10/INFO]: Initializing LWJGL OpenAL
[17:25:37] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[17:25:37] [Thread-10/INFO]: OpenAL initialized.
[17:25:37] [sound Library Loader/INFO]: Sound engine started
[17:25:43] [Client thread/INFO] [FML]: Max texture size: 16384
[17:25:43] [Client thread/INFO]: Created: 1024x512 textures-atlas
[17:25:45] [Client thread/WARN]: Skipping bad option: lastServer:
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN blocks/blocks/gym
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]:   domain blocks/blocks/gym is missing 1 texture
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]:     domain blocks/blocks/gym is missing a resource manager - it is probably a side-effect of automatic texture processing
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain blocks/blocks/gym are:
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/particle/ParticleSztanga.png
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain blocks/blocks/gym
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[17:25:45] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[17:25:49] [server thread/INFO]: Starting integrated minecraft server version 1.10.2
[17:25:49] [server thread/INFO]: Generating keypair
[17:25:49] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[17:25:49] [server thread/INFO] [FML]: Applying holder lookups
[17:25:49] [server thread/INFO] [FML]: Holder lookups applied
[17:25:49] [server thread/INFO] [FML]: Loading dimension 0 (Test) (net.minecraft.server.integrated.IntegratedServer@375465d6)
[17:25:50] [server thread/INFO] [FML]: Loading dimension 1 (Test) (net.minecraft.server.integrated.IntegratedServer@375465d6)
[17:25:50] [server thread/INFO] [FML]: Loading dimension -1 (Test) (net.minecraft.server.integrated.IntegratedServer@375465d6)
[17:25:50] [server thread/INFO]: Preparing start region for level 0
[17:25:51] [server thread/INFO]: Preparing spawn area: 2%
[17:25:52] [server thread/INFO]: Preparing spawn area: 78%
[17:25:52] [server thread/INFO]: Changing view distance to 12, from 10
[17:25:54] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[17:25:54] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[17:25:54] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
[17:25:54] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[17:25:54] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[17:25:54] [server thread/INFO]: lukas20056[local:E:39fa245f] logged in with entity id 205 at (57.33064243597522, 92.5625, 56.51571660147242)
[17:25:54] [server thread/INFO]: lukas20056 joined the game
[17:25:59] [Netty Local Client IO #0/ERROR] [FML]: SimpleChannelHandlerWrapper exception
java.lang.ClassCastException: net.minecraft.client.network.NetHandlerPlayClient cannot be cast to net.minecraft.network.NetHandlerPlayServer
at net.minecraftforge.fml.common.network.simpleimpl.MessageContext.getServerHandler(MessageContext.java:55) ~[MessageContext.class:?]
at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:52) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]
at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:1) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:410) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:276) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
[17:25:59] [Netty Local Client IO #0/ERROR] [FML]: There was a critical exception handling a packet on channel gym
java.lang.ClassCastException: net.minecraft.client.network.NetHandlerPlayClient cannot be cast to net.minecraft.network.NetHandlerPlayServer
at net.minecraftforge.fml.common.network.simpleimpl.MessageContext.getServerHandler(MessageContext.java:55) ~[MessageContext.class:?]
at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:52) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]
at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:1) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]
at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:4.0.23.Final]
at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]
at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:410) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:276) [NetworkDispatcher.class:?]
at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]
at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]
at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
[17:25:59] [server thread/INFO]: Saving and pausing game...
[17:25:59] [server thread/INFO]: Saving chunks for level 'Test'/Overworld
[17:25:59] [server thread/INFO]: Saving chunks for level 'Test'/Nether
[17:25:59] [server thread/INFO]: Saving chunks for level 'Test'/The End
[17:26:00] [server thread/INFO]: lukas20056 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
[17:26:00] [server thread/INFO]: lukas20056 left the game
[17:26:00] [server thread/INFO]: Stopping singleplayer server as player logged out
[17:26:00] [server thread/INFO]: Stopping server
[17:26:00] [server thread/INFO]: Saving players
[17:26:00] [server thread/INFO]: Saving worlds
[17:26:00] [server thread/INFO]: Saving chunks for level 'Test'/Overworld
[17:26:00] [server thread/INFO]: Saving chunks for level 'Test'/Nether
[17:26:00] [server thread/INFO]: Saving chunks for level 'Test'/The End
[17:26:02] [server thread/INFO] [FML]: Unloading dimension 0
[17:26:02] [server thread/INFO] [FML]: Unloading dimension -1
[17:26:02] [server thread/INFO] [FML]: Unloading dimension 1
[17:26:02] [server thread/INFO] [FML]: Applying holder lookups
[17:26:02] [server thread/INFO] [FML]: Holder lookups applied
[17:26:06] [Client thread/INFO]: Stopping!
[17:26:06] [Client thread/INFO]: SoundSystem shutting down...
[17:26:06] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

Posted
Your packet code still assumes to be received on the server (you cast to NetHandlerPlayServer for example).

 

do you mean this: final EntityPlayerMP p = ctx.getServerHandler().playerEntity;?

if yes then i alerady know this and fixed it

 

Why sendToAll?

 

how do i get the player instance inside the default impl of capablity?

Posted

What?

i added a constructor that takes an EntityPlayer as argument inside a default impl of my capability and now i need to insert something in my implementation of ICapabilitySerializable:

		public static class Provider implements ICapabilitySerializable {

		@Override
		public boolean hasCapability(Capability<?> capability, EnumFacing facing) {

			if (capability instanceof IPlayerData) return true;

			return false;

		}

		@Override
		public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
			return (T) new DefaultImpl(); // Right here
		}

		@Override
		public NBTBase serializeNBT() {
			NBTBase nbt = new NBTTagCompound();



			return nbt;
		}

		@Override
		public void deserializeNBT(NBTBase nbt) {


		}



	}

and DefaultImpl:

public static class DefaultImpl implements IPlayerData {

		private int Strength = 0;

		private EntityPlayerMP p;

		DefaultImpl(EntityPlayerMP p) {

			this.p = p;

		}

		@Override
		public int addStrength(int count) {

			return setStrength(getStrength() + count);
		}

		@Override
		public int subStrength(int count) {

			return setStrength(getStrength() - count);
		}

		@Override
		public int setStrength(int count) {

			NetworkManager.INSTANCE.sendTo(new PlayerDataMessage(count), p);

			return this.Strength = count;

		}

		@Override
		public int getStrength() {

			return this.Strength;

		}  
	}

or i am doing something wrong?

Posted

now when i join the world it is on the loading screen and nothing happens

 

log:

2016-09-21 17:52:30,071 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-09-21 17:52:30,075 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[17:52:30] [main/INFO] [GradleStart]: username: [email protected]

[17:52:30] [main/INFO] [GradleStart]: Extra: []

[17:52:30] [main/INFO] [GradleStart]: Password found, attempting login

[17:52:30] [main/INFO]: Logging in with username & password

[17:52:31] [main/INFO] [GradleStart]: Login Succesful!

[17:52:31] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, [{"name":"preferredLanguage","value":"en"},{"name":"twitch_access_token","value":"09emc4rwc7gr6saqfv8d33k7jxhi69"}], --assetsDir, C:/Users/Łukasz/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --userType, mojang, --accessToken{REDACTED}, --version, 1.10.2, --uuid, e149942f201f48db9f25b34056b86aa9, --username, lukas20056, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[17:52:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[17:52:31] [main/INFO] [FML]: Forge Mod Loader version 12.18.1.2042 for Minecraft 1.10.2 loading

[17:52:31] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.8.0_102, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_102

[17:52:31] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[17:52:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[17:52:31] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[17:52:31] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[17:52:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[17:52:31] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[17:52:32] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[17:52:35] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[17:52:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[17:52:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[17:52:37] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

2016-09-21 17:52:37,767 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-09-21 17:52:37,895 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-09-21 17:52:37,896 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[17:52:38] [main/INFO] [GradleStart]: Remapping AccessTransformer rules...

[17:52:38] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[17:52:38] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[17:52:38] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[17:52:40] [Client thread/INFO]: Setting user: lukas20056

[17:52:47] [Client thread/WARN]: Skipping bad option: lastServer:

[17:52:47] [Client thread/INFO]: LWJGL Version: 2.9.4

[17:52:50] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----

// Uh... Did I do that?

 

Time: 21.09.16 17:52

Description: Loading screen debug info

 

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR

 

 

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

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 10 (amd64) version 10.0

Java Version: 1.8.0_102, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 840262544 bytes (801 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML:

Loaded coremods (and transformers):

GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'

[17:52:50] [Client thread/INFO] [FML]: MinecraftForge v12.18.1.2042 Initialized

[17:52:50] [Client thread/INFO] [FML]: Replaced 233 ore recipes

[17:52:50] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[17:52:50] [Client thread/INFO] [FML]: Searching D:\Programy\Deweloping\Projekty\eclipse\Java\Mod Making\Gym-Mod\run\mods for mods

[17:52:52] [Client thread/WARN] [FML]: ****************************************

[17:52:52] [Client thread/WARN] [FML]: * The modid Baubles is not the same as it's lowercase version. Lowercasing will be enforced in 1.11

[17:52:52] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.sanityCheckModId(FMLModContainer.java:141)

[17:52:52] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.<init>(FMLModContainer.java:126)

[17:52:52] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[17:52:52] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

[17:52:52] [Client thread/WARN] [FML]: *  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

[17:52:52] [Client thread/WARN] [FML]: *  at java.lang.reflect.Constructor.newInstance(Unknown Source)...

[17:52:52] [Client thread/WARN] [FML]: ****************************************

[17:52:53] [Client thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load

[17:52:53] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at CLIENT

[17:52:53] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at SERVER

[17:52:55] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles

[17:52:55] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[17:52:55] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations

[17:52:55] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[17:52:55] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[17:52:55] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[17:52:55] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json

[17:52:55] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:44]: [Gym Mod] Pre Init

[17:52:55] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:44]: [Mine Lib] Pre Init

[17:52:55] [Client thread/INFO] [FML]: Applying holder lookups

[17:52:55] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 12.18.1.2092

[17:52:55] [Client thread/INFO] [FML]: Holder lookups applied

[17:52:55] [Client thread/INFO] [FML]: Injecting itemstacks

[17:52:55] [Client thread/INFO] [FML]: Itemstack injection complete

[17:53:02] [sound Library Loader/INFO]: Starting up SoundSystem...

[17:53:02] [Thread-8/INFO]: Initializing LWJGL OpenAL

[17:53:02] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[17:53:03] [Thread-8/INFO]: OpenAL initialized.

[17:53:03] [sound Library Loader/INFO]: Sound engine started

[17:53:11] [Client thread/INFO] [FML]: Max texture size: 16384

[17:53:11] [Client thread/INFO]: Created: 16x16 textures-atlas

[17:53:13] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:44]: [Gym Mod] Init

[17:53:14] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:44]: [Mine Lib] Init

[17:53:14] [Client thread/INFO] [FML]: Injecting itemstacks

[17:53:14] [Client thread/INFO] [FML]: Itemstack injection complete

[17:53:14] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:44]: [Gym Mod] Post Init

[17:53:14] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:44]: [Mine Lib] Post Init

[17:53:14] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 6 mods

[17:53:14] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles

[17:53:19] [Client thread/INFO]: SoundSystem shutting down...

[17:53:20] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[17:53:20] [sound Library Loader/INFO]: Starting up SoundSystem...

[17:53:20] [Thread-10/INFO]: Initializing LWJGL OpenAL

[17:53:20] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[17:53:20] [Thread-10/INFO]: OpenAL initialized.

[17:53:20] [sound Library Loader/INFO]: Sound engine started

[17:53:27] [Client thread/INFO] [FML]: Max texture size: 16384

[17:53:27] [Client thread/INFO]: Created: 1024x512 textures-atlas

[17:53:29] [Client thread/WARN]: Skipping bad option: lastServer:

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]:  DOMAIN blocks/blocks/gym

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]:  domain blocks/blocks/gym is missing 1 texture

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]:    domain blocks/blocks/gym is missing a resource manager - it is probably a side-effect of automatic texture processing

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]:    The missing resources for domain blocks/blocks/gym are:

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]:      textures/particle/ParticleSztanga.png

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]:    No other errors exist for domain blocks/blocks/gym

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================

[17:53:29] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

[17:53:35] [server thread/INFO]: Starting integrated minecraft server version 1.10.2

[17:53:35] [server thread/INFO]: Generating keypair

[17:53:35] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[17:53:36] [server thread/INFO] [FML]: Applying holder lookups

[17:53:36] [server thread/INFO] [FML]: Holder lookups applied

[17:53:36] [server thread/INFO] [FML]: Loading dimension 0 (Test) (net.minecraft.server.integrated.IntegratedServer@780a019a)

[17:53:36] [server thread/INFO] [FML]: Loading dimension 1 (Test) (net.minecraft.server.integrated.IntegratedServer@780a019a)

[17:53:36] [server thread/INFO] [FML]: Loading dimension -1 (Test) (net.minecraft.server.integrated.IntegratedServer@780a019a)

[17:53:36] [server thread/INFO]: Preparing start region for level 0

[17:53:37] [server thread/INFO]: Preparing spawn area: 0%

[17:53:38] [server thread/INFO]: Preparing spawn area: 59%

[17:53:39] [server thread/INFO]: Changing view distance to 12, from 10

[17:53:41] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2

[17:53:41] [Netty Server IO #1/INFO] [FML]: Client protocol version 2

[17:53:41] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]

[17:53:41] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

[17:53:41] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[17:53:41] [server thread/INFO]: lukas20056[local:E:1d25f519] logged in with entity id 205 at (57.33064243597522, 92.5625, 56.51571660147242)

[17:53:41] [server thread/INFO]: lukas20056 joined the game

[17:53:41] [Netty Local Client IO #0/ERROR] [FML]: SimpleChannelHandlerWrapper exception

java.lang.ClassCastException: net.minecraft.client.network.NetHandlerPlayClient cannot be cast to net.minecraft.network.NetHandlerPlayServer

at net.minecraftforge.fml.common.network.simpleimpl.MessageContext.getServerHandler(MessageContext.java:55) ~[MessageContext.class:?]

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:52) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:1) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:410) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:276) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]

at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]

[17:53:41] [Netty Local Client IO #0/ERROR] [FML]: There was a critical exception handling a packet on channel gym

java.lang.ClassCastException: net.minecraft.client.network.NetHandlerPlayClient cannot be cast to net.minecraft.network.NetHandlerPlayServer

at net.minecraftforge.fml.common.network.simpleimpl.MessageContext.getServerHandler(MessageContext.java:55) ~[MessageContext.class:?]

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:52) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:1) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:410) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:276) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]

at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handleJoinGame(NetHandlerPlayClient.java:299) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketJoinGame.processPacket(SPacketJoinGame.java:89) ~[sPacketJoinGame.class:?]

at net.minecraft.network.play.server.SPacketJoinGame.processPacket(SPacketJoinGame.java:13) ~[sPacketJoinGame.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handleCustomPayload(NetHandlerPlayClient.java:1903) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketCustomPayload.processPacket(SPacketCustomPayload.java:67) ~[sPacketCustomPayload.class:?]

at net.minecraft.network.play.server.SPacketCustomPayload.processPacket(SPacketCustomPayload.java:11) ~[sPacketCustomPayload.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handleServerDifficulty(NetHandlerPlayClient.java:1561) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketServerDifficulty.processPacket(SPacketServerDifficulty.java:31) ~[sPacketServerDifficulty.class:?]

at net.minecraft.network.play.server.SPacketServerDifficulty.processPacket(SPacketServerDifficulty.java:11) ~[sPacketServerDifficulty.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handleSpawnPosition(NetHandlerPlayClient.java:1015) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketSpawnPosition.processPacket(SPacketSpawnPosition.java:45) ~[sPacketSpawnPosition.class:?]

at net.minecraft.network.play.server.SPacketSpawnPosition.processPacket(SPacketSpawnPosition.java:11) ~[sPacketSpawnPosition.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handlePlayerAbilities(NetHandlerPlayClient.java:1677) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketPlayerAbilities.processPacket(SPacketPlayerAbilities.java:85) ~[sPacketPlayerAbilities.class:?]

at net.minecraft.network.play.server.SPacketPlayerAbilities.processPacket(SPacketPlayerAbilities.java:11) ~[sPacketPlayerAbilities.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handleHeldItemChange(NetHandlerPlayClient.java:634) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketHeldItemChange.processPacket(SPacketHeldItemChange.java:44) ~[sPacketHeldItemChange.class:?]

at net.minecraft.network.play.server.SPacketHeldItemChange.processPacket(SPacketHeldItemChange.java:10) ~[sPacketHeldItemChange.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.network.play.server.SPacketEntityStatus.getEntity(SPacketEntityStatus.java:56) ~[sPacketEntityStatus.class:?]

at net.minecraft.client.network.NetHandlerPlayClient.handleEntityStatus(NetHandlerPlayClient.java:1082) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketEntityStatus.processPacket(SPacketEntityStatus.java:50) ~[sPacketEntityStatus.class:?]

at net.minecraft.network.play.server.SPacketEntityStatus.processPacket(SPacketEntityStatus.java:12) ~[sPacketEntityStatus.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [Client thread/FATAL]: Error executing task

java.util.concurrent.ExecutionException: java.lang.NullPointerException

at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) [Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:406) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102]

at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]

at GradleStart.main(GradleStart.java:26) [start/:?]

Caused by: java.lang.NullPointerException

at net.minecraft.client.network.NetHandlerPlayClient.handleStatistics(NetHandlerPlayClient.java:1509) ~[NetHandlerPlayClient.class:?]

at net.minecraft.network.play.server.SPacketStatistics.processPacket(SPacketStatistics.java:33) ~[sPacketStatistics.class:?]

at net.minecraft.network.play.server.SPacketStatistics.processPacket(SPacketStatistics.java:15) ~[sPacketStatistics.class:?]

at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]

at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_102]

at net.minecraft.util.Util.runTask(Util.java:25) ~[util.class:?]

... 15 more

[17:53:41] [server thread/INFO]: lukas20056 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}

[17:53:41] [server thread/INFO]: lukas20056 left the game

[17:53:41] [server thread/INFO]: Stopping singleplayer server as player logged out

[17:53:42] [server thread/INFO]: Stopping server

[17:53:42] [server thread/INFO]: Saving players

[17:53:42] [server thread/INFO]: Saving worlds

[17:53:42] [server thread/INFO]: Saving chunks for level 'Test'/Overworld

[17:53:42] [server thread/INFO]: Saving chunks for level 'Test'/Nether

[17:53:42] [server thread/INFO]: Saving chunks for level 'Test'/The End

[17:53:42] [server thread/INFO] [FML]: Unloading dimension 0

[17:53:42] [server thread/INFO] [FML]: Unloading dimension -1

[17:53:42] [server thread/INFO] [FML]: Unloading dimension 1

[17:53:42] [server thread/INFO] [FML]: Applying holder lookups

[17:53:42] [server thread/INFO] [FML]: Holder lookups applied

[17:54:40] [Client thread/INFO]: Stopping!

[17:54:40] [Client thread/INFO]: SoundSystem shutting down...

[17:54:40] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

 

IPlayerData:

package pl.minepack.gym.capabilities;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import pl.minepack.gym.network.NetworkManager;
import pl.minepack.gym.network.PlayerDataMessage;
public interface IPlayerData {

	public int addStrength(int count);
	public int subStrength(int count);

	public int setStrength(int count);
	public int getStrength();

	public static class Storage implements Capability.IStorage<IPlayerData> {

		  @Override
		  public NBTBase writeNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side) {
			  NBTTagCompound nbt = new NBTTagCompound();
			  
			  nbt.setInteger("Strength", instance.getStrength());
			  
			  return nbt;
		  }

			@Override
			public void readNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side,
					NBTBase nbt) {

				instance.setStrength(((NBTTagCompound)nbt).getInteger("Strength"));

			}

	}

	public static class DefaultImpl implements IPlayerData {

		private int Strength = 0;

		private EntityPlayer p;

		DefaultImpl(EntityPlayer p) {

			this.p = p;

		}

		@Override
		public int addStrength(int count) {

			return setStrength(getStrength() + count);
		}

		@Override
		public int subStrength(int count) {

			return setStrength(getStrength() - count);
		}

		@Override
		public int setStrength(int count) {

			if (!p.getEntityWorld().isRemote) {

				NetworkManager.INSTANCE.sendTo(new PlayerDataMessage(count), (EntityPlayerMP) p);	

			}

			return this.Strength = count;

		}

		@Override
		public int getStrength() {

			return this.Strength;

		}  
	}

	public static class Provider implements ICapabilitySerializable {

		private EntityPlayer p;

		public Provider(EntityPlayer p) {

			this.p = p;

		}


		@Override
		public boolean hasCapability(Capability<?> capability, EnumFacing facing) {

			if (capability instanceof IPlayerData) return true;

			return false;

		}

		@Override
		public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
			return (T) new DefaultImpl(p);
		}

		@Override
		public NBTBase serializeNBT() {
			NBTBase nbt = new NBTTagCompound();



			return nbt;
		}

		@Override
		public void deserializeNBT(NBTBase nbt) {


		}



	}

}

AttachCapabilityEnvent:

	@SubscribeEvent
public void attachCap(AttachCapabilitiesEvent.Entity e) {
	if (e.getEntity() instanceof EntityPlayer) {
		//EntityPlayer player = (EntityPlayer) e.getEntity();

		e.addCapability(new ResourceLocation(Reference.MODID, "IPlayerData"), new IPlayerData.Provider((EntityPlayer) e.getEntity()));                   

	}
}

 

Posted

this is in my PlayerDataMessage class

package pl.minepack.gym.network;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import pl.minepack.gym.Reference;
import pl.minepack.gym.capabilities.IPlayerData;
import pl.minepack.gym.capabilities.ModCapabilities;
import pl.minepack.minelib.utils.utils;

public class PlayerDataMessage implements IMessage {
private int Strength = 0;

  // A default constructor is always required
  public PlayerDataMessage(){}


  public PlayerDataMessage(int Strength) {
    this.Strength = Strength;
  }

  @Override 
  public void toBytes(ByteBuf buf) {
	  
    buf.writeInt(Strength);
    
  }

  @Override 
  public void fromBytes(ByteBuf buf) {
	  
    // Reads the int back from the buf. Note that if you have multiple values, you must read in the same order you wrote.
	  Strength = buf.readInt();
  }

// The params of the IMessageHandler are <REQ, REPLY>
// This means that the first param is the packet you are receiving, and the second is the packet you are returning.
// The returned packet can be used as a "response" from a sent packet.
public static class PlayerDataMessageHandler implements IMessageHandler<PlayerDataMessage, IMessage> {
  // Do note that the default constructor is required, but implicitly defined in this case

  @Override 
  public IMessage onMessage(PlayerDataMessage message, MessageContext ctx) {
	final EntityPlayer p = ctx.getServerHandler().playerEntity;//ctx.getClientHandler does not have the #playerEntity field
    IThreadListener mainThread = (WorldServer) p.worldObj;
    final IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null);
    final int Strength = message.Strength;
    
    mainThread.addScheduledTask(new Runnable() {
	@Override
	public void run() {

		d.setStrength(Strength);
		utils.Println(d.getStrength() + " : " + p.getName().toString(), Reference.NAME);

	}
    });
    
    // No response packet
    return null;
  }
  
}
  
  
}

Posted

now my PlayerDataMessage looks like this:

package pl.minepack.gym.network;

import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import pl.minepack.gym.Reference;
import pl.minepack.gym.capabilities.IPlayerData;
import pl.minepack.gym.capabilities.ModCapabilities;
import pl.minepack.minelib.utils.utils;

public class PlayerDataMessage implements IMessage {
private int Strength = 0;
private EntityPlayer p;

  // A default constructor is always required
  public PlayerDataMessage(){}


  public PlayerDataMessage(int Strength, EntityPlayer p) {
    this.Strength = Strength;
    this.p = p;
  }

  @Override 
  public void toBytes(ByteBuf buf) {
	  
    buf.writeInt(Strength);
    
  }

  @Override 
  public void fromBytes(ByteBuf buf) {
	  
    // Reads the int back from the buf. Note that if you have multiple values, you must read in the same order you wrote.
	  Strength = buf.readInt();
  }

// The params of the IMessageHandler are <REQ, REPLY>
// This means that the first param is the packet you are receiving, and the second is the packet you are returning.
// The returned packet can be used as a "response" from a sent packet.
public static class PlayerDataMessageHandler implements IMessageHandler<PlayerDataMessage, IMessage> {
  // Do note that the default constructor is required, but implicitly defined in this case

  @Override 
  public IMessage onMessage(PlayerDataMessage message, MessageContext ctx) {
	EntityPlayer p = message.p;
    IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null);
    int Strength = message.Strength;
	d.setStrength(Strength);
	utils.Println(d.getStrength() + " : " + p.getName().toString(), Reference.NAME);
    
    // No response packet
    return null;
  }
  
}
  
  
}

so it do't uses these server methods and the error is the same

Posted

PlayerDataMessage:

package pl.minepack.gym.network;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import pl.minepack.gym.Reference;
import pl.minepack.gym.capabilities.IPlayerData;
import pl.minepack.gym.capabilities.ModCapabilities;
import pl.minepack.minelib.utils.utils;

public class PlayerDataMessage implements IMessage {
private int Strength = 0;

  // A default constructor is always required
  public PlayerDataMessage(){}


  public PlayerDataMessage(int Strength) {
    this.Strength = Strength;
  }

  @Override 
  public void toBytes(ByteBuf buf) {
	  
    buf.writeInt(Strength);
    
  }

  @Override 
  public void fromBytes(ByteBuf buf) {
	  
    // Reads the int back from the buf. Note that if you have multiple values, you must read in the same order you wrote.
	  Strength = buf.readInt();
  }

// The params of the IMessageHandler are <REQ, REPLY>
// This means that the first param is the packet you are receiving, and the second is the packet you are returning.
// The returned packet can be used as a "response" from a sent packet.
public static class PlayerDataMessageHandler implements IMessageHandler<PlayerDataMessage, IMessage> {
  // Do note that the default constructor is required, but implicitly defined in this case

  @Override 
  public IMessage onMessage(PlayerDataMessage message, MessageContext ctx) {
	EntityPlayer p = utils.getPlayerInstance(ctx);
    IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null);
    int Strength = message.Strength;
	d.setStrength(Strength);
	utils.Println(d.getStrength() + " : " + p.getName().toString(), Reference.NAME);
    
    // No response packet
    return null;
  }
  
}
  
  
}

 

utils#getPlayerInstance():

	public static EntityPlayer getPlayerInstance(MessageContext ctx) {

	return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : ctx.getServerHandler().playerEntity);

}

 

EDIT:

For some reason this code stopped working:

log:

 

2016-09-21 20:40:08,665 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-09-21 20:40:08,668 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[20:40:08] [main/INFO] [GradleStart]: username: [email protected]

[20:40:08] [main/INFO] [GradleStart]: Extra: []

[20:40:08] [main/INFO] [GradleStart]: Password found, attempting login

[20:40:08] [main/INFO]: Logging in with username & password

[20:40:09] [main/INFO] [GradleStart]: Login Succesful!

[20:40:09] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, [{"name":"preferredLanguage","value":"en"},{"name":"twitch_access_token","value":"09emc4rwc7gr6saqfv8d33k7jxhi69"}], --assetsDir, C:/Users/Łukasz/.gradle/caches/minecraft/assets, --assetIndex, 1.10, --userType, mojang, --accessToken{REDACTED}, --version, 1.10.2, --uuid, e149942f201f48db9f25b34056b86aa9, --username, lukas20056, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]

[20:40:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[20:40:09] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[20:40:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker

[20:40:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[20:40:09] [main/INFO] [FML]: Forge Mod Loader version 12.18.1.2042 for Minecraft 1.10.2 loading

[20:40:09] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.8.0_102, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_102

[20:40:09] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[20:40:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker

[20:40:09] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[20:40:09] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[20:40:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:40:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[20:40:09] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

[20:40:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:40:10] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[20:40:10] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[20:40:10] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[20:40:13] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[20:40:13] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[20:40:13] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[20:40:15] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker

2016-09-21 20:40:15,676 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-09-21 20:40:15,757 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

2016-09-21 20:40:15,759 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream

[20:40:15] [main/INFO] [GradleStart]: Remapping AccessTransformer rules...

[20:40:15] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[20:40:15] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[20:40:15] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[20:40:18] [Client thread/INFO]: Setting user: lukas20056

[20:40:26] [Client thread/WARN]: Skipping bad option: lastServer:

[20:40:26] [Client thread/INFO]: LWJGL Version: 2.9.4

[20:40:29] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:221]: ---- Minecraft Crash Report ----

// I'm sorry, Dave.

 

Time: 21.09.16 20:40

Description: Loading screen debug info

 

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR

 

 

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

---------------------------------------------------------------------------------------

 

-- System Details --

Details:

Minecraft Version: 1.10.2

Operating System: Windows 10 (amd64) version 10.0

Java Version: 1.8.0_102, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 748733912 bytes (714 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML:

Loaded coremods (and transformers):

GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 369.09' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'

[20:40:29] [Client thread/INFO] [FML]: MinecraftForge v12.18.1.2042 Initialized

[20:40:29] [Client thread/INFO] [FML]: Replaced 233 ore recipes

[20:40:30] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer

[20:40:30] [Client thread/INFO] [FML]: Searching D:\Programy\Deweloping\Projekty\eclipse\Java\Mod Making\Gym-Mod\run\mods for mods

[20:40:32] [Client thread/WARN] [FML]: ****************************************

[20:40:32] [Client thread/WARN] [FML]: * The modid Baubles is not the same as it's lowercase version. Lowercasing will be enforced in 1.11

[20:40:32] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.sanityCheckModId(FMLModContainer.java:141)

[20:40:32] [Client thread/WARN] [FML]: *  at net.minecraftforge.fml.common.FMLModContainer.<init>(FMLModContainer.java:126)

[20:40:32] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[20:40:32] [Client thread/WARN] [FML]: *  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

[20:40:32] [Client thread/WARN] [FML]: *  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

[20:40:32] [Client thread/WARN] [FML]: *  at java.lang.reflect.Constructor.newInstance(Unknown Source)...

[20:40:32] [Client thread/WARN] [FML]: ****************************************

[20:40:32] [Client thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load

[20:40:32] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at CLIENT

[20:40:32] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, gym, minelib, Baubles] at SERVER

[20:40:33] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles

[20:40:34] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[20:40:34] [Client thread/INFO] [FML]: Found 423 ObjectHolder annotations

[20:40:34] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations

[20:40:34] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations

[20:40:34] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[20:40:34] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:58]: [Gym Mod] Pre Init

[20:40:34] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json

[20:40:34] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:58]: [Mine Lib] Pre Init

[20:40:34] [Client thread/INFO] [FML]: Applying holder lookups

[20:40:34] [Client thread/INFO] [FML]: Holder lookups applied

[20:40:34] [Client thread/INFO] [FML]: Injecting itemstacks

[20:40:34] [Client thread/INFO] [FML]: Itemstack injection complete

[20:40:34] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: OUTDATED Target: 12.18.1.2092

[20:40:40] [sound Library Loader/INFO]: Starting up SoundSystem...

[20:40:41] [Thread-8/INFO]: Initializing LWJGL OpenAL

[20:40:41] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[20:40:41] [Thread-8/INFO]: OpenAL initialized.

[20:40:41] [sound Library Loader/INFO]: Sound engine started

[20:40:52] [Client thread/INFO] [FML]: Max texture size: 16384

[20:40:52] [Client thread/INFO]: Created: 16x16 textures-atlas

[20:40:55] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:58]: [Gym Mod] Init

[20:40:55] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:58]: [Mine Lib] Init

[20:40:55] [Client thread/INFO] [FML]: Injecting itemstacks

[20:40:55] [Client thread/INFO] [FML]: Itemstack injection complete

[20:40:55] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:58]: [Gym Mod] Post Init

[20:40:55] [Client thread/INFO] [sTDOUT]: [pl.minepack.minelib.utils.utils:Println:58]: [Mine Lib] Post Init

[20:40:55] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 6 mods

[20:40:55] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Gym Mod, FMLFileResourcePack:Mine Lib, FMLFileResourcePack:Baubles

[20:41:01] [Client thread/INFO]: SoundSystem shutting down...

[20:41:01] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[20:41:01] [sound Library Loader/INFO]: Starting up SoundSystem...

[20:41:02] [Thread-10/INFO]: Initializing LWJGL OpenAL

[20:41:02] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[20:41:02] [Thread-10/INFO]: OpenAL initialized.

[20:41:02] [sound Library Loader/INFO]: Sound engine started

[20:41:09] [Client thread/INFO] [FML]: Max texture size: 16384

[20:41:09] [Client thread/INFO]: Created: 1024x512 textures-atlas

[20:41:10] [Client thread/WARN]: Skipping bad option: lastServer:

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]:  DOMAIN blocks/blocks/gym

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]:  domain blocks/blocks/gym is missing 1 texture

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]:    domain blocks/blocks/gym is missing a resource manager - it is probably a side-effect of automatic texture processing

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]:    The missing resources for domain blocks/blocks/gym are:

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]:      textures/particle/ParticleSztanga.png

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]:    No other errors exist for domain blocks/blocks/gym

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================

[20:41:11] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=

[20:41:21] [server thread/INFO]: Starting integrated minecraft server version 1.10.2

[20:41:21] [server thread/INFO]: Generating keypair

[20:41:21] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[20:41:21] [server thread/INFO] [FML]: Applying holder lookups

[20:41:21] [server thread/INFO] [FML]: Holder lookups applied

[20:41:21] [server thread/INFO] [FML]: Loading dimension 0 (Test) (net.minecraft.server.integrated.IntegratedServer@351950a9)

[20:41:22] [server thread/INFO] [FML]: Loading dimension 1 (Test) (net.minecraft.server.integrated.IntegratedServer@351950a9)

[20:41:22] [server thread/INFO] [FML]: Loading dimension -1 (Test) (net.minecraft.server.integrated.IntegratedServer@351950a9)

[20:41:22] [server thread/INFO]: Preparing start region for level 0

[20:41:23] [server thread/INFO]: Preparing spawn area: 0%

[20:41:24] [server thread/INFO]: Preparing spawn area: 53%

[20:41:25] [server thread/INFO]: Changing view distance to 12, from 10

[20:41:27] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2

[20:41:27] [Netty Server IO #1/INFO] [FML]: Client protocol version 2

[20:41:27] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 6 mods : [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]

[20:41:27] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

[20:41:27] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[20:41:27] [server thread/INFO]: lukas20056[local:E:6bae02ab] logged in with entity id 207 at (72.14319974255062, 94.0, 51.63044043013551)

[20:41:27] [server thread/INFO]: lukas20056 joined the game

[20:41:27] [Netty Local Client IO #0/ERROR] [FML]: SimpleChannelHandlerWrapper exception

java.lang.NullPointerException

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:53) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:1) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:410) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:276) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]

at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]

[20:41:27] [Netty Local Client IO #0/ERROR] [FML]: There was a critical exception handling a packet on channel gym

java.lang.NullPointerException

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:53) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at pl.minepack.gym.network.PlayerDataMessage$PlayerDataMessageHandler.onMessage(PlayerDataMessage.java:1) ~[PlayerDataMessage$PlayerDataMessageHandler.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:56) ~[simpleChannelHandlerWrapper.class:?]

at net.minecraftforge.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:36) ~[simpleChannelHandlerWrapper.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) ~[simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:4.0.23.Final]

at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:109) [FMLProxyPacket.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:156) [NetworkManager.class:?]

at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:51) [NetworkManager.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:410) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:276) [NetworkDispatcher.class:?]

at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:73) [NetworkDispatcher.class:?]

at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final]

at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final]

at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final]

at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final]

at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final]

at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]

[20:41:27] [server thread/INFO]: lukas20056 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}

[20:41:27] [server thread/INFO]: lukas20056 left the game

[20:41:27] [server thread/INFO]: Stopping singleplayer server as player logged out

[20:41:27] [server thread/INFO]: Stopping server

[20:41:27] [server thread/INFO]: Saving players

[20:41:27] [server thread/INFO]: Saving worlds

[20:41:27] [server thread/INFO]: Saving chunks for level 'Test'/Overworld

[20:41:28] [server thread/INFO]: Saving chunks for level 'Test'/Nether

[20:41:28] [server thread/INFO]: Saving chunks for level 'Test'/The End

[20:41:28] [server thread/INFO] [FML]: Unloading dimension 0

[20:41:28] [server thread/INFO] [FML]: Unloading dimension -1

[20:41:28] [server thread/INFO] [FML]: Unloading dimension 1

[20:41:28] [server thread/INFO] [FML]: Applying holder lookups

[20:41:28] [server thread/INFO] [FML]: Holder lookups applied

[20:42:56] [Client thread/INFO]: Stopping!

[20:42:56] [Client thread/INFO]: SoundSystem shutting down...

[20:42:57] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

Java HotSpot 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

 

EDIT 2:

It says that the IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null); returned null but why?

 

Posted

Something something something NullPointerException something PlayerDataMessage line 53

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

IPlayerData:

package pl.minepack.gym.capabilities;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import pl.minepack.gym.network.ModNetwork;
import pl.minepack.gym.network.PlayerDataMessage;
public interface IPlayerData {

	public int addStrength(int count);
	public int subStrength(int count);

	public int setStrength(int count);
	public int getStrength();

	public static class Storage implements Capability.IStorage<IPlayerData> {

		  @Override
		  public NBTBase writeNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side) {
			  NBTTagCompound nbt = new NBTTagCompound();
			  
			  nbt.setInteger("Strength", instance.getStrength());
			  
			  return nbt;
		  }

			@Override
			public void readNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side,
					NBTBase nbt) {

				instance.setStrength(((NBTTagCompound)nbt).getInteger("Strength"));

			}

	}

	public static class DefaultImpl implements IPlayerData {

		private int Strength = 0;

		private EntityPlayer p;

		DefaultImpl(EntityPlayer p) {

			this.p = p;

		}

		@Override
		public int addStrength(int count) {

			return setStrength(getStrength() + count);
		}

		@Override
		public int subStrength(int count) {

			return setStrength(getStrength() - count);
		}

		@Override
		public int setStrength(int count) {

			if (!p.getEntityWorld().isRemote) {

				ModNetwork.INSTANCE.sendTo(new PlayerDataMessage(count), (EntityPlayerMP) p);	

			}

			return this.Strength = count;

		}

		@Override
		public int getStrength() {

			return this.Strength;

		}  
	}

	public static class Provider implements ICapabilitySerializable {

		private EntityPlayer p;

		public Provider(EntityPlayer p) {

			this.p = p;

		}


		@Override
		public boolean hasCapability(Capability<?> capability, EnumFacing facing) {

			if (capability instanceof IPlayerData) return true;

			return false;

		}

		@Override
		public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
			return (T) new DefaultImpl(p);
		}

		@Override
		public NBTBase serializeNBT() {
			NBTBase nbt = new NBTTagCompound();



			return nbt;
		}

		@Override
		public void deserializeNBT(NBTBase nbt) {


		}



	}

}

ModCapabilities:

public class ModCapabilities {

@CapabilityInject(IPlayerData.class)
public static Capability<IPlayerData> PLAYER_DATA_CAP = null;

public static void main() {

	CapabilityManager.INSTANCE.register(IPlayerData.class, new IPlayerData.Storage(), IPlayerData.DefaultImpl.class);

}

}

 

ModNetwork:

public class ModNetwork {

public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MODID);

public static void main() {

	register();

}

public static void register() {

	INSTANCE.registerMessage(PlayerDataMessageHandler.class, PlayerDataMessage.class, 0, Side.CLIENT);

}

}

 

AttachCapabilityEvent:

	@SubscribeEvent
public void attachCap(AttachCapabilitiesEvent.Entity e) {
	if (e.getEntity() instanceof EntityPlayer) {
		//EntityPlayer player = (EntityPlayer) e.getEntity();

		e.addCapability(new ResourceLocation(Reference.MODID, "PlayerData"), new IPlayerData.Provider((EntityPlayer) e.getEntity()));                   

	}
}

and i think thats all stuff related to this topic

Posted

For fucks sake, read what people tell you.

First:

if (capability instanceof IPlayerData) return true;
This won't work.

 

return (T) new DefaultImpl(); // Right here
While this will somewhat work, it is not very useful. Creating a new capability instance every time means it will not persist in any way, ever.

but what shloud i do in these 2 places??
Posted

now my code looks like this:

package pl.minepack.gym.capabilities;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import pl.minepack.gym.network.ModNetwork;
import pl.minepack.gym.network.PlayerDataMessage;
public interface IPlayerData {

	public int addStrength(int count);
	public int subStrength(int count);

	public int setStrength(int count);
	public int getStrength();

	public static class Storage implements Capability.IStorage<IPlayerData> {

		  @Override
		  public NBTBase writeNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side) {
			  NBTTagCompound nbt = new NBTTagCompound();
			  
			  nbt.setInteger("Strength", instance.getStrength());
			  
			  return nbt;
		  }

			@Override
			public void readNBT(Capability<IPlayerData> capability, IPlayerData instance, EnumFacing side,
					NBTBase nbt) {

				instance.setStrength(((NBTTagCompound)nbt).getInteger("Strength"));

			}

	}

	public static class DefaultImpl implements IPlayerData {

		private int Strength = 0;

		private EntityPlayer p;

		DefaultImpl(EntityPlayer p) {

			this.p = p;

		}

		@Override
		public int addStrength(int count) {

			return setStrength(getStrength() + count);
		}

		@Override
		public int subStrength(int count) {

			return setStrength(getStrength() - count);
		}

		@Override
		public int setStrength(int count) {

			if (!p.getEntityWorld().isRemote) {

				ModNetwork.INSTANCE.sendTo(new PlayerDataMessage(count), (EntityPlayerMP) p);	

			}

			return this.Strength = count;

		}

		@Override
		public int getStrength() {

			return this.Strength;

		}  
	}

	public static class Provider implements ICapabilitySerializable {

		private DefaultImpl Impl;

		public Provider(EntityPlayer p) {

			Impl = new DefaultImpl(p);

		}


		@Override
		public boolean hasCapability(Capability<?> capability, EnumFacing facing) {

			if (capability == ModCapabilities.PLAYER_DATA_CAP) return true;

			return false;

		}

		@Override
		public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
			return (T) Impl;
		}

		@Override
		public NBTBase serializeNBT() {
			NBTBase nbt = new NBTTagCompound();



			return nbt;
		}

		@Override
		public void deserializeNBT(NBTBase nbt) {


		}



	}

}

and it still returns null in 53 line of PlayerDataMessage:

package pl.minepack.gym.network;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IThreadListener;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import pl.minepack.gym.Reference;
import pl.minepack.gym.capabilities.IPlayerData;
import pl.minepack.gym.capabilities.ModCapabilities;
import pl.minepack.minelib.utils.utils;

public class PlayerDataMessage implements IMessage {
private int Strength = 0;

  // A default constructor is always required
  public PlayerDataMessage(){}


  public PlayerDataMessage(int Strength) {
    this.Strength = Strength;
  }

  @Override 
  public void toBytes(ByteBuf buf) {
	  
    buf.writeInt(Strength);
    
  }

  @Override 
  public void fromBytes(ByteBuf buf) {
	  
    // Reads the int back from the buf. Note that if you have multiple values, you must read in the same order you wrote.
	  Strength = buf.readInt();
  }

// The params of the IMessageHandler are <REQ, REPLY>
// This means that the first param is the packet you are receiving, and the second is the packet you are returning.
// The returned packet can be used as a "response" from a sent packet.
public static class PlayerDataMessageHandler implements IMessageHandler<PlayerDataMessage, IMessage> {
  // Do note that the default constructor is required, but implicitly defined in this case

  @Override 
  public IMessage onMessage(PlayerDataMessage message, MessageContext ctx) {
	EntityPlayer p = utils.getPlayerInstance(ctx);
    IPlayerData d = p.getCapability(ModCapabilities.PLAYER_DATA_CAP, null); //Here
	d.setStrength(message.Strength);
	utils.Println(d.getStrength() + " : " + p.getName().toString(), Reference.NAME);
    
    // No response packet
    return null;
  }
  
}
  
  
}

 

Posted

Of course it does not save, you did not write any code to save anything.

But how do i do that?

i have these read/write NBT methods in my capability storage class i need to call them or something?

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.