Add warning for outdated backpacks

This commit is contained in:
GeorgH93 2019-04-28 01:57:02 +02:00
parent 7349727cdc
commit 6151b08944
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016, 2018 GeorgH93
* Copyright (C) 2019 GeorgH93
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -20,6 +20,7 @@
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.BukkitItemStackSerializer;
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.ItemStackSerializer;
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.NBTItemStackSerializerGen2;
import at.pcgamingfreaks.Bukkit.MCVersion;
import at.pcgamingfreaks.ConsoleColor;
import org.bukkit.inventory.Inventory;
@ -66,7 +67,7 @@ public ItemStack[] deserialize(byte[] data, int usedSerializer)
switch(usedSerializer)
{
case 0: return BUKKIT_ITEM_STACK_SERIALIZER.deserialize(data);
case 1:
case 1: if(MCVersion.isNewerOrEqualThan(MCVersion.MC_1_13)) logger.warning(ConsoleColor.YELLOW + "Backpack was created with an old version of minecraft. There is the chance that some items will disappear from it.");
case 2: return serializer.deserialize(data);
default: logger.warning(ConsoleColor.RED + "No compatible serializer for item format available!" + ConsoleColor.RESET);
}