CC: Tweaked

CC: Tweaked

57M Downloads

Computer is connected to network without a modem

Josian2004 opened this issue · 13 comments

commented

Minecraft Version

1.19.x

Version

1.101.2

Details

When I place a computer and a cable behind it (so there is no modem between the computer and the cable), the computer is still connected to the network as if it had a modem. When I do peripheral.getNames(), it also shows that there is a modem on the "back" position but there is just a cable.

commented

Would you be able to post a screenshot of your setup and attach your logs? I've been unable to reproduce this - all these computers have no peripherals:

4 ComputerCraft computers, each pointing in a different direction. There is a networking cable next to each face of the computers, but no wired modem.

commented
commented

I'm not sure if the email got received properly so here are the screenshots again

2023-06-24_18 36 09
2023-06-24_18 36 17

commented

This is really odd, even with this set up I'm unable to reproduce.

The implementation ensures that the we only return a peripheral on the side the modem is on, so when there's no modem should only return something when side == null - a little dubious, but should never happen.

if( capability == CAPABILITY_PERIPHERAL )
{
if( side != null && getMaybeDirection() != side ) return LazyOptional.empty();
if( modemCap == null ) modemCap = LazyOptional.of( () -> modem );
return modemCap.cast();
}

Does this happen with just Forge and CC: Tweaked? If not, the only thing I can really suggest is finding the smallest set of mods which still cause this issue.

commented

Can it be just a visual glitch?

commented

I figured it out, it is because of more peripherals so I will open an issue there

commented

This is really odd, even with this set up I'm unable to reproduce.

The implementation ensures that the we only return a peripheral on the side the modem is on, so when there's no modem should only return something when side == null - a little dubious, but should never happen.

if( capability == CAPABILITY_PERIPHERAL )
{
if( side != null && getMaybeDirection() != side ) return LazyOptional.empty();
if( modemCap == null ) modemCap = LazyOptional.of( () -> modem );
return modemCap.cast();
}

Does this happen with just Forge and CC: Tweaked? If not, the only thing I can really suggest is finding the smallest set of mods which still cause this issue.

No were using more peripherals and advanced peripherals, it might be because of those mods so I will check without them soon

commented

Can it be just a visual glitch?

No because I can interact with the peripherals even though there is no modem on the computer

commented

No because I can interact with the peripherals even though there is no modem on the computer

I mean absence of modem can be a visual glitch. If I remember code correctly, non-block version of wired modem is actually cable block with some extra properties

commented

No because I can interact with the peripherals even though there is no modem on the computer

I mean absence of modem can be a visual glitch. If I remember code correctly, non-block version of wired modem is actually cable block with some extra properties

ah you mean like that, no I don't think so because I'm pretty sure that I didn't place a modem. I freshly picked a computer and peripherals and it still happens. But I will check with just CC Tweaked

commented

Hm, can I ask you to extract nbt data from block via \data get block x y z command and also blockstate of broken cable? Not sure, if it helps, but it can.

commented

https://github.com/JheffersonMarques/MorePeripherals/blob/5059400cf9ba774bd8fa473f42c92a471761df83/src/main/java/com/hakimen/peripherals/registry/ComputerCraftRegister.java#L30C100-L34

Oh, very odd. They're registering a peripheral provider which just gets the peripheral capability. As the side is null, that invalidates our invariant from before.

They shouldn't need to do this, as CC uses the peripheral capability already.

commented

We will link this issue in our issue to More Peripherals, maybe he can explain why he does that