mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
Add per-player Weather API. Adds BUKKIT-812
By: T00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
parent
97b686dc3b
commit
cc30a80aa3
2 changed files with 40 additions and 0 deletions
16
paper-api/src/main/java/org/bukkit/WeatherType.java
Normal file
16
paper-api/src/main/java/org/bukkit/WeatherType.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package org.bukkit;
|
||||
|
||||
/**
|
||||
* An enum of all current weather types
|
||||
*/
|
||||
public enum WeatherType {
|
||||
/**
|
||||
* Raining or snowing depending on biome.
|
||||
*/
|
||||
DOWNFALL,
|
||||
/**
|
||||
* Clear weather, clouds but no rain.
|
||||
*/
|
||||
CLEAR,
|
||||
;
|
||||
}
|
|
@ -12,6 +12,7 @@ import org.bukkit.Note;
|
|||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.Statistic;
|
||||
import org.bukkit.WeatherType;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.conversations.Conversable;
|
||||
import org.bukkit.map.MapView;
|
||||
|
@ -363,6 +364,29 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
|||
*/
|
||||
public void resetPlayerTime();
|
||||
|
||||
/**
|
||||
* Sets the type of weather the player will see. When used, the weather
|
||||
* status of the player is locked until {@link #resetPlayerWeather()} is
|
||||
* used.
|
||||
*
|
||||
* @param type The WeatherType enum type the player should experience
|
||||
*/
|
||||
public void setPlayerWeather(WeatherType type);
|
||||
|
||||
/**
|
||||
* Returns the type of weather the player is currently experiencing.
|
||||
*
|
||||
* @return The WeatherType that the player is currently experiencing or
|
||||
* null if player is seeing server weather.
|
||||
*/
|
||||
public WeatherType getPlayerWeather();
|
||||
|
||||
/**
|
||||
* Restores the normal condition where the player's weather is controlled
|
||||
* by server conditions.
|
||||
*/
|
||||
public void resetPlayerWeather();
|
||||
|
||||
/**
|
||||
* Gives the player the amount of experience specified.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue