mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 09:16:06 +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.OfflinePlayer;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.Statistic;
|
import org.bukkit.Statistic;
|
||||||
|
import org.bukkit.WeatherType;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.conversations.Conversable;
|
import org.bukkit.conversations.Conversable;
|
||||||
import org.bukkit.map.MapView;
|
import org.bukkit.map.MapView;
|
||||||
|
@ -363,6 +364,29 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
|
||||||
*/
|
*/
|
||||||
public void resetPlayerTime();
|
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.
|
* Gives the player the amount of experience specified.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue