use of org.spongepowered.common.applaunch.config.common.TeleportHelperCategory in project SpongeCommon by SpongePowered.
the class ConfigTeleportHelperFilter method updateCacheIfNecessary.
private static void updateCacheIfNecessary() {
if (ConfigTeleportHelperFilter.floorBlockTypes == null) {
final TeleportHelperCategory teleportHelperCat = SpongeConfigs.getCommon().get().teleportHelper;
ConfigTeleportHelperFilter.floorBlockTypes = teleportHelperCat.unsafeFloorBlocks.stream().map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH))).map(x -> (BlockType) Registry.BLOCK.get((ResourceLocation) (Object) x)).filter(Objects::nonNull).collect(Collectors.toList());
ConfigTeleportHelperFilter.floorBlockStates = teleportHelperCat.unsafeFloorBlocks.stream().map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH))).map(x -> Registry.BLOCK.getOptional((ResourceLocation) (Object) x).map(b -> (BlockType) b).map(StateContainer::defaultState).orElse(null)).filter(Objects::nonNull).collect(Collectors.toList());
ConfigTeleportHelperFilter.bodyBlockTypes = teleportHelperCat.unsafeBlockBlocks.stream().map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH))).map(x -> (BlockType) Registry.BLOCK.get((ResourceLocation) (Object) x)).filter(Objects::nonNull).collect(Collectors.toList());
ConfigTeleportHelperFilter.bodyBlockStates = teleportHelperCat.unsafeBlockBlocks.stream().map(x -> ResourceKey.resolve(x.toLowerCase(Locale.ENGLISH))).map(x -> Registry.BLOCK.getOptional((ResourceLocation) (Object) x).map(b -> (BlockType) b).map(StateContainer::defaultState).orElse(null)).filter(Objects::nonNull).collect(Collectors.toList());
}
}
Aggregations