From ff877ec03b8cb3fd19b532be56ab4a6152bfa8fd Mon Sep 17 00:00:00 2001 From: Kenzie Togami Date: Thu, 4 Oct 2018 17:20:07 -0700 Subject: [PATCH] Make BlockType#getDefaultState like other fields --- .../sk89q/worldedit/world/block/BlockType.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java index 8bebc7c46..feee8baed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockType.java @@ -86,16 +86,6 @@ public class BlockType { 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. * @@ -156,7 +146,13 @@ public class BlockType { * @return The default state */ 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; + }); } /**