mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-26 04:36:06 +01:00
Compare rose type durability for pre-1.13 servers, fixes #1286
This commit is contained in:
parent
5acea3d213
commit
b3aa22e8ab
@ -1292,11 +1292,11 @@ public class Quester {
|
|||||||
for (ItemStack is : getQuestData(quest).blocksBroken) {
|
for (ItemStack is : getQuestData(quest).blocksBroken) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
broken = is;
|
broken = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
broken = is;
|
broken = is;
|
||||||
}
|
}
|
||||||
} else if (m.getData() instanceof Crops && is.getData() instanceof Crops) {
|
} else if (m.getData() instanceof Crops && is.getData() instanceof Crops) {
|
||||||
@ -1309,8 +1309,13 @@ public class Quester {
|
|||||||
// Age is unspecified so ignore durability
|
// Age is unspecified so ignore durability
|
||||||
broken = is;
|
broken = is;
|
||||||
}
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
|
broken = is;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
broken = is;
|
broken = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1318,11 +1323,11 @@ public class Quester {
|
|||||||
for (ItemStack is : getCurrentStage(quest).blocksToBreak) {
|
for (ItemStack is : getCurrentStage(quest).blocksToBreak) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toBreak = is;
|
toBreak = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
toBreak = is;
|
toBreak = is;
|
||||||
}
|
}
|
||||||
} else if (m.getData() instanceof Crops && is.getData() instanceof Crops) {
|
} else if (m.getData() instanceof Crops && is.getData() instanceof Crops) {
|
||||||
@ -1335,8 +1340,13 @@ public class Quester {
|
|||||||
// Age is unspecified so ignore durability
|
// Age is unspecified so ignore durability
|
||||||
toBreak = is;
|
toBreak = is;
|
||||||
}
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
|
toBreak = is;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
toBreak = is;
|
toBreak = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1379,15 +1389,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getQuestData(quest).blocksDamaged) {
|
for (ItemStack is : getQuestData(quest).blocksDamaged) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
damaged = is;
|
damaged = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
damaged = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
damaged = is;
|
damaged = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
damaged = is;
|
damaged = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1395,15 +1410,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getCurrentStage(quest).blocksToDamage) {
|
for (ItemStack is : getCurrentStage(quest).blocksToDamage) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toDamage = is;
|
toDamage = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
toDamage = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toDamage = is;
|
toDamage = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
toDamage = is;
|
toDamage = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1446,15 +1466,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getQuestData(quest).blocksPlaced) {
|
for (ItemStack is : getQuestData(quest).blocksPlaced) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
placed = is;
|
placed = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
placed = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
placed = is;
|
placed = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
placed = is;
|
placed = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1462,15 +1487,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getCurrentStage(quest).blocksToPlace) {
|
for (ItemStack is : getCurrentStage(quest).blocksToPlace) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toPlace = is;
|
toPlace = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
toPlace = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toPlace = is;
|
toPlace = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
toPlace = is;
|
toPlace = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1513,15 +1543,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getQuestData(quest).blocksUsed) {
|
for (ItemStack is : getQuestData(quest).blocksUsed) {
|
||||||
if (m.getType() == is.getType() ) {
|
if (m.getType() == is.getType() ) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
used = is;
|
used = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
used = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
used = is;
|
used = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
used = is;
|
used = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1529,15 +1564,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getCurrentStage(quest).blocksToUse) {
|
for (ItemStack is : getCurrentStage(quest).blocksToUse) {
|
||||||
if (m.getType() == is.getType() ) {
|
if (m.getType() == is.getType() ) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid, so check durability
|
// Blocks are solid, so check durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toUse = is;
|
toUse = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
toUse = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toUse = is;
|
toUse = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid, so ignore durability
|
// Blocks are not solid, so ignore durability
|
||||||
toUse = is;
|
toUse = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1580,15 +1620,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getQuestData(quest).blocksCut) {
|
for (ItemStack is : getQuestData(quest).blocksCut) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
cut = is;
|
cut = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
cut = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
cut = is;
|
cut = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
cut = is;
|
cut = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1596,15 +1641,20 @@ public class Quester {
|
|||||||
for (ItemStack is : getCurrentStage(quest).blocksToCut) {
|
for (ItemStack is : getCurrentStage(quest).blocksToCut) {
|
||||||
if (m.getType() == is.getType()) {
|
if (m.getType() == is.getType()) {
|
||||||
if (m.getType().isSolid() && is.getType().isSolid()) {
|
if (m.getType().isSolid() && is.getType().isSolid()) {
|
||||||
//Blocks are solid so check for durability
|
// Blocks are solid so check for durability
|
||||||
if (m.getDurability() == is.getDurability()) {
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toCut = is;
|
toCut = is;
|
||||||
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
} else if (!LocaleQuery.isBelow113(plugin.getDetectedBukkitVersion())) {
|
||||||
//Ignore durability for 1.13+
|
// Ignore durability for 1.13+
|
||||||
|
toCut = is;
|
||||||
|
}
|
||||||
|
} else if (m.getType().name().equals("RED_ROSE")) {
|
||||||
|
// Flowers are unique so check for durability
|
||||||
|
if (m.getDurability() == is.getDurability()) {
|
||||||
toCut = is;
|
toCut = is;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Blocks are not solid so ignore durability
|
// Blocks are not solid so ignore durability
|
||||||
toCut = is;
|
toCut = is;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user