Jump to content

[1.10.2] Power system.


KingOfMiners

Recommended Posts

I don't know how I would go about creating a power system, I have looked into it and I have found close to nothing about it, and the stuff I have found hasn't been helpful, if you could spair time to help that would be very appreciated. :)

Power systems are relatively simple in nature. You need 'machines' that can recieve power, 'generators' which generate power, and some way of transfering that power.

 

Meaning atleast the old way you need three interfaces one for generators that allows you to extract power from it, another one for machines that allows input, and one that allows for both input and output. The way you handle the input and output is all up to you.

 

There is another way, you can achieve this with capabilities there is an EnergyHandler (i believe that is its name) that you can give TileEntities and which is basically a forge energy network.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I don't know how I would go about creating a power system, I have looked into it and I have found close to nothing about it, and the stuff I have found hasn't been helpful, if you could spair time to help that would be very appreciated. :)

Power systems are relatively simple in nature. You need 'machines' that can recieve power, 'generators' which generate power, and some way of transfering that power.

 

Meaning atleast the old way you need three interfaces one for generators that allows you to extract power from it, another one for machines that allows input, and one that allows for both input and output. The way you handle the input and output is all up to you.

 

There is another way, you can achieve this with capabilities there is an EnergyHandler (i believe that is its name) that you can give TileEntities and which is basically a forge energy network.

That's a thing now? Damn

 

Anyway, unlike Liquid systems, you only need to pass along an int or float, representing the power level. It's best to create interfaces or capabilities for this. Then, simply add or subtract based on your blocks needs.

 

If you wanted to pass along voltage, amps, etc, I'd recommend packing it up in a class, instead of passing values directly.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

Link to comment
Share on other sites

What I do is implement a function called addPower. When called, the cable searches for nearby cables, except the one it came from, checks it's power levels, and runs addPower accordingly.

Another way to do this would be like Extra Utilities. Having a master pipes and "slave" pipes.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.