Update deprecation

This commit is contained in:
PikaMug 2019-07-31 12:51:07 -04:00
parent 1e29ad1436
commit ccebc13d05
2 changed files with 15 additions and 15 deletions

View File

@ -64,7 +64,7 @@ public class CmdExecutor implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) { public boolean onCommand(CommandSender cs, Command cmd, String label, String[] args) {
if (cs instanceof Player) { if (cs instanceof Player) {
if (plugin.checkQuester(((Player) cs).getUniqueId()) == true) { if (!plugin.canUseQuests(((Player) cs).getUniqueId())) {
cs.sendMessage(ChatColor.RED + Lang.get((Player) cs, "noPermission")); cs.sendMessage(ChatColor.RED + Lang.get((Player) cs, "noPermission"));
return true; return true;
} }

View File

@ -346,7 +346,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerChat(AsyncPlayerChatEvent evt) { public void onPlayerChat(AsyncPlayerChatEvent evt) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId()); final Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
if (quester.getCurrentQuests().isEmpty() == false) { if (quester.getCurrentQuests().isEmpty() == false) {
for (final Quest quest : quester.getCurrentQuests().keySet()) { for (final Quest quest : quester.getCurrentQuests().keySet()) {
@ -382,7 +382,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent evt) { public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent evt) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId()); Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
if (quester.getCurrentQuests().isEmpty() == false) { if (quester.getCurrentQuests().isEmpty() == false) {
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
@ -481,7 +481,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerShearEntity(PlayerShearEntityEvent evt) { public void onPlayerShearEntity(PlayerShearEntityEvent evt) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId()); Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
if (evt.getEntity().getType() == EntityType.SHEEP && quester.containsObjective(quest, "shearSheep")) { if (evt.getEntity().getType() == EntityType.SHEEP && quester.containsObjective(quest, "shearSheep")) {
@ -496,7 +496,7 @@ public class PlayerListener implements Listener {
public void onEntityTame(EntityTameEvent evt) { public void onEntityTame(EntityTameEvent evt) {
if (evt.getOwner() instanceof Player) { if (evt.getOwner() instanceof Player) {
Player p = (Player) evt.getOwner(); Player p = (Player) evt.getOwner();
if (plugin.checkQuester(p.getUniqueId()) == false) { if (plugin.canUseQuests(p.getUniqueId())) {
Quester quester = plugin.getQuester(p.getUniqueId()); Quester quester = plugin.getQuester(p.getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
if (quester.containsObjective(quest, "tameMob")) { if (quester.containsObjective(quest, "tameMob")) {
@ -567,7 +567,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onEnchantItem(EnchantItemEvent evt) { public void onEnchantItem(EnchantItemEvent evt) {
if (plugin.checkQuester(evt.getEnchanter().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getEnchanter().getUniqueId())) {
Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId()); Quester quester = plugin.getQuester(evt.getEnchanter().getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
if (quester.containsObjective(quest, "enchantItem")) { if (quester.containsObjective(quest, "enchantItem")) {
@ -618,7 +618,7 @@ public class PlayerListener implements Listener {
* @since 3.1.4 * @since 3.1.4
*/ */
public void killMob(Entity damager, Entity target) { public void killMob(Entity damager, Entity target) {
if (plugin.checkQuester(damager.getUniqueId()) == true) { if (!plugin.canUseQuests(damager.getUniqueId())) {
return; return;
} }
if (damager instanceof Player) { if (damager instanceof Player) {
@ -679,7 +679,7 @@ public class PlayerListener implements Listener {
} }
Player target = evt.getEntity(); Player target = evt.getEntity();
if (plugin.checkQuester(target.getUniqueId()) == false) { if (plugin.canUseQuests(target.getUniqueId())) {
Quester quester = plugin.getQuester(target.getUniqueId()); Quester quester = plugin.getQuester(target.getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
Stage stage = quester.getCurrentStage(quest); Stage stage = quester.getCurrentStage(quest);
@ -710,7 +710,7 @@ public class PlayerListener implements Listener {
* @since 3.1.4 * @since 3.1.4
*/ */
public void killPlayer(Entity damager, Entity target) { public void killPlayer(Entity damager, Entity target) {
if (plugin.checkQuester(damager.getUniqueId()) == true) { if (!plugin.canUseQuests(damager.getUniqueId())) {
return; return;
} }
if (damager instanceof Player && target instanceof Player) { if (damager instanceof Player && target instanceof Player) {
@ -731,7 +731,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerFish(PlayerFishEvent evt) { public void onPlayerFish(PlayerFishEvent evt) {
Player player = evt.getPlayer(); Player player = evt.getPlayer();
if (plugin.checkQuester(player.getUniqueId()) == false) { if (plugin.canUseQuests(player.getUniqueId())) {
Quester quester = plugin.getQuester(player.getUniqueId()); Quester quester = plugin.getQuester(player.getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
if (quester.containsObjective(quest, "catchFish") && evt.getState().equals(State.CAUGHT_FISH)) { if (quester.containsObjective(quest, "catchFish") && evt.getState().equals(State.CAUGHT_FISH)) {
@ -744,7 +744,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerChangeWorld(PlayerChangedWorldEvent event) { public void onPlayerChangeWorld(PlayerChangedWorldEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (plugin.checkQuester(player.getUniqueId()) == false) { if (plugin.canUseQuests(player.getUniqueId())) {
Quester quester = plugin.getQuester(player.getUniqueId()); Quester quester = plugin.getQuester(player.getUniqueId());
quester.findCompassTarget(); quester.findCompassTarget();
} }
@ -753,7 +753,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) { public void onPlayerRespawn(PlayerRespawnEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
if (plugin.checkQuester(player.getUniqueId()) == false) { if (plugin.canUseQuests(player.getUniqueId())) {
final Quester quester = plugin.getQuester(player.getUniqueId()); final Quester quester = plugin.getQuester(player.getUniqueId());
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
@ -767,7 +767,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerJoin(PlayerJoinEvent evt) { public void onPlayerJoin(PlayerJoinEvent evt) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
Quester quester = new Quester(plugin); Quester quester = new Quester(plugin);
quester.setUUID(evt.getPlayer().getUniqueId()); quester.setUUID(evt.getPlayer().getUniqueId());
if (new File(plugin.getDataFolder(), "data" + File.separator + quester.getUUID() + ".yml").exists()) { if (new File(plugin.getDataFolder(), "data" + File.separator + quester.getUUID() + ".yml").exists()) {
@ -804,7 +804,7 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerQuit(PlayerQuitEvent evt) { public void onPlayerQuit(PlayerQuitEvent evt) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId()); Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
Stage currentStage = quester.getCurrentStage(quest); Stage currentStage = quester.getCurrentStage(quest);
@ -857,7 +857,7 @@ public class PlayerListener implements Listener {
} }
} }
if (plugin.getQuester(evt.getPlayer().getUniqueId()) != null) { if (plugin.getQuester(evt.getPlayer().getUniqueId()) != null) {
if (plugin.checkQuester(evt.getPlayer().getUniqueId()) == false) { if (plugin.canUseQuests(evt.getPlayer().getUniqueId())) {
Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId()); Quester quester = plugin.getQuester(evt.getPlayer().getUniqueId());
for (Quest quest : quester.getCurrentQuests().keySet()) { for (Quest quest : quester.getCurrentQuests().keySet()) {
if (quester.containsObjective(quest, "reachLocation")) { if (quester.containsObjective(quest, "reachLocation")) {