Synchronize on public class to prevent obscure crashes in some cases
This commit is contained in:
parent
0f48165b15
commit
a4e16704a3
|
|
@ -26,7 +26,7 @@ public class BlockStateCacheHandler {
|
|||
}
|
||||
|
||||
public static void rebuildParallel(boolean force) {
|
||||
synchronized (BlockBehaviour.BlockStateBase.Cache.class) {
|
||||
synchronized (BlockBehaviour.BlockStateBase.class) {
|
||||
for (BlockState blockState : Block.BLOCK_STATE_REGISTRY) {
|
||||
((IBlockState)blockState).clearCache();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public abstract class BlockStateBaseMixin implements IBlockState {
|
|||
private BlockBehaviour.BlockStateBase.Cache initCacheIfNeeded(BlockBehaviour.BlockStateBase base) {
|
||||
if(cacheInvalid) {
|
||||
// Ensure that only one block's cache is built at a time
|
||||
synchronized (BlockBehaviour.BlockStateBase.Cache.class) {
|
||||
synchronized (BlockBehaviour.BlockStateBase.class) {
|
||||
if(cacheInvalid) {
|
||||
// Ensure that if we end up in here recursively, we just use the original cache
|
||||
if(!buildingCache) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user