mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 10:37:41 +01:00
Fixed region priorities, but it needs a test.
This commit is contained in:
parent
28c44e0b2f
commit
08ab359534
@ -19,9 +19,9 @@
|
||||
package com.sk89q.worldguard.protection.managers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.TreeMap;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldguard.LocalPlayer;
|
||||
@ -138,8 +138,8 @@ public ProtectedRegion getRegion(String id) {
|
||||
*/
|
||||
@Override
|
||||
public ApplicableRegionSet getApplicableRegions(Vector pt) {
|
||||
PriorityQueue<ProtectedRegion> appRegions =
|
||||
new PriorityQueue<ProtectedRegion>();
|
||||
List<ProtectedRegion> appRegions =
|
||||
new ArrayList<ProtectedRegion>();
|
||||
|
||||
for (ProtectedRegion region : regions.values()) {
|
||||
if (region.contains(pt)) {
|
||||
@ -147,6 +147,8 @@ public ApplicableRegionSet getApplicableRegions(Vector pt) {
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(appRegions);
|
||||
|
||||
return new ApplicableRegionSet(appRegions, regions.get("__global__"));
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
package com.sk89q.worldguard.protection.managers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.TreeMap;
|
||||
import org.khelekore.prtree.MBRConverter;
|
||||
import org.khelekore.prtree.PRTree;
|
||||
@ -154,8 +154,8 @@ public void removeRegion(String id) {
|
||||
*/
|
||||
@Override
|
||||
public ApplicableRegionSet getApplicableRegions(Vector pt) {
|
||||
PriorityQueue<ProtectedRegion> appRegions =
|
||||
new PriorityQueue<ProtectedRegion>();
|
||||
List<ProtectedRegion> appRegions =
|
||||
new ArrayList<ProtectedRegion>();
|
||||
|
||||
int x = pt.getBlockX();
|
||||
int z = pt.getBlockZ();
|
||||
@ -166,6 +166,8 @@ public ApplicableRegionSet getApplicableRegions(Vector pt) {
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(appRegions);
|
||||
|
||||
return new ApplicableRegionSet(appRegions, regions.get("__global__"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user