Add block break sounds for blocks with 0 hardness, and refactor some things

The refactors in this commit go a bit beyond the scope of what the sound/effects branch was meant to accomplish, however most of these changes are necessary so chunk caching could be reintroduced for the standalone version. The chunk caching here allows for us to get the block ID before the block was broken, and in the future allow us to implement newer features. Chunk caching is optional (and disabled by default) as on non-Bukkit versions, it can eat up a lot of RAM with many players online.
This commit is contained in:
RednedEpic 2020-04-29 15:01:53 -05:00
parent efcf739973
commit 31be608038
74 changed files with 873 additions and 598 deletions

View file

@ -29,7 +29,7 @@ import lombok.AllArgsConstructor;
import ninja.leaping.configurate.ConfigurationNode;
import org.geysermc.common.IGeyserConfiguration;
import org.geysermc.connector.GeyserConfiguration;
import java.io.File;
import java.nio.file.Path;
@ -38,7 +38,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class GeyserSpongeConfiguration implements IGeyserConfiguration {
public class GeyserSpongeConfiguration implements GeyserConfiguration {
private File dataFolder;
private ConfigurationNode node;
@ -115,6 +115,11 @@ public class GeyserSpongeConfiguration implements IGeyserConfiguration {
return Paths.get(dataFolder.toString(), node.getNode("floodgate-key-file").getString("public-key.pem"));
}
@Override
public boolean isCacheChunks() {
return node.getNode("cache-chunks").getBoolean(false);
}
@Override
public SpongeMetricsInfo getMetrics() {
return metricsInfo;

View file

@ -27,11 +27,11 @@ package org.geysermc.platform.sponge;
import lombok.AllArgsConstructor;
import org.geysermc.common.logger.IGeyserLogger;
import org.geysermc.connector.GeyserLogger;
import org.slf4j.Logger;
@AllArgsConstructor
public class GeyserSpongeLogger implements IGeyserLogger {
public class GeyserSpongeLogger implements GeyserLogger {
private Logger logger;
private boolean debugMode;

View file

@ -31,8 +31,7 @@ import ninja.leaping.configurate.loader.ConfigurationLoader;
import ninja.leaping.configurate.yaml.YAMLConfigurationLoader;
import org.geysermc.common.PlatformType;
import org.geysermc.common.bootstrap.IGeyserBootstrap;
import org.geysermc.common.command.ICommandManager;
import org.geysermc.connector.bootstrap.GeyserBootstrap;
import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.command.CommandManager;
import org.geysermc.connector.utils.FileUtils;
@ -51,7 +50,7 @@ import java.io.IOException;
import java.util.UUID;
@Plugin(id = "geyser", name = GeyserConnector.NAME + "-Sponge", version = GeyserConnector.VERSION, url = "https://geysermc.org", authors = "GeyserMC")
public class GeyserSpongePlugin implements IGeyserBootstrap {
public class GeyserSpongePlugin implements GeyserBootstrap {
@Inject
private Logger logger;