Added GameMode methods to Server and HumanEntity
This commit is contained in:
parent
935ffcb125
commit
742847c63f
18
src/main/java/org/bukkit/GameMode.java
Normal file
18
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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user