mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Added GameMode methods to Server and HumanEntity
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
18
paper-api/src/main/java/org/bukkit/GameMode.java
Normal file
18
paper-api/src/main/java/org/bukkit/GameMode.java
Normal file
@@ -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
|
* @return Set containing banned players
|
||||||
*/
|
*/
|
||||||
public Set<OfflinePlayer> getBannedPlayers();
|
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;
|
package org.bukkit.entity;
|
||||||
|
|
||||||
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
import org.bukkit.permissions.Permissible;
|
import org.bukkit.permissions.Permissible;
|
||||||
@@ -60,4 +61,18 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible {
|
|||||||
* @return slumber ticks
|
* @return slumber ticks
|
||||||
*/
|
*/
|
||||||
public int getSleepTicks();
|
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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user