13
0
geforkt von Mirrors/Paper

Added a whole buncha overloads for Location in World

By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-02-18 16:34:49 +00:00
Ursprung 9adb4e4d92
Commit d7633fa07b
2 geänderte Dateien mit 34 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -52,7 +52,7 @@ public class Location implements Cloneable {
* @return Block at the represented location
*/
public Block getBlock() {
return world.getBlockAt(getBlockX(), getBlockY(), getBlockZ());
return world.getBlockAt(this);
}
/**

Datei anzeigen

@ -34,6 +34,16 @@ public interface World {
* @return Block at the given location
*/
public Block getBlockAt(int x, int y, int z);
/**
* Gets the block at the given location
*
* This block will always represent the latest state
*
* @param location Location of the block
* @return Block at the given location
*/
public Block getBlockAt(Location location);
/**
* Gets the block type-id at the given location
@ -45,6 +55,14 @@ public interface World {
*/
public int getBlockTypeIdAt(int x, int y, int z);
/**
* Gets the block type-id at the given location
*
* @param location Location of the block
* @return TypeId of the block at the given location
*/
public int getBlockTypeIdAt(Location location);
/**
* Gets the highest non-air coordinate at the given (x,z) location
* @param x X-coordinate of the blocks
@ -53,6 +71,13 @@ public interface World {
*/
public int getHighestBlockYAt(int x, int z);
/**
* Gets the highest non-air coordinate at the given location
* @param location Location of the blocks
* @return Y-coordinate of the highest non-air block
*/
public int getHighestBlockYAt(Location location);
/**
* Gets the chunk at the given location
*
@ -62,6 +87,14 @@ public interface World {
*/
public Chunk getChunkAt(int x, int z);
/**
* Gets the chunk at the given location
*
* @param location Location of the chunk
* @return Chunk at the given location
*/
public Chunk getChunkAt(Location location);
/**
* Gets the chunk which contains the given block
*