Forge Energy System V8

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Forge Fluid & Energy Project

Table of Contents
Page Section
1 Table of Contents
2 Project Information
3 Forge Flow System
7 Forge Energy System
8 Required cable block settings
9 Required global variables
9 Basic cable mechanics
10 Model name chart
11 Cable block tags
12 NBT cable and device variables
13 Forge energy modular sizes
14 Material names
15 Energy device ideas
19 Forge Fluid System
20 Required Pipe block settings
21 Required global variables
22 Basic pipe mechanics
23 Model name chart
24 Pipe block tags
25 NBT pipe and device variables
26 Forge Fluid Modular Sizes
27 Forge Fluid Type Names
28 Material names
29 Energy device ideas
30 Energy machine ideas
Project Information
YouTube series:
You can find a full series playlist for this project on my YouTube channel.

Project page:
You can find the project on the project page on my GitHub.

Project files:
The project contains the following:
• MCreator Workspace for testing if one gets stuck.
• Textures of the cables and example devices.
• BlockBench models of the cables so people can use it as a guide to make custom
cable thicknesses.
• Cable JSON files to quickly use the thickness that I made in the tutorial.
• Procedures for the cables and devices.
• This PDF file that explains more in detail about how things work.
Forge Flow System
The ForgeFlow system allows cables, pipe, and storage blocks such as tanks or batteries to
detect what direction energy is being sent from so that the energy does not have problems
sending energy.
Follow the steps below to set up this new system.

Making the global map variable:


The first step before you get started is to make the following global variable:
• Variable name: forgeFlow
• Variable type: Number
• Variable scope: Map
• Variable value: 0.0

On world tick update timer:

• The global timer allows for all cables and pipes to update at the same time which
addresses on issues I had trying to run it through NBT block variables.
• Procedure for the timer should be a global timer set to “On world tick update”, this will
allow the timer to work every time the game ticks.
• You only need this one timer for all your cables and pipes in your modification.
It is NOT required to make a timer for each cable or pipe.
• Make sure you set up the global variable listed above before importing this script.
Generator and pump script:

• Generators and pumps need to test for the cable NBT block variable the direction
where the energy will be sent to.
• Also the block needs to support energy so these to blocks should be taken into
consideration when you set the cable or pipe block’s forgeFlow number NBT variable.
• Below the condition you have the forgeFlow block NBT variable which sets the starting
number
• This number will decrease each block it passes through creating a flow mechanic the
further out it gets from the source of generator or pump.
• Below that in the collapsed block there is the energy script for the energy generation.
• Energy should run independently from the forgeFlow variable, don’t include the script
in your energy script or it could cause issues with the flow system.
• Fluid uses a NBT tag called forgeFluidFlow this was needed to ensure the
devices did not overlap with the flow system. Using the same forgeFlow NBT
variable broke the mechanics.
Cable and pipe script:

• The cable script was reworked to fix a critical issue with the flow of energy.
• Cable, pipes, storage blocks and generator/pumps now use this new system.
• Make sure you have the “forgeFlow” global map number variable added before you
import the new script.
• Again fluid uses forgeFluidFlow for th NBT number tag.

Storage block script:

• This is the “Reset Script”


• You will need to make the “forgeFlow” global map variable before importing this
procedure template.
• Your storage blocks also require the script above to make sure they reset every time
the global timer reaches 0.
• This is required to make sure the block can get energy from another direction if a
generator is broken.
• This block should be outside of your energy script see diagram below for more details.
• Again fluid uses forgeFluidFlow for th NBT number tag.
• Another important thing is to make sure that the “Limiter Script” is wrapped around
ALL of the energy script.
• This block makes sure the forgeFlow value is 1 or higher in order to send energy.
• Again fluid uses forgeFluidFlow for th NBT number tag.

• This is the “Extend Script”


