Open SquidDev opened 10 months ago
is getId() on IComputerAccess the same ID that ServerComputerRegistry.get() takes ? if so could use that to get whether or not it's a command computer ?
Then just check if the player using the keyboard has the right perms (which is OP and creative ? ) and only sending events on the command computers if they have the perms.
is getId() on IComputerAccess the same ID that ServerComputerRegistry.get() takes ? if so could use that to get whether or not it's a command computer ?
Wait, what!? I see you were using IComputerAccess.queueEvent
pre 1.20 - what was the motivation for this switch?
it still has those on 1.20, i think the non IComputerAccess stuff is just for rebooting and shutdown commands, which I don't think worked with the way i was doing it before ?
Versions
Steps to reproduce
I'm not really sure there's a good way to guard against this, at least within the confines of CC's API. Really the best solution would be to not queue events on command computers, but
IComputerAccess
doesn't expose any methods for that.Entirely unrelated, but didn't feel worth opening a separate bug for this,
KeyboardPeripheral
's handling of the computer list isn't thread-safe -attach
anddetach
can be called from both the computer and main thread. The easiest thing to do is swap out theArrayList
with aCollections.newSetFromMap(new ConcurrentHashMap<>())
.