FountainMC / FountainAPI

A 'simple but beautiful' Minecraft Server Plugin API
https://fountainmc.org/
MIT License
5 stars 5 forks source link

Consider if BlockPosition and Location should have a World argument #1

Closed Techcable closed 8 years ago

Techcable commented 8 years ago

Minecaraft's BlockPosition doesn't have a location, and it leads to code like this:

public default Block getBlockAt(BlockPosition pos) {
    checkNotNull(pos, "Null position");
    checkArgument(pos.getWorld() == this, "Position's world %s doesn't equal chunk's world %s", pos.getWorld().getName(), this.getName());
    return getBlockAt(pos.getX(), pos.getY(), pos.getZ());
}

However, Bukkit has World as part of their location, it could be useful to plugins, and is technically part of a 'Location'.

phase commented 8 years ago

If we're going to support multiple worlds, I think it is a must.

Techcable commented 8 years ago

Agreed, its very nice for plugins. Its more important to make stuff easy for plugins than to make stuff easy for the implementation.