mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-14 20:21:19 +01:00
Add warning for outdated backpacks
This commit is contained in:
parent
7349727cdc
commit
6151b08944
@ -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
|
* 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
|
* 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.BukkitItemStackSerializer;
|
||||||
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.ItemStackSerializer;
|
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.ItemStackSerializer;
|
||||||
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.NBTItemStackSerializerGen2;
|
import at.pcgamingfreaks.Bukkit.ItemStackSerializer.NBTItemStackSerializerGen2;
|
||||||
|
import at.pcgamingfreaks.Bukkit.MCVersion;
|
||||||
import at.pcgamingfreaks.ConsoleColor;
|
import at.pcgamingfreaks.ConsoleColor;
|
||||||
|
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
@ -66,7 +67,7 @@ public ItemStack[] deserialize(byte[] data, int usedSerializer)
|
|||||||
switch(usedSerializer)
|
switch(usedSerializer)
|
||||||
{
|
{
|
||||||
case 0: return BUKKIT_ITEM_STACK_SERIALIZER.deserialize(data);
|
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);
|
case 2: return serializer.deserialize(data);
|
||||||
default: logger.warning(ConsoleColor.RED + "No compatible serializer for item format available!" + ConsoleColor.RESET);
|
default: logger.warning(ConsoleColor.RED + "No compatible serializer for item format available!" + ConsoleColor.RESET);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user