Lunatrius / Schematica

Import schematics, export schematics, build schematics. All inside Minecraft!
MIT License
209 stars 145 forks source link

Certain tile entities can't be properly saved (replaced with bedrock) #115

Open TechnologicApe opened 8 years ago

TechnologicApe commented 8 years ago

I've noticed some blocks don't get saved properly to a schematics file. Blocks like JABBA Barrels and Refined Relocation's Pipes, they get saved as bedrock.

Lunatrius commented 8 years ago

That usually happens when a TileEntity can't be saved on the client side. The log file should contain more information why exactly it fails.

TechnologicApe commented 8 years ago

Is there a way to fix it?

TechnologicApe commented 8 years ago

I read the log,but I don't understand why it wasn't working.

Lunatrius commented 8 years ago

You don't have to understand the log, I just need the stacktrace from the log. Try to save a schematic, the stacktrace will be in the last 100 lines of the log file.

TechnologicApe commented 8 years ago

Schematica Saving starts at 581

http://pastebin.com/sudiY2fr

Lunatrius commented 8 years ago

Looks like JABBA barrels can't be saved client side. Could you try /schematicaSave if it's a SP world?

TechnologicApe commented 8 years ago

Doesn't seem to be working. I've tried:

/schematicaSave <X Y Z> <X Y Z>
/schematicaSave <X> <Y> <Z> <X> <Y> <Z>
/schematicaSave X Y Z X Y Z

Am I missing Something?

TechnologicApe commented 8 years ago

there's supposed to be XYZ in the top two iterations

Lunatrius commented 8 years ago

Typing /schematicaSave will bring up the help text: /schematicaSave <x> <y> <z> <x> <y> <z> <filename>

TechnologicApe commented 8 years ago

OK, I just tried it, it still loads barrels as Bedrock.

Lunatrius commented 8 years ago

In that case there is not much I can do about. It's crashing in JABBA's writeToNBT method which is what vanilla Minecraft uses to save blocks and tile entities into NBT.

java.lang.NullPointerException
 >  at mcp.mobius.betterbarrels.common.blocks.TileEntityBarrel.writeToNBT(TileEntityBarrel.java:465) ~[TileEntityBarrel.class:?]
    at com.github.lunatrius.schematica.nbt.NBTHelper.writeTileEntityToCompound(NBTHelper.java:145) ~[NBTHelper.class:?]
    at com.github.lunatrius.schematica.world.schematic.SchematicAlpha.writeToNBT(SchematicAlpha.java:142) [SchematicAlpha.class:?]
    ...

The line it crashes at (worldObj or provider is null (doesn't exist) for some reason...):

BSpaceStorageHandler.instance().updateBarrel(this.id, this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord);
TechnologicApe commented 8 years ago

OK. I'll see what they say over at JABBA

Lunatrius commented 8 years ago

Was there any comment from ProfMobious' side? Because it seems weird that the saving breaks when saving to a schematic but not to the save file even though the same method is used.

TechnologicApe commented 8 years ago

I couldn't find a way to contact them. I never found their Github. However I tried to save a schematic with Refined Relocation and the pipes didn't even save, not even replaced, just didn't save the blocks. The other blocks but not Refined Relocation's.

Lunatrius commented 8 years ago

Pretty sure JABBA is on Bitbucket. Most of the times tile entities fail to save because they depend on something that is not standard or possibly because I forgot to toggle/enable/set something. In JABBA's case I'm not really sure why it happens.

TechnologicApe commented 8 years ago

I've since removed JABBA and replaced it the Storage Drawers, which works, but refined relocation doesn't.