mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-07 08:58:27 +01:00
Fixed additions where at least one operand was not casted as double
This commit is contained in:
parent
ce025cc49f
commit
f2078aae3f
@ -11,6 +11,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.World.Environment;
|
import org.bukkit.World.Environment;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
import world.bentobox.bentobox.BStats;
|
import world.bentobox.bentobox.BStats;
|
||||||
import world.bentobox.bentobox.BentoBox;
|
import world.bentobox.bentobox.BentoBox;
|
||||||
import world.bentobox.bentobox.api.events.IslandBaseEvent;
|
import world.bentobox.bentobox.api.events.IslandBaseEvent;
|
||||||
@ -71,7 +72,6 @@ public class NewIsland {
|
|||||||
/**
|
/**
|
||||||
* Build a new island for a player
|
* Build a new island for a player
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public static class Builder {
|
public static class Builder {
|
||||||
private Island oldIsland2;
|
private Island oldIsland2;
|
||||||
@ -232,11 +232,14 @@ public class NewIsland {
|
|||||||
* Get the location of next free island spot
|
* Get the location of next free island spot
|
||||||
* @return Location of island spot or null if one cannot be found
|
* @return Location of island spot or null if one cannot be found
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
private Location getNextIsland() {
|
private Location getNextIsland() {
|
||||||
Location last = plugin.getIslands().getLast(world);
|
Location last = plugin.getIslands().getLast(world);
|
||||||
if (last == null) {
|
if (last == null) {
|
||||||
last = new Location(world, plugin.getIWM().getIslandXOffset(world) + plugin.getIWM().getIslandStartX(world),
|
last = new Location(world,
|
||||||
plugin.getIWM().getIslandHeight(world), plugin.getIWM().getIslandZOffset(world) + plugin.getIWM().getIslandStartZ(world));
|
(double) plugin.getIWM().getIslandXOffset(world) + plugin.getIWM().getIslandStartX(world),
|
||||||
|
plugin.getIWM().getIslandHeight(world),
|
||||||
|
(double) plugin.getIWM().getIslandZOffset(world) + plugin.getIWM().getIslandStartZ(world));
|
||||||
}
|
}
|
||||||
// Find a free spot
|
// Find a free spot
|
||||||
Map<Result, Integer> result = new EnumMap<>(Result.class);
|
Map<Result, Integer> result = new EnumMap<>(Result.class);
|
||||||
|
@ -306,7 +306,7 @@ public class SafeSpotTeleport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean safe(ChunkSnapshot chunk, int x, int y, int z, World world) {
|
private boolean safe(ChunkSnapshot chunk, int x, int y, int z, World world) {
|
||||||
Vector newSpot = new Vector((chunk.getX() << 4) + x + 0.5D, y + 1, (chunk.getZ() << 4) + z + 0.5D);
|
Vector newSpot = new Vector((chunk.getX() << 4) + x + 0.5D, y + 1.0D, (chunk.getZ() << 4) + z + 0.5D);
|
||||||
if (portal) {
|
if (portal) {
|
||||||
if (bestSpot == null) {
|
if (bestSpot == null) {
|
||||||
// Stash the best spot
|
// Stash the best spot
|
||||||
|
Loading…
Reference in New Issue
Block a user