Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
## **KillQuest - A Nukkit Quest System** v1.0.2
## **KillQuest - A Nukkit Quest System** v1.0.3
**KillQuest** is a **feature-rich quest system** for **Nukkit** servers, allowing players to complete **kill and gather quests** for rewards, and challenge themselves with procedurally generated jumping puzzles. It includes **multilingual support**, **scoreboard tracking**, and **EconomyAPI integration**.

---

## Changes in 1.0.3
- Added quest tracking for distance traveled (in height, depth or any direction)
- see example quests.yml
- Added better Forms handling of quest selection
- Added /queststatus command to show the detailed view of the active quest
- Added the ability to cancel the active quest in the /queststatus command
- Added the configuration possibility for generated kumpign puzzles
- /jumpconfig <name> <resetOnCompletion> <greenBlockResetTimeout>
- resetOnCompletion - Boolean - To regenerate the puzzle when a player finishes the puzzle
- greenBlockResetTimeout - Int - How many seconds a player have to sit on the green block to triger jumping puzzle regeneration
- Added translation keys for Quest Menus
- menu.questselector
- menu.questdetails
- menu.queststatus
- menu.questselector.description

## Changes in 1.0.2
- Added regenaration of puzzle when a user finishes it
- Added regeneration of puzzle, using a reset block. You must stay at least 5 seconds on it
Expand Down Expand Up @@ -37,8 +53,9 @@
---

## **📜 Features**
- **Quest System:** Kill entities and gather items to complete quests.
- **Dynamic Quest Selection:** Players can select quests using a UI (`/quests`).
- **Quest System:** Kill entities, gather items or travel distances to complete quests.
- **Dynamic Quest Selection:** Players can select quests using a UI (`/quests`).
- **Active Quest Status:** Players can view active quests using a UI (`/questsstatus`).
- **Scoreboard Tracking:** Displays active quest progress in the top-right.
- **Auto-Saving:** Quest progress is saved to files per player.
- **EconomyAPI Integration:** Players earn credits upon completion.
Expand Down Expand Up @@ -112,9 +129,25 @@ quests:
diamond: 20
iron_ore: 50
reward: 200

- name: "Long Journey"
description: "Travel over 500 blocks from your starting position"
distance: 500
reward: 50

- name: "High Climb"
description: "Climb 200 blocks in height"
height: 200
reward: 30

