Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Shanwer committed Aug 14, 2024
2 parents b572995 + 0bc39d5 commit 6d1b8b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public class LivingEntity extends Entity {
protected ItemData chestplate = ItemData.AIR;
protected ItemData leggings = ItemData.AIR;
protected ItemData boots = ItemData.AIR;
protected ItemData body = ItemData.AIR;
protected ItemData hand = ItemData.AIR;
protected ItemData offhand = ItemData.AIR;

Expand Down Expand Up @@ -112,6 +113,10 @@ public void setChestplate(ItemStack stack) {
this.chestplate = ItemTranslator.translateToBedrock(session, stack);
}

public void setBody(ItemStack stack) {
this.body = ItemTranslator.translateToBedrock(session, stack);
}

public void setLeggings(ItemStack stack) {
this.leggings = ItemTranslator.translateToBedrock(session, stack);
}
Expand Down Expand Up @@ -323,6 +328,7 @@ public void updateArmor(GeyserSession session) {
armorEquipmentPacket.setChestplate(chestplate);
armorEquipmentPacket.setLeggings(leggings);
armorEquipmentPacket.setBoots(boots);
armorEquipmentPacket.setBody(body);

session.sendUpstreamPacket(armorEquipmentPacket);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.geysermc.geyser.entity.type.LivingEntity;
import org.geysermc.geyser.entity.type.player.PlayerEntity;
import org.geysermc.geyser.item.Items;
import org.geysermc.geyser.network.GameProtocol;
import org.geysermc.geyser.session.GeyserSession;
import org.geysermc.geyser.skin.FakeHeadProvider;
import org.geysermc.geyser.translator.protocol.PacketTranslator;
Expand Down Expand Up @@ -72,11 +73,19 @@ public void translate(GeyserSession session, ClientboundSetEquipmentPacket packe
livingEntity.setHelmet(stack);
armorUpdated = true;
}
case CHESTPLATE, BODY -> {
// BODY is sent for llamas with a carpet equipped, as of 1.20.5
case CHESTPLATE -> {
livingEntity.setChestplate(stack);
armorUpdated = true;
}
case BODY -> {
// BODY is sent for llamas with a carpet equipped, as of 1.20.5
if (GameProtocol.isPre1_21_2(session)) {
livingEntity.setChestplate(stack);
} else {
livingEntity.setBody(stack);
}
armorUpdated = true;
}
case LEGGINGS -> {
livingEntity.setLeggings(stack);
armorUpdated = true;
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ remote:
# For plugin versions, it's recommended to keep the `address` field to "auto" so Floodgate support is automatically configured.
# If Floodgate is installed and `address:` is set to "auto", then "auth-type: floodgate" will automatically be used.
auth-type: online
# Allow for password-based authentication methods through Geyser. Only useful in online mode.
# If this is false, users must authenticate to Microsoft using a code provided by Geyser on their desktop.
allow-password-authentication: true
# Whether to enable PROXY protocol or not while connecting to the server.
# This is useful only when:
# 1) Your server supports PROXY protocol (it probably doesn't)
Expand Down

0 comments on commit 6d1b8b0

Please sign in to comment.