Defined a constant instead of duplicating "CHEST" 7 times

This commit is contained in:
tastybento 2023-02-05 16:00:06 -08:00
parent f00320095d
commit caf994738e

View File

@ -36,17 +36,18 @@ public class BlockInteractionListener extends FlagListener
* expense of a string comparison * expense of a string comparison
*/ */
private static final Map<String, String> stringFlags; private static final Map<String, String> stringFlags;
private static final String CHEST = "CHEST";
static static
{ {
stringFlags = Map.of( stringFlags = Map.of(
"ACACIA_CHEST_BOAT", "CHEST", "ACACIA_CHEST_BOAT", CHEST,
"BIRCH_CHEST_BOAT", "CHEST", "BIRCH_CHEST_BOAT", CHEST,
"JUNGLE_CHEST_BOAT", "CHEST", "JUNGLE_CHEST_BOAT", CHEST,
"DARK_OAK_CHEST_BOAT", "CHEST", "DARK_OAK_CHEST_BOAT", CHEST,
"MANGROVE_CHEST_BOAT", "CHEST", "MANGROVE_CHEST_BOAT", CHEST,
"OAK_CHEST_BOAT", "CHEST", "OAK_CHEST_BOAT", CHEST,
"SPRUCE_CHEST_BOAT", "CHEST"); "SPRUCE_CHEST_BOAT", CHEST);
} }
/** /**