• This procedure system allows the current variable to be passed to other supported
blocks.
• This will decrease the forgeFlow value by 1 for the next block going away from a
generator.
• There is templates for each direction that you can use in the project files.
• This should be put in a place where it is not dependant on the flow of energy but still
use the similar conditions.
• For example it should not require energy to be passed to a block to update the
forgeFlow variable.
• Again fluid uses forgeFluidFlow for th NBT number tag.
Final notes:
• You can find example in the batter update tick, generate update tick and cable update
tick procedures in the project workspace.
• You can find template scrips from this guide in the forgeFlow folder in the procedures
folder.
• Each kind of cable needs its own forge flow variable. For example Energy Cables
needs to be separate from Pipes even though they use the same Global timer for the
timing.

Forge Energy System


Forge has it’s own energy system which allows mod makers to make energy mods like
industrial craft or other major mods that use some kind of energy system.
With this being said NeoForge is an exact copy of Forge but with improvements so there will
be no real change to Forge energy other than some optimizations and maybe more features
in the future.
MCreator has added support for Forge Energy though limited its limited it allows MCreator
mods to use the feature. However a lot of things will be dependent on the cable mechanics
due to lack of support for block states.
This is a general guide on the cable system I designed for the MCreator community. I try my
best to keep the project maintained and fix and issues I notice though feel free to reach out in
if you find an issue on my YouTube video for the cables the link will be below.
Required cable block settings:
Some settings are required to make the cables work properly though anything else can be
changed how you like.

Cable block setting: Value: Notes:


Block rotation mode D/U/N/S/W/E rotation Required to make the cable
(rotation from player side) rotate based on the
connections.
Texture transparency type CUTOUT, Required for custom models,
CUTOUT_MIPPED, or and value should work as
TRANSLUCENT long as its not SOLID.
Tick rate 1 Required to send energy
each tick, tick randomly
should NOT be checked.

As a side note devices don’t


require this value they can be
set to a higher value or even
tick random if you wish.
Enable block entity for this True Forge Energy requires the
block blocks to be block entities,
also the script provided uses
NBT tags which also requires
this setting to be checked.
Enable energy storage True This is required to enable the
block to use forge energy.
Update tick procedure True The entire script runs from the
Update tick trigger for the
block so there is no way to
not use it.
Required global variables:
There are required global variables to make the system work properly.

Name: Type: Scope: Value: Notes:


forgeFlow Number Map 0.0 Used to fix the
flow system for
cables pipes and
some devices.

Make sure to
read the Forge
Flow section to
set this up
properly.

You can also


watch Part 4 in
the tutorial series
that is linked
above.
Base mechanics:
There are some main components that make forge cables work.
• Cable update tick procedure
◦ The update tick procedure calls both the Model Update Script and the Energy
Script. The order of which these scripts need to run are not specific.
• Cable model update procedures
◦ The Model Update Script does exactly what it says its soul purpose it to update the
blocks rotation, and junction type.
◦ This procedure needs to call sub-script for each block state. In addition you also
need to link up your blocks in the block selector to fully set this procedure up.
◦ There is a sub-procedure for each block model it can take some time to set these
procedures up but we made it easy to do.
• Cable energy procedure
◦ The Energy Script handles sending energy to other cables and devices. Version 5
of this project offers one procedure and no sub-procedures.
◦ The Script will require your NBT variables to be set up make sure you type them
the same as other procedures in the cables or they will not work properly.
◦ Also make sure your devices also use the same variables or at least have the
rotation set up for the same cable type.
◦ Devices can also use more than one of these variables based on the rotation so
you could allow more then one cable type say Aluminum and Copper to connect to
the same device but you will need to set the device to support both NBT tags based
on the rotation of the device block.
• Forge Flow procedure
◦ ForgeFlow helps the flow of forge energy and fluid through cables, pipes and
storage tanks or energy blocks such as batteries.
◦ ForgeFlow is set from the generator or pump and will run through the cables or
pipes allowing a good directional flow system for energy or fluid to pass through.
◦ See the ForgeFlow section for more information.
Model name chart:
Below you can find a full chart of model states for cables.

