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

Fix Piglin bartering animation (Fixes #863)

Dieser Commit ist enthalten in:
rtm516 2020-07-07 16:11:52 +01:00
Ursprung a16deb269a
Commit c2be7a181d
2 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -31,6 +31,7 @@ import com.nukkitx.protocol.bedrock.data.entity.EntityData;
import com.nukkitx.protocol.bedrock.data.entity.EntityFlag; import com.nukkitx.protocol.bedrock.data.entity.EntityFlag;
import org.geysermc.connector.entity.type.EntityType; import org.geysermc.connector.entity.type.EntityType;
import org.geysermc.connector.network.session.GeyserSession; import org.geysermc.connector.network.session.GeyserSession;
import org.geysermc.connector.network.translators.item.ItemRegistry;
public class PiglinEntity extends MonsterEntity { public class PiglinEntity extends MonsterEntity {
@ -56,4 +57,13 @@ public class PiglinEntity extends MonsterEntity {
super.updateBedrockMetadata(entityMetadata, session); super.updateBedrockMetadata(entityMetadata, session);
} }
@Override
public void updateEquipment(GeyserSession session) {
// Check if the Piglin is holding Gold and set the ADMIRING flag accordingly
metadata.getFlags().setFlag(EntityFlag.ADMIRING, offHand.getId() == ItemRegistry.GOLD);
super.updateBedrockMetadata(session);
super.updateEquipment(session);
}
} }

Datei anzeigen

@ -60,6 +60,8 @@ public class ItemRegistry {
public static final int SHIELD = 829; public static final int SHIELD = 829;
// Boat ID, used in BedrockInventoryTransactionTranslator.java // Boat ID, used in BedrockInventoryTransactionTranslator.java
public static final int BOAT = 333; public static final int BOAT = 333;
// Gold ID, used in PiglinEntity.java
public static final int GOLD = 266;
public static int BARRIER_INDEX = 0; public static int BARRIER_INDEX = 0;