Redstone Tools (RST)

Redstone Tools (RST)

0 Downloads

Test breakpoint implementation to see if its a possible feature (https://discord.com/channels/1071119659346169907/1071816701471101079)

Matthias1590 opened this issue ยท 10 comments

commented

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).

commented

Any updates? @Mireole

commented

I can try this

commented

It would be the block update not redstone update

commented

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

commented

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.

commented

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.

commented

out of curiosity, how did you get the block updates?

commented

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

commented

its just that I couldnt find a method to mix into, so I wanted to know what it was :D

commented

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

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!