Closed SirEndii closed 2 months ago
It's better if you can give a link to the actual code instead of pasting part of them
A link will include branch & file & line such useful information to help to position
It's better if you can give a link to the actual code instead of pasting part of them
A link will include branch & file & line such useful information to help to position
I agree The only thing was that I wrote this in a rush. I hadn't the time to do that Gonna edit the issue and add gh links to the actual code
I tried to test this on a dedicated server. But it seems that the modules don't work at all on a server. When inserting a module into the glasses, it never gets recognized by the glasses
It seems to be a client/server thing but I am unable to find a reason/fix for it...
After some random change now the module can work when inserting, and will stop to work when re-inserting 😓
And I found forge was doing some myth:
for some reason it's continuelly creating ModulePeripheral
and SmartGlassesItemHandler
.
for some reason it's continuelly creating
ModulePeripheral
andSmartGlassesItemHandler
.
I think some of the smart glasses systems need some changes
Describe
Currently, when we put a module in the smart glasses, they only apply after closing and re-opening the glasses' menu. After some debugging, https://github.com/IntelligenceModding/AdvancedPeripherals/blob/db7de3093eadd99f70017b3534e503eebae835a0/src/main/java/de/srendi/advancedperipherals/common/smartglasses/SmartGlassesItemHandler.java#L21 does not contain the item even after https://github.com/IntelligenceModding/AdvancedPeripherals/blob/db7de3093eadd99f70017b3534e503eebae835a0/src/main/java/de/srendi/advancedperipherals/common/smartglasses/SmartGlassesItemHandler.java#L125 was executed. However, placing a breakpoint into
SmartGlassesItemHandler#setStackInSlot
, placing an item into the modules slot and then skipping the called breakpoint(s) the module was recognized correctly, and the effects get applied to the glasses and https://github.com/IntelligenceModding/AdvancedPeripherals/blob/db7de3093eadd99f70017b3534e503eebae835a0/src/main/java/de/srendi/advancedperipherals/common/smartglasses/modules/ModulePeripheral.java#L26 returns the function.Weirdly enough,
setStackInSlot
gets called 6 times. Probably a client/server thing but 6 times seem wrong.I tried to call the https://github.com/IntelligenceModding/AdvancedPeripherals/blob/db7de3093eadd99f70017b3534e503eebae835a0/src/main/java/de/srendi/advancedperipherals/common/smartglasses/SmartGlassesComputer.java#L133 after 3 ticks markDirty was called, but that also didn't work. I assume it's an issue of how we create the item handler?
This issue mainly exists for my own forgetfulness and for contributors who want to help.
Steps to reproduce
getModules
also returns an empty tableMultiplayer?
No
Version
Own compiled build.
Minecraft, Forge and maybe other related mods versions
Forge 43.3.8 1.19.2
Screenshots or Videos
No response
Crashlog/log
No response