3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-19 14:30:16 +01:00

Fix enchantment order

Dieser Commit ist enthalten in:
Nassim Jahnke 2024-06-20 17:42:27 +02:00
Ursprung f5b3799db9
Commit 64497b305a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F
2 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -11,6 +11,9 @@ The base ViaVersion jar runs on Paper and Velocity. We also have projects integr
on Fabric, Forge, Bungee, Sponge, or as a standalone proxy to join from basically any client version on on Fabric, Forge, Bungee, Sponge, or as a standalone proxy to join from basically any client version on
any server version from the past decade. **See [HERE](https://github.com/ViaVersion) for an overview of the different Via\* projects.** any server version from the past decade. **See [HERE](https://github.com/ViaVersion) for an overview of the different Via\* projects.**
Note that ViaVersion will be able to **run best on either Paper servers or Fabric clients** due to having
direct access to client/server state and more extensive API.
Supported Versions: Supported Versions:
![Table (https://i.imgur.com/sTrVnC2.png)](https://i.imgur.com/sTrVnC2.png) ![Table (https://i.imgur.com/sTrVnC2.png)](https://i.imgur.com/sTrVnC2.png)

Datei anzeigen

@ -93,7 +93,13 @@ public final class EfficiencyAttributeStorage implements StorableObject {
final PacketWrapper attributesPacket = PacketWrapper.create(ClientboundPackets1_21.UPDATE_ATTRIBUTES, connection); final PacketWrapper attributesPacket = PacketWrapper.create(ClientboundPackets1_21.UPDATE_ATTRIBUTES, connection);
attributesPacket.write(Types.VAR_INT, enchants.entityId()); attributesPacket.write(Types.VAR_INT, enchants.entityId());
final List<ActiveEnchant> list = List.of(enchants.efficiency(), enchants.soulSpeed(), enchants.swiftSneak(), enchants.depthStrider()); final List<ActiveEnchant> list = List.of(
enchants.efficiency(),
enchants.soulSpeed(),
enchants.swiftSneak(),
enchants.aquaAffinity(),
enchants.depthStrider()
);
attributesPacket.write(Types.VAR_INT, list.size()); attributesPacket.write(Types.VAR_INT, list.size());
for (final ActiveEnchant enchant : list) { for (final ActiveEnchant enchant : list) {
final EnchantAttributeModifier modifier = enchant.modifier; final EnchantAttributeModifier modifier = enchant.modifier;
@ -113,8 +119,8 @@ public final class EfficiencyAttributeStorage implements StorableObject {
attributesPacket.scheduleSend(Protocol1_20_5To1_21.class); attributesPacket.scheduleSend(Protocol1_20_5To1_21.class);
} }
public record ActiveEnchants(int entityId, ActiveEnchant efficiency, ActiveEnchant aquaAffinity, public record ActiveEnchants(int entityId, ActiveEnchant efficiency, ActiveEnchant soulSpeed,
ActiveEnchant soulSpeed, ActiveEnchant swiftSneak, ActiveEnchant depthStrider) { ActiveEnchant swiftSneak, ActiveEnchant aquaAffinity, ActiveEnchant depthStrider) {
} }
public record ActiveEnchant(EnchantAttributeModifier modifier, int level) { public record ActiveEnchant(EnchantAttributeModifier modifier, int level) {