- name: "Deep Dive"
description: "Descend 100 blocks in depth"
depth: 100
reward: 40
```
- **Kill Targets:** Define entities to kill.
- **Gather Items:** Define items to collect.
- **Distance Traveled:** Define distance to travel (in range, height or depth).
- **Reward:** Credits given via EconomyAPI.

### **`translations.yml`**
Expand All @@ -137,10 +170,12 @@ translations:
| Command | Description |
|---------|------------|
| `/quests` | Opens the quest selection UI |
| `/questsstatus` | Opens the active quest status UI |
| `/killquest reload` | Reloads quests and translations |
| `/jumpgen <name> <length> <width> <height>` | Generates a jumping puzzle with a unique name. |
| `/clearpuzzle <name>` | Clears a specific puzzle. |
| `/listpuzzles` | Lists all active puzzles. |
| `/jumpconfig <name> <resetOnCompletion> <greenBlockResetTimeout>` | Adjust values of generated jumping puzzle |

---

Expand All @@ -155,7 +190,7 @@ translations:
[INFO ] [KillQuestPlugin] ██║ ██╗██║███████╗███████╗╚██████╔╝╚██████╔╝███████╗███████║ ██║
[INFO ] [KillQuestPlugin] ╚═╝ ╚═╝╚═╝╚══════╝╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚══════╝╚══════╝ ╚═╝
[INFO ] [KillQuestPlugin]
[INFO ] [KillQuestPlugin] Version: 1.0.2
[INFO ] [KillQuestPlugin] Version: 1.0.3
[INFO ] [KillQuestPlugin] Developed by digitalwm
[INFO ] [KillQuestPlugin]
[INFO ] [KillQuestPlugin] Loaded language: en_US with 41 keys.
Expand All @@ -172,7 +207,6 @@ translations:

## **💡 Future Improvements**
- ✅ **More Quest Types:** Crafting, Shooting
- ✅ **Permissions Support**
- ✅ **More Customization Options**
- ✅ **SQL Database support**

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>com.digitalwm.killquestplugin</groupId>
<artifactId>KillQuestPlugin</artifactId>
<version>1.0.2</version>
<version>1.0.3</version>

<build>
<defaultGoal>package</defaultGoal>
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/digitalwm/killquest/ActiveQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import cn.nukkit.math.Vector3;

public class ActiveQuest {
private Quest quest;
private QuestProgress progress;
private Vector3 startPos;

public ActiveQuest(Quest quest, QuestProgress progress) {
public ActiveQuest(Quest quest, QuestProgress progress, Vector3 startPos) {
this.quest = quest;
this.progress = progress;
this.startPos = startPos;
}

public Quest getQuest() { return quest; }
public QuestProgress getProgress() { return progress; }
public void setQuest(Quest quest) { this.quest = quest; }
public void setProgress(QuestProgress progress) { this.progress = progress; }
public Vector3 getStartPos() { return startPos; }
}
27 changes: 24 additions & 3 deletions src/main/java/com/digitalwm/killquest/JumpPuzzleGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class JumpPuzzleGenerator {

private final String puzzleName; // ✅ Declare puzzle name

private boolean resetOnCompletion = true;
private int greenBlockResetTimeout = 5; // Default to 5 seconds

public JumpPuzzleGenerator(KillQuestPlugin plugin, Level level, Vector3 startPos, String puzzleName, int length, int width, int maxHeight) {
this.level = level;
this.startPos = startPos;
Expand All @@ -51,12 +54,27 @@ public void setPuzzleBoundaries(Vector3 startPos, int width, int length, int max
maxHeight++;
puzzleMin = new Vector3(startPos.x - width / 2, startPos.y, startPos.z - length / 2);
puzzleMax = new Vector3(startPos.x + width / 2, startPos.y + maxHeight, startPos.z + length / 2);
plugin.getLogger().info("Puzzle boundaries set: " + puzzleMin + " to " + puzzleMax);
}

public String getPuzzleName() {
return puzzleName;
}

public boolean isResetOnCompletion() {
return resetOnCompletion;
}

public void setResetOnCompletion(boolean resetOnCompletion) {
this.resetOnCompletion = resetOnCompletion;
}

public int getGreenBlockResetTimeout() {
return greenBlockResetTimeout;
}

public void setGreenBlockResetTimeout(int greenBlockResetTimeout) {
this.greenBlockResetTimeout = greenBlockResetTimeout;
}

public void generate() {
clearArea();
Expand Down Expand Up @@ -326,7 +344,7 @@ public void handlePlayerMovement(PlayerMoveEvent event) {
playerGreenBlockTimes.put(player, currentTime);
} else {
long timeOnGreenBlock = currentTime - playerGreenBlockTimes.get(player);
if (timeOnGreenBlock > 5000) { // 5 seconds
if (timeOnGreenBlock > greenBlockResetTimeout * 1000) { // 5 seconds
player.sendMessage("§cYou stayed on the green block for too long! The puzzle has been reset.");
resetPuzzleForPlayer(player);
}
Expand All @@ -349,7 +367,10 @@ public void handlePlayerMovement(PlayerMoveEvent event) {
EconomyAPI.getInstance().addMoney(player, 100);
plugin.onJumpPuzzleEnd(player, puzzleName); // Trigger end event
playerStartTimes.remove(player);
resetPuzzleForPlayer(player);

if (resetOnCompletion) {
resetPuzzleForPlayer(player);
}
}
}
}
Expand Down
Loading
Loading