Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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.

  • 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?

  • 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.

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.

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.