forked from GeyserMC/Geyser
Fix fire not extinguishing on server side when on bedrock
Fixes #875 Fixes #906
This commit is contained in:
parent
04cf8b2a99
commit
3ef7e30230
1 changed files with 12 additions and 0 deletions
|
@ -119,6 +119,18 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
|
||||||
// Handled in BedrockInventoryTransactionTranslator
|
// Handled in BedrockInventoryTransactionTranslator
|
||||||
break;
|
break;
|
||||||
case START_BREAK:
|
case START_BREAK:
|
||||||
|
if (session.getConnector().getConfig().isCacheChunks()) {
|
||||||
|
if (packet.getFace() == BlockFace.UP.ordinal()) {
|
||||||
|
int blockUp = session.getConnector().getWorldManager().getBlockAt(session, packet.getBlockPosition().add(0, 1, 0));
|
||||||
|
String identifier = BlockTranslator.getJavaIdBlockMap().inverse().get(blockUp);
|
||||||
|
if (identifier.startsWith("minecraft:fire") || identifier.startsWith("minecraft:soul_fire")) {
|
||||||
|
ClientPlayerActionPacket startBreakingPacket = new ClientPlayerActionPacket(PlayerAction.START_DIGGING, new Position(packet.getBlockPosition().getX(),
|
||||||
|
packet.getBlockPosition().getY() + 1, packet.getBlockPosition().getZ()), BlockFace.values()[packet.getFace()]);
|
||||||
|
session.sendDownstreamPacket(startBreakingPacket);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ClientPlayerActionPacket startBreakingPacket = new ClientPlayerActionPacket(PlayerAction.START_DIGGING, new Position(packet.getBlockPosition().getX(),
|
ClientPlayerActionPacket startBreakingPacket = new ClientPlayerActionPacket(PlayerAction.START_DIGGING, new Position(packet.getBlockPosition().getX(),
|
||||||
packet.getBlockPosition().getY(), packet.getBlockPosition().getZ()), BlockFace.values()[packet.getFace()]);
|
packet.getBlockPosition().getY(), packet.getBlockPosition().getZ()), BlockFace.values()[packet.getFace()]);
|
||||||
session.sendDownstreamPacket(startBreakingPacket);
|
session.sendDownstreamPacket(startBreakingPacket);
|
||||||
|
|
Loading…
Reference in a new issue