Skip to content

Commit 64497b3

Browse files
committed
Fix enchantment order
1 parent f5b3799 commit 64497b3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ The base ViaVersion jar runs on Paper and Velocity. We also have projects integr
1111
on Fabric, Forge, Bungee, Sponge, or as a standalone proxy to join from basically any client version on
1212
any server version from the past decade. **See [HERE](https://github.com/ViaVersion) for an overview of the different Via\* projects.**
1313

14+
Note that ViaVersion will be able to **run best on either Paper servers or Fabric clients** due to having
15+
direct access to client/server state and more extensive API.
16+
1417
Supported Versions:
1518

1619
![Table (https://i.imgur.com/sTrVnC2.png)](https://i.imgur.com/sTrVnC2.png)

common/src/main/java/com/viaversion/viaversion/protocols/v1_20_5to1_21/storage/EfficiencyAttributeStorage.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,13 @@ private void sendAttributesPacket(final UserConnection connection) {
9393
final PacketWrapper attributesPacket = PacketWrapper.create(ClientboundPackets1_21.UPDATE_ATTRIBUTES, connection);
9494
attributesPacket.write(Types.VAR_INT, enchants.entityId());
9595

96-
final List<ActiveEnchant> list = List.of(enchants.efficiency(), enchants.soulSpeed(), enchants.swiftSneak(), enchants.depthStrider());
96+
final List<ActiveEnchant> list = List.of(
97+
enchants.efficiency(),
98+
enchants.soulSpeed(),
99+
enchants.swiftSneak(),
100+
enchants.aquaAffinity(),
101+
enchants.depthStrider()
102+
);
97103
attributesPacket.write(Types.VAR_INT, list.size());
98104
for (final ActiveEnchant enchant : list) {
99105
final EnchantAttributeModifier modifier = enchant.modifier;
@@ -113,8 +119,8 @@ private void sendAttributesPacket(final UserConnection connection) {
113119
attributesPacket.scheduleSend(Protocol1_20_5To1_21.class);
114120
}
115121

116-
public record ActiveEnchants(int entityId, ActiveEnchant efficiency, ActiveEnchant aquaAffinity,
117-
ActiveEnchant soulSpeed, ActiveEnchant swiftSneak, ActiveEnchant depthStrider) {
122+
public record ActiveEnchants(int entityId, ActiveEnchant efficiency, ActiveEnchant soulSpeed,
123+
ActiveEnchant swiftSneak, ActiveEnchant aquaAffinity, ActiveEnchant depthStrider) {
118124
}
119125

120126
public record ActiveEnchant(EnchantAttributeModifier modifier, int level) {

0 commit comments

Comments
 (0)