3 comments
Avatar
Administrator
winrid
Here's an example for Java!
    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        logger.info("Caught shutdown signal, saving");
        gameEngine.pauseAllShards();
        gameEngine.commitToDisk();
        logger.info("Saving complete");
    }));
Avatar Placeholder
johan
    print('Does pasted code work?')
EDIT: it automatically added an indentation.
print('Does markdown codeblock work?')
EDIT: Markdown works perfectly!
Avatar
Administrator
winrid
        for (Feature feature : features) {
        String id = feature.getUniqueId();
        Set<Feature> featuresForId = featuresById.get(id);
        if (featuresForId == null) {
            Set<Feature> featureList = new HashSet<>(1);
            featureList.add(feature);
            featuresById.put(id, featureList);
        } else {
            featuresForId.add(feature);
        }
    }