Hello. I'm developing a plugin that needs to receive votes. I installed the plugin, added your dependency, setup the port forward and all that. I added this to my onEnable
public class VoteListener implements Listener {
@EventHandler(priority= EventPriority.NORMAL)
public void onVotifierEvent(VotifierEvent event) {
Vote vote = event.getVote();
Logger.getAnonymousLogger().info("Received vote for " + vote.getUsername());
Player player = Bukkit.getPlayer(vote.getUsername());
try (Session session = DbFactory.getSessionFactory().openSession()) {
HibernateCriteriaBuilder builder = session.getCriteriaBuilder();
JpaCriteriaQuery query = builder.createQuery(Votes.class);
JpaRoot root = query.from(Votes.class);
session.beginTransaction();
query.select(root);
query.where(
builder.equal(root.get("UserGuid"), player.getUniqueId())
);
List results = session.createQuery(query).getResultList();
Votes votes;
if (results.stream().count() == 0)
votes = new Votes(player.getUniqueId(), 0);
else votes = (Votes) results.get(0);
votes.SetVotes(votes.GetVotes() + 1);
votes.SetVoteTokens(votes.GetVoteTokens() + 1);
session.saveOrUpdate(votes);
session.getTransaction().commit();
} catch (Throwable e) {
throw e;
}
}
}
However neither the minestatus votifier tester nor the in game test command trigger the logger or a breakpoint in the event handler. I am positive the port forward and all that is working because I get an error about the vote not being signed when I just punch the ip/port into my browser
Hello. I'm developing a plugin that needs to receive votes. I installed the plugin, added your dependency, setup the port forward and all that. I added this to my onEnable
and the VoteListener class
However neither the minestatus votifier tester nor the in game test command trigger the logger or a breakpoint in the event handler. I am positive the port forward and all that is working because I get an error about the vote not being signed when I just punch the ip/port into my browser