Jump to content

Recommended Posts

Posted

I am trying to use a world capability as part of a storage system, but I am not sure how they work. I have tried following examples I have found, but don't know how to properly access it.

I have previously used WorldSaveData, but that method no longer appears to be available in 1.14

Can anybody give me any advice?

Posted

This is the current state of my source code https://github.com/TehStoneMan/BetterStorageToo/tree/1.14

 

When trying to access my capability, I get this error:

[17Aug2019 14:00:13.553] [Server thread/INFO] [betterstorage/]: ==== net.minecraftforge.common.capabilities.Capability@5a8110de ====
[17Aug2019 14:00:13.554] [Server thread/ERROR] [net.minecraft.world.chunk.Chunk/]: A TileEntity type io.github.tehstoneman.betterstorage.common.tileentity.TileEntityCrate has thrown an exception trying to write state. It will not persist, Report this to the mod author
java.lang.ClassCastException: net.minecraftforge.common.capabilities.Capability cannot be cast to io.github.tehstoneman.betterstorage.common.world.storage.CrateStorage
	at io.github.tehstoneman.betterstorage.common.tileentity.TileEntityCrate.getCrateStackHandler(TileEntityCrate.java:93) ~[?:?]
	at io.github.tehstoneman.betterstorage.common.tileentity.TileEntityCrate.getNumCrates(TileEntityCrate.java:316) ~[?:?]
	at io.github.tehstoneman.betterstorage.common.tileentity.TileEntityCrate.write(TileEntityCrate.java:389) ~[?:?]
	at net.minecraft.world.chunk.Chunk.func_223134_j(Chunk.java:432) ~[?:?]
	at net.minecraft.world.chunk.storage.ChunkSerializer.write(ChunkSerializer.java:303) ~[?:?]
	at net.minecraft.world.server.ChunkManager.func_219229_a(ChunkManager.java:674) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) [?:1.8.0_211]
	at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) [?:1.8.0_211]
	at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) [?:1.8.0_211]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) [?:1.8.0_211]
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source) [?:1.8.0_211]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) [?:1.8.0_211]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) [?:1.8.0_211]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) [?:1.8.0_211]
	at java.util.stream.AbstractPipeline.evaluate(Unknown Source) [?:1.8.0_211]
	at java.util.stream.ReferencePipeline.forEach(Unknown Source) [?:1.8.0_211]
	at net.minecraft.world.server.ChunkManager.save(ChunkManager.java:333) [?:?]
	at net.minecraft.world.server.ServerChunkProvider.save(SourceFile:319) [?:?]
	at net.minecraft.world.server.ServerWorld.save(ServerWorld.java:746) [?:?]
	at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:513) [?:?]
	at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:553) [?:?]
	at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:210) [?:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:661) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.