private static void ensureSetup() {
        if (SETUP.get()) {
            return;
        }

        if (!SETUP.getAndSet(true)) {

            // remove player metadata when they leave the server
            Events.subscribe(PlayerQuitEvent.class, EventPriority.MONITOR)
                    .handler(e -> StandardMetadataRegistries.PLAYER.remove(e.getPlayer().getUniqueId()));

            // cache housekeeping task
            Schedulers.builder()
                    .async()
                    .afterAndEvery(1, TimeUnit.MINUTES)
                    .run(() -> {
                        for (MetadataRegistry<?> registry : StandardMetadataRegistries.values()) {
                            registry.cleanup();
                        }
                    });
        }
    }
Provides access to {@link MetadataRegistry} instances bound to players, entities, blocks and worlds.
helper/src/main/java/me/lucko/helper/metadata/Metadata.java