-
Notifications
You must be signed in to change notification settings - Fork 180
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
Refactor ColorSprayBehaviour for gt pipes and ae2 cables #2532
base: 1.20.1
Are you sure you want to change the base?
Conversation
if (be instanceof CableBusBlockEntity cable && first instanceof CableBusBlockEntity og) { | ||
var side = getPaintDirection(player).getOpposite(); | ||
if (!first.getBlockPos().equals(be.getBlockPos()) && | ||
(cable.getPart(side) != null || cable.getCableConnectionType(side) == AECableType.NONE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am reading this right, for each block, it checks if near side has a cable part, and if so, stops before painting that block. I think you also want to check is the previous block has a cable part on the far side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for both ae2 cables and gt pipes it's almost the same thing iirc, if the previous cable has a part on the far side the near side of the current one will either be disconnected or have another part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With no knowledge of how AE represents things internally, is that true of ME P2P tunnel? Certainly, from a logical perspective, the cable opposite the tunnel is connected to the tunnel. I don't know what that means in terms of getCableConnectionType
though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, p2p is an edge case, I'll see how it can be handled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the right way to do it would probably be a refactor of the behaviour to use some custom collector logic for each block paintable block type, that would also help if we want to paint the connected network instead of just a straight line, I'll give it a shot later
What
Spray paint only paints pipes/cables of the same color as the original block when painting a line.
Spray paint will stop painting when 2 adjacent pipes/cables are disconnected instead of ignoring connections.
Additionally
Resolves #2518