Jump to content

Elix_x

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by Elix_x

  1. Yes, entity registration is just for from nbt retreival and nothing more.
  2. I think he has custom class and no writeToNbt and readToNbt methods (and maybe no super methods). And he asks about how he can save "complex" variables like objects to nbt.
  3. 1) Right, it will get deleted as soon as chunk is loaded... 2) You can prevent entity from saving by... simply not saving it! Override writeToNbt method and do nothing! Also, do not register your entity in this case.
  4. There's event that may help you - OnChunkUnload (or similar). Then, get all your entities in chunk and "kill" them.
  5. You may try packets: client sends packet to server demanding server data, server answers with packet containing that server data.
  6. You can always split objects in to basic objects. All basic objects, you can save in nbt. For example BlockPos, can be split into int x, int y, int z . And IBlockState can be converted to int meta by using get metaFromState.
  7. Thanks, that worked! Never heard about it though...
  8. Hello evrybody. In eclipse i launch server (server is in offline, eula=true mode). Then i launch client. Then i try to connect to localhost. And i get disconnected with this: [09:36:36] [Client thread/INFO]: Connecting to localHost, 25565 [09:36:36] [Netty Client IO #3/INFO] [FML]: Server protocol version 2 [09:36:36] [Netty Client IO #3/INFO] [FML]: Attempting connection with missing mods [] at SERVER [09:36:36] [Netty Client IO #3/INFO] [FML]: Injecting existing block and item data into this client instance [09:36:36] [Netty Client IO #3/INFO] [FML]: Applying holder lookups [09:36:36] [Netty Client IO #3/INFO] [FML]: Holder lookups applied [09:36:36] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established [09:36:36] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception io.netty.handler.codec.DecoderException: java.io.IOException: The received string length is longer than maximum allowed (23 > 20) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:263) ~[byteToMessageDecoder.class:?] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:131) ~[byteToMessageDecoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [byteToMessageDecoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_25] Caused by: java.io.IOException: The received string length is longer than maximum allowed (23 > 20) at net.minecraft.network.PacketBuffer.readStringFromBuffer(PacketBuffer.java:185) ~[PacketBuffer.class:?] at net.minecraft.network.play.server.S3FPacketCustomPayload.readPacketData(S3FPacketCustomPayload.java:42) ~[s3FPacketCustomPayload.class:?] at net.minecraft.util.MessageDeserializer.decode(MessageDeserializer.java:46) ~[MessageDeserializer.class:?] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:232) ~[byteToMessageDecoder.class:?] ... 16 more [09:36:36] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception io.netty.handler.codec.DecoderException: java.io.IOException: Packet was larger than I expected, found 91 bytes extra whilst reading packet 0 at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:263) ~[byteToMessageDecoder.class:?] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:147) ~[byteToMessageDecoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [byteToMessageDecoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_25] Caused by: java.io.IOException: Packet was larger than I expected, found 91 bytes extra whilst reading packet 0 at net.minecraft.util.MessageDeserializer.decode(MessageDeserializer.java:50) ~[MessageDeserializer.class:?] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:232) ~[byteToMessageDecoder.class:?] ... 16 more [09:36:36] [Netty Client IO #3/ERROR] [FML]: NetworkDispatcher exception io.netty.handler.codec.DecoderException: java.io.IOException: Packet was larger than I expected, found 82 bytes extra whilst reading packet 31 at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:263) ~[byteToMessageDecoder.class:?] at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:196) ~[byteToMessageDecoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:237) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:223) [DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:214) [byteToMessageDecoder.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:237) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:223) [DefaultChannelHandlerContext.class:?] at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75) [ChannelInboundHandlerAdapter.class:?] at io.netty.handler.timeout.ReadTimeoutHandler.channelInactive(ReadTimeoutHandler.java:143) [ReadTimeoutHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:237) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:223) [DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767) [DefaultChannelPipeline.class:?] at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:558) [AbstractChannel$AbstractUnsafe$5.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:?] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348) [NioEventLoop.class:?] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_25] Caused by: java.io.IOException: Packet was larger than I expected, found 82 bytes extra whilst reading packet 31 at net.minecraft.util.MessageDeserializer.decode(MessageDeserializer.java:50) ~[MessageDeserializer.class:?] at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:232) ~[byteToMessageDecoder.class:?] ... 16 more And there's no any mention of any of my classes in error log. I can only think that it's caused indirectly by one of net parts of one of my mods. But why and how? Thanks for help! If you need anything else (code maybe) - just ask!
  9. capabilities.isFlying...
  10. Show what you have tried.
  11. 1) When entity dies: LivingDeathEvent 2) Save all data to nbt: entity.writeToNbt(nbtTag) This will save all information about this entity to this NBTTagCompound 3) Save: Save how? Where? When? 4) Load: EntityList.createFromNbt(nbtTag) This will return you your entity filled with data found in this nbtTag.
  12. Rerun gradlew comands.
  13. bounding boxes = hit boxes
  14. First, learn the basics: client-server side meaning, how to use @mod, events, packets... For that there are plenty o' tutorials. Just google. For mana, you will have to use IExtendedEntityProperties. For that there are plenty o' tutorials too. Just google. For magic thing to happen on key press you will have to use: events and packets. For that there are plenty o' tutorials too. Just google. Personally, tutorials that i recommend: Basics, events, packets... jabelar's tutorials IExtendedEntity Properties, coolAlias's tutorial.
  15. OnNeighbohurChange (or similar name) Is called when one of adjacent blocks has changed somehow. In this case this includes redstone signal.
  16. So basically each block has one chance out of 1365 to be ticked. That's interesting...
  17. This is not true. You cannot specify the tick rate for random ticks. The tickRate method does nothing. Apearently, yes. Going though call hierarchy of tickRate showed only BlockStairs and only BlockStairs. Then how often/with which chance is updateTick called?
  18. So basically, if it returns 10 it means each 10th tick? Or each tick with 1 chance out of 10? Thanks so much!
  19. Hello everybody! After working on some time related mechanics, i ran into question: how often block.updateTick is normally called? It's for sure not every tick, that's what are my results for now... Thanks for help! If you have any questions - just ask!
  20. If you know how you centered background, you should know how to center text field. Answer is there.
  21. @Mod(dependencies="required-after=thisModIsRequiredAndShouldBeLoadedBeforeThisOne,after=ThisModIsNotRequiredButShouldBeLoadedBeforeThisOne")
  22. Thanks. I already understood that. So i had to do this: float fw = entity.moveForward; float st = entity.moveStrafing; boolean sneaking = entity.isSneaking(); boolean forward = fw > 0; boolean backwards = fw < 0; boolean left = st < 0; boolean right = st > 0; boolean up = false; boolean down = sneaking; Oh and also, forge has to create isJumping method in EntityLivingBase. Otherwise we have to use reflection to check if entity is jumping...
  23. Use the PlayerTickEvent , and modify the motionX/Y/Z variables in there. I'm already doing this... I just need to know where player wants to move... This makes me sad... Op has to be rewritten...
  24. Hello, i have a little question: how can i know where player wants to move on server side? I know that: -On client i can check for key binds press. -Server does not have keyboard. -Client sends packets to server about input. But: -All calls checking move key press go from MovementInputFromOptions, but this one is called only from EntityPlayerSP. ANd: -Somehow client sends to server data about movement. -In worst case i could send packets... But that's for worst case... What i'm trying to do: -In player update event check where player wants to move and modify motionX,Y,Z according to some side effects (not blocks, not entities, not tiles...). Just to know where player wants to move!!! I know everything else!!!!!!!!!!! Thanks for help! If you have any questions - just ask!
×
×
  • Create New...

Important Information

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