13
0
geforkt von Mirrors/Paper

Added GameMode methods to Server and HumanEntity

By: Dinnerbone <dinnerbone@dinnerbone.com>
Dieser Commit ist enthalten in:
Bukkit/Spigot 2011-09-09 01:15:37 +01:00
Ursprung 42235114ca
Commit a3154f3ffc
3 geänderte Dateien mit 47 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -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;
}

Datei anzeigen

@ -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);
}

Datei anzeigen

@ -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);
}