diff --git a/Pixi/PixiPlugin.cs b/Pixi/PixiPlugin.cs index 57d0748..15990c3 100644 --- a/Pixi/PixiPlugin.cs +++ b/Pixi/PixiPlugin.cs @@ -7,10 +7,11 @@ using UnityEngine; using Unity.Mathematics; // float3 using IllusionPlugin; -// using GamecraftModdingAPI; +using GamecraftModdingAPI; using GamecraftModdingAPI.Commands; using GamecraftModdingAPI.Utility; using GamecraftModdingAPI.Blocks; +using GamecraftModdingAPI.Players; namespace Pixi { @@ -29,8 +30,6 @@ namespace Pixi private double blockSize = 0.2; - private PlayerLocationEngine playerLocationEngine = new PlayerLocationEngine(); - // called when Gamecraft shuts down public void OnApplicationQuit() { @@ -71,7 +70,6 @@ namespace Pixi // register commands so the modding API knows about it CommandManager.AddCommand(pixelate2DCommand); CommandManager.AddCommand(scaleCommand); - GameEngineManager.AddGameEngine(playerLocationEngine); GamecraftModdingAPI.Utility.Logging.LogDebug($"{Name} has started up"); } @@ -104,7 +102,7 @@ namespace Pixi Logging.MetaLog(e.Message + "\n" + e.StackTrace); return; } - float3 position = playerLocationEngine.GetPlayerLocation(0u); + float3 position = new Player(PlayerType.Local).Position; uint blockCount = 0; position.x += 1f; //position.y += 1f; @@ -138,7 +136,7 @@ namespace Pixi if (qVoxel.visible) { position.y = zero_y + (float)((y * blockSize + (y - scale.y) * blockSize) / 2); - Placement.PlaceBlock(qVoxel.block, position, color: qVoxel.color, darkness: qVoxel.darkness, scale: scale); + Block.PlaceNew(qVoxel.block, position, color: qVoxel.color, darkness: qVoxel.darkness, scale: scale); blockCount++; } scale = new float3(1, 1, 1); @@ -154,7 +152,7 @@ namespace Pixi if (qVoxel.visible) { position.y = zero_y + (float)((height * blockSize + (height - scale.y) * blockSize) / 2); - Placement.PlaceBlock(qVoxel.block, position, color: qVoxel.color, darkness: qVoxel.darkness, scale: scale); + Block.PlaceNew(qVoxel.block, position, color: qVoxel.color, darkness: qVoxel.darkness, scale: scale); blockCount++; } //position.y = zero_y; diff --git a/Pixi/PlayerLocationEngine.cs b/Pixi/PlayerLocationEngine.cs deleted file mode 100644 index a13681c..0000000 --- a/Pixi/PlayerLocationEngine.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; - -using GamecraftModdingAPI.Utility; -using Svelto.ECS; -using Unity.Mathematics; -using RobocraftX.Physics; -using RobocraftX.Character; - -namespace Pixi -{ - internal class PlayerLocationEngine : IApiEngine - { - public string Name => "PixiPlayerLocationGameEngine"; - - public EntitiesDB entitiesDB { set; private get; } - - public void Dispose() {} - - public void Ready() {} - - public float3 GetPlayerLocation(uint playerId) - { - return entitiesDB.QueryEntity(playerId, CharacterExclusiveGroups.OnFootGroup).position; - } - } -}