mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-12-27 17:37:41 +01:00
Deserialize the backpack async
this should fix the lag caused by the plugin on MC 1.14, quick testing showed no problems caused by this
This commit is contained in:
parent
a4fd00f687
commit
7349727cdc
@ -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
|
||||
@ -371,11 +371,13 @@ protected void loadBackpack(final OfflinePlayer player, final Callback<Backpack>
|
||||
data = null;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack[] its = itsSerializer.deserialize(data, version);
|
||||
final Backpack backpack = (its != null) ? new Backpack(player, its, bpID) : null;
|
||||
plugin.getServer().getScheduler().runTask(plugin, () -> {
|
||||
ItemStack[] its = itsSerializer.deserialize(data, version);
|
||||
if(its != null)
|
||||
if(backpack != null)
|
||||
{
|
||||
callback.onResult(new Backpack(player, its, bpID));
|
||||
callback.onResult(backpack);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user