aboutsummaryrefslogtreecommitdiffstats
path: root/bukkit/src/main/java/com
diff options
context:
space:
mode:
authorKrakenied <Krakenied1@gmail.com>2024-03-26 04:16:24 +0100
committerLeonardo Bishop <13875753+LMBishop@users.noreply.github.com>2024-06-03 18:48:22 +0100
commit8cc9a4a7ecf4e284b2b0c614b91722b98d65880d (patch)
tree70a74ed43953ae5591f2d50ce61df2cba10df705 /bukkit/src/main/java/com
parentf4853eecaeaef429c281578c917ec0fb33c441a5 (diff)
Begin work on villager-type and villager-profession options
Diffstat (limited to 'bukkit/src/main/java/com')
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/CuringTaskType.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/CuringTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/CuringTaskType.java
index c65fe675..1f4135b2 100644
--- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/CuringTaskType.java
+++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/CuringTaskType.java
@@ -11,6 +11,7 @@ import com.leonardobishop.quests.common.quest.Task;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
+import org.bukkit.entity.Villager;
import org.bukkit.entity.ZombieVillager;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@@ -54,12 +55,20 @@ public final class CuringTaskType extends BukkitTaskType {
return;
}
+ Villager.Type type = zombieVillager.getVillagerType();
+ Villager.Profession profession = zombieVillager.getVillagerProfession();
+
for (TaskUtils.PendingTask pendingTask : TaskUtils.getApplicableTasks(player, qPlayer, this, TaskConstraintSet.ALL)) {
Quest quest = pendingTask.quest();
Task task = pendingTask.task();
TaskProgress taskProgress = pendingTask.taskProgress();
- super.debug("Player cured " + entity.getType(), quest.getId(), task.getId(), player.getUniqueId());
+ // I don't know why my IDE thinks profession
+ // is always null, probably a bad API design.
+ //noinspection ConstantValue
+ super.debug("Player cured " + zombieVillager.getType() + " of profession " + profession + " and type " + type, quest.getId(), task.getId(), player.getUniqueId());
+
+ // TODO: add villager-type and villager-profession options
int progress = TaskUtils.incrementIntegerTaskProgress(taskProgress);
super.debug("Incrementing task progress (now " + progress + ")", quest.getId(), task.getId(), player.getUniqueId());