Posted May 13, 20169 yr I would assume this would be done with NBT in my tile entity, and I know there are readFromNBT() and writeToNBT() methods in my tile entity, but I am unsure how to go about using them to store my RF values. Can anyone help me please?
May 13, 20169 yr Assuming you have an EnergyStorage field in your TileEntity , call its readFromNBT and writeToNBT methods in your overrides of the corresponding TileEntity methods. You can also extend [url=https://github.com/CoFH/RedstoneFlux-API/blob/10e10af21489e351624813120ed6474c44b09ff6/src/main/java/cofh/api/energy/TileEnergyHandler.java]TileEnergyHandler[/url] and let it handle the NBT reading/writing for you. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 13, 20169 yr Author Assuming you have an EnergyStorage field in your TileEntity , call its readFromNBT and writeToNBT methods in your overrides of the corresponding TileEntity methods. You can also extend [url=https://github.com/CoFH/RedstoneFlux-API/blob/10e10af21489e351624813120ed6474c44b09ff6/src/main/java/cofh/api/energy/TileEnergyHandler.java]TileEnergyHandler[/url] and let it handle the NBT reading/writing for you. I have this @Override public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); storage.readFromNBT(nbt); } @Override public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); storage.writeToNBT(nbt); } and it isn't saving. I also attempted making it a TileEnergyHandler, also nothing. What am I missing?
May 13, 20169 yr Are there any errors in the log? Have you registered your TileEntity class? Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 13, 20169 yr Author Are there any errors in the log? Have you registered your TileEntity class? I can't see the log since I am testing the mod outside of the modding environment (if anyone wants to help me get mods working in the environment that would be great), and my TileEntity is registered in initialization GameRegistry.registerTileEntity(ChargerTileEntity.class, "Charger"); . It also has working features.
May 13, 20169 yr There's always a log, regardless of whether you're in the development or release environment. It's written to logs/fml-client-latest.log in the game directory. Mods will work in the development environment if you're using development/deobfuscated versions. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 13, 20169 yr Put CodeChickenCore into your mods directory, it will enable you to put other normal "non-dev" mods into your dev env. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1279956-chickenbones-mods
May 21, 20169 yr Author There's always a log, regardless of whether you're in the development or release environment. It's written to logs/fml-client-latest.log in the game directory. Mods will work in the development environment if you're using development/deobfuscated versions. Checked logs, no errors.
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.