Mirror von
https://github.com/Moulberry/AxiomPaperPlugin.git
synchronisiert 2024-11-17 05:40:06 +01:00
fix: hotbar switch on 1.20.6
Dieser Commit ist enthalten in:
Ursprung
b9225711d0
Commit
5a12999ad8
@ -62,10 +62,20 @@ public class SwitchActiveHotbarPacketListener implements PluginMessageListener {
|
|||||||
} else {
|
} else {
|
||||||
stack = stack.clone();
|
stack = stack.clone();
|
||||||
}
|
}
|
||||||
containerHotbarItems.set(new NamespacedKey("axiom", "slot_"+index), ItemStackDataType.INSTANCE, stack);
|
|
||||||
|
if (stack.isEmpty()) {
|
||||||
|
containerHotbarItems.remove(new NamespacedKey("axiom", "slot_" + index));
|
||||||
|
} else {
|
||||||
|
containerHotbarItems.set(new NamespacedKey("axiom", "slot_" + index), ItemStackDataType.INSTANCE, stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int index = activeHotbarIndex*9 + i;
|
int index = activeHotbarIndex*9 + i;
|
||||||
containerHotbarItems.set(new NamespacedKey("axiom", "slot_"+index), ItemStackDataType.INSTANCE, hotbarItems[i].clone());
|
ItemStack hotbarItem = hotbarItems[i].clone();
|
||||||
|
if (hotbarItem.isEmpty()) {
|
||||||
|
containerHotbarItems.remove(new NamespacedKey("axiom", "slot_" + index));
|
||||||
|
} else {
|
||||||
|
containerHotbarItems.set(new NamespacedKey("axiom", "slot_"+index), ItemStackDataType.INSTANCE, hotbarItem);
|
||||||
|
}
|
||||||
if (player.getGameMode() == GameMode.CREATIVE) player.getInventory().setItem(i, hotbarItems[i]);
|
if (player.getGameMode() == GameMode.CREATIVE) player.getInventory().setItem(i, hotbarItems[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren