Remove duplicate Cut block entries. Fixes part 3 of #404. Bump version

number
This commit is contained in:
HappyPikachu 2016-08-29 21:23:13 -04:00
parent 47b0a9d159
commit fb6f743999
2 changed files with 9 additions and 18 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>2.7.2</version>
<version>2.7.3</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -1119,13 +1119,13 @@ public class Quester {
public void cutBlock(Quest quest, ItemStack m) {
ItemStack temp = m;
temp.setAmount(0);
ItemStack broken = temp;
ItemStack cut = temp;
ItemStack toCut = temp;
for (ItemStack is : getQuestData(quest).blocksCut) {
if (m.getType() == is.getType() && m.getDurability() == is.getDurability()) {
broken = is;
cut = is;
}
}
@ -1135,15 +1135,15 @@ public class Quester {
}
}
if (broken != null && toCut != null) {
if (broken.getAmount() < toCut.getAmount()) {
ItemStack newCut = broken;
newCut.setAmount(broken.getAmount() + 1);
if (cut != null && toCut != null) {
if (cut.getAmount() < toCut.getAmount()) {
ItemStack newCut = cut;
newCut.setAmount(cut.getAmount() + 1);
//TODO is this correct?
getQuestData(quest).blocksCut.set(getQuestData(quest).blocksCut.indexOf(broken), newCut);
getQuestData(quest).blocksCut.set(getQuestData(quest).blocksCut.indexOf(cut), newCut);
if (broken.getAmount() == toCut.getAmount()) {
if (cut.getAmount() == toCut.getAmount()) {
finishObjective(quest, "cutBlock", m, null, null, null, null, null, null, null, null, null);
}
}
@ -1811,15 +1811,6 @@ Material m = null;
}
}
if (quest.getStage(0).blocksToCut.isEmpty() == false) {
for (ItemStack is : quest.getStage(0).blocksToCut) {
//TODO should be .set() ?
is.setAmount(0);
data.blocksCut.add(is);
}
}
if (quest.getStage(0).locationsToReach.isEmpty() == false) {
for (Location l : quest.getStage(0).locationsToReach) {