mirror of
https://github.com/BGHDDevelopment/PlayerBalancer.git
synced 2024-11-23 11:15:30 +01:00
Position without principal section
This commit is contained in:
parent
7a49c4e31d
commit
88a55271d5
@ -99,7 +99,11 @@ public class SectionManager {
|
|||||||
return principal;
|
return principal;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setPrincipal(ServerSection principal) {
|
void setPrincipal(ServerSection principal) {
|
||||||
this.principal = principal;
|
this.principal = principal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean hasPrincipal() {
|
||||||
|
return principal != null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,18 +124,21 @@ public class ServerSection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Calculate below principal
|
//Calculate below principal
|
||||||
iterations = 0;
|
if (plugin.getSectionManager().hasPrincipal()) {
|
||||||
current = plugin.getSectionManager().getPrincipal();
|
iterations = 0;
|
||||||
while (current != null) {
|
current = plugin.getSectionManager().getPrincipal();
|
||||||
if (current.equals(this)) {
|
while (current != null) {
|
||||||
return iterations;
|
if (current.equals(this)) {
|
||||||
}
|
return iterations;
|
||||||
|
}
|
||||||
|
|
||||||
current = current.getParent();
|
current = current.getParent();
|
||||||
iterations--;
|
iterations--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
//Returns iterations above parents
|
||||||
|
return iterations;
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user