From 58cfba443eb2a4ba41582335cea06f0638b837cd Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Wed, 30 Sep 2020 23:52:17 +0200 Subject: [PATCH] Add hotfix blocks and Player.LocalPlayer --- GamecraftModdingAPI/Blocks/BlockIDs.cs | 4 ++++ GamecraftModdingAPI/Player.cs | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/GamecraftModdingAPI/Blocks/BlockIDs.cs b/GamecraftModdingAPI/Blocks/BlockIDs.cs index a9a8d3a..d867ce0 100644 --- a/GamecraftModdingAPI/Blocks/BlockIDs.cs +++ b/GamecraftModdingAPI/Blocks/BlockIDs.cs @@ -323,6 +323,10 @@ namespace GamecraftModdingAPI.Blocks SunLight, AmbientLight, UnlitGlowCube = 381, + PointLightInvisible, + SpotLightInvisible, + UnlitSlope, + UnlitGlowSlope, MagmaRockCube = 777, MagmaRockCubeSliced, MagmaRockSlope, diff --git a/GamecraftModdingAPI/Player.cs b/GamecraftModdingAPI/Player.cs index 40dd385..a4b7064 100644 --- a/GamecraftModdingAPI/Player.cs +++ b/GamecraftModdingAPI/Player.cs @@ -17,6 +17,7 @@ namespace GamecraftModdingAPI { // static functionality private static PlayerEngine playerEngine = new PlayerEngine(); + private static Player localPlayer; /// /// Checks if the specified player exists. @@ -54,6 +55,19 @@ namespace GamecraftModdingAPI return (uint) playerEngine.GetAllPlayerCount(); } + /// + /// Returns the current player belonging to this client. + /// + public static Player LocalPlayer + { + get + { + if (localPlayer == null || localPlayer.Id != playerEngine.GetLocalPlayer()) + localPlayer = new Player(PlayerType.Local); + return localPlayer; + } + } + /// /// Initializes a new instance of the class. ///