maruohon / litematica

A modern client-side schematic mod for Minecraft
GNU Lesser General Public License v3.0
730 stars 222 forks source link

Saving non-generated chests? #57

Open SunSerega opened 5 years ago

SunSerega commented 5 years ago

A few days ago i copied a ship from end sity (without opening it's chests), and when i paced it - chests were empty. Is it possible to save loot table of chest in .litematica file?

maruohon commented 5 years ago

I think it should save the loot table seed and stuff if you make the schematic in single player. Was this in single player or on a server?

SunSerega commented 5 years ago

I think i was saving in single player and pasting in creative multiplayer... Lemmi try both in single player now...

Also, isn't it possible to get server-side data if player making litematica is op? And otherwise it would be usefull to have some sort of warning, telling that some server-side data isn't saved.

maruohon commented 5 years ago

Yes in 1.13+ it would be possible to get TileEntity and Entity data using vanilla packets, if the player is OP'd.

I have also recently started working on a new separate server-side mod that is meant to provide data for my client-side mods, and sending TileEntity and Entity NBT data or just inventory contents is the first feature I'm working on for it.

SunSerega commented 5 years ago

Ok, so, when trying to copy ungenerated chest from ... to ... :

sp => sp : The exact seed of chest is saved, not it's loot table. So if you paste it multiple times - you get the same loot when opening it. Even though you still can't open this chest in gm3.

sp => server, server => server, server => sp : Empty chest is pasted.

maruohon commented 5 years ago

What did you mean by not its loot table? If you make a schematic of an un-opened loot chest, then the schematic will contain the loot table name and the seed, so all pasted copies of it will generate the same loot when opened. This is what's expected.

As to saving from or pasting to a server, all (server-side-only) TileEntity data is lost and/or not restored after pasting. This should start working on servers that have my to-be-released server-side support mod installed, after I have the time to implement the required Litematica integration to that mod (basically requesting and restoring the full TileEntity data).