Fix error when using IntervalChecked uncache strategy

This commit is contained in:
GeorgH93 2023-06-28 00:44:53 +02:00
parent 940e2a4b13
commit c119874d09
No known key found for this signature in database
GPG Key ID: D1630D37F9E4B3C8

View File

@ -12,7 +12,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package at.pcgamingfreaks.Minepacks.Bukkit.Database.UnCacheStrategies;
@ -20,6 +20,7 @@
import at.pcgamingfreaks.Minepacks.Bukkit.Backpack;
import at.pcgamingfreaks.Minepacks.Bukkit.Database.Database;
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
import org.bukkit.Bukkit;
public class IntervalChecked extends UnCacheStrategy implements Runnable
@ -41,7 +42,7 @@ public void run()
long currentTime = System.currentTimeMillis() - delay;
for(Backpack backpack : cache.getLoadedBackpacks())
{
if(!backpack.getOwner().isOnline() && backpack.getOwner().getPlayer().getLastPlayed() < currentTime && !backpack.isOpen())
if(!backpack.getOwner().isOnline() && backpack.getOwner().getLastPlayed() < currentTime && !backpack.isOpen())
{
this.cache.unloadBackpack(backpack);
}