mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Make BlockType#getDefaultState like other fields
This commit is contained in:
parent
ef2c07ca24
commit
ff877ec03b
@ -86,16 +86,6 @@ public class BlockType {
|
|||||||
return updateField(blockStatesMap, () -> BlockState.generateStateMap(this));
|
return updateField(blockStatesMap, () -> BlockState.generateStateMap(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
private BlockState getDefaultStateMemoized() {
|
|
||||||
return updateField(defaultState, () -> {
|
|
||||||
BlockState defaultState = new ArrayList<>(getBlockStatesMap().values()).get(0);
|
|
||||||
if (values != null) {
|
|
||||||
defaultState = values.apply(defaultState);
|
|
||||||
}
|
|
||||||
return defaultState;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the ID of this block.
|
* Gets the ID of this block.
|
||||||
*
|
*
|
||||||
@ -156,7 +146,13 @@ public class BlockType {
|
|||||||
* @return The default state
|
* @return The default state
|
||||||
*/
|
*/
|
||||||
public BlockState getDefaultState() {
|
public BlockState getDefaultState() {
|
||||||
return getDefaultStateMemoized();
|
return updateField(defaultState, () -> {
|
||||||
|
BlockState defaultState = new ArrayList<>(getBlockStatesMap().values()).get(0);
|
||||||
|
if (values != null) {
|
||||||
|
defaultState = values.apply(defaultState);
|
||||||
|
}
|
||||||
|
return defaultState;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user