ID: Clockwise: Counter clockwise: Description:


N No Connection
E End
I Straight
L LC LCC Corner
LT LTC Y Corner
T TC Three-Way Junction
TX TXC TXCC Three-Way Y Junction
X XC Cross Junction
F Five-Way Junction
S Six-Way Junction

Making your elements:


When making your elements its easiest to add the blocks in the order listed above. Add them
from Left to Right, Top to Down this will ensure things will be easier to find in MCreator’s UI.

Custom cable models:


If you want to make you own cable you can use the cable models from the project files
provided as an example. As long as your cables are rotated the same and connect to the
edge of the block area then it should be compatible with larger or smaller cable models.
Cable block tags:
Cables need a block tag to help them update their block state and rotation. Though NBT
variables also play a role in them updating, the block tags help when new blocks are placed
next to other cables.

Cross-mod support:
In order to make your cables comparable with other mods there needs to be some
consistency between mods, this part is up to the mod developer to do though we can give
some advice on how to set it up, mod developers will need to pick and choice what they want
at the end of the day.
If you want to keep it comparable then follow the guidelines below.
• NAMESPACE: (Required)
◦ Your tag should be under your mod namespace.
• SIZE: (Required)
◦ Pick a modular size and add this to your tag so you have room to make more cable
sizes later on.
• MATERIAL: (Optional)
◦ If you want to limit your cables from working with other cable materials you can
specify the material type of the cable at the cost of it may not being compatible with
all mods. If its a common material like copper, gold, or fibreglass then it should be
fine for comparability but if you decided to add a custom material you made up like
Bloodite then it may not be something other mods will use.

Modular tag format:


Below are the examples for the tag format.

Option: Format: Example:


Size <namespace>:cables/<size> foundrycraft:cables/c
Size + Material <namespace>:cables/<size>/<material> founderycraft:cables/c/gold
NBT cable and device variables:
• NBT variables are used for both devices and cables to let them know what can send
and revive energy.
• For cables they only support one NBT variable set but you can add more than one set
to devices allowing them to connect to more cable types if you like.
• This can be handy when you need to add support for other mods.

Cross-mod support:
Like cable tags this is up to the developer to decide how they want to implement the
connections, though keep in mind that if you want it to be supported I would suggest picking
your name carefully and deciding if you want to use the material type or not.
See below for some common material types that are used in mods. Also below you will find
size information.
Some general tips to keep your NBT names consistent.
1. Always start the tag name with a lower case letter.
2. Always start with the word “cables”
3. Every other component must start with a capital like so “oneTwoThreeFour”
4. Always include the cable size after the cables name like so “cablesA”
5. If you use materials add this after the size so like this “cablesCCopper”
6. Last important thing is to state the direction at the end so like this “cablesFGoldNorth”
or “cablesFNorth”. All six directions be structured the same way.
Forge energy modular sizes:
• In some cases you may want to have high capacity cables medium capacity cables
and low capacity cables for transporting energy across the world.
• With this being said you may have lower capacity cables for low tier machines where
larger capacity may be used for things that require more energy like foundry blocks.
• With this you will run into some cases were you will have more than one cable set this
is where modular cable sizes can play role in keeping your cables cross-mod
compatible.
• Use the chart below to group your cables into classes and use the class for your Cable
Block Tag name and NBT variable names.

Class letter Max send Max receive Cable Battery Transformer


