From f68632f43349816528efc8719e01817ff4d518fc Mon Sep 17 00:00:00 2001 From: DoctorMacc Date: Mon, 6 Jul 2020 21:38:10 -0400 Subject: [PATCH] Block-related updates - Fix block breaking animation - Fix block breaking particles - Don't initialize Geyser's chunk cache if using Spigot --- .../connector/network/session/cache/ChunkCache.java | 11 +++++++---- .../translators/bedrock/BedrockActionTranslator.java | 2 +- .../BedrockInventoryTransactionTranslator.java | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/network/session/cache/ChunkCache.java b/connector/src/main/java/org/geysermc/connector/network/session/cache/ChunkCache.java index a7b0c966..9601a298 100644 --- a/connector/src/main/java/org/geysermc/connector/network/session/cache/ChunkCache.java +++ b/connector/src/main/java/org/geysermc/connector/network/session/cache/ChunkCache.java @@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.data.game.chunk.Chunk; import com.github.steveice10.mc.protocol.data.game.chunk.Column; import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position; import lombok.Getter; +import org.geysermc.connector.bootstrap.GeyserBootstrap; import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.translators.world.block.BlockTranslator; import org.geysermc.connector.network.translators.world.chunk.ChunkPosition; @@ -38,15 +39,17 @@ import java.util.Map; public class ChunkCache { - private boolean cache; - private final GeyserSession session; + private final boolean cache; @Getter private Map chunks = new HashMap<>(); public ChunkCache(GeyserSession session) { - this.session = session; - this.cache = session.getConnector().getConfig().isCacheChunks(); + if (session.getConnector().getWorldManager().getClass() == GeyserBootstrap.DEFAULT_CHUNK_MANAGER.getClass()) { + this.cache = session.getConnector().getConfig().isCacheChunks(); + } else { + this.cache = false; // To prevent Spigot from initializing + } } public void addToCache(Column chunk) { diff --git a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java index 7d8772fb..dfd49f2e 100644 --- a/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java +++ b/connector/src/main/java/org/geysermc/connector/network/translators/bedrock/BedrockActionTranslator.java @@ -112,7 +112,7 @@ public class BedrockActionTranslator extends PacketTranslator