Example #1
0
 public PlayerClickedData.VoxelHit ToPlayerClick()
 {
     PlayerClickedData.VoxelHit hit = PlayerClickedData.PoolGet <PlayerClickedData.VoxelHit>();
     hit.BlockHit      = VoxelPositionHit;
     hit.DistanceToHit = Distance;
     hit.SideHit       = VoxelSideHit;
     hit.TypeHit       = TypeHit;
     return(hit);
 }
Example #2
0
 public static void PlaceItem(Players.Player player, PlayerClickedData data)
 {
     if (data.TypeSelected == ItemTypes.GetType(Nach0ColonyBuiltIn.ItemTypes.COMMANDTOOL).ItemIndex)
     {
         PlayerClickedData.VoxelHit voxelData = data.GetVoxelHit();
         if (data.ClickType == PlayerClickedData.EClickType.Left)
         {
             SendCommandUI.SendUI(player);
         }
         else if (data.ClickType == PlayerClickedData.EClickType.Right)
         {
             if (PlayerClickedData.EHitType.Block == data.HitType && voxelData.SideHit == VoxelSide.yPlus)
             {
                 if (commandUIInteraction.item_placer_dict.ContainsKey(player))
                 {
                     ServerManager.TryChangeBlock(voxelData.PositionBuild, ItemTypes.GetType(commandUIInteraction.item_placer_dict[player]).ItemIndex, player);
                 }
             }
         }
     }
 }