I noticed in one of your recent changes that you replaced layers().set(2, xxx) with layers().add(xxx).
I did that in my code before as well and then I noticed that calling add(xxx) on layers() goes directly down to modify the list. All other functions are actually in Layers.java to mark the layers as dirty, etc.
I think you might want to add add(xxx) to Layers.java to work alongside with add(int, layer) and set(int, layer).
I noticed in one of your recent changes that you replaced layers().set(2, xxx) with layers().add(xxx). I did that in my code before as well and then I noticed that calling add(xxx) on layers() goes directly down to modify the list. All other functions are actually in Layers.java to mark the layers as dirty, etc.
I think you might want to add add(xxx) to Layers.java to work alongside with add(int, layer) and set(int, layer).