mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 22:13:25 +01:00
Fix stripping warped/crimson stems and barks not counting for the StripLogs action (#1177)
This commit is contained in:
parent
3fdb5be9f5
commit
e40bea99ee
@ -1622,8 +1622,7 @@ public class JobsPaymentListener implements Listener {
|
|||||||
"[current]", blockOwner.getTotal(jPlayer.getUniqueId()),
|
"[current]", blockOwner.getTotal(jPlayer.getUniqueId()),
|
||||||
"[max]", jPlayer.getMaxOwnerShipAllowed(blockOwner.getType()) == 0 ? "-" : jPlayer.getMaxOwnerShipAllowed(blockOwner.getType())));
|
"[max]", jPlayer.getMaxOwnerShipAllowed(blockOwner.getType()) == 0 ? "-" : jPlayer.getMaxOwnerShipAllowed(blockOwner.getType())));
|
||||||
}
|
}
|
||||||
} else if (Version.isCurrentEqualOrHigher(Version.v1_13_R1) &&
|
} else if (!block.getType().toString().startsWith("STRIPPED_") &&
|
||||||
!block.getType().toString().startsWith("STRIPPED_") && block.getType().toString().endsWith("_LOG") &&
|
|
||||||
event.getAction() == Action.RIGHT_CLICK_BLOCK && jPlayer != null && hand.toString().endsWith("_AXE")) {
|
event.getAction() == Action.RIGHT_CLICK_BLOCK && jPlayer != null && hand.toString().endsWith("_AXE")) {
|
||||||
// check if player is riding
|
// check if player is riding
|
||||||
if (Jobs.getGCManager().disablePaymentIfRiding && p.isInsideVehicle())
|
if (Jobs.getGCManager().disablePaymentIfRiding && p.isInsideVehicle())
|
||||||
@ -1634,6 +1633,10 @@ public class JobsPaymentListener implements Listener {
|
|||||||
- Jobs.getNms().getDurability(Jobs.getNms().getItemInMainHand(p)) != hand.getMaxDurability())
|
- Jobs.getNms().getDurability(Jobs.getNms().getItemInMainHand(p)) != hand.getMaxDurability())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// either it's version 1.13+ and we're trying to strip a normal log like oak,
|
||||||
|
// or it's 1.16+ and we're trying to strip a fungi like warped stem
|
||||||
|
if ((Version.isCurrentEqualOrHigher(Version.v1_13_R1) && (block.getType().toString().endsWith("_LOG") || block.getType().toString().endsWith("_WOOD"))) ||
|
||||||
|
(Version.isCurrentEqualOrHigher(Version.v1_16_R1) && (block.getType().toString().endsWith("_STEM") || block.getType().toString().endsWith("_HYPHAE"))))
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> Jobs.action(jPlayer, new BlockActionInfo(block, ActionType.STRIPLOGS), block), 1);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> Jobs.action(jPlayer, new BlockActionInfo(block, ActionType.STRIPLOGS), block), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user