Thank you for that code, so that I could understand why you were returning values the way you were. The correct way to do this would be to return a boolean.
for(DecayHandler decayHandler: decayHandlers){
if(decayHandler.OnTick()){
decayHandlersToBeRemoved.add(decayHandler);
}
}
But as I said, this whole custom data structure is unnecessary.
...The heck? You don't need this entire block. Much less two loops and a temporary variable!
decayHandlers.removeAll(decayHandlersToBeRemoved);
Yes, but also no.
Yes, in the sense that you do need to have a way to serialize your data, but in 99% of cases you should simply be providing a method to serialize and let the game decide when to call it, via the Capabilities system. The structure you have here is a world capability, assuming the existing systems didn't do what you needed them to sufficiently.
Speaking of:
You know there's more than one world, right? Even in single player you have the ClientWorld, the Overworld, the Nether, and the End.
Hashtag I wonder how redstone repeaters work.