Jump to content

lukas2005

Forge Modder
  • Posts

    289
  • Joined

  • Days Won

    2

Everything posted by lukas2005

  1. i just want to ask if you gus know any good entity creating tuts
  2. ok i figured out what was wrong now it dont crashes but what now?
  3. 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; } } }
  4. 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
  5. i have this code: 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; public class PlayerDataCapabilityClass { public interface PlayerDataCapability { int Strength = 0; public int addStrength(int count); public int subStrength(int count); public void setStrength(int count); public int getStrength(); } public static class PlayerDataCapabilityStorage implements Capability.IStorage<PlayerDataCapability> { @Override public NBTBase writeNBT(Capability<PlayerDataCapability> capability, PlayerDataCapability instance, EnumFacing side) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("Strength", instance.getStrength()); return nbt; } @Override public void readNBT(Capability<PlayerDataCapability> capability, PlayerDataCapability instance, EnumFacing side, NBTBase nbt) { instance.setStrength(((NBTTagCompound)nbt).getInteger("Strength")); } } public static class PlayerDataCapabilityFactory implements PlayerDataCapability { 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; } } } and what now?
  6. Maybe add a public variable InfoAdded = false to the Item Class and check for it in the Add Info method
  7. can you show me an example?
  8. Call ICapabilityProvider#getCapability to get the instance of your handler attached to the provider. Every Entity (including EntityPlayer ) is an ICapabilityProvider . where i need to call this and how do i read/write the data?
  9. ok i have created and registered capability but how do i use it?
  10. So i need to pass a PlayerDataCapabilityClass.PlayerDataCapabilityFactory.this as a third argument?
  11. It says "The method register(Class<T>, Capability.IStorage<T>,Class<? extends T>) is not applicable for arguments(Class<PlayerDataCapabilityClass.PlayerDataCapability>,Class<PlayerDataCapabilityClass.PlayerDataCapabilityStorage>,Class<PlayerDataCapabilityClass.PlayerDataCapabilityFactory>)"
  12. few questions: 1.Where i shloud register my capabliity 2.i have an error when i am trying to register a capability eclipse marks this with red line: CapabilityManager.INSTANCE.register(PlayerDataCapabilityClass.PlayerDataCapability.class, PlayerDataCapabilityClass.PlayerDataCapabilityStorage.class, PlayerDataCapabilityClass.PlayerDataCapabilityFactory.class); PlayerDataCapabilityClass.java: public class PlayerDataCapabilityClass { public interface PlayerDataCapability { } public static class PlayerDataCapabilityStorage implements Capability.IStorage<PlayerDataCapability> { @Override public NBTBase writeNBT(Capability<PlayerDataCapability> capability, PlayerDataCapability instance, EnumFacing side) { return null; // return an NBT tag } @Override public void readNBT(Capability<PlayerDataCapability> capability, PlayerDataCapability instance, EnumFacing side, NBTBase nbt) { // TODO Auto-generated method stub } } public static class PlayerDataCapabilityFactory implements Callable<PlayerDataCapability> { @Override public PlayerDataCapability call() throws Exception { return null; } } }
  13. What if i want to Store a int and a boolean shloud i create 2 capabilities?
  14. what i shloud do? Create own capability or use existing one?
  15. can anyone explain this Capabilities system step-by-step because i spend like a 2 weeks to try to figure it out by myself
  16. i think in this RenderManager argument you shloud pass Minecraft.GetMinecraft().GetRenderManager() but i'm not really sure
  17. i have a variable and i need to save it and i have no idea how to use capabilities
  18. ok but is this possible to use the NBTTag?
  19. is there a way to use NBTTag?
  20. Like in topic i want to save some data to player but i have no idea how to do this
  21. Ok now eveything works
  22. what "% 20 == 0" means?
  23. in the Potion#isReady method is only /** * checks if Potion effect is ready to be applied this tick. */ public boolean isReady(int duration, int amplifier) { if (this == MobEffects.REGENERATION) { int k = 50 >> amplifier; return k > 0 ? duration % k == 0 : true; } else if (this == MobEffects.POISON) { int j = 25 >> amplifier; return j > 0 ? duration % j == 0 : true; } else if (this == MobEffects.WITHER) { int i = 40 >> amplifier; return i > 0 ? duration % i == 0 : true; } else { return this == MobEffects.HUNGER; } } what i shloud do with this?
  24. Nausea now works but i dont know how much time poison needs to enable
  25. ok so i need to check if player arelady has a potion to make it work EDIT: i changed my utils.addPotionEffect function to: public static boolean addPotionEffect(EntityLivingBase entity, Potion potion, int duration, int amplifier, boolean showParticles) { if (!entity.isPotionActive(potion)) { entity.addPotionEffect(new PotionEffect(potion, duration, amplifier, false, showParticles)); return true; } return false; and still not works maybe resaon is that i am giving the potion on 1 sec
×
×
  • Create New...

Important Information

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