Hwyla

Hwyla

86M Downloads

HatcheryTileProvider not receiving correct nbt

GenDeathrow opened this issue ยท 2 comments

commented

Issue Description:

I believe since the last two updates of HWYLA. I had been getting reports crashes on servers with waila. Further looking into it. I realized it was null pointer exception. So I decided to try and catch it my side. Than I noticed that when I updated my dev to the newest HWYLA it stopped working. At first I thought stuff wasn't getting registered properly. But using printouts my code was in-fact getting called. I than started to printout what the client was receiving. Its sending my entire tile entity instead of just the data it needs to send. I store inventory and entities in the block. But I don't need the entire tile entity. its a lot of unnecessary data.

Now I'm hoping its just something simple I missed, but its been aggravating me for the last week. So Im bringing this up to have another set of eyes.

What happens:

https://github.com/GenDeathrow/Hatchery/blob/master/src/main/java/com/gendeathrow/hatchery/core/waila/HatcheryTileProvider.java#L90

The output of that nbttag:

[13:20:18] [Client thread/INFO] [STDOUT]: [com.gendeathrow.hatchery.core.waila.HatcheryTileProvider:getWailaTail:90]: {x:898,y:4,Items:[],z:235,id:"com.gendeathrow.hatchery.block.nestpen.NestPenTileEntity",storedEntity:{IsChickenJockey:0b,HurtByTimestamp:0,Growth:1,Attributes:[0:{Base:4.0d,Name:"generic.maxHealth"},1:{Base:0.0d,Name:"generic.knockbackResistance"},2:{Base:0.25d,Name:"generic.movementSpeed"},3:{Base:0.0d,Name:"generic.armor"},4:{Base:0.0d,Name:"generic.armorToughness"},5:{Base:16.0d,Name:"generic.followRange"}],FallFlying:0b,ForcedAge:0,AbsorptionAmount:0.0f,InLove:0,DeathTime:0s,HandDropChances:[0:0.085f,1:0.085f],PersistenceRequired:0b,id:"chickens.ChickensChicken",Age:-1,Leashed:0b,Health:4.0f,LeftHanded:0b,HandItems:[0:{},1:{}],ArmorDropChances:[0:0.085f,1:0.085f,2:0.085f,3:0.085f],EggLayTime:6000,Type:203,Analyzed:0b,ArmorItems:[0:{},1:{},2:{},3:{}],CanPickUpLoot:0b,HurtTime:0s,Gain:1,Strength:1}}
[13:20:18] [Client thread/INFO] [STDOUT]: [com.gendeathrow.hatchery.core.waila.HatcheryTileProvider:getWailaTail:90]: {x:898,y:4,Items:[],z:235,id:"com.gendeathrow.hatchery.block.nestpen.NestPenTileEntity",storedEntity:{IsChickenJockey:0b,HurtByTimestamp:0,Growth:1,Attributes:[0:{Base:4.0d,Name:"generic.maxHealth"},1:{Base:0.0d,Name:"generic.knockbackResistance"},2:{Base:0.25d,Name:"generic.movementSpeed"},3:{Base:0.0d,Name:"generic.armor"},4:{Base:0.0d,Name:"generic.armorToughness"},5:{Base:16.0d,Name:"generic.followRange"}],FallFlying:0b,ForcedAge:0,AbsorptionAmount:0.0f,InLove:0,DeathTime:0s,HandDropChances:[0:0.085f,1:0.085f],PersistenceRequired:0b,id:"chickens.ChickensChicken",Age:-1,Leashed:0b,Health:4.0f,LeftHanded:0b,HandItems:[0:{},1:{}],ArmorDropChances:[0:0.085f,1:0.085f,2:0.085f,3:0.085f],EggLayTime:6000,Type:203,Analyzed:0b,ArmorItems:[0:{},1:{},2:{},3:{}],CanPickUpLoot:0b,HurtTime:0s,Gain:1,Strength:1}}
[13:20:18] [Server thread/INFO] [STDOUT]: [com.gendeathrow.hatchery.core.waila.HatcheryTileProvider:getNBTData:172]: server:true
[13:20:18] [Server thread/INFO] [STDOUT]: [com.gendeathrow.hatchery.core.waila.HatcheryTileProvider:getNBTData:172]: server:true


What you expected to happen:

It should be sending a small nbttag: https://github.com/GenDeathrow/Hatchery/blob/master/src/main/java/com/gendeathrow/hatchery/core/waila/HatcheryTileProvider.java#L167-L200

Output should be more like this (Example):

[13:20:18] [Client thread/INFO] [STDOUT]: [com.gendeathrow.hatchery.core.waila.HatcheryTileProvider:getWailaTail:90]: {x:898,y:4,z:235,id:"com.gendeathrow.hatchery.block.nestpen.NestPenTileEntity", hasChicken:true, entityname:'Chicken' ,timetilldrop: 100, inventory:[and list of inventory items names].

Steps to reproduce:

  1. Just having mods installed.

Affected Versions (Do not use "latest"):

  • Hwyla: 1.8.9
  • Minecraft: 1.10.2
  • Forge: 12.18.3.2185
commented

Tags are collected across all handlers that are registered to a class that parents your class, also, tag handlers are only used when connected to a dedicated server. In single player, writeToNBT() is used since network is not an issue. This is how Waila has worked for quite some time.

It not working was an error on my part which was initially fixed in 1872199, then again in 03f0c65. Neither of those have seen releases since I'm still making attempts at fixing the extremely large payload sizes generically instead of hardcoded cases..

commented

I get what your saying. I haven't changed anything since Sept 17, 2016, when I first added walia support. Every thing has worked fine until v3.0.6 of SkyFactory. Which I believe is using Hwyla 1.8.8_B22. This mod has been in SF3 since the beginning.

I am using Override Method for getNBTData. But it wasn't actually setting up the nbt tag that I wanted it to send instead, client or server. I didn't think i mattered if its server or client for that nbtprovider?

All I can say now is it works again with your lastest update Hwyla-1.8.10-B24. Thanks for do this, even if its a temp fix for now.