geforkt von Mirrors/Paper
Added GameMode methods to Server and HumanEntity
By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Ursprung
42235114ca
Commit
a3154f3ffc
18
paper-api/src/main/java/org/bukkit/GameMode.java
Normale Datei
18
paper-api/src/main/java/org/bukkit/GameMode.java
Normale Datei
@ -0,0 +1,18 @@
|
||||
package org.bukkit;
|
||||
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
|
||||
/**
|
||||
* Represents the various type of game modes that {@link HumanEntity}s may have
|
||||
*/
|
||||
public enum GameMode {
|
||||
/**
|
||||
* Creative mode may fly, build instantly, become invulnerable and create free items
|
||||
*/
|
||||
CREATIVE,
|
||||
|
||||
/**
|
||||
* Survival mode is the "normal" gameplay type, with no special features.
|
||||
*/
|
||||
SURVIVAL;
|
||||
}
|
@ -441,4 +441,18 @@ public interface Server {
|
||||
* @return Set containing banned players
|
||||
*/
|
||||
public Set<OfflinePlayer> getBannedPlayers();
|
||||
|
||||
/**
|
||||
* Gets the default {@link GameMode} for new players
|
||||
*
|
||||
* @return Default game mode
|
||||
*/
|
||||
public GameMode getDefaultGameMode();
|
||||
|
||||
/**
|
||||
* Sets the default {@link GameMode} for new players
|
||||
*
|
||||
* @param mode New game mode
|
||||
*/
|
||||
public void setDefaultGameMode(GameMode mode);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.permissions.Permissible;
|
||||
@ -60,4 +61,18 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible {
|
||||
* @return slumber ticks
|
||||
*/
|
||||
public int getSleepTicks();
|
||||
|
||||
/**
|
||||
* Gets this humans current {@link GameMode}
|
||||
*
|
||||
* @return Current game mode
|
||||
*/
|
||||
public GameMode getGameMode();
|
||||
|
||||
/**
|
||||
* Sets this humans current {@link GameMode}
|
||||
*
|
||||
* @param mode New game mode
|
||||
*/
|
||||
public void setGameMode(GameMode mode);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren