Don't show block break animation at all in creative

This commit is contained in:
RednedEpic 2020-04-30 00:53:28 -05:00
parent 0ac4789f2c
commit f057edb526
2 changed files with 7 additions and 0 deletions

View file

@ -61,6 +61,9 @@ public class JavaPlayerActionAckTranslator extends PacketTranslator<ServerPlayer
ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition()); ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition());
break; break;
case START_DIGGING: case START_DIGGING:
if (session.getGameMode() == GameMode.CREATIVE) {
break;
}
blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(packet.getNewState().getId()); blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(packet.getNewState().getId());
levelEvent.setType(LevelEventType.BLOCK_START_BREAK); levelEvent.setType(LevelEventType.BLOCK_START_BREAK);
levelEvent.setPosition(Vector3f.from( levelEvent.setPosition(Vector3f.from(

View file

@ -41,6 +41,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import org.geysermc.connector.GeyserConnector; import org.geysermc.connector.GeyserConnector;
import org.geysermc.connector.network.translators.item.ItemEntry; import org.geysermc.connector.network.translators.item.ItemEntry;
import org.geysermc.connector.network.translators.item.ToolItemEntry; import org.geysermc.connector.network.translators.item.ToolItemEntry;
import org.geysermc.connector.network.translators.sound.SoundHandlerRegistry;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
@ -145,6 +146,9 @@ public class Toolbox {
// Load the locale data // Load the locale data
LocaleUtils.init(); LocaleUtils.init();
// Load sound handlers
SoundHandlerRegistry.init();
/* Load creative items */ /* Load creative items */
stream = getResource("bedrock/creative_items.json"); stream = getResource("bedrock/creative_items.json");