SteamWar/BauSystem2.0
Archiviert
12
0

Fix Hotbar errors

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-09-13 15:24:45 +02:00
Ursprung dfcaac5045
Commit 70c0488083

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bausystem.features.hotbar;
import de.steamwar.bausystem.configplayer.Config;
import de.steamwar.core.Core;
import lombok.experimental.UtilityClass;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -47,7 +48,7 @@ public class DefaultHotbar {
yapionArray.add(new YAPIONValue<>(null));
}
}
Config.getInstance().get(p).add("hotbar", yapionArray);
Config.getInstance().get(p).add("hotbar-" + Core.getVersion(), yapionArray);
Config.getInstance().save(p);
}
@ -62,7 +63,7 @@ public class DefaultHotbar {
}
public ItemStack[] getItems(Player p) {
YAPIONArray yapionArray = Config.getInstance().get(p).getYAPIONArrayOrSetDefault("hotbar", defaultHotbar());
YAPIONArray yapionArray = Config.getInstance().get(p).getYAPIONArrayOrSetDefault("hotbar-" + Core.getVersion(), defaultHotbar());
ItemStack[] hotbar = new ItemStack[13];
yapionArray.forEach((integer, yapionAnyType) -> {
if (yapionAnyType instanceof YAPIONValue) {