mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Set SnifferEntity digTicks to 0 when transitioning out of DIGGING state
This commit is contained in:
parent
c35b7c93fd
commit
701d9844aa
1 changed files with 5 additions and 1 deletions
|
@ -84,6 +84,10 @@ public class SnifferEntity extends AnimalEntity implements Tickable {
|
||||||
|
|
||||||
if (this.flags.contains(EntityFlag.DIGGING)) {
|
if (this.flags.contains(EntityFlag.DIGGING)) {
|
||||||
digTicks = DIG_END;
|
digTicks = DIG_END;
|
||||||
|
} else {
|
||||||
|
// Handles situations where the DIGGING state is exited earlier than expected,
|
||||||
|
// such as hitting the sniffer or joining the game while it is digging
|
||||||
|
digTicks = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +103,7 @@ public class SnifferEntity extends AnimalEntity implements Tickable {
|
||||||
levelEventPacket.setType(LevelEvent.PARTICLE_DESTROY_BLOCK_NO_SOUND);
|
levelEventPacket.setType(LevelEvent.PARTICLE_DESTROY_BLOCK_NO_SOUND);
|
||||||
levelEventPacket.setPosition(pos);
|
levelEventPacket.setPosition(pos);
|
||||||
levelEventPacket.setData(blockId);
|
levelEventPacket.setData(blockId);
|
||||||
session.getUpstream().sendPacket(levelEventPacket);
|
session.sendUpstreamPacket(levelEventPacket);
|
||||||
|
|
||||||
if (digTicks % 10 == 0) {
|
if (digTicks % 10 == 0) {
|
||||||
LevelSoundEventPacket levelSoundEventPacket = new LevelSoundEventPacket();
|
LevelSoundEventPacket levelSoundEventPacket = new LevelSoundEventPacket();
|
||||||
|
|
Loading…
Reference in a new issue