(per tick) (per tick) capacity capacity (input/output)
A 65,536/t 65,536/t 65,536 65,653,000 Downgrade:
(x1) A to (x4) B
B 16,384/t 16,384/t 16,384 16,384,000 Downgrade:
(x1) B to (x4) C
Upgrade:
(x4) B to (x1) A
C 4,096/t 4,096/t 4,096 4,096,000 Downgrade:
(x1) C to (x4) D
Upgrade:
(x4) C to (x1) B
D 1,024/t 1,024/t 1,024 1,024,000 Downgrade:
(x1) D to (x4) E
Upgrade:
(x4) D to (x1) C
E 256/t 256/t 256 256,000 Downgrade:
(x1) E to (x4) F
Upgrade:
(x4) E to (x1) D
F 64/t 64/t 64 64,000 Downgrade:
(x1) F to (x4) G
Upgrade:
(x4) F to (x1) E
G 16/t 16/t 16 16,000 Upgrade:
(x4) G to (x1) F
Material names:
Here are some metal material names that could be used for better cross-mod support for
cables.

Metals:
• Aluminum (Al)
• Chromium (Cr)
• Cobalt (Co)
• Copper (Cu)
• Gold (Au)
• Iridium (Ir)
• Iron (Fe)
• Lead (Pb)
• Lithium (Li)
• Nickel (Ni)
• Platinum (Pt)
• Silver (Ag)
• Sodium (Na)
• Tin (Sn)
• Titanium (Ti)
• Tungsten (W)
• Uranium (U)
• Zinc (Zn)

Other:
• Fibreglass
Energy device ideas:
Energy generator ideas:
• Biomass Generator
• Coal Generator
• Crude Oil Generator
• Geothermal Generator
• Hydro Damn
• Natural Gas Generator
• Nuclear Reactor
• Petroleum Generator
• Solar Panel
• Steam Generator
• Water Mill
• Wind Mill
Energy machine ideas:
• Collector
• Compressor
• Electric Dropper
• Electric Furnace
• Electric Lights
• Electric Sorter
• Electrified Blocks
• Electrolizer
• Entity Barrier
• Extractor
• Fabricator
• Farmer
• Forester
• Grinder
• Magnetizer
• Metal Former
• Miner
• Mining Pump
• Pumps
• Quarry
• Recycler
• Replicator
• Scanner
• Teleporter
• Terra former
• Trader Machine
Other energy ideas:
• Transformers
Forge Fluid System
Forge also has its own fluid system which is similar to other mods like industrial craft. It
provides the ground work for transporting fluids through blocks and use them in machines or
devices.
With this being said NeoForge is an exact copy of Forge but with improvements so there will
be no real change to Forge energy other than some optimizations and maybe more features
in the future.
MCreator has added support for Forge Fluid though limited its limited it allows MCreator mods
to use the feature. However a lot of things will be dependent on the pipe mechanics due to
lack of support for block states.
This is a general guide on the pipe system I designed for the MCreator community. I try my
best to keep the project maintained and fix and issues I notice though feel free to reach out in
if you find an issue on my YouTube video for the pipe the link will be below.
Required Pipe block settings
Some settings are required to make the pipes work properly though anything else can be
changed how you like.

Cable block setting: Value: Notes:


Block rotation mode D/U/N/S/W/E rotation Required to make the cable
(rotation from player side) rotate based on the
connections.
Texture transparency type CUTOUT, Required for custom models,
CUTOUT_MIPPED, or and value should work as
TRANSLUCENT long as its not SOLID.
Tick rate 1 Required to send fluid each
tick, tick randomly should
NOT be checked.

As a side note devices don’t


require this value they can be
set to a higher value or even
tick random if you wish.
Enable block entity for this True Forge Fluid requires the
block blocks to be block entities,
also the script provided uses
NBT tags which also requires
this setting to be checked.
Enable fluid storage True This is required to enable the
block to use forge fluid.
Update tick procedure True The entire script runs from the
Update tick trigger for the
block so there is no way to
not use it.
Required global variables:
There are required global variables to make the system work properly.

Name: Type: Scope: Value: Notes:


forgeFlow Number Map 0.0 Used to fix the
flow system for
cables pipes and
some devices.

Make sure to
read the Forge
Flow section to
set this up
properly.

You can also


