mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-07 19:28:11 +01:00
Fix error when using IntervalChecked uncache strategy
This commit is contained in:
parent
940e2a4b13
commit
c119874d09
@ -12,7 +12,7 @@
|
|||||||
* GNU General Public License for more details.
|
* GNU General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* 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;
|
package at.pcgamingfreaks.Minepacks.Bukkit.Database.UnCacheStrategies;
|
||||||
@ -20,6 +20,7 @@
|
|||||||
import at.pcgamingfreaks.Minepacks.Bukkit.Backpack;
|
import at.pcgamingfreaks.Minepacks.Bukkit.Backpack;
|
||||||
import at.pcgamingfreaks.Minepacks.Bukkit.Database.Database;
|
import at.pcgamingfreaks.Minepacks.Bukkit.Database.Database;
|
||||||
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
|
import at.pcgamingfreaks.Minepacks.Bukkit.Minepacks;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class IntervalChecked extends UnCacheStrategy implements Runnable
|
public class IntervalChecked extends UnCacheStrategy implements Runnable
|
||||||
@ -41,7 +42,7 @@ public void run()
|
|||||||
long currentTime = System.currentTimeMillis() - delay;
|
long currentTime = System.currentTimeMillis() - delay;
|
||||||
for(Backpack backpack : cache.getLoadedBackpacks())
|
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);
|
this.cache.unloadBackpack(backpack);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user