Slimefun

Slimefun

3M Downloads

Allow the Multimeter to be used on Generators

TheBusyBiscuit opened this issue ยท 4 comments

commented

This Issue is part of Hacktoberfest - A yearly event which encourages participation in the open-source community. Sign up on their website and submit four pull requests during october (Oct 1st - Oct 31st) to any public open-source project on GitHub and earn a limited-edition T-shirt or plant a tree!

๐Ÿ”Ž Scope

The following bullet points explain what the scope of this feature should be.
It should give a general idea of what we want, you can of course deviate from this as needed.

  • The Multimeter should be able to read the current energy output from any generator
    • Solar Generators could display some extra debugging info, like the current time and weather, this could help resolve #2280

โš“ Difficulty

Here is our honest estimate on how difficult (on a scale of 1-5) the implementation may be:

๐Ÿ”ต๐Ÿ”ตโšชโšชโšช

๐Ÿšง Technical Challenges

These are some challenges which may need to be overcome, we wanna be as transparent as possible, so here is some guidance on what may present itself as an obstacle.

  • Getting the energy output from a generator may not be that straight-forward, as it is calculated "on the fly" by the Energy Regulator. So one possible solution to this would be to "queue" this request and wait for the energy regulator to generate the output and then send the message to the player

๐Ÿ“ Relevant Classes or Snippets

Here are some classes or code snippets which we think might help you get a better understanding where to look for in this gigantic codebase

๐Ÿ“– Useful Resources

If you need help on how to get started, maybe try looking into the following resources!


If you want to work on this, simply comment down below and state your interests! Please also comment again if you have changed your mind. Anyone is allowed to discuss in the comments below, feel free to collaborate and work together โค๏ธ

You can always ask for help here if you get stuck.

commented

@TheBusyBiscuit I'd like to give this a crack.

commented

Hi @TheBusyBiscuit I'd like to work on this. Could you assign it to me?

commented

Hi, should I implement a getGeneratedOutput function that works for all the generators in the Multimeter class?

commented

Hi, should I implement a getGeneratedOutput function that works for all the generators in the Multimeter class?

I am not quite sure whether this would help you out a lot.
The way I'd approach this would be to add a HashMap to the EnergyNet which stores the Location of the block that was clicked and the Player UUID.
And then when the EnergyNet ticks, get the requested player (or not) and send them a message with the energy this generator just generated during this tick.