Skip to content

Custom energy types on SimpleEnergyItem #30

Open

Description

@Luligabi1

Hello,

I was wondering if there's a way to have SimpleEnergyItems be unregistered from the "default" energy type? Currently, I have two energy items that are extended from a class that implements SimpleEnergyItem (and other behaviors that are not relevant to the issue).
All is dandy for the first item, since it is meant to use the default energy type. However, for the second, it's meant to use a custom energy type; I registered it manually to it - however, it's still registered to the default type (as all items that implement SimpleEnergyItem do), essentially allowing unintended 1:1 energy transferral.

Even if unregistering is an option, It'd be nice to have custom energy types support, since I wouldn't consider having what's essentially the same logic registered to other id enough to deem it complex/advanced to warrant having to use EnergyStorage.ITEM directly.

EDIT: Not long after I posted this, I found out I just had to register an empty EnergyStorage for the default type and it'd work 😅 Hopefully the request for built-in support, thus requiring no additional setup, is worth keeping the issue open.

Activity

  1. Technici4n commented on Jan 30, 2024

    @Technici4n
    Collaborator

    I think you should make your own interface and implement support for your API Lookup accordingly. You can use createStorage as follows: https://github.com/TechReborn/Energy/blob/master/src/main/java/team/reborn/energy/impl/EnergyImpl.java#L13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions