mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-06 15:41:50 +00:00
Translate Warden sonic boom event
Bump Protocol to fix Sonic boom flag
This commit is contained in:
@@ -44,6 +44,8 @@ public class WardenEntity extends MonsterEntity implements Tickable {
|
||||
private int heartBeatDelay;
|
||||
private int tickCount;
|
||||
|
||||
private int sonicBoomTickDuration;
|
||||
|
||||
public WardenEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
|
||||
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
|
||||
}
|
||||
@@ -77,5 +79,17 @@ public class WardenEntity extends MonsterEntity implements Tickable {
|
||||
packet.setVolume((random.nextFloat() - random.nextFloat()) * 0.2f + 1.0f);
|
||||
session.sendUpstreamPacket(packet);
|
||||
}
|
||||
|
||||
if (--sonicBoomTickDuration == 0) {
|
||||
setFlag(EntityFlag.SONIC_BOOM, false);
|
||||
updateBedrockMetadata();
|
||||
}
|
||||
}
|
||||
|
||||
public void onSonicBoom() {
|
||||
setFlag(EntityFlag.SONIC_BOOM, true);
|
||||
updateBedrockMetadata();
|
||||
|
||||
sonicBoomTickDuration = 3 * 20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.geysermc.geyser.entity.type.Entity;
|
||||
import org.geysermc.geyser.entity.type.EvokerFangsEntity;
|
||||
import org.geysermc.geyser.entity.type.FishingHookEntity;
|
||||
import org.geysermc.geyser.entity.type.LivingEntity;
|
||||
import org.geysermc.geyser.entity.type.living.monster.WardenEntity;
|
||||
import org.geysermc.geyser.session.GeyserSession;
|
||||
import org.geysermc.geyser.translator.protocol.PacketTranslator;
|
||||
import org.geysermc.geyser.translator.protocol.Translator;
|
||||
@@ -245,6 +246,11 @@ public class JavaEntityEventTranslator extends PacketTranslator<ClientboundEntit
|
||||
entityEventPacket.setType(EntityEventType.VIBRATION_DETECTED);
|
||||
}
|
||||
break;
|
||||
case WARDEN_SONIC_BOOM:
|
||||
if (entity instanceof WardenEntity wardenEntity) {
|
||||
wardenEntity.onSonicBoom();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (entityEventPacket.getType() != null) {
|
||||
|
||||
Submodule core/src/main/resources/mappings updated: 7fc4ac1789...e13611fd97
Reference in New Issue
Block a user