The threading was not working because Thread.run() does not start a new thread. Thread.start() should've been used for that.
What is more, the threading was not safe because getting World is not a thread-safe operation, so threading was removed altogether from this part.
First two ifs can be summarized as "if dimension is not created then create it, and if it's already created then handle it".
Because createDimension is now single-threaded, we can call it without checking if it's already in the process of creating a dimension. The handling of creating a dimension was put in createDimension.
The threading was not working because
Thread.run()
does not start a new thread.Thread.start()
should've been used for that. What is more, the threading was not safe because getting World is not a thread-safe operation, so threading was removed altogether from this part.First two
if
s can be summarized as "if dimension is not created then create it, and if it's already created then handle it".Because
createDimension
is now single-threaded, we can call it without checking if it's already in the process of creating a dimension. The handling of creating a dimension was put increateDimension
.