mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-02 17:00:19 +01:00
Make block break whitelists / breakPlaceBlocks complement each other; resolves #616
This commit is contained in:
parent
a46ddbc1fc
commit
409de0d756
@ -536,19 +536,14 @@ public class DGameWorld extends DInstanceWorld {
|
||||
ExItem material = VanillaItem.get(block.getType());
|
||||
ExItem breakTool = caliburn.getExItem(player.getItemInHand());
|
||||
|
||||
if (whitelist == null) {
|
||||
if (rules.canBreakPlacedBlocks()) {
|
||||
return (!placedBlocks.contains(block));
|
||||
} else if (rules.canBreakBlocks()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (whitelist.containsKey(material) && whitelist.get(material) == null | whitelist.get(material).isEmpty() | whitelist.get(material).contains(breakTool)) {
|
||||
if (rules.canBreakPlacedBlocks()) {
|
||||
return (!placedBlocks.contains(block));
|
||||
} else if (rules.canBreakBlocks()) {
|
||||
return false;
|
||||
}
|
||||
if (rules.canBreakPlacedBlocks() && placedBlocks.contains(block)) {
|
||||
return false;
|
||||
}
|
||||
if (whitelist != null && whitelist.containsKey(material)
|
||||
&& (whitelist.get(material) == null
|
||||
|| whitelist.get(material).isEmpty()
|
||||
|| whitelist.get(material).contains(breakTool))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user