Add hotfix blocks and Player.LocalPlayer
This commit is contained in:
parent
ee6a0e3af6
commit
58cfba443e
2 changed files with 18 additions and 0 deletions
|
@ -323,6 +323,10 @@ namespace GamecraftModdingAPI.Blocks
|
||||||
SunLight,
|
SunLight,
|
||||||
AmbientLight,
|
AmbientLight,
|
||||||
UnlitGlowCube = 381,
|
UnlitGlowCube = 381,
|
||||||
|
PointLightInvisible,
|
||||||
|
SpotLightInvisible,
|
||||||
|
UnlitSlope,
|
||||||
|
UnlitGlowSlope,
|
||||||
MagmaRockCube = 777,
|
MagmaRockCube = 777,
|
||||||
MagmaRockCubeSliced,
|
MagmaRockCubeSliced,
|
||||||
MagmaRockSlope,
|
MagmaRockSlope,
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace GamecraftModdingAPI
|
||||||
{
|
{
|
||||||
// static functionality
|
// static functionality
|
||||||
private static PlayerEngine playerEngine = new PlayerEngine();
|
private static PlayerEngine playerEngine = new PlayerEngine();
|
||||||
|
private static Player localPlayer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the specified player exists.
|
/// Checks if the specified player exists.
|
||||||
|
@ -54,6 +55,19 @@ namespace GamecraftModdingAPI
|
||||||
return (uint) playerEngine.GetAllPlayerCount();
|
return (uint) playerEngine.GetAllPlayerCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the current player belonging to this client.
|
||||||
|
/// </summary>
|
||||||
|
public static Player LocalPlayer
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer())
|
||||||
|
localPlayer = new Player(PlayerType.Local);
|
||||||
|
return localPlayer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="T:GamecraftModdingAPI.Player"/> class.
|
/// Initializes a new instance of the <see cref="T:GamecraftModdingAPI.Player"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue