-
Posts
878 -
Joined
-
Last visited
Everything posted by Elix_x
-
Yes, entity registration is just for from nbt retreival and nothing more.
-
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.
-
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.
-
There's event that may help you - OnChunkUnload (or similar). Then, get all your entities in chunk and "kill" them.
-
You may try packets: client sends packet to server demanding server data, server answers with packet containing that server data.
-
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.
-
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!
-
capabilities.isFlying...
-
Show what you have tried.
-
[1.7.10] Reading all data from NBT on Entities
Elix_x replied to American2050's topic in Modder Support
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. -
Rerun gradlew comands.
-
bounding boxes = hit boxes
-
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.
-
[1.8]Make a block react on Redstone input
Elix_x replied to ItsAMysteriousYT's topic in Modder Support
OnNeighbohurChange (or similar name) Is called when one of adjacent blocks has changed somehow. In this case this includes redstone signal. -
So basically each block has one chance out of 1365 to be ticked. That's interesting...
-
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?
-
So basically, if it returns 10 it means each 10th tick? Or each tick with 1 chance out of 10? Thanks so much!
-
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!
-
If you know how you centered background, you should know how to center text field. Answer is there.
-
@Mod(dependencies="required-after=thisModIsRequiredAndShouldBeLoadedBeforeThisOne,after=ThisModIsNotRequiredButShouldBeLoadedBeforeThisOne")
-
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...
-
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!