Skip to content

Commit e7a5800

Browse files
committed
Fix isValid returning true if both positions are in different worlds
Signed-off-by: thebigsmileXD <[email protected]>
1 parent cd27009 commit e7a5800

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

plugin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: MagicWE2
33
main: xenialdan\MagicWE2\Loader
4-
version: 6.0.1
4+
version: 6.0.2
55
api: [4.0.0+dev, 3.2.5+dev]
66
load: STARTUP
77
authors:

src/xenialdan/MagicWE2/Selection.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,10 @@ public function isValid(): bool
147147
$this->getLevel();
148148
$this->getPos1();
149149
$this->getPos2();
150-
if ($this->getPos1()->getLevel() === $this->getPos2()->getLevel())
151-
return true;
150+
return ($this->getPos1()->getLevel() === $this->getLevel() && $this->getPos2()->getLevel() === $this->getLevel());
152151
} catch (\Exception $e) {
153152
return false;
154153
}
155-
return true;
156154
}
157155

158156
/**

0 commit comments

Comments
 (0)