Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.15] Energy Network Implementation


Maciej916
 Share

Recommended Posts

Hello, couple days ago I started making tech mod but after I add couple machines i realized that I need some sort of cables to transport energy from one machine to another. When I started i didn't know that it will be that hard to make but after some days I was able to make something that works. I know there is some bugs and issues with it and some things are still missing. There is many people on this forum that are more advanced in java programming that Im, If you one of this people you probably can help me improve my code. Im not asking you to code anything just look at my code and give me clues what i can improve or remake to make it better.

 

Source: https://github.com/Maciej916/Test-Mod/tree/master/src/main/java/com/maciej916/testmod

Edited by Maciej916
Link to comment
Share on other sites

I’ve done this (badly) before, let me try and find my forum article.

The way I would do it if I did it now is have a chunk capability that has a list of energy networks (one for each group of connected pipes) that allow the cables in the network to draw from a collective power supply. In addition to this each network could store a list of other networks it’s connected to (via entry/exit positions?) to speed up the transfer between networks & allow energy to travel over unloaded chunks.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

This is basicly how the current code works. When you place a cable it looks for network around and possible outputs and inputs, if there is non eit create new network, if there is one it join that nrtwork and if there is more than on it merge all. Each network of cables know possible inputs and outputs and have little storage but can accept or output energy only if there is a valid machine connected. When you break cable it try to rebuild network if network split it create new ones and each new network also know inputs and outputs. 

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.