watch Part 4 in
the tutorial series
that is linked
above.
Base mechanics:
There are some main components that make forge pipes work.
• Pipe update tick procedure
◦ The update tick procedure calls both the Model Update Script and the Fluid Script.
The order of which these scripts need to run are not specific.
• Pipe model update procedures
◦ The Model Update Script does exactly what it says its soul purpose it to update the
blocks rotation, and junction type.
◦ This procedure needs to call sub-script for each block state. In addition you also
need to link up your blocks in the block selector to fully set this procedure up.
◦ There is a sub-procedure for each block model it can take some time to set these
procedures up but we made it easy to do.
• Pipe Fluid procedure
◦ The Fluid Script handles sending fluid to other pipes and devices. This is built off of
the cable script to ensure an easier learning curve for the community.
◦ The Script will require your NBT variables to be set up make sure you type them
the same as other procedures in the pipes or they will not work properly.
◦ Also make sure your devices also use the same variables or at least have the
rotation set up for the same pipe type.
◦ Devices can also use more than one of these variables based on the rotation so
you could allow more then one pipe type say Aluminum and Copper to connect to
the same device but you will need to set the device to support both NBT tags based
on the rotation of the device block.
• Forge Flow procedure
◦ ForgeFlow helps the flow of forge energy and fluid through cables, pipes and
storage tanks or energy blocks such as batteries.
◦ ForgeFlow is set from the generator or pump and will run through the cables or
pipes allowing a good directional flow system for energy or fluid to pass through.
◦ See the ForgeFlow section for more information.
Model name chart:
Below you can find a full chart of model states for pipes.

ID: Clockwise: Counter clockwise: Description:


N No Connection
E End
I Straight
L LC LCC Corner
LT LTC Y Corner
T TC Three-Way Junction
TX TXC TXCC Three-Way Y Junction
X XC Cross Junction
F Five-Way Junction
S Six-Way Junction

Making your elements:


When making your elements its easiest to add the blocks in the order listed above. Add them
from Left to Right, Top to Down this will ensure things will be easier to find in MCreator’s UI.

Custom pipe models:


If you want to make you own pipes you can use the pipe models from the project files
provided as an example. As long as your pipes are rotated the same and connect to the edge
of the block area then it should be compatible with larger or smaller pipe models.
Pipe block tags:
Pipes need a block tag to help them update their block state and rotation. Though NBT
variables also play a role in them updating, the block tags help when new blocks are placed
next to other pipes.

Cross-mod support:
In order to make your pipes comparable with other mods there needs to be some consistency
between mods, this part is up to the mod developer to do though we can give some advice on
how to set it up, mod developers will need to pick and choice what they want at the end of the
day.
If you want to keep it comparable then follow the guidelines below.
• NAMESPACE: (Required)
◦ Your tag should be under your mod namespace.
• SIZE: (Required)
◦ Pick a modular size and add this to your tag so you have room to make more pipe
sizes later on.
• MATERIAL: (Optional)
◦ If you want to limit your pipes from working with other pipe materials you can
specify the material type of the pipe at the cost of it may not being compatible with
all mods. If its a common material like aluminum or copper then it should be fine for
comparability but if you decided to add a custom material you made up like stone
pipes then it may not be something other mods will use.

Modular tag format:


Below are the examples for the tag format.

Option: Format: Example:

Size <namespace>:pipes/<size> foundrycraft:pipes/c

Size + Material <namespace>:pipes/<size>/<material> founderycraft:pipes/c/copper


NBT pipe and device variables:
• NBT variables are used for both devices and pipes to let them know what can send
and revive fluid.
• For pipes they only support one NBT variable set but you can add more than one set to
devices allowing them to connect to more pipes types if you like.
• This can be handy when you need to add support for other mods.

