Railcraft

Railcraft

34M Downloads

Serialize the charge def for nodes (except battery supplier)

liach opened this issue ยท 4 comments

commented

See 7316d4d
I edited the charge system for a few purposes below:

  1. #1036 Interfacing charge system (block)
  2. #1413 Fix tile interaction issues with the batteries
  3. Serializing nodes to the world so that they don't require a chunk load to be loaded again.
  4. Use breath first search to prevent stack overflows (Player suggested using bfs over dfs/recursion)
  5. Rename so concepts are clearer (also move some classes out of subclasses)

Now I totally move batteries to blocks. Tiles should always retrieve when needed. Block#onBlockAdded is always called before the te is loaded, so the code is safe.

commented

You talk about serializing nodes, but I don't see code for that anywhere...

commented

Hmm... you just serialize the ChargeDef, I can see that working pretty well. I hadn't considered that.

commented

I save the def except the battery supplier.