Make BlockType#getDefaultState like other fields

Dieser Commit ist enthalten in:
Kenzie Togami 2018-10-04 17:20:07 -07:00
Ursprung ef2c07ca24
Commit ff877ec03b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 5D200B325E157A81

Datei anzeigen

@ -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;
});
} }
/** /**