|
| 1 | +package be.woutdev.clientworlds.api.world; |
| 2 | + |
| 3 | +import be.woutdev.clientworlds.api.block.ClientBlock; |
| 4 | +import org.bukkit.Location; |
| 5 | +import org.bukkit.entity.Player; |
| 6 | + |
| 7 | +/** |
| 8 | + * Created by Wout on 24/08/2016. |
| 9 | + */ |
| 10 | +public interface ClientWorld |
| 11 | +{ |
| 12 | + /** |
| 13 | + * Add a player to the ClientWorld. This will directly send updates to the player. |
| 14 | + * @param player The player to add. |
| 15 | + * @return If adding the player was successful or not. |
| 16 | + */ |
| 17 | + boolean addPlayer(Player player); |
| 18 | + |
| 19 | + /** |
| 20 | + * Remove a player from the ClientWorld. This will directly update the world to its normal state. Be careful with the players location when using this. |
| 21 | + * @param player The player to remove. |
| 22 | + * @return If removing the player was successful or not. |
| 23 | + */ |
| 24 | + boolean removePlayer(Player player); |
| 25 | + |
| 26 | + /** |
| 27 | + * Get a ClientBlock by location. |
| 28 | + * @param location The location. |
| 29 | + * @return The ClientBlock at that location. |
| 30 | + */ |
| 31 | + ClientBlock getBlockAt(Location location); |
| 32 | + |
| 33 | + /** |
| 34 | + * Get a ClientBlock by coordinates. |
| 35 | + * @param x The x-coordinate. |
| 36 | + * @param y The y-coordinate. |
| 37 | + * @param z The z-coordinate. |
| 38 | + * @return The ClientBlock at the given coordinates. |
| 39 | + */ |
| 40 | + ClientBlock getBlockAt(int x, int y, int z); |
| 41 | + |
| 42 | + /** |
| 43 | + * Hide the player from the observer. |
| 44 | + * @param observer The observer where the player should be hidden from. |
| 45 | + * @param player The player that should be hidden for the observer. |
| 46 | + * @return If this action went successful. |
| 47 | + */ |
| 48 | + boolean hide(Player observer, Player player); |
| 49 | + |
| 50 | + /** |
| 51 | + * Show the player to the observer. |
| 52 | + * @param observer The observer where the player should be shown for. |
| 53 | + * @param player The player that should be shown for the observer. |
| 54 | + * @return If this action went successful. |
| 55 | + */ |
| 56 | + boolean show(Player observer, Player player); |
| 57 | +} |
0 commit comments