Test breakpoint implementation to see if its a possible feature (https://discord.com/channels/1071119659346169907/1071816701471101079)
Matthias1590 opened this issue ยท 10 comments
Might be a good idea to just create an empty mod to benchmark the performance impact of a potential breakpoint feature (it would trigger an event when a certain block gets powered), the implementation could use a hashset which keeps track of what blocks have a breakpoint set and would have to implement a mixin to check when a block gets hit whether that block is in the hashset. For more info or questions see the discord forum post (link in title).
Any updates? @Mireole
Yeah, but how do you know the block update is becouse of redstone.
edit: maybe I was just injecting the wrong methods, but it doesnt do blockupdates for blocks that are inbetween the signal at all
Looping trough 100K breakpoints(much more then anyone would ever need) takes +- 5ms
I (finally) finished testing the block update method. When testing it with ~100 breakpoints and big redstone circuits, it started skippings ticks (it does not do that on vanilla)
Looping through the list of blocks every tick seems way more efficient.
I have a simple prototype. It stores a list of all breakpoints and checks if any of them is powered or not. I did not find method for "redstone update" that would work for all blocks, so I went with this.
I mixed in the redstone wire block update method
Even if this didn't check for other components, il got sufficiently laggy to justify discarding this method
I can put the code I used on github if you want
its just that I couldnt find a method to mix into, so I wanted to know what it was :D
Yeah, but how do you know the block update is becouse of redstone.
edit: maybe I was just injecting the wrong methods, but it doesnt do blockupdates for blocks that are inbetween the signal at allLooping trough 100K breakpoints(much more then anyone would ever need) takes +- 5ms
Looping through the blocks to see if they're powered would have to happen every tick though whereas a mixin would only run when the block gets powered
I suppose if a loop works then for now we could just use that
Thanks guys!