Fix mail to work with recent changes

This commit is contained in:
Shaun Bennett 2014-11-26 11:55:28 -06:00
parent c73a9f3bd5
commit 7c9226d6de
2 changed files with 6 additions and 9 deletions

View File

@ -1,12 +1,12 @@
package mineplex.hub.mail; package mineplex.hub.mail;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.MiniClientPlugin; import mineplex.core.MiniClientPlugin;
import mineplex.core.MiniPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.account.event.RetrieveClientInformationEvent;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.hub.mail.command.MailCommand; import mineplex.hub.mail.command.MailCommand;
import mineplex.hub.mail.gui.MailShop; import mineplex.hub.mail.gui.MailShop;
@ -34,18 +34,15 @@ public class MailManager extends MiniClientPlugin<PlayerMailData>
return new PlayerMailData(); return new PlayerMailData();
} }
@Override @EventHandler
protected void loadClientInformation(final RetrieveClientInformationEvent event) protected void loadPlayerData(final PlayerJoinEvent event)
{ {
event.incrementProcessingCount();
runAsync(new Runnable() runAsync(new Runnable()
{ {
@Override @Override
public void run() public void run()
{ {
Set(event.getPlayerName(), _repository.loadMailData(event.getUniqueId())); Set(event.getPlayer().getName(), _repository.loadMailData(event.getPlayer().getUniqueId()));
event.decreaseProcessingCount();
} }
}); });
} }

View File

@ -43,7 +43,7 @@ public class MailRepository extends RepositoryBase
Result<MailRecord> resultSet = context.selectFrom(Tables.mail).where(Tables.mail.accountId.eq(DSL.select(Tables.accounts.id) Result<MailRecord> resultSet = context.selectFrom(Tables.mail).where(Tables.mail.accountId.eq(DSL.select(Tables.accounts.id)
.from(Tables.accounts) .from(Tables.accounts)
.where(Tables.accounts.uuid.eq(uuid.toString()))) .where(Tables.accounts.uuid.eq(uuid.toString())))
).fetch(); ).and(Tables.mail.deleted.isFalse()).fetch();
for (MailRecord record : resultSet) for (MailRecord record : resultSet)
{ {