Cross-mod support:
Like cable tags this is up to the developer to decide how they want to implement the
connections, though keep in mind that if you want it to be supported I would suggest picking
your name carefully and deciding if you want to use the material type or not.
See below for some common material types that are used in mods. Also below you will find
size information.
Some general tips to keep your NBT names consistent.
1. Always start the tag name with a lower case letter.
2. Always start with the word “pipes”
3. Every other component must start with a capital like so “oneTwoThreeFour”
4. Always include the pipes size after the cables name like so “pipesA”
5. If you use materials add this after the size so like this “pipesCCopper”
6. Last important thing is to state the direction at the end so like this “pipesFGoldNorth” or
“pipesFNorth”. All six directions be structured the same way.
Forge Fluid modular sizes:
• Fluid is measured in millabuckets. 1 didget is one 1 miliabucket. 1 bucket is 1000
miliabuckets.
• In some cases you may want to have high capacity pipes medium capacity pipes and
low capacity pipes for transporting fluid across the world.
• With this being said you may have lower capacity pipes for low tier machines where
larger capacity may be used for things that require more fluid like foundry blocks.
• With this you will run into some cases were you will have more than one pipe set this is
where modular pipe sizes can play role in keeping your pipes cross-mod compatible.
• Use the chart below to group your pipes into classes and use the class for your Pipe
Block Tag name and NBT variable names.

Class letter Fluid Tank Transformer


capacity capacity (input/output)

A 1,024,000 1,024,000,000 Downgrade:


(x1) A to (x4) B
B 256,000 256,000,000 Downgrade:
(x1) B to (x4) C
Upgrade:
(x4) B to (x1) A
C 64,000 64,000,000 Downgrade:
(x1) C to (x4) D
Upgrade:
(x4) C to (x1) B
D 16,000 16,000,000 Downgrade:
(x1) D to (x4) E
Upgrade:
(x4) D to (x1) C
E 4,000 4,000,000 Downgrade:
(x1) E to (x4) F
Upgrade:
(x4) E to (x1) D
F 1,000 1,000,000 Downgrade:
(x1) F to (x4) G
Upgrade:
(x4) F to (x1) E
G 100 100,000 Upgrade:
(x4) G to (x1) F
Forge Fluid Type Names
Though MCreator currently does not support cross mod compatability with fluid with forge
fluid there is support for NBT liquids to keep the pipes seperated. The NBT variable is a string
and called “forgeFluidType”. Its values should be all CAPS with spaces using ‘_’ under scores.

For vanilla liquids and other possible liquids here is a list below with some examples.
• FLOWING_DIESEL
• FLOWING_GASOLINE
• FLOWING_HYDROGEN_PEROXIDE
• FLOWING_HONEY
• FLOWING_LAVA
• FLOWING_LIQUID_HYDROGEN
• FLOWING_MILK
• FLOWING_NATURAL_GAS
• FLOWING_OIL
• FLOWING_WATER
• DIESEL
• GASOLINE
• HYDROGEN_PEROXIDE
• HONEY
• LAVA
• LIQUID_HYDROGEN
• MILK
• NATURAL_GAS
• OIL
• WATER
You can find a list of liquids on this Wikipedia page here.
Material names:
Here are some metal material names that could be used for better cross-mod support for
pipes.

Metals:
• Aluminum (Al)
• Chromium (Cr)
• Cobalt (Co)
• Copper (Cu)
• Gold (Au)
• Iridium (Ir)
• Iron (Fe)
• Lead (Pb)
• Lithium (Li)
• Nickel (Ni)
• Platinum (Pt)
• Silver (Ag)
• Sodium (Na)
• Tin (Sn)
• Titanium (Ti)
• Tungsten (W)
• Uranium (U)
• Zinc (Zn)

Other:
• Glass
Fluid device ideas:
Fluid generator ideas:
• Water Pump
• Lava Pump
• Steam Pump
• Oil Pump
• Natural Gas Pump
Energy machine ideas:
• Bucket Filler
• Natural Gas Generator
• Oil Fabricator
• Oil Refinery
• Reactor Cooling System

You might also like