Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory pipe system #3621

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Factory pipe system #3621

wants to merge 1 commit into from

Conversation

RecursivePineapple
Copy link
Contributor

The system is mostly stable, but it needs a bit more testing. This is meant to be used for complex laser-like pipes that form a network, but in practice it can be used with any mechanic that can be represented as a graph. Factory networks are completely minecraft-agnostic, so they can be used with anything.

There is an example test implementation (see TestFactoryNetwork et al) that has everything a base network should do.

There are also two base classes that remove most of the useless boilerplate for factory hatches and factory pipes. It is highly recommended to subclass these if possible.

A typical factory pipe system would subclass StandardFactoryGrid and StandardFactoryNetwork. It is highly recommended (but not necessary) to make the grid a static singleton. A grid tracks all networks & elements and generally only handles graph/network topology updates. A network is a logical group of factory elements. If your pipe system needs to do anything special, the network is the best place to do it. A factory element represents a real machine in the world and can be a pipe, hatch, multi, or anything else. When a machine is placed in the world, it should immediately add itself to the grid, even if it's not connected to anything. The grid will automatically join two adjacent machines together. Factory elements don't have a superclass, they all implement a shared interface (see TestFactoryElement).

All three types refer to each other recursively via generics. The grid & network subclasses should refer to the others, and the element interface should refer to the grid and the network. The element interface shouldn't have any generics that refer to the pipe system - they should all be pre-specified.

The system is mostly stable, but it needs a bit more testing. This is
meant to be used for complex laser-like pipes that form a network, but
in practice it can be used with any mechanic that can be represented
as a graph. Factory networks are completely minecraft-agnostic, so they
can be used with anything.

There is an example test implementation (see TestFactoryNetwork et al)
that has everything a base network should do.

There are also two base classes that remove most of the useless
boilerplate for factory hatches and factory pipes. It is highly
recommended to subclass these if possible.

A typical factory pipe system would subclass StandardFactoryGrid and
StandardFactoryNetwork. It is highly recommended (but not necessary)
to make the grid a static singleton. A grid tracks all networks &
elements and generally only handles graph/network topology updates.
A network is a logical group of factory elements. If your pipe system
needs to do anything special, the network is the best place to do it.
A factory element represents a real machine in the world and can be a
pipe, hatch, multi, or anything else. When a machine is placed in the
world, it should immediately add itself to the grid, even if it's not
connected to anything. The grid will automatically join two adjacent
machines together. Factory elements don't have a superclass, they all
implement a shared interface (see TestFactoryElement).

All three types refer to each other recursively via generics. The grid &
network subclasses should refer to the others, and the element interface
should refer to the grid and the network. The element interface shouldn't
have any generics that refer to the pipe system - they should all be
pre-specified.
@Dream-Master Dream-Master requested a review from a team December 9, 2024 14:44
@Dream-Master Dream-Master added the new feature Add something new. Please explain in detail how it works. label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Add something new. Please explain in detail how it works.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants