Slimefun4 icon indicating copy to clipboard operation
Slimefun4 copied to clipboard

Add network signal insulators

Open iTwins opened this issue 2 years ago • 11 comments

Description

A feature for energy and cargo networks to stop nodes from connecting.

Proposed changes

Add 2 items, 1 for energy and 1 for cargo, that you can place in between network nodes to stop them form connecting. To accomplish this the following is necessary:

  • Add INSULATOR to the network and energy component enums to classify them.
  • Stop discovering neighbors in the current direction if an insulator is found.
  • If an insulator is placed inside the network, rebuild it.
  • if an insulator is broken inside the network update all its neighbors that are connected to the network.

Related Issues (if applicable)

Implements approved suggestion #1652

Checklist

  • [x] I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • [x] I have made sure that the proposed changes do not break compatibility across the supported Minecraft versions (1.16.* - 1.20.*).
  • [x] I followed the existing code standards and didn't mess up the formatting.
  • [x] I did my best to add documentation to any public classes or methods I added.
  • [x] I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • [ ] I added sufficient Unit Tests to cover my code.

iTwins avatar Sep 03 '23 02:09 iTwins

Your Pull Request was automatically labelled as: "🎈 Feature" Thank you for contributing to this project! ❤️

github-actions[bot] avatar Sep 03 '23 02:09 github-actions[bot]

Slimefun preview build

A Slimefun preview build is available for testing! Commit: 813b55b7

https://preview-builds.walshy.dev/download/Slimefun/3963/813b55b7

Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!

github-actions[bot] avatar Sep 03 '23 02:09 github-actions[bot]

I like this feature, only worried about performance on this. Can we maybe get some testing on performance on it.

Also we need some general testing on this. This is a major change for 2 essential things in Slimefun. We should block this till it has been tested a bunch

J3fftw1 avatar Sep 03 '23 08:09 J3fftw1

Agreed, needs some good testing :)

Sefiraat avatar Sep 03 '23 10:09 Sefiraat

Can we also get a toggle on this maybe within a gui. I think the reason few years ago was that people wanted this because the matter fabracitor uses so much energy and more machines do these days. A toggle would solve this problem.

J3fftw1 avatar Sep 03 '23 10:09 J3fftw1

Can we also get a toggle on this maybe within a gui. I think the reason few years ago was that people wanted this because the matter fabracitor uses so much energy and more machines do these days. A toggle would solve this problem.

What about right clicking the insulator to enable/disable it?

Also yes, please test this a lot. I have tried my best to break this already, but I would feel a lot safer if someone else tested this as well.

iTwins avatar Sep 03 '23 12:09 iTwins

Yes that’s fine by me as well

J3fftw1 avatar Sep 03 '23 12:09 J3fftw1

both cargo and energy insulators seem to be working as intended. my suggestion would be alter the appearance as the only difference is a white dot on the top.

Boomer-1 avatar Nov 23 '23 01:11 Boomer-1

Have you tested this with a large network or small network? Also if anyone if up for designing better textures, please send the file or the base64 encoded string :DD.

iTwins avatar Nov 23 '23 02:11 iTwins

i didnt have a large network setup to test on. it was a pretty basic one

Boomer-1 avatar Nov 23 '23 02:11 Boomer-1

Alright, good to know. Maybe someone with a big network setup can also test this a little?

iTwins avatar Nov 23 '23 02:11 iTwins