Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +01:00
Fix block break particles not displaying in survival
Dieser Commit ist enthalten in:
Ursprung
1fbb755d26
Commit
364aac7e1a
@ -118,7 +118,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
|
||||
case 2:
|
||||
BlockState blockState = session.getChunkCache().getBlockAt(new Position(packet.getBlockPosition().getX(), packet.getBlockPosition().getY(), packet.getBlockPosition().getZ()));
|
||||
double blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(blockState.getId());
|
||||
if (session.getGameMode() == GameMode.CREATIVE || blockHardness == 0) {
|
||||
if (session.getGameMode() == GameMode.CREATIVE || (session.getConnector().getConfig().isCacheChunks() && blockHardness == 0)) {
|
||||
session.setLastBlockPlacedId(null);
|
||||
session.setLastBlockPlacePosition(null);
|
||||
|
||||
|
@ -48,9 +48,9 @@ public class JavaPlayerActionAckTranslator extends PacketTranslator<ServerPlayer
|
||||
@Override
|
||||
public void translate(ServerPlayerActionAckPacket packet, GeyserSession session) {
|
||||
LevelEventPacket levelEvent = new LevelEventPacket();
|
||||
double blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(packet.getNewState().getId());
|
||||
switch (packet.getAction()) {
|
||||
case FINISH_DIGGING:
|
||||
double blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(session.getBreakingBlock() == null ? 0 : session.getBreakingBlock().getId());
|
||||
if (session.getGameMode() != GameMode.CREATIVE && blockHardness != 0) {
|
||||
levelEvent.setType(LevelEventType.DESTROY);
|
||||
levelEvent.setPosition(Vector3f.from(packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ()));
|
||||
@ -61,6 +61,7 @@ public class JavaPlayerActionAckTranslator extends PacketTranslator<ServerPlayer
|
||||
ChunkUtils.updateBlock(session, packet.getNewState(), packet.getPosition());
|
||||
break;
|
||||
case START_DIGGING:
|
||||
blockHardness = BlockTranslator.JAVA_RUNTIME_ID_TO_HARDNESS.get(packet.getNewState().getId());
|
||||
levelEvent.setType(LevelEventType.BLOCK_START_BREAK);
|
||||
levelEvent.setPosition(Vector3f.from(
|
||||
packet.getPosition().getX(),
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren