Hello my name is Andrew or as minecraft knows me as an120633, I am making a industrial mod,I have already put in power cable's and all the rendering things about it now i need to implement some kind of power system but I have no clue where to start!
You could just look in the redstone code. Or are you trying to make some crazy mod like IndustrialCraft?
Redstone isn't really a good example because of a few limitations, and because redstone is designed for static levels, that is, when a machine uses a redstone signal, the machine doesn't pull "strength" from the signal in the same way it would an energy network, which I'm guessing the OP is wanting.
Hello my name is Andrew or as minecraft knows me as an120633, I am making a industrial mod,I have already put in power cable's and all the rendering things about it now i need to implement some kind of power system but I have no clue where to start!
If you want to help me I need a few things!
Do you have Skype Yes or no if so whats your name
age
your programming skill
whats your minecraft Name
Coding an energy network is not as simple as you think, there are a lot of things you need to keep track of, and there are many ways to go about actually creating an energy network. You can have a cable dump energy into adjacent cables, and by doing this, using a simple algorithm you make, the energy will "travel through the network" to other machines. Or you can create an advanced list of tile entities that interest you (such as generators, capacitors and sinks), all linked to the same network through the cables, and when routing energy through the network, find the closest capacitor near the providing generator and dump the energy in that capacitor (this is like what IC2 does, sort of, AFAIK). Each method has advantages and disadvantages, and each method has differing complexity and difficulty levels.
This is why there isn't a tutorial or anything on things like this, because there is no one way to make it, it's up to you. Hell, you could even think of a brand new paradigm (method) to use and have a unique energy network in your mod. The same also goes for people teaching this to you, you won't find many people who are willing to one-on-one teach you how to code an energy network because of how large of a project one is (you will spend night after night on this) and because of how many different ways there are to create one.
Rollback Post to RevisionRollBack
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
So can anyone help me make a basic power network I already have cables that connect to any blocks I tell them to
I am trying to made a mod some what like IC2
So can anyone help me make a basic power network I already have cables that connect to any blocks I tell them to
I am trying to made a mod some what like IC2
As I said before, you won't find many people who will one-on-one help you with a project as big as an energy network, especially if you're basing it off IC2's network structure (IC2 uses a "store and reference" sort of structure, add a new block connected to a network and the block is added to the list, when a generator is trying to dump energy into the network the code iterates (loops) through all stored blocks, looking for A. an energy storage block that can accept the power being dumped into it and B. the closest block to wherever the generator is). And, and I mean no offence to anyone, but people who may offer to help probably won't understand how to actually create something like an energy network simply because of how complex they are. Your best bet would be to try and do it yourself. If you don't know something, say you don't know how tile entities work or how NBT works, research those before you start coding the energy net, these things and more are must-knows if you're wanting to make an energy network.
The easiest way to handle something like this would be to A. plan before you code and B. break things up into separate smaller functions of the one system.
Say you choose to make it so that a cable dumps energy into other adjacent cables, and then the cables will check before it dumps into other cables, for a machine that accepts energy (so that way the machine is a higher priority than the adjacent cables, you could even code it so that the cable will not dump energy into other cables until the machine is full). Firstly, plan how your network will work, how exactly energy is moved through the network, how it is generated, how it is received, how it is stored, whether the network will be "intelligent" or "dumb" (ie, at one end of the network there's a storage cube or something, and another storage cube at the other end, we'll call these S1 and S2 respectively, connected to S2 is a machine which is say smelting ores into ingots or whatever, and it is getting it's energy from S2, so that way it has a large buffer. Do you want S1 to give up it's energy to S2 so S2 remains as full as possible, or do you want S1 to act as one-way transport, one side is input and another is output? I call the first an "intelligent" network, if one element is requiring energy, another element will give up it's energy for the first element, and the second is a "dumb" network, elements are "selfish", if one element runs out of energy, you need to use generators to recharge it, a completely separate element cannot recharge the first), etc. Then, once all that is planned, break each step down into smaller steps, take a cable searching for adjacent cables to dump energy into. Do you want it to just search in random directions, or loop through a set of directions in a specific order? Do you want the cable to make sure the target cable has less energy than itself or just dump energy into it regardless? Should the cable dump equal energy amounts into other cables, say 1 point of energy, or iterate through adjacent cables and work out which one needs energy the most and dump energy into that one first? Or maybe split the total energy up between the cables based on how much a cable needs the energy, so a cable 1/2 full takes 1/2 energy, but a cable 1/4 full takes 3/4 the energy, thus the 1/2 filled cable can only be given 1/4 energy. These are the questions you need to ask yourself.
The "store and reference" method is even more advanced. Again, plan it out, but also plan out how the network will store the list and what exactly will? Maybe you want a central controller block that controls and governs the network like AE? Or maybe you want to do what (I presume) IC2 does, and store the list as a different NBT map that you load back in, unique NBTTagCompound instances for each network you build? How will your network store them, will it just store a single list of all blocks related to the network, that is, cables, generators, storage, machines, or will it categorise these so all generators are in one nested NBTTagCompound, machines are in another nested NBTTagCompound, etc?
See why no tutorials exist on this yet? Or why people aren't willing to help? It's ultimately up to how you want to build it.
How much Java do you know? A project this big requires a fair amount of Java knowledge, you need to know all the different types of iteration, you need to know inheritence, abstraction and general concepts behind object-oriented languages. You need to know NBT and TileEntity's. You need to know how to read errors and what a specific exception is, how to catch exceptions and even how to catch them before you actually run your code. You need to know packets and networking, the different sides of logic, what is vs what isn't good practice. You need to know a lot, if you want to tackle a project as big as this.
Rollback Post to RevisionRollBack
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
I know a good amount of java I have a windmill that generates power but i do not know how to transfer to my pipe network, my pipes are done rendering and connect to any blocks i tell them to!
If you want to help me I need a few things!
Do you have Skype Yes or no if so whats your name
age
your programming skill
whats your minecraft Name
Redstone isn't really a good example because of a few limitations, and because redstone is designed for static levels, that is, when a machine uses a redstone signal, the machine doesn't pull "strength" from the signal in the same way it would an energy network, which I'm guessing the OP is wanting.
Coding an energy network is not as simple as you think, there are a lot of things you need to keep track of, and there are many ways to go about actually creating an energy network. You can have a cable dump energy into adjacent cables, and by doing this, using a simple algorithm you make, the energy will "travel through the network" to other machines. Or you can create an advanced list of tile entities that interest you (such as generators, capacitors and sinks), all linked to the same network through the cables, and when routing energy through the network, find the closest capacitor near the providing generator and dump the energy in that capacitor (this is like what IC2 does, sort of, AFAIK). Each method has advantages and disadvantages, and each method has differing complexity and difficulty levels.
This is why there isn't a tutorial or anything on things like this, because there is no one way to make it, it's up to you. Hell, you could even think of a brand new paradigm (method) to use and have a unique energy network in your mod. The same also goes for people teaching this to you, you won't find many people who are willing to one-on-one teach you how to code an energy network because of how large of a project one is (you will spend night after night on this) and because of how many different ways there are to create one.
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
My Github page.
The entire Minecraft shader development community now has its own Discord server! Feel free to join and chat with all the developers!
I am trying to made a mod some what like IC2
As I said before, you won't find many people who will one-on-one help you with a project as big as an energy network, especially if you're basing it off IC2's network structure (IC2 uses a "store and reference" sort of structure, add a new block connected to a network and the block is added to the list, when a generator is trying to dump energy into the network the code iterates (loops) through all stored blocks, looking for A. an energy storage block that can accept the power being dumped into it and B. the closest block to wherever the generator is). And, and I mean no offence to anyone, but people who may offer to help probably won't understand how to actually create something like an energy network simply because of how complex they are. Your best bet would be to try and do it yourself. If you don't know something, say you don't know how tile entities work or how NBT works, research those before you start coding the energy net, these things and more are must-knows if you're wanting to make an energy network.
The easiest way to handle something like this would be to A. plan before you code and B. break things up into separate smaller functions of the one system.
Say you choose to make it so that a cable dumps energy into other adjacent cables, and then the cables will check before it dumps into other cables, for a machine that accepts energy (so that way the machine is a higher priority than the adjacent cables, you could even code it so that the cable will not dump energy into other cables until the machine is full). Firstly, plan how your network will work, how exactly energy is moved through the network, how it is generated, how it is received, how it is stored, whether the network will be "intelligent" or "dumb" (ie, at one end of the network there's a storage cube or something, and another storage cube at the other end, we'll call these S1 and S2 respectively, connected to S2 is a machine which is say smelting ores into ingots or whatever, and it is getting it's energy from S2, so that way it has a large buffer. Do you want S1 to give up it's energy to S2 so S2 remains as full as possible, or do you want S1 to act as one-way transport, one side is input and another is output? I call the first an "intelligent" network, if one element is requiring energy, another element will give up it's energy for the first element, and the second is a "dumb" network, elements are "selfish", if one element runs out of energy, you need to use generators to recharge it, a completely separate element cannot recharge the first), etc. Then, once all that is planned, break each step down into smaller steps, take a cable searching for adjacent cables to dump energy into. Do you want it to just search in random directions, or loop through a set of directions in a specific order? Do you want the cable to make sure the target cable has less energy than itself or just dump energy into it regardless? Should the cable dump equal energy amounts into other cables, say 1 point of energy, or iterate through adjacent cables and work out which one needs energy the most and dump energy into that one first? Or maybe split the total energy up between the cables based on how much a cable needs the energy, so a cable 1/2 full takes 1/2 energy, but a cable 1/4 full takes 3/4 the energy, thus the 1/2 filled cable can only be given 1/4 energy. These are the questions you need to ask yourself.
The "store and reference" method is even more advanced. Again, plan it out, but also plan out how the network will store the list and what exactly will? Maybe you want a central controller block that controls and governs the network like AE? Or maybe you want to do what (I presume) IC2 does, and store the list as a different NBT map that you load back in, unique NBTTagCompound instances for each network you build? How will your network store them, will it just store a single list of all blocks related to the network, that is, cables, generators, storage, machines, or will it categorise these so all generators are in one nested NBTTagCompound, machines are in another nested NBTTagCompound, etc?
See why no tutorials exist on this yet? Or why people aren't willing to help? It's ultimately up to how you want to build it.
How much Java do you know? A project this big requires a fair amount of Java knowledge, you need to know all the different types of iteration, you need to know inheritence, abstraction and general concepts behind object-oriented languages. You need to know NBT and TileEntity's. You need to know how to read errors and what a specific exception is, how to catch exceptions and even how to catch them before you actually run your code. You need to know packets and networking, the different sides of logic, what is vs what isn't good practice. You need to know a lot, if you want to tackle a project as big as this.
Author of the Clarity, Serenity, Sapphire & Halcyon shader packs for Minecraft: Java Edition.
My Github page.
The entire Minecraft shader development community now has its own Discord server! Feel free to join and chat with all the developers!
i have skype (dartsie2), my age is 15, im good at programing, my minecraft name is boomshot898