mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-14 10:45:23 +01:00
Rename database getter
This commit is contained in:
parent
b6a8d372f5
commit
042941a4e7
@ -231,7 +231,7 @@ public void save()
|
||||
{
|
||||
if(hasChanged())
|
||||
{
|
||||
Minepacks.getInstance().getDb().saveBackpack(this);
|
||||
Minepacks.getInstance().getDatabase().saveBackpack(this);
|
||||
hasChanged = false;
|
||||
}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String arg, String[]
|
||||
final long cooldownTime = System.currentTimeMillis() + cooldown;
|
||||
if(syncCooldown)
|
||||
{
|
||||
plugin.getDb().syncCooldown(player, cooldownTime);
|
||||
plugin.getDatabase().syncCooldown(player, cooldownTime);
|
||||
}
|
||||
plugin.cooldowns.put(player.getUniqueId(), cooldownTime);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public void onClick(InventoryClickEvent event)
|
||||
public void onPlayerLeaveEvent(PlayerQuitEvent event)
|
||||
{
|
||||
plugin.cooldowns.remove(event.getPlayer().getUniqueId());
|
||||
Backpack backpack = plugin.getDb().getBackpack(event.getPlayer());
|
||||
Backpack backpack = plugin.getDatabase().getBackpack(event.getPlayer());
|
||||
if(backpack != null) backpack.save();
|
||||
}
|
||||
}
|
@ -185,6 +185,7 @@ private void unload()
|
||||
getServer().getScheduler().cancelTasks(this); // Kill all running task
|
||||
database.close(); // Close the DB connection, we won't need them any longer
|
||||
instance = null;
|
||||
cooldowns.clear();
|
||||
}
|
||||
|
||||
public void reload()
|
||||
@ -208,7 +209,7 @@ public Config getConfiguration()
|
||||
return config;
|
||||
}
|
||||
|
||||
public Database getDb()
|
||||
public Database getDatabase()
|
||||
{
|
||||
return database;
|
||||
}
|
||||
@ -268,10 +269,7 @@ public int getBackpackPermSize(Player player)
|
||||
{
|
||||
for(int i = maxSize; i > 1; i--)
|
||||
{
|
||||
if(player.hasPermission("backpack.size." + i))
|
||||
{
|
||||
return i * 9;
|
||||
}
|
||||
if(player.hasPermission("backpack.size." + i)) return i * 9;
|
||||
}
|
||||
return 9;
|
||||
}
|
||||
@ -279,10 +277,7 @@ public int getBackpackPermSize(Player player)
|
||||
public WorldBlacklistMode isDisabled(Player player)
|
||||
{
|
||||
if(worldBlacklistMode == WorldBlacklistMode.None || (worldBlacklistMode != WorldBlacklistMode.NoPlugin && player.hasPermission("backpack.ignoreWorldBlacklist"))) return WorldBlacklistMode.None;
|
||||
if(worldBlacklist.contains(player.getWorld().getName().toLowerCase()))
|
||||
{
|
||||
return worldBlacklistMode;
|
||||
}
|
||||
if(worldBlacklist.contains(player.getWorld().getName().toLowerCase())) return worldBlacklistMode;
|
||||
return WorldBlacklistMode.None;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user