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



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Look at the classes that implement it.
    • any download link for that please?    
    • Posting here due to having a related issue, not a custom pack, its a curseforge pack, HR- New Beginnings. Been following the advice here but my crash logs dont come with the preamble of this for example. It starts as the Caused by part. Here's the log. ---- Minecraft Crash Report ---- // Uh... Did I do that? Time: 5/12/21 11:33 PM Description: Exception in server tick loop com.electronwill.nightconfig.core.io.ParsingException: Not enough data available at com.electronwill.nightconfig.core.io.ParsingException.notEnoughData(ParsingException.java:22) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.io.ReaderInput.directReadChar(ReaderInput.java:36) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.io.AbstractInput.readChar(AbstractInput.java:49) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.io.CharacterInput.readCharAndSkip(CharacterInput.java:59) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.toml.Toml.readNonSpaceChar(Toml.java:48) ~[toml-3.6.2.jar:?] {} at com.electronwill.nightconfig.toml.TableParser.parseTableName(TableParser.java:126) ~[toml-3.6.2.jar:?] {} at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:51) ~[toml-3.6.2.jar:?] {} at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) ~[toml-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) ~[core-3.6.2.jar:?] {} at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) ~[core-3.6.2.jar:?] {} at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:53) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:104) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:83) ~[?:?] {re:classloading} at java.lang.Iterable.forEach(Unknown Source) ~[?:1.8.0_311] {} at java.util.Collections$SynchronizedCollection.forEach(Unknown Source) ~[?:1.8.0_311] {} at net.minecraftforge.fml.config.ConfigTracker.loadConfigs(ConfigTracker.java:83) ~[?:?] {re:classloading} at net.minecraftforge.fml.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:87) ~[?:?] {re:classloading} at net.minecraft.server.integrated.IntegratedServer.func_71197_b(IntegratedServer.java:95) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:613) [?:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Unknown Source) [?:1.8.0_311] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.15.2 Minecraft Version ID: 1.15.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_311, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 1069460008 bytes (1019 MB) / 2735734784 bytes (2609 MB) up to 4772593664 bytes (4551 MB) CPUs: 8 JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms512m -Xmx5120m ModLauncher: 5.1.2+70+master.2845bb9 ModLauncher launch target: fmlclient ModLauncher naming: srg ModLauncher services: /mixin-0.8.2.jar mixin PLUGINSERVICE /eventbus-2.2.1-service.jar eventbus PLUGINSERVICE /forge-1.15.2-31.2.47-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.15.2-31.2.47-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-2.1.3-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.15.2-31.2.47-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.15.2-31.2.47-launcher.jar runtimedistcleaner PLUGINSERVICE /mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE /forge-1.15.2-31.2.47-launcher.jar fml TRANSFORMATIONSERVICE /MixinBootstrap-1.0.5.jar mixinbootstrap TRANSFORMATIONSERVICE FML: 31.2 Forge: net.minecraftforge:31.2.47 FML Language Providers: javafml@31.2 minecraft@1 Mod List: NetherPortalFix_1.15.2-6.0.2.jar NetherPortalFix {netherportalfix@6.0.2 DONE} refinedpipes-0.4.2.jar Refined Pipes {refinedpipes@0.4.2 DONE} DoggyTalents-1.15.2-2.0.1.2.jar Doggy Talents 2 {doggytalents@2.0.1.2 DONE} mcws-win-1.15.2-v1.0.2.jar Macaw's Windows {mcwwindows@1.0.2 DONE} SilentMechanisms-1.15.2-0.8.0+59.jar Silent's Mechanisms {silents_mechanisms@0.8.0+59 DONE} Industrial Agriculture[Core]-1.15.2-1.7.0.jar Industrial Agriculture {industrialagriculture@1.15.2-1.7.0 DONE} strawgolem-1.15.2-1.9.jar Straw Golem {strawgolem@1.15.2-1.9 DONE} essentials-1.15.2-2.7.4.jar Essentials {essentials@1.15.2-2.7.4 DONE} Placebo-1.15.2-3.1.0.jar Placebo {placebo@3.1.0 DONE} NamePain-1.3.1 Forge-1.15.2.jar Name Pain {namepain@1.3.1 DONE} theloader-1.15.2-1.1.0.jar The Loader {theloader@1.15.2-1.1.0 DONE} WitherSkeletonTweaks-1.15.2-4.0.2.jar Wither Skeleton Tweaks {wstweaks@4.0.2 DONE} u_team_core-1.15.2-3.0.2.169.jar U Team Core {uteamcore@3.0.2.169 DONE} randompatches-1.15.2-1.22.1.1.jar RandomPatches {randompatches@1.15.2-1.22.1.1 DONE} buildinggadgets-3.4.1.jar Building Gadgets {buildinggadgets@3.4.1 DONE} ProgressiveBosses-2.1.5-mc1.15.2.jar Progressive Bosses {progressivebosses@2.1.5-mc1.15.2 DONE} mcw-doors-1.0.2-mc1.15.2.jar Macaw's Doors {mcwdoors@1.0.2 DONE} Morpheus-1.15.2-4.2.50.jar Morpheus {morpheus@version DONE} MekanismGenerators-1.15.2-9.10.9.422.jar Mekanism: Generators {mekanismgenerators@9.10.9 DONE} Hwyla-forge-1.10.8-B72_1.15.2.jar Waila {waila@version DONE} SnowRealMagic-1.15.2-1.7.5.jar Snow! Real Magic! {snowrealmagic@1.7.5 DONE} refinedstorage-1.8.8.jar Refined Storage {refinedstorage@1.8.8 DONE} PackMenu-1.15.2-1.2.8.jar Pack Menu {packmenu@1.2.8 DONE} mcw-bridges-1.0.5-mc1.15.2.jar Macaw's Bridges {mcwbridges@1.0.5 DONE} industrial-foregoing-1.15.2-2.3.3-e356e61.jar Industrial Foregoing {industrialforegoing@2.3.3 DONE} useful_backpacks-1.15.2-1.10.3.77.jar Useful Backpacks {usefulbackpacks@1.10.3.77 DONE} AmbientSounds_v3.0.20_mc1.15.2.jar Ambient Sounds {ambientsounds@3.0.3 DONE} Industrial Agriculture[Silent's Mechanisms]-1.15.2-1.6.1.jar Industrial Agriculture Plugin-Silent's Mechanisms {iapsm@1.15.2-1.6.1 DONE} BiomesOPlenty-1.15.2-10.0.0.366-universal.jar Biomes O' Plenty {biomesoplenty@1.15.2-10.0.0.366 DONE} phosphor-forge-mc1.15.2-0.5.2+build.4.jar Phosphor {phosphor@0.5.2+build.4 DONE} Blur-1.1.0-1.jar Blur {blur@1.1.0-1 DONE} valhelsia_structures-15.0.3a.jar Valhelsia Structures {valhelsia_structures@15.0.3a DONE} mcw-trapdors-1.0.1-mc1.15.2.jar Macaw's Trapdoors {mcwtrpdoors@1.0.1 DONE} mining_dimension-1.15.2-1.0.4.jar Mining World {mining_dimension@1.15.2-1.0.4 DONE} SilentGear-1.15.2-1.11.4+187.jar Silent Gear {silentgear@1.11.4+187 DONE} simplefarming-1.15.2-1.3.4.jar Simple Farming {simplefarming@1.15.1-1.3.4 DONE} MysticalAdaptations-1.15.2-1.2.3.jar Mystical Adaptations {mysticaladaptations@NONE DONE} MysticalAgradditions-1.15.2-3.0.1.jar Mystical Agradditions {mysticalagradditions@3.0.1 DONE} curios-FORGE-1.15.2-2.0.2.7.jar Curios API {curios@FORGE-1.15.2-2.0.2.7 DONE} Patchouli-1.15.2-1.2-35.jar Patchouli {patchouli@1.15.2-1.2-35 DONE} config-2-3.0.jar Cloth Config v2 API {cloth-config2@3.0 DONE} OreExcavation-1.7.151.jar Ore Excavation {oreexcavation@NONE DONE} libnonymous-1.15.2-1.1.1.5.jar Libnonymous {libnonymous@1.1.1.5 DONE} elevatorid-1.15.2-1.7.1.jar Elevator Mod {elevatorid@1.15.2-1.7.1 DONE} obfuscate-0.5.0-1.15.2.jar Obfuscate {obfuscate@0.5.0 DONE} NaturesAura-28.5.jar Nature's Aura {naturesaura@28.5 DONE} furniture-7.0.0-pre16-1.15.1.jar MrCrayfish's Furniture Mod {cfm@7.0.0-pre16 DONE} AI-Improvements-1.15.2-0.3.0.jar AI-Improvements {aiimprovements@0.3.0 DONE} mcw-furniture-1.0.1-mc1.15.1 1.15.2.jar Macaw's Furnitures {mcwfurnitures@1.0.1 DONE} the_bumblezone-1.15.2-1.3.10.jar The Bumblezone {the_bumblezone@1.15.2-1.3.10 DONE} FastLeafDecay-v22.1.jar FastLeafDecay {fastleafdecay@v22.1 DONE} inventorysorter-1.15.2-17.0.0.jar Simple Inventory Sorter {inventorysorter@17.0.0 DONE} Cucumber-1.15.2-3.0.9.jar Cucumber Library {cucumber@3.0.9 DONE} mining-helmet-1.15.2-1.0.9.jar Mining Helmet {mining_helmet@1.0.9 DONE} metalbarrels-2.2.jar Metal Barrels {metalbarrels@2.2 DONE} FallingTree-1.15.2-2.4.0.jar Falling Tree {falling_tree@2.4.0 DONE} fishtraps-forge-1.15.2-0.0.5.jar Fish Traps {fishtraps@1.14.4-0.0.4 DONE} Abnormals-Core-1.15.2-1.0.6.jar Abnormals Core {abnormals_core@1.0.6 DONE} Buzzier-Bees-1.15.2-1.5.2.jar Buzzier Bees {buzzierbees@1.5.2 DONE} KiwiBirds 1.3 1.15.2.jar Kiwi Birds {kiwibirds@1.2 1.15.2 DONE} goblintraders-1.2.0-1.15.2.jar Goblin Traders {goblintraders@1.2.0 DONE} Mekanism-1.15.2-9.10.9.422.jar Mekanism {mekanism@9.10.9 DONE} Waystones_1.15.2-6.0.2.jar Waystones {waystones@6.0.2 DONE} goldenhopper-1.1.1-1.15.2.jar Golden Hopper {goldenhopper@1.1.1 DONE} light-overlay-4.7.2.jar Light Overlay Forge {lightoverlay-forge@NONE DONE} journeymap-1.15.2-5.7.0b3.jar Journeymap {journeymap@5.7.0b3 DONE} comforts-FORGE-1.15.2-2.0.0.4.jar Comforts {comforts@FORGE-1.15.2-2.0.0.4 DONE} NaturesCompass-1.15.2-1.8.5.jar Nature's Compass {naturescompass@1.15.2-1.8.5 DONE} FruitTrees-1.15.2-1.7.0.jar Fruit Trees {fruittrees@1.7.0 DONE} Kiwi-1.15.2-2.8.5.jar Kiwi {kiwi@2.8.5 DONE} VanillaTweaks-1.15.2.1.5.30.jar VanillaTweaks {vanillatweaks@1.15.2.1.5.30 DONE} DefaultSettings-1.14.x-1.15.2-2.2.0.jar DefaultSettings {defaultsettings@2.2.0 DONE} betteranimalsplus-1.15.2-10.1.0.jar Better Animals Plus {betteranimalsplus@10.1.0 DONE} snowundertrees-1.15.2-v1.1.1.jar Snow Under Trees {snowundertrees@v1.1.1 DONE} BonsaiTrees-2.1.2.6.jar Bonsai Trees 2 {bonsaitrees2@2.1.2.6 DONE} JEITweaker-1.15.2-1.0.1.3.jar JEI Tweaker {jeitweaker@1.0.1.3 DONE} CraftTweaker-1.15.2-6.0.0.24.jar CraftTweaker {crafttweaker@6.0.0.24 DONE} Swamp-Expansion-1.15.2-1.7.3.jar Swamp Expansion {swampexpansion@NONE DONE} forge-1.15.2-31.2.47-universal.jar Forge {forge@31.2.47 DONE} Waddles-1.15.2-0.8.6.jar Waddles {waddles@1.15.2-0.8.6 DONE} MysticalAgriculture-1.15.2-3.0.10.jar Mystical Agriculture {mysticalagriculture@3.0.10 DONE} ironchest-1.15.2-10.0.3.jar Iron Chests {ironchest@1.15.2-10.0.1 DONE} CraftingTweaks_1.15.2-11.0.1.jar Crafting Tweaks {craftingtweaks@11.0.1 DONE} forge-1.15.2-31.2.47-client.jar Minecraft {minecraft@1.15.2 DONE} The-Endergetic-Expansion-1.15.2-v1.3.2.jar The Endergetic Expansion {endergetic@1.3.2 DONE} swingthroughgrass-1.15.2-1.4.1.jar SwingThroughGrass {swingthroughgrass@1.15.2-1.4.1 DONE} MouseTweaks-2.13-mc1.15.1.jar Mouse Tweaks {mousetweaks@2.13 DONE} titanium-1.15.2-2.4.2.jar Titanium {titanium@2.4.2 DONE} SilentLib-1.15.2-4.6.6+59.jar Silent Lib {silentlib@4.6.6+59 DONE} morevanillalib-1.15.2-1.2.4.jar MoreVanillaLib {morevanillalib@1.2.4 DONE} Savage-and-Ravage-1.15.2-1.1.4.jar Savage & Ravage {savageandravage@1.1.4 DONE} JAOPCA-1.15.2-3.2.0.16.jar JAOPCA {jaopca@3.2.0.16 DONE} gravestone-1.17.6.jar Gravestone Mod {gravestone@1.17.6 DONE} autumnity-1.3.3-1.15.2.jar Autumnity {autumnity@1.3.3 DONE} polymorph-FORGE-1.15.2-0.10.jar Polymorph {polymorph@FORGE-1.15.2-0.10 DONE} AutoRegLib-1.5-40.jar AutoRegLib {autoreglib@1.5-40 DONE} Quark-r2.1-245.jar Quark {quark@r2.1-245 DONE} StorageDrawers-1.15.2-7.0.3.jar Storage Drawers {storagedrawers@1.15.2-7.0.3 DONE} performant-1.15-3.16m.jar Performant {performant@3.16m DONE} vanillahammers-1.15.2-2.1.jar Vanilla Hammers {vanillahammers@2.1 DONE} midnight-0.5.11.jar The Midnight {midnight@0.5.11 DONE} jei-1.15.2-6.0.3.15.jar Just Enough Items {jei@6.0.3.15 DONE} PickleTweaks-1.15.2-4.0.4.jar Pickle Tweaks {pickletweaks@4.0.4 DONE} AppleSkin-mc1.15.2-forge-1.0.14.jar AppleSkin {appleskin@1.0.14 DONE} Aquaculture-1.15.2-2.0.23.jar Aquaculture 2 {aquaculture@1.15.2-2.0.23 DONE} Industrial Agriculture[Mekanism]-1.15.2-1.6.1.jar Industrial Agriculture Plugin-Mekanism {iapmekanism@1.15.2-1.6.1 DONE} refinedstorageaddons-0.6.3.jar Refined Storage Addons {refinedstorageaddons@0.6.3 DONE} SolarGeneration-1.15.2-1.2.2.jar Solar Generation {solargeneration@1.2.2 DONE} SoundFilters-0.14_for_1.15.2.jar Sound Filters {soundfilters@0.14_for_1.15.2 DONE} Kiwi Modules: fruittrees:cherry fruittrees:fruittrees fruittrees:hybridization kiwi:contributors kiwi:data snowrealmagic:snowrealmagic Patchouli open book context: n/a Player Count: 0 / 8; [] Data Packs: Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'forge'   This was caused by loading a world ive sunk a fair bit of time into, after some strange error removed the "instance.cfg" for the pack on MultiMC, not sure if that has anything to do with it. I might try a fresh install of the instance and see if it can boot up the world.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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