mirror of
https://gitlab.com/SamB440/rpgregions-2.git
synced 2025-12-28 11:19:24 +00:00
Rework quest reward so it may be expanded upon.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
repositories {
|
||||
maven("https://betonquest.org/nexus/repository/betonquest/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("com.github.seeseemelk:MockBukkit-v1.17:1.13.0")
|
||||
@@ -28,6 +32,7 @@ dependencies {
|
||||
}
|
||||
compileOnly(":AlonsoLevels_v2.0-BETA") // alonsolevels
|
||||
compileOnly(":Quests-4.0.1") // quests
|
||||
compileOnly("pl.betoncraft:betonquest:1.12.0")
|
||||
compileOnly("com.github.shynixn.headdatabase:hdb-api:1.0") // head database
|
||||
compileOnly("com.github.plan-player-analytics:Plan:5.4.1366") // plan
|
||||
compileOnly("io.lumine.xikage:MythicMobs:4.9.1") {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.islandearth.rpgregions.rewards;
|
||||
|
||||
import net.islandearth.rpgregions.api.IRPGRegionsAPI;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class BetonQuestReward extends QuestReward {
|
||||
|
||||
public BetonQuestReward(IRPGRegionsAPI api) {
|
||||
super(api);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void award(Player player) {
|
||||
//todo: According to the developer, BetonQuest has no such concept of "starting" or "completing" quests?
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Quest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginRequirement() {
|
||||
return "BetonQuest";
|
||||
}
|
||||
}
|
||||
@@ -16,9 +16,29 @@ public class QuestReward extends DiscoveryReward implements Blocking {
|
||||
@GuiEditable("Quest id")
|
||||
private final String questId;
|
||||
|
||||
@GuiEditable("Start or complete?")
|
||||
private final boolean start;
|
||||
|
||||
@GuiEditable("Ignore requirements for starting?")
|
||||
private final boolean ignoreRequirements;
|
||||
|
||||
public QuestReward(IRPGRegionsAPI api) {
|
||||
super(api);
|
||||
this.questId = "test";
|
||||
this.start = true;
|
||||
this.ignoreRequirements = false;
|
||||
}
|
||||
|
||||
public String getQuestId() {
|
||||
return questId;
|
||||
}
|
||||
|
||||
public boolean startOrComplete() {
|
||||
return start;
|
||||
}
|
||||
|
||||
public boolean ignoreRequirements() {
|
||||
return ignoreRequirements;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -28,7 +48,8 @@ public class QuestReward extends DiscoveryReward implements Blocking {
|
||||
Quester quester = quests.getStorage().loadQuesterData(player.getUniqueId()).get();
|
||||
Quest quest = quests.getQuestById(questId);
|
||||
if (quest == null) return;
|
||||
quest.completeQuest(quester);
|
||||
if (start) quester.takeQuest(quest, ignoreRequirements);
|
||||
else quest.completeQuest(quester);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -39,6 +60,7 @@ public class QuestReward extends DiscoveryReward implements Blocking {
|
||||
return "Quest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginRequirement() {
|
||||
return "Quests";
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ main: net.islandearth.rpgregions.RPGRegions
|
||||
api-version: '1.16'
|
||||
libraries:
|
||||
- "com.zaxxer:HikariCP:4.0.3" # database
|
||||
softdepend: [Hyperverse, Multiverse, Languagy, UltraRegions, WorldGuard, PlaceholderAPI, HeadDatabase, Residence, Plan, GriefPrevention, Vault, MythicMobs, AlonsoLevels, Dynmap, ProtocolLib]
|
||||
softdepend: [Hyperverse, Multiverse, UltraRegions, WorldGuard, PlaceholderAPI, HeadDatabase, Residence, Plan, GriefPrevention, Vault, MythicMobs, AlonsoLevels, Dynmap, ProtocolLib, Quests, BetonQuest]
|
||||
authors: [SamB440]
|
||||
description: Discoverable regions
|
||||
website: https://fortitude.islandearth.net
|
||||
Reference in New Issue
Block a user