board with index 3 is now larger, toofaraway now depends on (close to) true center
This commit is contained in:
parent
496c0c06bd
commit
02c19075d7
3 changed files with 36 additions and 14 deletions
3
pom.xml
3
pom.xml
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<groupId>de.lunarakai</groupId>
|
||||
<artifactId>Minecleaner</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<version>1.0.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>Minecleaner</name>
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
</properties>
|
||||
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
|
|||
|
|
@ -556,18 +556,39 @@ public class MinecleanerArena {
|
|||
return true;
|
||||
}
|
||||
player.getLocation(tempLoc);
|
||||
double dist = tempLoc.distanceSquared(centerLocation);
|
||||
switch (widthIndex) {
|
||||
case 0:
|
||||
return dist > 64.0;
|
||||
case 1:
|
||||
return dist > 96.0;
|
||||
case 2:
|
||||
return dist > 128.0;
|
||||
case 3:
|
||||
return dist > 156.0;
|
||||
|
||||
double centerX = centerLocation.getX();
|
||||
double centerY = centerLocation.getY() + (BoardSize.boardSizesHeight[widthIndex]/3)/2.0 - 1;
|
||||
double centerZ = centerLocation.getZ();
|
||||
|
||||
switch (orientation) {
|
||||
case NORTH: {
|
||||
centerX = centerLocation.getX() - ((BoardSize.boardSizesWidth[widthIndex]/3)/2.0) + 1;
|
||||
break;
|
||||
}
|
||||
return dist > 64.0;
|
||||
case EAST: {
|
||||
centerZ = centerLocation.getZ() - ((BoardSize.boardSizesWidth[widthIndex]/3)/2.0) + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
case SOUTH: {
|
||||
centerX = centerLocation.getX() + ((BoardSize.boardSizesWidth[widthIndex]/3)/2.0) -1;
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
centerZ = centerLocation.getZ() + ((BoardSize.boardSizesWidth[widthIndex]/3)/2.0) - 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Location trueCenterLocation = new Location(player.getWorld(), centerX, centerY, centerZ);
|
||||
double dist = tempLoc.distanceSquared(trueCenterLocation);
|
||||
player.sendMessage(ChatColor.GOLD + "Dist: " + dist);
|
||||
|
||||
return dist > Math.pow((BoardSize.boardSizesWidth[widthIndex]/4.5) + 6, 2);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ public class BoardSize {
|
|||
9,
|
||||
12,
|
||||
18,
|
||||
33,
|
||||
36,
|
||||
};
|
||||
|
||||
public static int[] boardSizesHeight = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue