gigabit101 / Shrink

GNU Lesser General Public License v3.0
9 stars 10 forks source link

[Bug]: Captured entities in bottles lose data #112

Open Linguardium opened 16 hours ago

Linguardium commented 16 hours ago

Describe the bug

Capturing entities appears to only capture the id

Steps to reproduce

use shrink mod to shrink chicken check chicken nbt data pickup chicken with bottle check bottle nbt (only shows entity id) place chicken check chicken data and notice egg laying time has been randomly assigned again

Expected behaviour

picked up entities should have all entity data stored in nbt

Screenshots

No response

Version

2.0.0.43

Minecraft Version

1.21.1

ModLoader Version

neoforge 21.1.59

Additional Information

Issue was tested on the Craftoria modpack

Test performed using occultism gem to store and pick up chicken vs shrink and bottle, printing out item nbt via kubejs hand command:

[22:10:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Item in hand:
[22:10:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - 'occultism:soul_gem[entity_data={AbsorptionAmount:0.0f,Age:0,Air:300s,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Brain:{memories:{}},CanPickUpLoot:0b,DeathTime:0s,EggLayTime:3677,FallDistance:0.0f,FallFlying:0b,Fire:-1s,ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],Health:4.0f,HurtByTimestamp:104,HurtTime:0s,InLove:0,Invulnerable:0b,IsChickenJockey:0b,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],NeoForgeData:{},OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,Pos:[245.20000000298023d,63.9375d,-190.20000000298023d],Rotation:[147.69266f,0.0f],UUID:[I;1789964535,2092453730,-1703571937,1119844227],attributes:[{base:0.25d,id:"minecraft:generic.movement_speed"},{base:0.6d,id:"minecraft:generic.step_height"},{base:0.0d,id:"minecraft:generic.armor"},{base:0.1d,id:"caelus:fall_flying"},{base:0.0d,id:"minecraft:generic.oxygen_bonus"},{base:0.08d,id:"minecraft:generic.gravity"}],es_data:{in_abyssal_fire_ticks:0},id:"minecraft:chicken","neoforge:attachments":{"blueflame:blue_flame_handler":{isOnFire:0b}}}]'
[22:10:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '#modern_industrialization:replicator_blacklist'
[22:10:43] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '@occultism'
[22:11:04] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Item in hand:
[22:11:04] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - 'shrink:shrink_bottle[shrink:entity="minecraft:chicken"]'
[22:11:04] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '#modern_industrialization:replicator_blacklist'
[22:11:04] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '@shrink'
[22:11:39] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Item in hand:
[22:11:39] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - 'occultism:soul_gem[entity_data={AbsorptionAmount:0.0f,Age:0,Air:300s,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Brain:{memories:{}},CanPickUpLoot:0b,DeathTime:0s,EggLayTime:6735,FallDistance:0.0f,FallFlying:0b,Fire:-1s,ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],Health:4.0f,HurtByTimestamp:0,HurtTime:0s,InLove:0,Invulnerable:0b,IsChickenJockey:0b,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],NeoForgeData:{},OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,Pos:[221.5d,66.0d,-175.5d],Rotation:[0.0f,0.0f],UUID:[I;-1712155680,154617847,-1640011392,490468532],attributes:[{base:0.25d,id:"minecraft:generic.movement_speed"},{base:0.6d,id:"minecraft:generic.step_height"},{base:0.0d,id:"minecraft:generic.armor"},{base:0.1d,id:"caelus:fall_flying"},{base:0.0d,id:"minecraft:generic.oxygen_bonus"},{base:0.08d,id:"minecraft:generic.gravity"}],es_data:{in_abyssal_fire_ticks:0},id:"minecraft:chicken","neoforge:attachments":{"blueflame:blue_flame_handler":{isOnFire:0b}}}]'
[22:11:39] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '#modern_industrialization:replicator_blacklist'
[22:11:39] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '@occultism'
[22:13:54] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Item in hand:
[22:13:54] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - 'occultism:soul_gem[entity_data={AbsorptionAmount:0.0f,Age:0,Air:300s,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Brain:{memories:{}},CanPickUpLoot:0b,DeathTime:0s,EggLayTime:6735,FallDistance:0.0f,FallFlying:0b,Fire:-1s,ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],Health:4.0f,HurtByTimestamp:0,HurtTime:0s,InLove:0,Invulnerable:0b,IsChickenJockey:0b,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],NeoForgeData:{},OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,Pos:[221.5d,66.0d,-175.5d],Rotation:[0.0f,0.0f],UUID:[I;-1712155680,154617847,-1640011392,490468532],attributes:[{base:0.25d,id:"minecraft:generic.movement_speed"},{base:0.6d,id:"minecraft:generic.step_height"},{base:0.0d,id:"minecraft:generic.armor"},{base:0.1d,id:"caelus:fall_flying"},{base:0.0d,id:"minecraft:generic.oxygen_bonus"},{base:0.08d,id:"minecraft:generic.gravity"}],es_data:{in_abyssal_fire_ticks:0},id:"minecraft:chicken","neoforge:attachments":{"blueflame:blue_flame_handler":{isOnFire:0b}}}]'
[22:13:54] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '#modern_industrialization:replicator_blacklist'
[22:13:54] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '@occultism'
[22:14:12] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] Item in hand:
[22:14:12] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - 'occultism:soul_gem[entity_data={AbsorptionAmount:0.0f,Age:0,Air:300s,ArmorDropChances:[0.085f,0.085f,0.085f,0.085f],ArmorItems:[{},{},{},{}],Brain:{memories:{}},CanPickUpLoot:0b,DeathTime:0s,EggLayTime:6729,FallDistance:0.0f,FallFlying:0b,Fire:-1s,ForcedAge:0,HandDropChances:[0.085f,0.085f],HandItems:[{},{}],Health:4.0f,HurtByTimestamp:0,HurtTime:0s,InLove:0,Invulnerable:0b,IsChickenJockey:0b,LeftHanded:0b,Motion:[0.0d,-0.0784000015258789d,0.0d],NeoForgeData:{},OnGround:1b,PersistenceRequired:0b,PortalCooldown:0,Pos:[221.5d,66.0d,-174.5d],Rotation:[0.0f,0.0f],UUID:[I;-1712155680,154617847,-1640011392,490468532],attributes:[{base:0.25d,id:"minecraft:generic.movement_speed"},{base:0.6d,id:"minecraft:generic.step_height"},{base:0.0d,id:"minecraft:generic.armor"},{base:0.1d,id:"caelus:fall_flying"},{base:0.08d,id:"minecraft:generic.gravity"},{base:0.0d,id:"minecraft:generic.oxygen_bonus"}],es_data:{in_abyssal_fire_ticks:0},id:"minecraft:chicken","neoforge:attachments":{"blueflame:blue_flame_handler":{isOnFire:0b}}}]'
[22:14:12] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '#modern_industrialization:replicator_blacklist'
[22:14:12] [Render thread/INFO] [minecraft/ChatComponent]: [System] [CHAT] - '@occultism'
Linguardium commented 16 hours ago

Just tested on an instance with only this mod, polylib, architectury and a test FE generation mod to charge the shrink tool. It even loses sheep wool colors.

Linguardium commented 15 hours ago

issue is that you never finished creating your item data component type... you only have a String component that you save the id into. so you literally wipe all entity data and only save the id.