Jump to content

[SOLVED][1.14.3] Difficulties creating multiple energies per block


cleardragonf

Recommended Posts

Hi So i've been trying to add a second and third energy to the same block....and i've hit a snag with not not being able to get the energy to be non static PER block placement...but i also need them to be static so that i can pass the Energy into the Screen to increase Bar Progress and Energy Status....Here's my git...Any help with figuring out HOW to Intialize Mana_StoneTile.java would be a major help...I know i need an instant of it...and probably some other things...but i can't figure out how...

 

Thanks.

https://github.com/Cleardragonf/AsuraMagica.git

Edited by cleardragonf
Link to comment
Share on other sites

ManaStoneContainer, ManaStoneTile, and ManaStoneScreen are not blocks and should not be in your blocks package. They should be in inventory, tileentities, and client.gui respectively.

 

https://github.com/Cleardragonf/AsuraMagica/blob/master/src/main/java/me/asuramagica/blocks/Mana_StoneTile.java#L101-L103

 

BlockPos.getInBox(...)

 

https://github.com/Cleardragonf/AsuraMagica/blob/master/src/main/java/me/asuramagica/blocks/Mana_StoneTile.java#L150

 

1) you can just make the field a CustomEnergyStorage in the first place so you don't need to cast

2) you shouldn't have "add fire energy" as a separate method from "add water energy" on your custom energy storage as you already separate them by using different instances

3) What, if you're "adding fire energy" as your singular method name, its named wrong.

 

And now on to your requested problem

https://github.com/Cleardragonf/AsuraMagica/blob/master/src/main/java/me/asuramagica/blocks/Mana_StoneTile.java#L249

Because all of your energies are all the same ENERGY capability you can't distinguish which energy you return from GetCapability.

 

Either:

1) make a new capability

2) use a custom energy storage that stores all four as independent variables

 

I recommend #1, as #2 will require an assumption when dealing with energy systems from other mods (which one is the right type to send over?)

  • Thanks 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Yea after being explained what was going on by another...i realized that Two would be the way to go for this mod....as the energy inside would only SEEM to be energy...and wouldn't be used for any other mod at this time, eventually I'd create a converter block or system that would turn them into other mod's energy.  But honestly this is more of a 'magical energy' system...and shouldn't be used by other mods...though i suppose it could.  Thank you for taking the time to recommend these things and point out some of the setup issues i had! I'm glad you took the time.   

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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