TehStoneMan Posted August 17, 2019 Share Posted August 17, 2019 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? Quote My mods: http://www.curse.com/mc-mods/minecraft/225548-greenscreen http://mods.curse.com/mc-mods/minecraft/238981-cash-craft Link to comment Share on other sites More sharing options...
Animefan8888 Posted August 17, 2019 Share Posted August 17, 2019 46 minutes ago, TehStoneMan said: Can anybody give me any advice? What have you tried? Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator. Link to comment Share on other sites More sharing options...
TehStoneMan Posted August 18, 2019 Author Share Posted August 18, 2019 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] Quote My mods: http://www.curse.com/mc-mods/minecraft/225548-greenscreen http://mods.curse.com/mc-mods/minecraft/238981-cash-craft Link to comment Share on other sites More sharing options...
Recommended Posts
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.