3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-27 08:30:12 +01:00

Don't send the SetHealthPacket clientbound

Seems like this can cause the client to break in 1.18.30, and we already send the health as an attribute.
Dieser Commit ist enthalten in:
Camotoy 2022-04-22 18:06:38 -04:00
Ursprung 5a94bdae5a
Commit 7ea14c1a03

Datei anzeigen

@ -27,7 +27,6 @@ package org.geysermc.geyser.translator.protocol.java.entity.player;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player.ClientboundSetHealthPacket; import com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity.player.ClientboundSetHealthPacket;
import com.nukkitx.protocol.bedrock.data.AttributeData; import com.nukkitx.protocol.bedrock.data.AttributeData;
import com.nukkitx.protocol.bedrock.packet.SetHealthPacket;
import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket; import com.nukkitx.protocol.bedrock.packet.UpdateAttributesPacket;
import org.geysermc.geyser.entity.attribute.GeyserAttributeType; import org.geysermc.geyser.entity.attribute.GeyserAttributeType;
import org.geysermc.geyser.entity.type.player.SessionPlayerEntity; import org.geysermc.geyser.entity.type.player.SessionPlayerEntity;
@ -44,11 +43,6 @@ public class JavaSetHealthTranslator extends PacketTranslator<ClientboundSetHeal
public void translate(GeyserSession session, ClientboundSetHealthPacket packet) { public void translate(GeyserSession session, ClientboundSetHealthPacket packet) {
SessionPlayerEntity entity = session.getPlayerEntity(); SessionPlayerEntity entity = session.getPlayerEntity();
int health = (int) Math.ceil(packet.getHealth());
SetHealthPacket setHealthPacket = new SetHealthPacket();
setHealthPacket.setHealth(health);
session.sendUpstreamPacket(setHealthPacket);
entity.setHealth(packet.getHealth()); entity.setHealth(packet.getHealth());
UpdateAttributesPacket attributesPacket = new UpdateAttributesPacket(); UpdateAttributesPacket attributesPacket = new UpdateAttributesPacket();