Begun mcMMO requirement support

This commit is contained in:
Blackvein 2013-10-22 22:14:55 -07:00
parent 112fc7bc3d
commit 2f73f6f6cc
3 changed files with 23 additions and 5 deletions

BIN
lib/Vault.jar Executable file → Normal file

Binary file not shown.

View File

@ -26,10 +26,6 @@
<id>denizens-repo</id>
<url>http://repo.citizensnpcs.com</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://ci.herocraftonline.com/plugin/repository/everything</url>
</repository>
</repositories>
@ -52,7 +48,9 @@
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.2.22-SNAPSHOT</version>
<version>1.2.27</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Vault.jar</systemPath>
</dependency>
<dependency>
<groupId>com.gmail.nossr50.mcMMO</groupId>

View File

@ -1,5 +1,6 @@
package me.blackvein.quests;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.util.player.UserManager;
import java.util.LinkedList;
import java.util.List;
@ -34,6 +35,8 @@ public class Quest {
List<String> neededQuests = new LinkedList<String>();
List<String> blockQuests = new LinkedList<String>();
List<String> permissionReqs = new LinkedList<String>();
List<String> mcMMOSkillReqs = new LinkedList<String>();
List<Integer> mcMMOAmountReqs = new LinkedList<Integer>();
public String failRequirements = null;
//
//Rewards
@ -174,6 +177,15 @@ public class Quest {
}
for(String s : mcMMOSkillReqs) {
final SkillType st = Quests.getMcMMOSkill(s);
final int lvl = mcMMOAmountReqs.get(mcMMOSkillReqs.indexOf(s));
if(UserManager.getPlayer(player).getProfile().getSkillLevel(st) < lvl)
return false;
}
if (quester.questPoints < questPointsReq) {
return false;
}
@ -454,6 +466,14 @@ public class Quest {
return false;
}
if (other.mcMMOSkillReqs.equals(mcMMOSkillReqs) == false) {
return false;
}
if (other.mcMMOAmountReqs.equals(mcMMOAmountReqs) == false) {
return false;
}
if (other.questPoints != questPoints) {
return false;
}